query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Redundant comparison
martyzz1/heroku3.py/heroku3/api.py
[ { "content": " def _get_data(self, resource, params=None, legacy=None, order_by=None, limit=None, valrange=None, sort=None):\n\n r = self._http_resource('GET', resource, params=params, legacy=legacy, order_by=order_by, limit=limit, valrange=valrange, sort=sort)\n\n items = self._resource_deserialize(r.content.decode(\"utf-8\"))\n if r.status_code == 206 and 'Next-Range' in r.headers and not limit:\n #We have unexpected chunked response - deal with it\n valrange = r.headers['Next-Range']\n print (\"Warning Response was chunked, Loading the next Chunk using the following next-range header returned by Heroku '{0}'. WARNING - This breaks randomly depending on your order_by name. I think it's only guarenteed to work with id's - Looks to be a Heroku problem\".format(valrange))\n new_items = self._get_data(resource, params=params, legacy=legacy, order_by=order_by, limit=limit, valrange=valrange, sort=sort)\n items.extend(new_items)\n\n return items", "metadata": "root.HerokuCore._get_data", "header": "['class', 'HerokuCore', '(', 'object', ')', ':', '___EOS___']", "index": 202 } ]
[]
[]
0
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "class_", "Hero", "ku", "Core_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "data_", "(_", "self_", ",_", "resource_", ",_", "params_", "=_", "None_", ",_", "legacy_", "=_", "None_", ",_", "order", "\\u", "by_", "=_", "None_", ",_", "limit_", "=_", "None_", ",_", "val", "range_", "=_", "None_", ",_", "sort_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "self_", "._", "\\u", "http", "\\u", "resource_", "(_", "'", "GET", "'_", ",_", "resource_", ",_", "params_", "=_", "params_", ",_", "legacy_", "=_", "legacy_", ",_", "order", "\\u", "by_", "=_", "order", "\\u", "by_", ",_", "limit_", "=_", "limit_", ",_", "val", "range_", "=_", "val", "range_", ",_", "sort_", "=_", "sort_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "self_", "._", "\\u", "resource", "\\u", "deserialize_", "(_", "r_", "._", "content_", "._", "decode_", "(_", "\"", "utf", "-", "8", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "._", "status", "\\u", "code_", "==_", "206_", "and_", "'", "Ne", "xt", "-", "Range", "'_", "in_", "r_", "._", "headers_", "and_", "not_", "limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "We", " ", "have", " ", "unexpected", " ", "chunked", " ", "response", " ", "-", " ", "deal", " ", "with", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val", "range_", "=_", "r_", "._", "headers_", "[_", "'", "Ne", "xt", "-", "Range", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Warn", "ing", " ", "Respons", "e", " ", "was", " ", "chunked", ",", " ", "Load", "ing", " ", "the", " ", "next", " ", "Chunk", " ", "usi", "ng", " ", "the", " ", "follow", "ing", " ", "next", "-", "range", " ", "header", " ", "return", "ed", " ", "by", " ", "Hero", "ku", " ", "'{", "0", "}'", ".", " ", "WARN", "ING", " ", "-", " ", "Thi", "s", " ", "breaks", " ", "random", "ly", " ", "depend", "ing", " ", "on", " ", "your", " ", "order", "\\u", "by", " ", "name", ".", " ", "I", " ", "think", " ", "it", "'", "s", " ", "only", " ", "gua", "rent", "eed", " ", "to", " ", "work", " ", "with", " ", "id", "'", "s", " ", "-", " ", "Look", "s", " ", "to", " ", "be", " ", "a", " ", "Hero", "ku", " ", "problem", "\"_", "._", "format_", "(_", "val", "range_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "items_", "=_", "self_", "._", "\\u", "get", "\\u", "data_", "(_", "resource_", ",_", "params_", "=_", "params_", ",_", "legacy_", "=_", "legacy_", ",_", "order", "\\u", "by_", "=_", "order", "\\u", "by_", ",_", "limit_", "=_", "limit_", ",_", "val", "range_", "=_", "val", "range_", ",_", "sort_", "=_", "sort_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "extend_", "(_", "new", "\\u", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "items_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
mozilla/addons-server/src/olympia/amo/tests/test_celery.py
[ { "content": " def test_cache_start_time(self):\n fake_task.delay()\n assert self.cache.set.call_args[0][0].startswith('task_start_time')", "metadata": "root.TestTaskTiming.test_cache_start_time", "header": "['class', 'TestTaskTiming', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 26 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Task", "Tim", "ing_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "start", "\\u", "time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake", "\\u", "task_", "._", "delay_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "cache_", "._", "set_", "._", "call", "\\u", "args_", "[_", "0_", "]_", "[_", "0_", "]_", "._", "startswith_", "(_", "'", "task", "\\u", "start", "\\u", "time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
scrapy/scrapy/scrapy/loader/__init__.py
[ { "content": " def __init__(self, item=None, selector=None, response=None, parent=None, **context):\n if selector is None and response is not None:\n selector = self.default_selector_class(response)\n self.selector = selector\n context.update(selector=selector, response=response)\n if item is None:\n item = self.default_item_class()\n self.context = context\n self.parent = parent\n self._local_item = context['item'] = item\n self._local_values = defaultdict(list)", "metadata": "root.ItemLoader.__init__", "header": "['class', 'ItemLoader', '(', 'object', ')', ':', '___EOS___']", "index": 26 } ]
[]
[]
0
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Item", "Loader_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "item_", "=_", "None_", ",_", "selector_", "=_", "None_", ",_", "response_", "=_", "None_", ",_", "parent_", "=_", "None_", ",_", "**_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "selector_", "is_", "None_", "and_", "response_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selector_", "=_", "self_", "._", "default", "\\u", "select", "or", "\\u", "class_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "selector_", "=_", "selector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "._", "update_", "(_", "selector_", "=_", "selector_", ",_", "response_", "=_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "self_", "._", "default", "\\u", "item", "\\u", "class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "context_", "=_", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent_", "=_", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "local", "\\u", "item_", "=_", "context_", "[_", "'", "item", "'_", "]_", "=_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "local", "\\u", "values_", "=_", "defaultdict_", "(_", "list_", ")_", "\\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 ]
First parameter of a method is not named 'self'
twitterdev/twitter-for-bigquery/libs/config.py
[ { "content": " def handleMismatch(self, obj1, obj2):\n \"\"\"\n Handle a mismatch between two objects.\n\n @param obj1: The object to merge into.\n @type obj1: any\n @param obj2: The object to merge.\n @type obj2: any\n \"\"\"\n raise ConfigError(\"unable to merge %r with %r\" % (obj1, obj2))", "metadata": "root.ConfigMerger.handleMismatch", "header": "['class', 'ConfigMerger', '(', 'object', ')', ':', '___EOS___']", "index": 1635 } ]
[]
[]
0
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Config", "Merge", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "Mismatch", "_", "(_", "self_", ",_", "obj1_", ",_", "obj2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "a", " ", "mism", "atch", " ", "bet", "ween", " ", "two", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "obj1", ":", " ", "The", " ", "object", " ", "to", " ", "merge", " ", "int", "o", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "obj1", ":", " ", "any", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "obj2", ":", " ", "The", " ", "object", " ", "to", " ", "merge", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "obj2", ":", " ", "any", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Config", "Error_", "(_", "\"", "una", "ble", " ", "to", " ", "merge", " ", "%", "r", " ", "with", " ", "%", "r", "\"_", "%_", "(_", "obj1_", ",_", "obj2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
getsentry/freight/freight/checks/github.py
[ { "content": " def check(self, app, sha, config):\n token = current_app.config['GITHUB_TOKEN']\n if not token:\n raise CheckFailed('GITHUB_TOKEN is not set')\n\n api_root = (\n config.get('api_root') or current_app.config['GITHUB_API_ROOT']\n ).rstrip('/')\n\n contexts = set(config.get('contexts') or [])\n repo = config['repo']\n\n url = '{api_root}/repos/{repo}/commits/{ref}/statuses'.format(\n api_root=api_root,\n repo=repo,\n ref=sha,\n )\n\n headers = {\n 'Accepts': 'application/json',\n 'Authorization': 'token {}'.format(token),\n }\n\n resp = http.get(url, headers=headers)\n\n context_list = resp.json()\n if not context_list:\n raise CheckFailed('No contexts were present in GitHub')\n\n valid_contexts = set()\n for data in context_list:\n if data['state'] == 'success':\n valid_contexts.add(data['context'])\n try:\n contexts.remove(data['context'])\n except KeyError:\n pass\n if data['context'] in valid_contexts:\n continue\n if contexts and data['context'] not in contexts:\n continue\n if data['state'] == 'pending':\n raise CheckPending(ERR_CHECK.format(data['context'], data['state']))\n elif data['state'] != 'success':\n raise CheckFailed(ERR_CHECK.format(data['context'], data['state']))\n contexts.remove(data['context'])\n\n if contexts:\n raise CheckFailed(ERR_MISSING_CONTEXT.format(iter(contexts).next()))", "metadata": "root.GitHubContextCheck.check", "header": "['class', 'GitHubContextCheck', '(', 'Check', ')', ':', '___EOS___']", "index": 25 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Git", "Hub", "Context", "Check_", "(_", "Check_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check_", "(_", "self_", ",_", "app_", ",_", "sha_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token_", "=_", "current", "\\u", "app_", "._", "config_", "[_", "'", "GIT", "HUB", "\\u", "TOKEN", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Check", "Failed_", "(_", "'", "GIT", "HUB", "\\u", "TOKEN", " ", "is", " ", "not", " ", "set", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "api", "\\u", "root_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "._", "get_", "(_", "'", "api", "\\u", "root", "'_", ")_", "or_", "current", "\\u", "app_", "._", "config_", "[_", "'", "GIT", "HUB", "\\u", "API", "\\u", "ROO", "T", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "rstrip_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "contexts_", "=_", "set_", "(_", "config_", "._", "get_", "(_", "'", "context", "s", "'_", ")_", "or_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo_", "=_", "config_", "[_", "'", "repo", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'{", "api", "\\u", "root", "}/", "repos", "/{", "repo", "}/", "commit", "s", "/{", "ref", "}/", "status", "es", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "api", "\\u", "root_", "=_", "api", "\\u", "root_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repo_", "=_", "repo_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ref_", "=_", "sha_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Accept", "s", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Authoriz", "ation", "'_", ":_", "'", "token", " ", "{}'_", "._", "format_", "(_", "token_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "http_", "._", "get_", "(_", "url_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "context", "\\u", "list_", "=_", "resp_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "context", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Check", "Failed_", "(_", "'", "No", " ", "context", "s", " ", "wer", "e", " ", "presen", "t", " ", "in", " ", "Git", "Hub", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "valid", "\\u", "contexts_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "context", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "data_", "[_", "'", "state", "'_", "]_", "==_", "'", "success", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "valid", "\\u", "contexts_", "._", "add_", "(_", "data_", "[_", "'", "context", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "contexts_", "._", "remove_", "(_", "data_", "[_", "'", "context", "'_", "]_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "[_", "'", "context", "'_", "]_", "in_", "valid", "\\u", "contexts_", ":_", "\\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_", "contexts_", "and_", "data_", "[_", "'", "context", "'_", "]_", "not_", "in_", "contexts_", ":_", "\\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_", "data_", "[_", "'", "state", "'_", "]_", "==_", "'", "pend", "ing", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Check", "Pend", "ing_", "(_", "ERR", "\\u", "CHECK_", "._", "format_", "(_", "data_", "[_", "'", "context", "'_", "]_", ",_", "data_", "[_", "'", "state", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "data_", "[_", "'", "state", "'_", "]_", "!=_", "'", "success", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Check", "Failed_", "(_", "ERR", "\\u", "CHECK_", "._", "format_", "(_", "data_", "[_", "'", "context", "'_", "]_", ",_", "data_", "[_", "'", "state", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "contexts_", "._", "remove_", "(_", "data_", "[_", "'", "context", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "contexts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Check", "Failed_", "(_", "ERR", "\\u", "MISSING", "\\u", "CONTEXT_", "._", "format_", "(_", "iter_", "(_", "contexts_", ")_", "._", "next_", "(_", ")_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jon-jacky/PyModel/samples/WebApplication/fsmpy/TestIntFailureFSM.py
[ { "content": "def Login(): pass", "metadata": "root.Login", "header": "['module', '___EOS___']", "index": 8 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Login_", "(_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
blaze/blaze/blaze/sql.py
[ { "content": "@dispatch(sa.Table, (list, tuple))\ndef create_index(s,\n columns,\n name=None,\n unique=False,\n ignore_existing=False,\n concurrently=False):\n \"\"\"Create an index for a single column.\n\n Parameters\n ----------\n s : sa.Table\n The table to create the index on.\n columns : list[str] or tuple[str]\n The names of the columns to create an index on.\n name : str\n The name of the created index.\n unique : bool, optional\n Should the index be unique.\n ignore_existing : bool, optional\n Should this supress exceptions from the index already existing.\n concurrently : bool, optional\n Should the index be created without holding a lock. This feature is\n postgres specific.\n \"\"\"\n\n if name is None:\n raise ValueError('SQL indexes must have a name')\n try:\n sa.Index(\n name,\n *(s.c[c] for c in columns),\n unique=unique,\n **{'postgresql_concurrently': concurrently} if concurrently else {}\n ).create(s.bind)\n except (sa.exc.ProgrammingError, sa.exc.OperationalError):\n # sqlite raises OperationalError but postgres raises ProgrammingError\n # thanks fam\n if not ignore_existing:\n raise", "metadata": "root.create_index", "header": "['module', '___EOS___']", "index": 33 } ]
[]
[]
0
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_", "@_", "dispatch_", "(_", "sa_", "._", "Table_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create", "\\u", "index_", "(_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "columns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unique_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ignore", "\\u", "existing_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "concurrent", "ly_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "an", " ", "index", " ", "for", " ", "a", " ", "single", " ", "column", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "s", " ", ":", " ", "sa", ".", "Table", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "table", " ", "to", " ", "create", " ", "the", " ", "index", " ", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "column", "s", " ", ":", " ", "list", "[", "str", "]", " ", "or", " ", "tuple", "[", "str", "]", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "names", " ", "of", " ", "the", " ", "column", "s", " ", "to", " ", "create", " ", "an", " ", "index", " ", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "name", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "name", " ", "of", " ", "the", " ", "created", " ", "index", ".", "\\", "10", ";", " ", " ", " ", " ", "unique", " ", ":", " ", "bool", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "the", " ", "index", " ", "be", " ", "unique", ".", "\\", "10", ";", " ", " ", " ", " ", "ignore", "\\u", "exist", "ing", " ", ":", " ", "bool", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "this", " ", "sup", "ress", " ", "exception", "s", " ", "from", " ", "the", " ", "index", " ", "alr", "ead", "y", " ", "exist", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "concurrent", "ly", " ", ":", " ", "bool", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "the", " ", "index", " ", "be", " ", "created", " ", "with", "out", " ", "holding", " ", "a", " ", "lock", ".", " ", "Thi", "s", " ", "feature", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "postgres", " ", "specific", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "SQL", " ", "indexe", "s", " ", "must", " ", "have", " ", "a", " ", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sa_", "._", "Index_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "(_", "s_", "._", "c_", "[_", "c_", "]_", "for_", "c_", "in_", "columns_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unique_", "=_", "unique_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "{_", "'", "postgres", "ql", "\\u", "concurrent", "ly", "'_", ":_", "concurrent", "ly_", "}_", "if_", "concurrent", "ly_", "else_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "create_", "(_", "s_", "._", "bind_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "sa_", "._", "exc_", "._", "Programm", "ing", "Error_", ",_", "sa_", "._", "exc_", "._", "Opera", "tion", "al", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sql", "ite", " ", "raise", "s", " ", "Opera", "tion", "al", "Error", " ", "but", " ", "postgres", " ", "raise", "s", " ", "Programm", "ing", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "thanks", " ", "fam", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "ignore", "\\u", "existing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_" ]
[ 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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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 ]
Implicit string concatenation in a list
kiberpipa/Intranet/pipa/video/migrations/0001_initial.py
[ { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n '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 'mercenaries.costcenter': {\n 'Meta': {'object_name': 'CostCenter'},\n 'code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),\n 'wage_per_hour': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'})\n },\n 'mercenaries.salarytype': {\n 'Meta': {'object_name': 'SalaryType'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'})\n },\n 'org.category': {\n 'Meta': {'object_name': 'Category'},\n 'chg_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'note': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'pub_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})\n },\n 'org.email': {\n 'Meta': {'object_name': 'Email'},\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})\n },\n 'org.event': {\n 'Meta': {'ordering': \"('title',)\", 'object_name': 'Event'},\n 'announce': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.Category']\"}),\n 'chg_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'emails': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['org.Email']\", 'null': 'True', 'blank': 'True'}),\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'event_image': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.IntranetImage']\", 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'language': ('django.db.models.fields.CharField', [], {'default': \"'sl'\", 'max_length': '2', 'null': 'True', 'blank': 'True'}),\n 'length': ('django.db.models.fields.TimeField', [], {}),\n 'note': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'place': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.Place']\"}),\n 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.Project']\"}),\n 'pub_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'require_technician': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'require_video': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'responsible': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\"}),\n 'sequence': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\n 'short_announce': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'slides': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '150', 'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),\n 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['org.Tag']\", 'null': 'True', 'blank': 'True'}),\n 'technician': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'event_technican'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['auth.User']\"}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'visitors': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True', 'blank': 'True'})\n },\n 'org.intranetimage': {\n 'Meta': {'ordering': \"('-image',)\", 'object_name': 'IntranetImage'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),\n 'md5': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'unique': 'True', 'max_length': '32', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})\n },\n 'org.place': {\n 'Meta': {'object_name': 'Place'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'note': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})\n },\n 'org.project': {\n 'Meta': {'ordering': \"('name',)\", 'object_name': 'Project'},\n 'chg_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'cost_center': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mercenaries.CostCenter']\", 'null': 'True', 'blank': 'True'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),\n 'email_members': ('django.db.models.fields.NullBooleanField', [], {'default': 'True', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'note': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.Project']\", 'null': 'True', 'blank': 'True'}),\n 'pub_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'responsible': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\", 'null': 'True', 'blank': 'True'}),\n 'salary_rate': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'salary_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mercenaries.SalaryType']\", 'null': 'True', 'blank': 'True'}),\n 'verbose_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})\n },\n 'org.tag': {\n 'Meta': {'object_name': 'Tag'},\n 'font_size': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'primary_key': \"'True'\"}),\n 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.Tag']\", 'null': 'True', 'blank': 'True'}),\n 'total_ref': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})\n },\n 'video.video': {\n 'Meta': {'object_name': 'Video'},\n 'event': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['org.Event']\", 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image_url': ('django.db.models.fields.CharField', [], {'max_length': '240'}),\n 'play_url': ('django.db.models.fields.CharField', [], {'max_length': '240'}),\n 'pub_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),\n 'videodir': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})\n }\n }\n\n complete_apps = ['video']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 } ]
[]
[]
0
true
[ "[CLS]_", "Implicit", "_", "string_", "concate", "nation_", "in_", "a_", "list_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "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_", "'", "merc", "ena", "rie", "s", ".", "cost", "center", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Cost", "Center", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "300", "'_", "}_", ")_", ",_", "\\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", "'_", ":_", "'", "200", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wag", "e\\u", "per", "\\u", "hour", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Deci", "mal", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "digit", "s", "'_", ":_", "'", "5", "'_", ",_", "'", "decima", "l\\u", "place", "s", "'_", ":_", "'", "2", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "merc", "ena", "rie", "s", ".", "salary", "type", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Sala", "ry", "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", "'_", ":_", "'", "200", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "category", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Cate", "gory", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chg", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "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_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pub", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "email", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Ema", "il", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "event", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "title", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Event", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "announce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "category", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Cate", "gory", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chg", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Ema", "il", "']\"_", ",_", "'", "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_", "'", "event", "\\u", "image", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Intr", "ane", "t", "Image", "']\"_", ",_", "'", "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_", "'", "language", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "sl", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "length", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Place", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Project", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pub", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "public", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "require", "\\u", "techn", "icia", "n", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "require", "\\u", "video", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "responsib", "le", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sequence", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "short", "\\u", "announce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slides", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "File", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "150", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Ta", "g", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "techn", "icia", "n", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "event", "\\u", "techn", "ican", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "visitor", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "intra", "neti", "mage", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'-", "image", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Intr", "ane", "t", "Image", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "md5", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "32", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "place", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Place", "'_", "}_", ",_", "\\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", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "project", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Project", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chg", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cost", "\\u", "center", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "merc", "ena", "rie", "s", ".", "Cost", "Center", "']\"_", ",_", "'", "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_", "'", "email", "\\u", "member", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Null", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "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_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Project", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pub", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "responsib", "le", "'_", ":_", "(_", "'", "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_", "'", "salary", "\\u", "rate", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "salary", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "merc", "ena", "rie", "s", ".", "Sala", "ry", "Type", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "verbo", "se", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", ".", "tag", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Ta", "g", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "font", "\\u", "size", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "\"'", "Tru", "e", "'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Ta", "g", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "total", "\\u", "ref", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "video", ".", "video", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Vid", "eo", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "org", ".", "Event", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "240", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "play", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "240", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pub", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "video", "dir", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "video", "'_", "]_" ]
[ 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, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
Toblerity/Shapely/packaging/specifiers.py
[ { "content": " @property\n def version(self):\n return self._spec[1]", "metadata": "root._IndividualSpecifier.version", "header": "['class', '_IndividualSpecifier', '(', 'BaseSpecifier', ')', ':', '___EOS___']", "index": 157 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "\\u", "Individual", "Specifie", "r_", "(_", "Base", "Specifie", "r_", ")_", ":_", "\\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_", "version_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "spec_", "[_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
lukesneeringer/django-pgfields/django_pg/models/fields/array.py
[ { "content": "from __future__ import absolute_import, unicode_literals\nfrom django.core.management.color import no_style\nfrom django.db import models\ntry:\n from django_pg import lookups\nexcept ImportError: # Django < 1.7\n lookups = None\nfrom django_pg.utils.datatypes import CoerciveList\nfrom django_pg.utils.south import south_installed\nimport six\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@six.add_metaclass(models.SubfieldBase)\nclass ArrayField(models.Field):\n \"\"\"Field for storing PostgreSQL arrays.\"\"\"\n\n if lookups: # Django 1.7\n class_lookups = {'len': lookups.ArrayLength}\n description = 'PostgreSQL arrays.'\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ArrayField", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, of=models.IntegerField, **kwargs):\n # The `of` argument is a bit tricky once we need compatibility\n # with South.\n # \n # South can't store a field, and the eval it performs doesn't\n # put enough things in the context to use South's internal\n # \"get field\" function (`BaseMigration.gf`).\n # \n # Therefore, we need to be able to accept a South triple of our\n # sub-field and hook into South to get the correct thing back.\n if isinstance(of, tuple) and south_installed:\n from south.utils import ask_for_it_by_name as gf\n of = gf(of[0])(*of[1], **of[2])\n\n # Arrays in PostgreSQL are arrays of a particular type.\n # Save the subtype in our field class.\n self.of = of\n if isinstance(self.of, type):\n self.of = self.of()\n\n # Set \"null\" to True. Arrays don't have nulls, but null=True\n # in the ORM amounts to nothing in SQL (whereas null=False\n # corresponds to `NOT NULL`)\n kwargs['null'] = True\n\n # Now pass the rest of the work to the Field superclass.\n super(ArrayField, self).__init__(**kwargs)", "metadata": "root.ArrayField.__init__", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 20 }, { "content": " def create_type(self, connection):\n if hasattr(self.of, 'create_type'):\n return self.of.create_type(connection)\n return", "metadata": "root.ArrayField.create_type", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 48 }, { "content": " def create_type_sql(self, connection, style=no_style(),\n only_if_not_exists=False ):\n if hasattr(self.of, 'create_type_sql'):\n return self.of.create_type_sql(connection, style,\n only_if_not_exists=only_if_not_exists)\n return ''", "metadata": "root.ArrayField.create_type_sql", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 53 }, { "content": " def db_type(self, connection):\n \"\"\"Return the appropriate type to create a PostgreSQL array.\"\"\"\n\n # Retrieve the SQL type of the sub-field.\n db_subfield = self.of.db_type(connection)\n\n # Return the PostgreSQL array type syntax.\n return '%s[]' % db_subfield", "metadata": "root.ArrayField.db_type", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 60 }, { "content": " def get_db_lookup_expression(self, lookup_type, value, connection):\n # If this is the \"exact\" lookup type, then explicitly\n # typecast our value to the proper type.\n if lookup_type == 'exact':\n return '{field} = {value}::%s' % self.db_type(connection)\n\n # If `__contains` was used to seek an item within the array,\n # return the appropriate PostgreSQL expression to handle that.\n if lookup_type == 'contains':\n if isinstance(value, (list, tuple)):\n return '{field} @> {value}::%s' % self.db_type(connection)\n return '{value} = ANY({field})'\n\n # If the lookup_type is \"len\", then we are asking for\n # an array of a given length.\n if lookup_type == 'len':\n if value:\n return '{value} = ARRAY_LENGTH({field}, 1)'\n return 'ARRAY_LENGTH({field}, 1) IS NULL'", "metadata": "root.ArrayField.get_db_lookup_expression", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 69 }, { "content": " def get_db_prep_lookup(self, lookup_type, value, connection,\n prepared=False):\n\n # Handle our special case: We don't want the \"%\" adding\n # to `contains` that comes with the Django stock implementation;\n # this is an array presence check, not a full text search.\n if lookup_type == 'contains':\n return [value]\n\n # Default behavior is fine in all other cases.\n return super(ArrayField, self).get_db_prep_lookup(\n lookup_type, value, connection,\n prepared=prepared,\n )", "metadata": "root.ArrayField.get_db_prep_lookup", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 89 }, { "content": " def get_lookup(self, lookup_name):\n \"\"\"Return the appropriate Django 1.7 lookup class for our\n custom lookups.\n \"\"\"\n # If this is a `__contains` lookup, return a custom ArrayContains\n # subclass.\n if lookup_name == 'contains':\n class ArrayContains(lookups.ArrayContains):\n field = self\n return ArrayContains\n\n # If this is an `__exact` lookup, return a custom ArrayExact\n # subclass.\n if lookup_name == 'exact':\n class ArrayExact(lookups.ArrayExact):\n field = self\n return ArrayExact\n\n # The standard superclass is acceptable in every other situation.\n return super(ArrayField, self).get_lookup(lookup_name)", "metadata": "root.ArrayField.get_lookup", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 104 }, { "content": " def get_prep_lookup(self, lookup_type, value):\n # Handling for `__len`, which is a custom lookup type\n # for arrays, must be properly handled.\n if lookup_type == 'len':\n try:\n return int(value)\n except ValueError:\n raise TypeError('__len only supports integers.')\n\n # Arrays do not support many built-in lookups.\n if lookup_type not in ('exact', 'contains'):\n raise TypeError('Unsupported lookup type: %s' % lookup_type)\n\n # If we're checking on a list, coerce each individual value into\n # its appropriate lookup type.\n if isinstance(value, (list, tuple)):\n value = [self.of.get_prep_lookup('exact', i) for i in value]\n\n # The superclass handling is good enough for everything else.\n return super(ArrayField, self).get_prep_lookup(lookup_type, value)", "metadata": "root.ArrayField.get_prep_lookup", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 125 }, { "content": " def get_prep_value(self, value):\n \"\"\"Iterate over each item in the array, and run it\n through the `get_prep_value` of this array's type.\n \"\"\"\n # If no valid value was given, return an empty list.\n if not value:\n return []\n\n # Appropriately coerce each individual value within\n # our array.\n answer = []\n for item in list(value):\n answer.append(self.of.get_prep_value(item))\n\n # Run the superclass' value coersion.\n return answer", "metadata": "root.ArrayField.get_prep_value", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 146 }, { "content": " def register_composite(self, connection, globally=True):\n if hasattr(self.of, 'register_composite'):\n return self.of.register_composite(connection, globally=globally)\n return", "metadata": "root.ArrayField.register_composite", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 163 }, { "content": " def south_field_triple(self):\n \"\"\"Return a description of this field parsable by South.\"\"\"\n\n # It's safe to import South at this point; this method\n # will never actually be called unless South is installed.\n from south.modelsinspector import introspector\n\n # Get the args and kwargs with which this field was generated.\n # The \"double\" variable name is a riff of of South \"triples\", since\n # the `introspector` function only returns the final two elements\n # of a South triple. This is fine since those two pieces are all\n # we actually need.\n double = introspector(self.of)\n\n # Return the appropriate South triple.\n return (\n '%s.%s' % (self.__class__.__module__, self.__class__.__name__),\n [],\n {\n # The `of` argument is *itself* another triple, of\n # the internal field.\n # The ArrayField constructor understands how to resurrect\n # its internal field from this serialized state.\n 'of': (\n '{module}.{class_name}'.format(\n module=self.of.__class__.__module__,\n class_name=self.of.__class__.__name__,\n ),\n double[0],\n double[1],\n ),\n },\n )", "metadata": "root.ArrayField.south_field_triple", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 168 }, { "content": " def to_python(self, value):\n \"\"\"Convert the database value to a Python list.\"\"\"\n return CoerciveList(self.of.to_python, value)", "metadata": "root.ArrayField.to_python", "header": "['class', 'ArrayField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 202 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "management_", "._", "color_", "import_", "no", "\\u", "style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django", "\\u", "pg_", "import_", "lookups", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "#", " ", "Dj", "ang", "o", " ", "<", " ", "1.7", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lookups", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django", "\\u", "pg_", "._", "utils_", "._", "datatypes_", "import_", "Coe", "rci", "ve", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "pg_", "._", "utils_", "._", "south_", "import_", "south", "\\u", "installed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "six_", "\\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_", "@_", "six_", "._", "add", "\\u", "metaclass_", "(_", "models_", "._", "Sub", "field", "Base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Field", " ", "for", " ", "stor", "ing", " ", "Post", "gre", "SQL", " ", "arrays", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lookups", "_", ":_", "#", " ", "Dj", "ang", "o", " ", "1.7", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class", "\\u", "lookups", "_", "=_", "{_", "'", "len", "'_", ":_", "lookups", "_", "._", "Array", "Length_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "description_", "=_", "'", "Post", "gre", "SQL", " ", "arrays", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "of_", "=_", "models_", "._", "Integer", "Field_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "`", "of", "`", " ", "argu", "ment", " ", "is", " ", "a", " ", "bit", " ", "trick", "y", " ", "onc", "e", " ", "we", " ", "need", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "South", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "South", " ", "can", "'", "t", " ", "store", " ", "a", " ", "field", ",", " ", "and", " ", "the", " ", "eval", " ", "it", " ", "perform", "s", " ", "doe", "sn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "eno", "ugh", " ", "thing", "s", " ", "in", " ", "the", " ", "context", " ", "to", " ", "use", " ", "South", "'", "s", " ", "internal_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "get", " ", "field", "\"", " ", "function", " ", "(", "`", "Base", "Migrat", "ion", ".", "gf", "`)", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", "fore", ",", " ", "we", " ", "need", " ", "to", " ", "be", " ", "able", " ", "to", " ", "accept", " ", "a", " ", "South", " ", "triple", " ", "of", " ", "our_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sub", "-", "field", " ", "and", " ", "hook", " ", "int", "o", " ", "South", " ", "to", " ", "get", " ", "the", " ", "correct", " ", "thing", " ", "back", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "of_", ",_", "tuple_", ")_", "and_", "south", "\\u", "installed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "south_", "._", "utils_", "import_", "ask", "\\u", "for", "\\u", "it", "\\u", "by", "\\u", "name_", "as_", "gf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "of_", "=_", "gf_", "(_", "of_", "[_", "0_", "]_", ")_", "(_", "*_", "of_", "[_", "1_", "]_", ",_", "**_", "of_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Arrays", " ", "in", " ", "Post", "gre", "SQL", " ", "are", " ", "arrays", " ", "of", " ", "a", " ", "partic", "ular", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Save", " ", "the", " ", "subt", "ype", " ", "in", " ", "our", " ", "field", " ", "class", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "of_", "=_", "of_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "self_", "._", "of_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "of_", "=_", "self_", "._", "of_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "\"", "null", "\"", " ", "to", " ", "Tru", "e", ".", " ", "Arrays", " ", "don", "'", "t", " ", "have", " ", "null", "s", ",", " ", "but", " ", "null", "=", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "ORM", " ", "amounts", " ", "to", " ", "not", "hing", " ", "in", " ", "SQL", " ", "(", "where", "as", " ", "null", "=", "False_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "correspond", "s", " ", "to", " ", "`", "NOT", " ", "NULL", "`)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "null", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "pass", " ", "the", " ", "rest", " ", "of", " ", "the", " ", "work", " ", "to", " ", "the", " ", "Field", " ", "superclass", "._", "\\u\\u\\uNL\\u\\u\\u_", "super_", "(_", "Array", "Field_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "type_", "(_", "self_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", "._", "of_", ",_", "'", "create", "\\u", "type", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "of_", "._", "create", "\\u", "type_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "type", "\\u", "sql_", "(_", "self_", ",_", "connection_", ",_", "style_", "=_", "no", "\\u", "style_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "only", "\\u", "if", "\\u", "not", "\\u", "exists_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", "._", "of_", ",_", "'", "create", "\\u", "type", "\\u", "sql", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "of_", "._", "create", "\\u", "type", "\\u", "sql_", "(_", "connection_", ",_", "style_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "only", "\\u", "if", "\\u", "not", "\\u", "exists_", "=_", "only", "\\u", "if", "\\u", "not", "\\u", "exists_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "db", "\\u", "type_", "(_", "self_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "appropr", "iate", " ", "type", " ", "to", " ", "create", " ", "a", " ", "Post", "gre", "SQL", " ", "array", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Retrieve", " ", "the", " ", "SQL", " ", "type", " ", "of", " ", "the", " ", "sub", "-", "field", "._", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "subfield", "_", "=_", "self_", "._", "of_", "._", "db", "\\u", "type_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "the", " ", "Post", "gre", "SQL", " ", "array", " ", "type", " ", "synta", "x", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'%", "s", "[]'_", "%_", "db", "\\u", "subfield", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "look", "up", "\\u", "expression_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "is", " ", "the", " ", "\"", "exact", "\"", " ", "look", "up", " ", "type", ",", " ", "then", " ", "explicit", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typec", "ast", " ", "our", " ", "value", " ", "to", " ", "the", " ", "proper", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "look", "up", "\\u", "type_", "==_", "'", "exact", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'{", "field", "}", " ", "=", " ", "{", "value", "}:", ":", "%", "s", "'_", "%_", "self_", "._", "db", "\\u", "type_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "`\\u", "\\u", "contain", "s", "`", " ", "was", " ", "used", " ", "to", " ", "seek", " ", "an", " ", "item", " ", "within", " ", "the", " ", "array", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "appropr", "iate", " ", "Post", "gre", "SQL", " ", "express", "ion", " ", "to", " ", "handle", " ", "tha", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "type_", "==_", "'", "contain", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'{", "field", "}", " ", "@", ">", " ", "{", "value", "}:", ":", "%", "s", "'_", "%_", "self_", "._", "db", "\\u", "type_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'{", "value", "}", " ", "=", " ", "ANY", "({", "field", "})'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "look", "up", "\\u", "type", " ", "is", " ", "\"", "len", "\",", " ", "then", " ", "we", " ", "are", " ", "ask", "ing", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "array", " ", "of", " ", "a", " ", "give", "n", " ", "length", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "type_", "==_", "'", "len", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'{", "value", "}", " ", "=", " ", "ARR", "AY", "\\u", "LENGTH", "({", "field", "},", " ", "1", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'", "ARR", "AY", "\\u", "LENGTH", "({", "field", "},", " ", "1", ")", " ", "IS", " ", "NULL", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ",_", "connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepared", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Handle", " ", "our", " ", "special", " ", "case", ":", " ", "We", " ", "don", "'", "t", " ", "want", " ", "the", " ", "\"%", "\"", " ", "addin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "`", "contain", "s", "`", " ", "tha", "t", " ", "come", "s", " ", "with", " ", "the", " ", "Dj", "ang", "o", " ", "stock", " ", "implementation", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "an", " ", "array", " ", "presen", "ce", " ", "check", ",", " ", "not", " ", "a", " ", "full", " ", "text", " ", "search", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "look", "up", "\\u", "type_", "==_", "'", "contain", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Default", " ", "behavior", " ", "is", " ", "fine", " ", "in", " ", "all", " ", "other", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Array", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "db", "\\u", "prep", "\\u", "lookup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "look", "up", "\\u", "type_", ",_", "value_", ",_", "connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepared", "_", "=_", "prepared", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "appropr", "iate", " ", "Dj", "ang", "o", " ", "1.7", " ", "look", "up", " ", "class", " ", "for", " ", "our", "\\", "10", ";", " ", " ", " ", " ", "custom", " ", "lookups", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "is", " ", "a", " ", "`\\u", "\\u", "contain", "s", "`", " ", "look", "up", ",", " ", "return", " ", "a", " ", "custom", " ", "Array", "Contains_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subclass", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "look", "up", "\\u", "name_", "==_", "'", "contain", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Array", "Contains_", "(_", "lookups", "_", "._", "Array", "Contains_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Array", "Contains_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "is", " ", "an", " ", "`\\u", "\\u", "exact", "`", " ", "look", "up", ",", " ", "return", " ", "a", " ", "custom", " ", "Array", "Exa", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subclass", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "name_", "==_", "'", "exact", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Array", "Exa", "ct_", "(_", "lookups", "_", "._", "Array", "Exa", "ct_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Array", "Exa", "ct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "standard", " ", "superclass", " ", "is", " ", "acceptabl", "e", " ", "in", " ", "every", " ", "other", " ", "situation", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Array", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "lookup_", "(_", "look", "up", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "lookup_", "(_", "self_", ",_", "look", "up", "\\u", "type_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hand", "ling", " ", "for", " ", "`\\u", "\\u", "len", "`", ",", " ", "whi", "ch", " ", "is", " ", "a", " ", "custom", " ", "look", "up", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "arrays", ",", " ", "must", " ", "be", " ", "proper", "ly", " ", "handle", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "look", "up", "\\u", "type_", "==_", "'", "len", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'\\u", "\\u", "len", " ", "only", " ", "support", "s", " ", "integ", "ers", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Arrays", " ", "do", " ", "not", " ", "support", " ", "many", " ", "bui", "lt", "-", "in", " ", "lookups", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "look", "up", "\\u", "type_", "not_", "in_", "(_", "'", "exact", "'_", ",_", "'", "contain", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "Unsu", "ppo", "rted", " ", "look", "up", " ", "type", ":", " ", "%", "s", "'_", "%_", "look", "up", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "re", " ", "checking", " ", "on", " ", "a", " ", "list", ",", " ", "coerce", " ", "each", " ", "individual", " ", "value", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "its", " ", "appropr", "iate", " ", "look", "up", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "[_", "self_", "._", "of_", "._", "get", "\\u", "prep", "\\u", "lookup_", "(_", "'", "exact", "'_", ",_", "i_", ")_", "for_", "i_", "in_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "superclass", " ", "handling", " ", "is", " ", "good", " ", "eno", "ugh", " ", "for", " ", "every", "thing", " ", "else", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Array", "Field_", ",_", "self_", ")_", "._", "get", "\\u", "prep", "\\u", "lookup_", "(_", "look", "up", "\\u", "type_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "prep", "\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Iterat", "e", " ", "over", " ", "each", " ", "item", " ", "in", " ", "the", " ", "array", ",", " ", "and", " ", "run", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "through", " ", "the", " ", "`", "get", "\\u", "prep", "\\u", "value", "`", " ", "of", " ", "this", " ", "array", "'", "s", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "no", " ", "valid", " ", "value", " ", "was", " ", "give", "n", ",", " ", "return", " ", "an", " ", "empty", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "value_", ":_", "\\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_", "#", " ", "Appro", "pri", "ate", "ly", " ", "coerce", " ", "each", " ", "individual", " ", "value", " ", "within", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "our", " ", "array", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "answer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "list_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "answer_", "._", "append_", "(_", "self_", "._", "of_", "._", "get", "\\u", "prep", "\\u", "value_", "(_", "item_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "the", " ", "superclass", "'", " ", "value", " ", "coe", "rsi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "answer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "register", "\\u", "composite_", "(_", "self_", ",_", "connection_", ",_", "global", "ly_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", "._", "of_", ",_", "'", "register", "\\u", "composi", "te", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "of_", "._", "register", "\\u", "composite_", "(_", "connection_", ",_", "global", "ly_", "=_", "global", "ly_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "south", "\\u", "field", "\\u", "triple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "description", " ", "of", " ", "this", " ", "field", " ", "pars", "able", " ", "by", " ", "South", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "safe", " ", "to", " ", "import", " ", "South", " ", "at", " ", "this", " ", "point", ";", " ", "this", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "neve", "r", " ", "actual", "ly", " ", "be", " ", "call", "ed", " ", "unl", "ess", " ", "South", " ", "is", " ", "install", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "south_", "._", "model", "sin", "spect", "or_", "import_", "introspect", "or_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "args", " ", "and", " ", "kwarg", "s", " ", "with", " ", "whi", "ch", " ", "this", " ", "field", " ", "was", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "\"", "double", "\"", " ", "variab", "le", " ", "name", " ", "is", " ", "a", " ", "rif", "f", " ", "of", " ", "of", " ", "South", " ", "\"", "triple", "s", "\",", " ", "since_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "the", " ", "`", "introspect", "or", "`", " ", "function", " ", "only", " ", "return", "s", " ", "the", " ", "final", " ", "two", " ", "elements_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "of", " ", "a", " ", "South", " ", "triple", ".", " ", "Thi", "s", " ", "is", " ", "fine", " ", "sinc", "e", " ", "tho", "se", " ", "two", " ", "piece", "s", " ", "are", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "we", " ", "actual", "ly", " ", "need", "._", "\\u\\u\\uNL\\u\\u\\u_", "double_", "=_", "introspect", "or_", "(_", "self_", "._", "of_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "the", " ", "appropr", "iate", " ", "South", " ", "triple", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "module\\u\\u_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "`", "of", "`", " ", "argu", "ment", " ", "is", " ", "*", "its", "elf", "*", " ", "anot", "her", " ", "triple", ",", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "the", " ", "internal", " ", "field", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "Array", "Field", " ", "construct", "or", " ", "underst", "ands", " ", "how", " ", "to", " ", "resu", "rrect", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "its", " ", "internal", " ", "field", " ", "from", " ", "this", " ", "serialize", "d", " ", "state", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "of", "'_", ":_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'{", "module", "}.", "{", "class", "\\u", "name", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "module_", "=_", "self_", "._", "of_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "module\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "class", "\\u", "name_", "=_", "self_", "._", "of_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "double_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "double_", "[_", "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_", "[SEP]_", "class_", "Array", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "python_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", " ", "the", " ", "databa", "se", " ", "value", " ", "to", " ", "a", " ", "Pyth", "on", " ", "list", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Coe", "rci", "ve", "List_", "(_", "self_", "._", "of_", "._", "to", "\\u", "python_", ",_", "value_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Module is imported with 'import' and 'import from'
kdart/pycopia/storage/pycopia/db/tables.py
[ { "content": "#!/usr/bin/python2.7\n# -*- coding: utf8 -*-\n# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab\n# File originally autogenerated by SQLAutoCode, then modified.\n# see http://code.google.com/p/sqlautocode/\n\n\"\"\"\nBasic set of tables useful for web applications, test automation, and lab\nmanagement.\n\ntypical database:\n create DATABASE pycopia ENCODING 'utf-8' OWNER pycopia;\n\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nfrom pytz import timezone\nfrom datetime import datetime\n\nfrom sqlalchemy import *\nfrom pycopia.db.types import *\n\n# default value constructors\n\nUTC = timezone('UTC')\n\n\n\n\n\n\nmetadata = MetaData()\n\n\nauth_message = Table('auth_message', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('user_id', INTEGER(), primary_key=False, nullable=False),\n Column('message', TEXT(length=None, convert_unicode=False), primary_key=False, nullable=False),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='auth_message_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_auth_message_user_id', auth_message.c.user_id, unique=False)\n\n\nclient_session = Table('client_session', metadata,\n Column('session_key', VARCHAR(length=40, convert_unicode=False), primary_key=True, nullable=False),\n Column('data', PickleText(), primary_key=False, nullable=False, default=default_obj({})),\n Column('expire_date', TIMESTAMP(timezone=True), primary_key=False, nullable=False),\n schema='public')\nIndex('index_client_session_pkey', client_session.c.session_key, unique=True)\n\n\nproject_category = Table('project_category', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_project_category_name_key', project_category.c.name, unique=True)\n\n\nconfig = Table('config', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=True, default=default_obj(None)),\n Column('comment', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('parent_id', INTEGER(), primary_key=False),\n Column('user_id', INTEGER(), primary_key=False),\n Column('testcase_id', INTEGER(), primary_key=False),\n Column('testsuite_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['testcase_id'], ['public.test_cases.id'], name='config_testcase_id_fkey'),\n ForeignKeyConstraint(['testsuite_id'], ['public.test_suites.id'], name='config_testsuite_id_fkey'),\n ForeignKeyConstraint(['parent_id'], ['public.config.id'], name='parent_id_refs_config_id'),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='config_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n UniqueConstraint(\"name\", \"parent_id\"),\n schema='public')\nIndex('index_config_testcase_id', config.c.testcase_id, unique=False)\nIndex('index_config_name_key', config.c.name, config.c.parent_id, unique=True)\nIndex('index_config_parent_id', config.c.parent_id, unique=False)\nIndex('index_config_user_id', config.c.user_id, unique=False)\nIndex('index_config_testsuite_id', config.c.testsuite_id, unique=False)\n\n\ncontacts = Table('contacts', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('prefix', VARCHAR(length=15, convert_unicode=False), primary_key=False),\n Column('firstname', VARCHAR(length=50, convert_unicode=False), primary_key=False, nullable=False),\n Column('middlename', VARCHAR(length=50, convert_unicode=False), primary_key=False),\n Column('lastname', VARCHAR(length=50, convert_unicode=False), primary_key=False, nullable=False),\n Column('title', VARCHAR(length=50, convert_unicode=False), primary_key=False),\n Column('position', VARCHAR(length=100, convert_unicode=False), primary_key=False),\n Column('phonehome', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('phoneoffice', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('phoneother', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('phonework', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('phonemobile', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('pager', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('fax', VARCHAR(length=25, convert_unicode=False), primary_key=False),\n Column('email', VARCHAR(length=80, convert_unicode=False), primary_key=False),\n Column('note', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('address_id', INTEGER(), primary_key=False),\n Column('user_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['address_id'], ['public.addresses.id'], name='contacts_address_id_fkey'),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='contacts_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n schema='public')\nIndex('index_contacts_address_id', contacts.c.address_id, unique=False)\nIndex('index_contacts_lastname', contacts.c.lastname, unique=False)\nIndex('index_contacts_user_id', contacts.c.user_id, unique=False)\n\n\ncorp_attribute_type = Table('corp_attribute_type', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('value_type', ValueType(), primary_key=False, nullable=False, default=ValueType.get_default),\n schema='public')\nIndex('index_corp_attribute_type_name_key', corp_attribute_type.c.name, unique=True)\n\n\ncorp_attributes = Table('corp_attributes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('type_id', INTEGER(), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=False),\n Column('corporation_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['corporation_id'], ['public.corporations.id'], name='corp_attributes_corporation_id_fkey'),\n ForeignKeyConstraint(['type_id'], ['public.corp_attribute_type.id'], name='corp_attributes_type_id_fkey'),\n UniqueConstraint(\"type_id\", \"corporation_id\"),\n schema='public')\nIndex('index_corp_attributes_type_id', corp_attributes.c.type_id, unique=False)\nIndex('index_corp_attributes_corporation_id', corp_attributes.c.corporation_id, unique=False)\n\n\naccount_ids = Table('account_ids', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('identifier', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('login', VARCHAR(length=80, convert_unicode=False), primary_key=False),\n Column('password', VARCHAR(length=80, convert_unicode=False), primary_key=False),\n Column('note', TEXT(length=None, convert_unicode=False), primary_key=False),\n schema='public')\nIndex('index_account_ids_identifier', account_ids.c.identifier, unique=False)\n\n\naddresses = Table('addresses', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('address', TEXT(length=None, convert_unicode=False), primary_key=False, nullable=False),\n Column('address2', TEXT(length=None, convert_unicode=False), primary_key=False, nullable=True),\n Column('city', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=True),\n Column('stateprov', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=True),\n Column('postalcode', VARCHAR(length=15, convert_unicode=False), primary_key=False, nullable=True),\n Column('country_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['country_id'], ['public.country_codes.id'], name='addresses_country_id_fkey'),\n schema='public')\nIndex('index_addresses_country_id', addresses.c.country_id, unique=False)\n\n\ncapability_group = Table('capability_group', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_capability_group_name_key', capability_group.c.name, unique=True)\n\n\ncapability_type = Table('capability_type', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('group_id', INTEGER(), primary_key=False),\n Column('value_type', ValueType(), primary_key=False, nullable=False, default=ValueType.get_default),\n ForeignKeyConstraint(['group_id'], ['public.capability_group.id'], name='capability_type_group_id_fkey'),\n schema='public')\nIndex('index_capability_type_name_key', capability_type.c.name, unique=True)\nIndex('index_capability_type_group_id', capability_type.c.group_id, unique=False)\n\n\ncapability = Table('capability', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('type_id', INTEGER(), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=False),\n Column('equipment_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['equipment_id'], ['public.equipment.id'], name='capability_equipment_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n ForeignKeyConstraint(['type_id'], ['public.capability_type.id'], name='capability_type_id_fkey'),\n schema='public')\nIndex('index_capability_equipment_id', capability.c.equipment_id, unique=False)\nIndex('index_capability_type_id', capability.c.type_id, unique=False)\n\n\nlocation = Table('location', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('locationcode', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('address_id', INTEGER(), primary_key=False),\n Column('contact_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['address_id'], ['public.addresses.id'], name='location_address_id_fkey'),\n ForeignKeyConstraint(['contact_id'], ['public.contacts.id'], name='location_contact_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n schema='public')\nIndex('index_location_address_id', location.c.address_id, unique=False)\nIndex('index_location_contact_id', location.c.contact_id, unique=False)\n\n\nattribute_type = Table('attribute_type', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('value_type', ValueType(), primary_key=False, nullable=False, default=ValueType.get_default),\n schema='public')\nIndex('index_attribute_type_name_key', attribute_type.c.name, unique=True)\n\n\nsoftware_attributes = Table('software_attributes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('type_id', INTEGER(), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=False),\n Column('software_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['software_id'], ['public.software.id'], name='software_attributes_software_id_fkey'),\n ForeignKeyConstraint(['type_id'], ['public.attribute_type.id'], name='software_attributes_type_id_fkey'),\n UniqueConstraint(\"type_id\", \"software_id\"),\n schema='public')\nIndex('index_software_attributes_software_id', software_attributes.c.software_id, unique=False)\nIndex('index_software_attributes_type_id', software_attributes.c.type_id, unique=False)\n\n\nenvironmentattribute_type = Table('environmentattribute_type', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('value_type', ValueType(), primary_key=False, nullable=False, default=ValueType.get_default),\n schema='public')\nIndex('index_environmentattribute_type_name_key', environmentattribute_type.c.name, unique=True)\n\n\nenvironment_attributes = Table('environment_attributes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('type_id', INTEGER(), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=False),\n Column('environment_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['environment_id'], ['public.environments.id'], name='environment_attributes_environment_id_fkey'),\n ForeignKeyConstraint(['type_id'], ['public.environmentattribute_type.id'], name='environment_attributes_type_id_fkey'),\n UniqueConstraint(\"type_id\", \"environment_id\"),\n schema='public')\nIndex('index_environment_attributes_environment_id', environment_attributes.c.environment_id, unique=False)\nIndex('index_environment_attributes_type_id', environment_attributes.c.type_id, unique=False)\n\n\ntest_jobs = Table('test_jobs', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('user_id', INTEGER(), primary_key=False, nullable=False),\n Column('environment_id', INTEGER(), primary_key=False, nullable=False),\n Column('testsuite_id', INTEGER(), primary_key=False, nullable=False),\n Column('reportname', VARCHAR(length=80, convert_unicode=False), primary_key=False,\n nullable=False, default=default_obj(\"email\")),\n Column('parameters', TEXT(), primary_key=False),\n Column('isscheduled', BOOLEAN(), primary_key=False, nullable=False, default=default_inactive),\n Column('schedule_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['environment_id'], ['public.environments.id'], name='test_jobs_environment_id_fkey'),\n ForeignKeyConstraint(['schedule_id'], ['public.schedule.id'], name='test_jobs_schedule_id_fkey'),\n ForeignKeyConstraint(['testsuite_id'], ['public.test_suites.id'], name='test_jobs_testsuite_id_fkey'),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='test_jobs_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_test_jobs_user_id', test_jobs.c.user_id, unique=False)\nIndex('index_test_jobs_testsuite_id', test_jobs.c.testsuite_id, unique=False)\nIndex('index_test_jobs_name', test_jobs.c.name, unique=False)\nIndex('index_test_jobs_schedule_id', test_jobs.c.schedule_id, unique=False)\nIndex('index_test_jobs_environment_id', test_jobs.c.environment_id, unique=False)\nIndex('index_test_jobs_name_key', test_jobs.c.name, test_jobs.c.user_id, unique=True)\n\n\nschedule = Table('schedule', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('user_id', INTEGER(), primary_key=False),\n Column('minute', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('hour', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('day_of_month', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('month', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('day_of_week', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='schedule_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_schedule_user_id', schedule.c.user_id, unique=False)\n\n\ntest_results_data = Table('test_results_data', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('data', JsonText(), primary_key=False, nullable=False),\n Column('note', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('test_results_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['test_results_id'], ['public.test_results.id'], name='test_results_data_test_results_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_test_results_data_pkey', test_results_data.c.id, unique=True)\nIndex('fki_test_results_data_test_results_fkey', test_results_data.c.test_results_id, unique=True)\n\n\ntest_results = Table('test_results', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('testcase_id', INTEGER(), primary_key=False),\n Column('testimplementation', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('testversion', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('tester_id', INTEGER(), primary_key=False),\n Column('environment_id', INTEGER(), primary_key=False),\n Column('build_id', INTEGER(), primary_key=False),\n Column('parent_id', INTEGER(), primary_key=False),\n Column('objecttype', TestObjectType(), primary_key=False, nullable=False),\n Column('starttime', TIMESTAMP(timezone=True), primary_key=False),\n Column('endtime', TIMESTAMP(timezone=True), primary_key=False),\n Column('arguments', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('result', TestResultType(), primary_key=False, nullable=False),\n Column('diagnostic', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('resultslocation', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('reportfilename', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('note', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('valid', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n Column('testsuite_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['tester_id'], ['public.auth_user.id'], name='test_results_tester_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['parent_id'], ['public.test_results.id'], name='parent_id_refs_test_results_id'),\n ForeignKeyConstraint(['build_id'], ['public.project_versions.id'], name='test_results_build_id_fkey'),\n ForeignKeyConstraint(['environment_id'], ['public.environments.id'], name='test_results_environment_id_fkey'),\n ForeignKeyConstraint(['testcase_id'], ['public.test_cases.id'], name='test_results_testcase_id_fkey'),\n ForeignKeyConstraint(['testsuite_id'], ['public.test_suites.id'], name='test_results_testsuite_id_fkey'),\n schema='public')\nIndex('index_test_results_testcase_id', test_results.c.testcase_id, unique=False)\nIndex('index_test_results_build_id', test_results.c.build_id, unique=False)\nIndex('index_test_results_parent_id', test_results.c.parent_id, unique=False)\nIndex('index_test_results_tester_id', test_results.c.tester_id, unique=False)\nIndex('index_test_results_testimplementation', test_results.c.testimplementation, unique=False)\nIndex('index_test_results_environment_id', test_results.c.environment_id, unique=False)\nIndex('index_test_results_testsuite_id', test_results.c.testsuite_id, unique=False)\n\n\ntraps = Table('traps', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('timestamp', TIMESTAMP(timezone=True), primary_key=False, nullable=False,\n default=time_now),\n Column('trap', PickleText(), primary_key=False, nullable=False),\n schema='public')\nIndex('index_traps_pkey', traps.c.id, unique=True)\n\n\ncookies = Table('cookies', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('value', TEXT(length=None, convert_unicode=False), primary_key=False, nullable=False),\n Column('comment', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('domain', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('max_age', INTEGER(), primary_key=False),\n Column('path', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('version', INTEGER(), primary_key=False, nullable=False),\n Column('secure', BOOLEAN(), primary_key=False),\n Column('expires', TIMESTAMP(timezone=True), primary_key=False),\n Column('discard', BOOLEAN(), primary_key=False),\n Column('comment_url', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('port', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('user_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='cookies_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_cookies_user_id', cookies.c.user_id, unique=False)\n\n\nauth_group_permissions = Table('auth_group_permissions', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('group_id', INTEGER(), primary_key=False, nullable=False),\n Column('permission_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['group_id'], ['public.auth_group.id'], name='auth_group_permissions_group_id_fkey'),\n ForeignKeyConstraint(['permission_id'], ['public.auth_permission.id'], name='auth_group_permissions_permission_id_fkey'),\n schema='public')\nIndex('index_auth_group_permissions_group_id_key', auth_group_permissions.c.group_id, auth_group_permissions.c.permission_id, unique=True)\n\n\nauth_user_groups = Table('auth_user_groups', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('user_id', INTEGER(), primary_key=False, nullable=False),\n Column('group_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['group_id'], ['public.auth_group.id'], name='auth_user_groups_group_id_fkey'),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='auth_user_groups_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_auth_user_groups_user_id_key', auth_user_groups.c.user_id, auth_user_groups.c.group_id, unique=True)\n\n\nauth_group = Table('auth_group', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_auth_group_name_key', auth_group.c.name, unique=True)\n\n\nauth_permission = Table('auth_permission', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=50, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\n\n\nauth_user_user_permissions = Table('auth_user_user_permissions', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('user_id', INTEGER(), primary_key=False, nullable=False),\n Column('permission_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['permission_id'], ['public.auth_permission.id'], name='auth_user_user_permissions_permission_id_fkey'),\n ForeignKeyConstraint(['user_id'], ['public.auth_user.id'], name='auth_user_user_permissions_user_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\nIndex('index_auth_user_user_permissions_user_id_key', auth_user_user_permissions.c.user_id, auth_user_user_permissions.c.permission_id, unique=True)\n\n\nauth_user = Table('auth_user', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('username', VARCHAR(length=30, convert_unicode=False), primary_key=False, nullable=False),\n Column('first_name', VARCHAR(length=30, convert_unicode=False), primary_key=False, nullable=False),\n Column('middle_name', VARCHAR(length=30, convert_unicode=False), primary_key=False),\n Column('last_name', VARCHAR(length=30, convert_unicode=False), primary_key=False, nullable=False),\n Column('email', VARCHAR(length=75, convert_unicode=False), primary_key=False),\n Column('is_staff', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n Column('is_active', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n Column('is_superuser', BOOLEAN(), primary_key=False, nullable=False, default=default_inactive),\n Column('last_login', TIMESTAMP(timezone=True), primary_key=False, nullable=False,\n onupdate=time_now, default=time_now),\n Column('date_joined', TIMESTAMP(timezone=True), primary_key=False, nullable=False, default=time_now),\n Column('password', VARCHAR(length=40, convert_unicode=False), primary_key=False),\n Column('authservice', VARCHAR(length=20, convert_unicode=False), primary_key=False, nullable=False),\n Column('address_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['address_id'], ['public.addresses.id'], name='auth_user_address_id_fkey'),\n schema='public')\nIndex('index_auth_user_username_key', auth_user.c.username, unique=True)\n\n\ncomponents_suites = Table('components_suites', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('component_id', INTEGER(), primary_key=False, nullable=False),\n Column('testsuite_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['component_id'], ['public.components.id'], name='components_suites_component_id_fkey'),\n ForeignKeyConstraint(['testsuite_id'], ['public.test_suites.id'], name='components_suites_testsuite_id_fkey'),\n schema='public')\nIndex('index_components_suites_component_id_key', components_suites.c.component_id, components_suites.c.testsuite_id, unique=True)\n\n\nprojects = Table('projects', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('category_id', INTEGER(), primary_key=False),\n Column('leader_id', INTEGER(), primary_key=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False, nullable=False),\n Column('created', TIMESTAMP(timezone=True), primary_key=False, nullable=False, default=time_now),\n ForeignKeyConstraint(['category_id'], ['public.project_category.id'], name='projects_category_id_fkey'),\n ForeignKeyConstraint(['leader_id'], ['public.contacts.id'], name='projects_leader_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n schema='public')\nIndex('index_projects_name_key', projects.c.name, unique=True)\nIndex('index_projects_leader_id', projects.c.leader_id, unique=False)\nIndex('index_projects_category_id', projects.c.category_id, unique=False)\n\n\nprojects_components = Table('projects_components', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('project_id', INTEGER(), primary_key=False, nullable=False),\n Column('component_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['component_id'], ['public.components.id'], name='projects_components_component_id_fkey'),\n ForeignKeyConstraint(['project_id'], ['public.projects.id'], name='projects_components_project_id_fkey'),\n schema='public')\nIndex('index_projects_components_project_id_key', projects_components.c.project_id, projects_components.c.component_id, unique=True)\n\n\ncomponents = Table('components', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False, nullable=False),\n Column('created', TIMESTAMP(timezone=True), primary_key=False, nullable=False, default=time_now),\n schema='public')\nIndex('index_components_name_key', components.c.name, unique=True)\n\n\ntest_cases_areas = Table('test_cases_areas', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('testcase_id', INTEGER(), primary_key=False, nullable=False),\n Column('functionalarea_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['functionalarea_id'], ['public.functional_area.id'], name='test_cases_areas_functionalarea_id_fkey'),\n ForeignKeyConstraint(['testcase_id'], ['public.test_cases.id'], name='test_cases_areas_testcase_id_fkey'),\n schema='public')\nIndex('index_test_cases_areas_testcase_id_key', test_cases_areas.c.testcase_id, test_cases_areas.c.functionalarea_id, unique=True)\n\n\ntest_cases = Table('test_cases', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('lastchange', TIMESTAMP(timezone=True), primary_key=False, nullable=False,\n onupdate=time_now, default=time_now),\n Column('lastchangeauthor_id', INTEGER(), primary_key=False),\n Column('author_id', INTEGER(), primary_key=False),\n Column('reviewer_id', INTEGER(), primary_key=False),\n Column('tester_id', INTEGER(), primary_key=False),\n Column('purpose', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('passcriteria', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('startcondition', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('endcondition', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('procedure', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('comments', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('priority', PriorityType(), primary_key=False, nullable=False, default=PriorityType.get_default),\n Column('cycle', TestCaseType(), primary_key=False, nullable=False, default=TestCaseType.get_default),\n Column('status', TestCaseStatus(), primary_key=False, nullable=False, default=TestCaseStatus.get_default),\n Column('automated', BOOLEAN(), primary_key=False, nullable=False, default=default_inactive),\n Column('interactive', BOOLEAN(), primary_key=False, nullable=False, default=default_inactive),\n Column('valid', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n Column('testimplementation', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('bugid', VARCHAR(length=80, convert_unicode=False), primary_key=False),\n Column('reference_id', INTEGER(), primary_key=False),\n Column('time_estimate', INTERVAL(), primary_key=False), # for manual tests\n ForeignKeyConstraint(['author_id'], ['public.auth_user.id'], name='test_cases_author_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['reviewer_id'], ['public.auth_user.id'], name='test_cases_reviewer_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['tester_id'], ['public.auth_user.id'], name='test_cases_tester_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['lastchangeauthor_id'], ['public.auth_user.id'], name='test_cases_lastchangeauthor_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['reference_id'], ['public.requirement_ref.id'], name='test_cases_requirement_ref_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n schema='public')\nIndex('index_test_cases_lastchangeauthor_id', test_cases.c.lastchangeauthor_id, unique=False)\nIndex('index_test_cases_reviewer_id', test_cases.c.reviewer_id, unique=False)\nIndex('index_test_cases_testimplementation', test_cases.c.testimplementation, unique=False)\nIndex('index_test_cases_author_id', test_cases.c.author_id, unique=False)\nIndex('index_test_cases_name_key', test_cases.c.name, unique=True)\nIndex('index_test_cases_tester_id', test_cases.c.tester_id, unique=False)\nIndex('index_test_cases_requirement_ref_id', test_cases.c.reference_id, unique=False)\n\ntest_cases_prerequisites = Table('test_cases_prerequisites', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('testcase_id', INTEGER(), primary_key=False, nullable=False),\n Column('prerequisite_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['testcase_id'], ['public.test_cases.id'], name='test_cases_testcase_id_fkey'),\n ForeignKeyConstraint(['prerequisite_id'], ['public.test_cases.id'],\n name='test_cases_relation_prerequisite_id_fkey'),\n schema='public')\nIndex('index_test_cases_test_cases_id_key',\n test_cases_prerequisites.c.testcase_id, test_cases_prerequisites.c.prerequisite_id, unique=True)\n\n\ntest_suites = Table('test_suites', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('valid', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n Column('lastchange', TIMESTAMP(timezone=True), primary_key=False, nullable=False,\n onupdate=time_now, default=time_now),\n Column('lastchangeauthor_id', INTEGER(), primary_key=False),\n Column('suiteimplementation', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('project_id', INTEGER(), primary_key=False),\n Column('purpose', TEXT(length=None, convert_unicode=False), primary_key=False),\n ForeignKeyConstraint(['lastchangeauthor_id'], ['public.auth_user.id'], name='test_suites_lastchangeauthor_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['project_id'], ['public.projects.id'], name='test_suites_projects_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n schema='public')\nIndex('index_test_suites_lastchangeauthor_id', test_suites.c.lastchangeauthor_id, unique=False)\nIndex('index_test_suites_name_key', test_suites.c.name, unique=True)\nIndex('index_test_suites_project_id', test_suites.c.project_id, unique=False)\nIndex('index_test_suites_suiteimplementation', test_suites.c.suiteimplementation, unique=False)\n\n\ntest_suites_testcases = Table('test_suites_testcases', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('testsuite_id', INTEGER(), primary_key=False, nullable=False),\n Column('testcase_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['testcase_id'], ['public.test_cases.id'], name='test_suites_testcases_testcase_id_fkey'),\n ForeignKeyConstraint(['testsuite_id'], ['public.test_suites.id'], name='test_suites_testcases_testsuite_id_fkey'),\n schema='public')\nIndex('index_test_suites_testcases_testsuite_id_key', test_suites_testcases.c.testsuite_id, test_suites_testcases.c.testcase_id, unique=True)\n\n\nuse_cases = Table('use_cases', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False), # full path\n Column('purpose', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('notes', TEXT(length=None, convert_unicode=False), primary_key=False),\n schema='public')\nIndex('index_use_case_name', use_cases.c.name, unique=True)\n\n# risk managmnet schema\nrisk_factors = Table('risk_factors', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('description', TEXT(convert_unicode=False), primary_key=False),\n Column('priority', PriorityType(), primary_key=False, nullable=False, default=PriorityType.get_default),\n Column('likelihood', LikelihoodType(), primary_key=False, nullable=False, default=LikelihoodType.get_default),\n Column('severity', SeverityType(), primary_key=False, nullable=False, default=SeverityType.get_default),\n Column('testcase_id', INTEGER(), primary_key=False),\n Column('requirement_id', INTEGER(), primary_key=False),\n Column('risk_category_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['testcase_id'], ['public.test_cases.id'],\n name='risk_factors_testcase_id_fkey', ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['requirement_id'], ['public.requirement_ref.id'],\n name='risk_factors_requirement_id_fkey', ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['risk_category_id'], ['public.risk_category.id'],\n name='risk_factors_risk_category_id_fkey'),\n schema='public')\nIndex('index_risk_factors_testcase_id', risk_factors.c.testcase_id, unique=False)\nIndex('index_risk_factors_requirement_ref_id', risk_factors.c.requirement_id, unique=False)\nIndex('index_risk_factors_risk_category_id', risk_factors.c.risk_category_id, unique=False)\n\nrisk_category = Table('risk_category', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), nullable=False),\n Column('description', TEXT(convert_unicode=False), primary_key=False),\n schema='public')\nIndex('index_risk_category_name_key', risk_category.c.name, unique=True)\n\nrequirement_ref = Table('requirement_ref', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('uri', VARCHAR(length=255), primary_key=False),\n Column('description', TEXT(convert_unicode=False), primary_key=False),\n schema='public')\n\ncountry_codes = Table('country_codes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('isocode', VARCHAR(length=4, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_country_codes_isocode_key', country_codes.c.isocode, unique=True)\n\n\ntest_suites_suites = Table('test_suites_suites', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('from_testsuite_id', INTEGER(), primary_key=False, nullable=False),\n Column('to_testsuite_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['from_testsuite_id'], ['public.test_suites.id'], name='test_suites_suites_from_testsuite_id_fkey'),\n ForeignKeyConstraint(['to_testsuite_id'], ['public.test_suites.id'], name='test_suites_suites_to_testsuite_id_fkey'),\n schema='public')\nIndex('index_test_suites_suites_from_testsuite_id_key', test_suites_suites.c.from_testsuite_id, test_suites_suites.c.to_testsuite_id, unique=True)\n\n\ncountry_sets = Table('country_sets', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_country_sets_name_key', country_sets.c.name, unique=True)\n\n\ncountry_sets_countries = Table('country_sets_countries', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('countryset_id', INTEGER(), primary_key=False, nullable=False),\n Column('country_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['country_id'], ['public.country_codes.id'], name='country_sets_countries_country_id_fkey'),\n ForeignKeyConstraint(['countryset_id'], ['public.country_sets.id'], name='country_sets_countries_countryset_id_fkey'),\n schema='public')\nIndex('index_country_sets_countries_countryset_id_key', country_sets_countries.c.countryset_id, country_sets_countries.c.country_id, unique=True)\n\n\nlanguage_sets = Table('language_sets', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_language_sets_name_key', language_sets.c.name, unique=True)\n\n\nlanguage_sets_languages = Table('language_sets_languages', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('languageset_id', INTEGER(), primary_key=False, nullable=False),\n Column('language_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['language_id'], ['public.language_codes.id'], name='language_sets_languages_language_id_fkey'),\n ForeignKeyConstraint(['languageset_id'], ['public.language_sets.id'], name='language_sets_languages_languageset_id_fkey'),\n schema='public')\nIndex('index_language_sets_languages_languageset_id_key', language_sets_languages.c.languageset_id, language_sets_languages.c.language_id, unique=True)\n\n\ncorporations_services = Table('corporations_services', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('corporation_id', INTEGER(), primary_key=False, nullable=False),\n Column('functionalarea_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['corporation_id'], ['public.corporations.id'], name='corporations_services_corporation_id_fkey'),\n ForeignKeyConstraint(['functionalarea_id'], ['public.functional_area.id'], name='corporations_services_functionalarea_id_fkey'),\n schema='public')\nIndex('index_corporations_services_corporation_id_key', corporations_services.c.corporation_id, corporations_services.c.functionalarea_id, unique=True)\n\n\nfunctional_area = Table('functional_area', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n schema='public')\nIndex('index_functional_area_name_key', functional_area.c.name, unique=True)\n\n\nsoftware_variants = Table('software_variants', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('software_id', INTEGER(), primary_key=False, nullable=False),\n Column('softwarevariant_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['software_id'], ['public.software.id'], name='software_variants_software_id_fkey'),\n ForeignKeyConstraint(['softwarevariant_id'], ['public.software_variant.id'], name='software_variants_softwarevariant_id_fkey'),\n schema='public')\nIndex('index_software_variants_software_id_key', software_variants.c.software_id, software_variants.c.softwarevariant_id, unique=True)\n\n\nsoftware_variant = Table('software_variant', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('language_id', INTEGER(), primary_key=False),\n Column('country_id', INTEGER(), primary_key=False),\n Column('encoding', VARCHAR(length=80, convert_unicode=False), primary_key=False),\n ForeignKeyConstraint(['country_id'], ['public.country_codes.id'], name='software_variant_country_id_fkey'),\n ForeignKeyConstraint(['language_id'], ['public.language_codes.id'], name='software_variant_language_id_fkey'),\n schema='public')\nIndex('index_software_variant_name_key', software_variant.c.name, unique=True)\nIndex('index_software_variant_language_id', software_variant.c.language_id, unique=False)\nIndex('index_software_variant_country_id', software_variant.c.country_id, unique=False)\n\n\nlanguage_codes = Table('language_codes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('isocode', VARCHAR(length=6, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_language_codes_isocode_key', language_codes.c.isocode, unique=True)\nIndex('index_language_codes_name_key', language_codes.c.name, unique=True)\n\n\nnetworks = Table('networks', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=64, convert_unicode=False), primary_key=False, nullable=False),\n Column('layer', INTEGER(), primary_key=False, nullable=False, server_default=\"1\"),\n Column('vlanid', INTEGER(), primary_key=False),\n Column('ipnetwork', Cidr(), primary_key=False),\n Column('lower_id', INTEGER(), primary_key=False),\n Column('notes', TEXT(length=None, convert_unicode=False), primary_key=False),\n ForeignKeyConstraint(['lower_id'], ['public.networks.id'], name='lower_id_refs_networks_id',\n ondelete=\"SET NULL\"),\n CheckConstraint('layer > 0 AND layer < 8', name='osilayers'),\n CheckConstraint('vlanid > 0 AND vlanid < 4094', name='vlanrange'),\n schema='public')\n\n\nequipment = Table('equipment', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('model_id', INTEGER(), primary_key=False, nullable=False),\n Column('serno', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('location_id', INTEGER(), primary_key=False),\n Column('sublocation', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('addeddate', TIMESTAMP(timezone=True), primary_key=False, default=time_now),\n Column('comments', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('language_id', INTEGER(), primary_key=False),\n Column('owner_id', INTEGER(), primary_key=False),\n Column('vendor_id', INTEGER(), primary_key=False),\n Column('account_id', INTEGER(), primary_key=False),\n Column('parent_id', INTEGER(), primary_key=False),\n Column('active', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n ForeignKeyConstraint(['language_id'], ['public.language_codes.id'], name='equipment_language_id_fkey'),\n ForeignKeyConstraint(['model_id'], ['public.equipment_model.id'], name='equipment_model_id_fkey'),\n ForeignKeyConstraint(['vendor_id'], ['public.corporations.id'], name='equipment_vendor_id_fkey'),\n ForeignKeyConstraint(['owner_id'], ['public.auth_user.id'], name='equipment_owner_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n ForeignKeyConstraint(['location_id'], ['public.location.id'], name='equipment_location_id_fkey'),\n ForeignKeyConstraint(['account_id'], ['public.account_ids.id'], name='equipment_account_id_fkey'),\n ForeignKeyConstraint(['parent_id'], ['public.equipment.id'], name='parent_id_refs_equipment_id'),\n schema='public')\n\nIndex('index_equipment_model_id', equipment.c.model_id, unique=False)\nIndex('index_equipment_language_id', equipment.c.language_id, unique=False)\nIndex('index_equipment_owner_id', equipment.c.owner_id, unique=False)\nIndex('index_equipment_vendor_id', equipment.c.vendor_id, unique=False)\nIndex('index_equipment_location_id', equipment.c.location_id, unique=False)\nIndex('index_equipment_account_id', equipment.c.account_id, unique=False)\nIndex('index_equipment_parent_id', equipment.c.parent_id, unique=False)\n\n# IANAifType\ninterface_type = Table('interface_type', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=40, convert_unicode=False), primary_key=False, nullable=False),\n Column('enumeration', INTEGER(), primary_key=False),\n schema='public')\n\ninterfaces = Table('interfaces', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=64, convert_unicode=False), primary_key=False, nullable=False),\n Column('alias', VARCHAR(length=64, convert_unicode=False)),\n Column('ifindex', INTEGER(), primary_key=False),\n Column('description', TEXT(convert_unicode=False), primary_key=False),\n Column('macaddr', MACADDR(), primary_key=False),\n Column('vlan', INTEGER(), primary_key=False),\n Column('ipaddr', Inet(), primary_key=False),\n Column('mtu', INTEGER(), primary_key=False),\n Column('speed', INTEGER(), primary_key=False),\n Column('status', INTEGER(), primary_key=False),\n Column('interface_type_id', INTEGER(), primary_key=False),\n Column('parent_id', INTEGER(), primary_key=False),\n Column('equipment_id', INTEGER(), primary_key=False),\n Column('network_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['equipment_id'], ['public.equipment.id'], name='interfaces_equipment_id_fkey'),\n ForeignKeyConstraint(['parent_id'], ['public.interfaces.id'], name='parent_id_refs_interfaces_id'),\n ForeignKeyConstraint(['interface_type_id'], ['public.interface_type.id'], name='interface_type_id_refs_interfaces_id'),\n ForeignKeyConstraint(['network_id'], ['public.networks.id'], name='network_id_refs_networks_id'),\n schema='public')\nIndex('index_interfaces_parent_id', interfaces.c.parent_id, unique=False)\nIndex('index_interfaces_equipment_id', interfaces.c.equipment_id, unique=False)\nIndex('index_interfaces_interface_type_id', interfaces.c.interface_type_id, unique=False)\nIndex('index_interfaces_network_id', interfaces.c.network_id, unique=False)\n\nequipment_attributes = Table('equipment_attributes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('type_id', INTEGER(), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=False),\n Column('equipment_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['equipment_id'], ['public.equipment.id'], name='equipment_attributes_equipment_id_fkey'),\n ForeignKeyConstraint(['type_id'], ['public.attribute_type.id'], name='equipment_attributes_type_id_fkey'),\n UniqueConstraint(\"type_id\", \"equipment_id\"),\n schema='public')\nIndex('index_equipment_attributes_type_id', equipment_attributes.c.type_id, unique=False)\nIndex('index_equipment_attributes_equipment_id', equipment_attributes.c.equipment_id, unique=False)\n\n\nequipment_model_attributes = Table('equipment_model_attributes', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('type_id', INTEGER(), primary_key=False, nullable=False),\n Column('value', PickleText(), primary_key=False, nullable=False),\n Column('equipmentmodel_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['equipmentmodel_id'], ['public.equipment_model.id'], name='equipment_model_attributes_equipmentmodel_id_fkey'),\n ForeignKeyConstraint(['type_id'], ['public.attribute_type.id'], name='equipment_model_attributes_type_id_fkey'),\n UniqueConstraint(\"type_id\", \"equipmentmodel_id\"),\n schema='public')\nIndex('index_equipment_model_attributes_type_id', equipment_model_attributes.c.type_id, unique=False)\nIndex('index_equipment_model_attributes_equipmentmodel_id', equipment_model_attributes.c.equipmentmodel_id, unique=False)\n\n\nequipment_subcomponents = Table('equipment_subcomponents', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('from_equipment_id', INTEGER(), primary_key=False, nullable=False),\n Column('to_equipment_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['from_equipment_id'], ['public.equipment.id'], name='equipment_subcomponents_from_equipment_id_fkey'),\n ForeignKeyConstraint(['to_equipment_id'], ['public.equipment.id'], name='equipment_subcomponents_to_equipment_id_fkey'),\n schema='public')\nIndex('index_equipment_subcomponents_from_equipment_id_key', equipment_subcomponents.c.from_equipment_id, equipment_subcomponents.c.to_equipment_id, unique=True)\n\n\nequipment_software = Table('equipment_software', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('equipment_id', INTEGER(), primary_key=False, nullable=False),\n Column('software_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['equipment_id'], ['public.equipment.id'], name='equipment_software_equipment_id_fkey'),\n ForeignKeyConstraint(['software_id'], ['public.software.id'], name='equipment_software_software_id_fkey'),\n schema='public')\nIndex('index_equipment_software_equipment_id_key', equipment_software.c.equipment_id, equipment_software.c.software_id, unique=True)\n\n\nequipment_category = Table('equipment_category', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n schema='public')\nIndex('index_equipment_category_name_key', equipment_category.c.name, unique=True)\n\n\nequipment_model = Table('equipment_model', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('manufacturer_id', INTEGER(), primary_key=False, nullable=False),\n Column('category_id', INTEGER(), primary_key=False, nullable=False),\n Column('specs', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('picture', VARCHAR(length=255, convert_unicode=False), primary_key=False),\n Column('note', TEXT(length=None, convert_unicode=False), primary_key=False),\n ForeignKeyConstraint(['category_id'], ['public.equipment_category.id'], name='equipment_model_category_id_fkey'),\n ForeignKeyConstraint(['manufacturer_id'], ['public.corporations.id'], name='equipment_model_manufacturer_id_fkey'),\n schema='public')\nIndex('index_equipment_model_category_id', equipment_model.c.category_id, unique=False)\nIndex('index_equipment_model_manufacturer_id', equipment_model.c.manufacturer_id, unique=False)\nIndex('index_equipment_model_manufacturer_id_key', equipment_model.c.manufacturer_id, equipment_model.c.name, unique=True)\n\n\nequipment_model_embeddedsoftware = Table('equipment_model_embeddedsoftware', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('equipmentmodel_id', INTEGER(), primary_key=False, nullable=False),\n Column('software_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['equipmentmodel_id'], ['public.equipment_model.id'], name='equipment_model_embeddedsoftware_equipmentmodel_id_fkey'),\n ForeignKeyConstraint(['software_id'], ['public.software.id'], name='equipment_model_embeddedsoftware_software_id_fkey'),\n schema='public')\nIndex('index_equipment_model_embeddedsoftware_equipmentmodel_id_key', equipment_model_embeddedsoftware.c.equipmentmodel_id, equipment_model_embeddedsoftware.c.software_id, unique=True)\n\n\nsoftware = Table('software', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('manufacturer_id', INTEGER(), primary_key=False),\n Column('vendor_id', INTEGER(), primary_key=False),\n Column('category_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['category_id'], ['public.software_category.id'], name='software_category_id_fkey'),\n ForeignKeyConstraint(['vendor_id'], ['public.corporations.id'], name='software_vendor_id_fkey'),\n ForeignKeyConstraint(['manufacturer_id'], ['public.corporations.id'], name='software_manufacturer_id_fkey'),\n schema='public')\nIndex('index_software_manufacturer_id', software.c.manufacturer_id, unique=False)\nIndex('index_software_name_key', software.c.name, unique=True)\nIndex('index_software_vendor_id', software.c.vendor_id, unique=False)\nIndex('index_software_category_id', software.c.category_id, unique=False)\n\n\nproject_versions = Table('project_versions', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('project_id', INTEGER(), primary_key=False, nullable=False),\n Column('major', INTEGER(), primary_key=False, nullable=False, default=default_obj(1)),\n Column('minor', INTEGER(), primary_key=False, nullable=False, default=default_obj(0)),\n Column('subminor', INTEGER(), primary_key=False, nullable=False, default=default_obj(0)),\n Column('build', INTEGER(), primary_key=False),\n Column('valid', BOOLEAN(), primary_key=False, nullable=False, default=default_active),\n ForeignKeyConstraint(['project_id'], ['public.projects.id'],\n name='project_versions_project_id_fkey'),\n UniqueConstraint(\"project_id\", \"major\", \"minor\", \"subminor\", \"build\",\n name=\"project_versions_unique\"),\n schema='public')\nIndex('index_project_versions_project_id', project_versions.c.project_id, unique=False)\n\n\ncorporations = Table('corporations', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('parent_id', INTEGER(), primary_key=False),\n Column('notes', TEXT(length=None, convert_unicode=False), primary_key=False),\n Column('address_id', INTEGER(), primary_key=False),\n Column('contact_id', INTEGER(), primary_key=False),\n Column('country_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['contact_id'], ['public.contacts.id'], name='contact_id_refs_contacts_id'),\n ForeignKeyConstraint(['parent_id'], ['public.corporations.id'], name='parent_id_refs_corporations_id'),\n ForeignKeyConstraint(['country_id'], ['public.country_codes.id'], name='corporations_country_id_fkey'),\n ForeignKeyConstraint(['address_id'], ['public.addresses.id'], name='corporations_address_id_fkey'),\n schema='public')\nIndex('index_corporations_parent_id', corporations.c.parent_id, unique=False)\nIndex('index_corporations_name', corporations.c.name, unique=False)\nIndex('index_corporations_country_id', corporations.c.country_id, unique=False)\nIndex('index_corporations_contact_id', corporations.c.contact_id, unique=False)\nIndex('index_corporations_address_id', corporations.c.address_id, unique=False)\nIndex('index_corporations_name_key', corporations.c.name, corporations.c.country_id, unique=True)\n\n\nenvironments = Table('environments', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=255, convert_unicode=False), primary_key=False, nullable=False),\n Column('owner_id', INTEGER(), primary_key=False),\n ForeignKeyConstraint(['owner_id'], ['public.auth_user.id'], name='environments_owner_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"SET NULL\"),\n schema='public')\nIndex('index_environments_name_key', environments.c.name, unique=True)\nIndex('index_environments_owner_id', environments.c.owner_id, unique=False)\n\n\ntestequipment = Table('testequipment', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('equipment_id', INTEGER(), primary_key=False, nullable=False),\n Column('environment_id', INTEGER(), primary_key=False, nullable=False),\n Column('UUT', BOOLEAN(), primary_key=False, nullable=False, default=default_inactive),\n ForeignKeyConstraint(['environment_id'], ['public.environments.id'], name='testequipment_environment_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n ForeignKeyConstraint(['equipment_id'], ['public.equipment.id'], name='testequipment_equipment_id_fkey',\n onupdate=\"CASCADE\", ondelete=\"CASCADE\"),\n schema='public')\n\nIndex('index_testequipment_equipment_id', testequipment.c.equipment_id, unique=False)\nIndex('index_testequipment_environment_id', testequipment.c.environment_id, unique=False)\n\n\ntestequipment_roles = Table('testequipment_roles', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('testequipment_id', INTEGER(), primary_key=False, nullable=False),\n Column('softwarecategory_id', INTEGER(), primary_key=False, nullable=False),\n ForeignKeyConstraint(['softwarecategory_id'], ['public.software_category.id'], name='testequipment_roles_softwarecategory_id_fkey'),\n ForeignKeyConstraint(['testequipment_id'], ['public.testequipment.id'], name='testequipment_roles_testequipment_id_fkey'),\n schema='public')\nIndex('index_testequipment_roles_testequipment_id_key', testequipment_roles.c.testequipment_id, testequipment_roles.c.softwarecategory_id, unique=True)\n\n\nsoftware_category = Table('software_category', metadata,\n Column('id', INTEGER(), primary_key=True, nullable=False),\n Column('name', VARCHAR(length=80, convert_unicode=False), primary_key=False, nullable=False),\n Column('description', TEXT(length=None, convert_unicode=False), primary_key=False),\n schema='public')\nIndex('index_software_category_name_key', software_category.c.name, unique=True)\n\n\n# Run this module to create the tables. The user/role/database should\n# already be created.\nif __name__ == '__main__':\n import sys\n from pycopia import autodebug\n from pycopia import getopt\n from sqlalchemy import create_engine\n\n tname = None\n opts, longopts, args = getopt.getopt(sys.argv[1:], \"\")\n try:\n url = args[0]\n except IndexError:\n print (\"Please supply a database URL.\")\n print (\"e.g: postgresql://pycopia@localhost/pycopia\")\n else:\n db = create_engine(unicode(url))\n metadata.bind = db\n if len(args) > 1:\n for tname in args[1:]:\n tbl = getattr(sys.modules[__name__], tname)\n print (tbl)\n tbl.drop(checkfirst=True)\n tbl.create()\n else:\n print (\"creating tables in\", url)\n metadata.create_all()\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python", "2.7", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "ts", "=", "4", ":", "sw", "=", "4", ":", "soft", "tabs", "top", "=", "4", ":", "smart", "tab", ":", "expand", "tab_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "File", " ", "original", "ly", " ", "autogen", "erate", "d", " ", "by", " ", "SQL", "Auto", "Code", ",", " ", "then", " ", "modifi", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "see", " ", "http", "://", "code", ".", "google", ".", "com", "/", "p", "/", "sqla", "uto", "code", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Basic", " ", "set", " ", "of", " ", "tables", " ", "usef", "ul", " ", "for", " ", "web", " ", "applica", "tion", "s", ",", " ", "test", " ", "automati", "on", ",", " ", "and", " ", "lab", "\\", "10", ";", "manage", "ment", ".", "\\", "10", ";", "\\", "10", ";", "typical", " ", "databa", "se", ":", "\\", "10", ";", " ", " ", "create", " ", "DATA", "BASE", " ", "pyco", "pia", " ", "ENCODING", " ", "'", "utf", "-", "8", "'", " ", "OWNER", " ", "pyco", "pia", ";", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pytz_", "import_", "timezone_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "._", "db_", "._", "types_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "default", " ", "value", " ", "construct", "ors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UTC_", "=_", "timezone_", "(_", "'", "UT", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "metadata_", "=_", "Meta", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "message_", "=_", "Table_", "(_", "'", "auth", "\\u", "message", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "message", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "message", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "auth", "\\u", "message", "\\u", "user", "\\u", "id", "'_", ",_", "auth", "\\u", "message_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "session_", "=_", "Table_", "(_", "'", "client", "\\u", "session", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "session", "\\u", "key", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "40_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "data", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "obj_", "(_", "{_", "}_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "expir", "e\\u", "date", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "client", "\\u", "session", "\\u", "pkey", "'_", ",_", "client", "\\u", "session_", "._", "c_", "._", "session", "\\u", "key_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "category_", "=_", "Table_", "(_", "'", "project", "\\u", "category", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "project", "\\u", "category", "\\u", "name", "\\u", "key", "'_", ",_", "project", "\\u", "category_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "Table_", "(_", "'", "config", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "True_", ",_", "default_", "=_", "default", "\\u", "obj_", "(_", "None_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "comment", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "parent", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testc", "ase", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testc", "ase", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "config", "\\u", "testc", "ase", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "config", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "parent", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "config", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "parent", "\\u", "id", "\\u", "refs", "\\u", "config", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "config", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "name", "\"_", ",_", "\"", "parent", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "config", "\\u", "testc", "ase", "\\u", "id", "'_", ",_", "config_", "._", "c_", "._", "testc", "ase", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "config", "\\u", "name", "\\u", "key", "'_", ",_", "config_", "._", "c_", "._", "name_", ",_", "config_", "._", "c_", "._", "parent", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "config", "\\u", "parent", "\\u", "id", "'_", ",_", "config_", "._", "c_", "._", "parent", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "config", "\\u", "user", "\\u", "id", "'_", ",_", "config_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "config", "\\u", "testsuite", "\\u", "id", "'_", ",_", "config_", "._", "c_", "._", "testsuite", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "contacts_", "=_", "Table_", "(_", "'", "contact", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "prefix", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "15_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "first", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "50_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "middle", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "50_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "last", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "50_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "title", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "50_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "position", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "100_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "phone", "home", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "phone", "office", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "phone", "other", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "phone", "work", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "phone", "mobile", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "pager", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "fax", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "25_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "email", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "address", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "address", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "addresse", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "contact", "s", "\\u", "address", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "contact", "s", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "contact", "s", "\\u", "address", "\\u", "id", "'_", ",_", "contacts_", "._", "c_", "._", "address", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "contact", "s", "\\u", "last", "name", "'_", ",_", "contacts_", "._", "c_", "._", "lastname_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "contact", "s", "\\u", "user", "\\u", "id", "'_", ",_", "contacts_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "corp", "\\u", "attribute", "\\u", "type_", "=_", "Table_", "(_", "'", "corp", "\\u", "attribute", "\\u", "type", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "\\u", "type", "'_", ",_", "Value", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Value", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corp", "\\u", "attribute", "\\u", "type", "\\u", "name", "\\u", "key", "'_", ",_", "corp", "\\u", "attribute", "\\u", "type_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "corp", "\\u", "attributes_", "=_", "Table_", "(_", "'", "corp", "\\u", "attribute", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "corporat", "ion", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "corporat", "ion", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "corp", "\\u", "attribute", "s", "\\u", "corporat", "ion", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corp", "\\u", "attribute", "\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "corp", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "type", "\\u", "id", "\"_", ",_", "\"", "corporat", "ion", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corp", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "'_", ",_", "corp", "\\u", "attributes_", "._", "c_", "._", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corp", "\\u", "attribute", "s", "\\u", "corporat", "ion", "\\u", "id", "'_", ",_", "corp", "\\u", "attributes_", "._", "c_", "._", "corporat", "ion", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "account", "\\u", "ids_", "=_", "Table_", "(_", "'", "account", "\\u", "ids", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "identifi", "er", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "login", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "password", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "account", "\\u", "ids", "\\u", "identifi", "er", "'_", ",_", "account", "\\u", "ids_", "._", "c_", "._", "identifier_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "addresses_", "=_", "Table_", "(_", "'", "addresse", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "address", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "address", "2", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "city", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "state", "prov", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "postal", "code", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "15_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "countr", "y", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "countr", "y", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "countr", "y", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "addresse", "s", "\\u", "countr", "y", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "addresse", "s", "\\u", "countr", "y", "\\u", "id", "'_", ",_", "addresses_", "._", "c_", "._", "countr", "y", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "capab", "ilit", "y", "\\u", "group_", "=_", "Table_", "(_", "'", "capab", "ilit", "y", "\\u", "group", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "capab", "ilit", "y", "\\u", "group", "\\u", "name", "\\u", "key", "'_", ",_", "capab", "ilit", "y", "\\u", "group_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "capab", "ilit", "y", "\\u", "type_", "=_", "Table_", "(_", "'", "capab", "ilit", "y", "\\u", "type", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "group", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "\\u", "type", "'_", ",_", "Value", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Value", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "group", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "capab", "ilit", "y", "\\u", "group", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "capab", "ilit", "y", "\\u", "type", "\\u", "group", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "capab", "ilit", "y", "\\u", "type", "\\u", "name", "\\u", "key", "'_", ",_", "capab", "ilit", "y", "\\u", "type_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "capab", "ilit", "y", "\\u", "type", "\\u", "group", "\\u", "id", "'_", ",_", "capab", "ilit", "y", "\\u", "type_", "._", "c_", "._", "group", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "capability_", "=_", "Table_", "(_", "'", "capab", "ilit", "y", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "capab", "ilit", "y", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "capab", "ilit", "y", "\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "capab", "ilit", "y", "\\u", "type", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "capab", "ilit", "y", "\\u", "equipment", "\\u", "id", "'_", ",_", "capability_", "._", "c_", "._", "equipment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "capab", "ilit", "y", "\\u", "type", "\\u", "id", "'_", ",_", "capability_", "._", "c_", "._", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "location_", "=_", "Table_", "(_", "'", "location", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "location", "code", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "address", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "contact", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "address", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "addresse", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "location", "\\u", "address", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "contact", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "contact", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "location", "\\u", "contact", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "location", "\\u", "address", "\\u", "id", "'_", ",_", "location_", "._", "c_", "._", "address", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "location", "\\u", "contact", "\\u", "id", "'_", ",_", "location_", "._", "c_", "._", "contact", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "attribute", "\\u", "type_", "=_", "Table_", "(_", "'", "attribute", "\\u", "type", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "\\u", "type", "'_", ",_", "Value", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Value", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "attribute", "\\u", "type", "\\u", "name", "\\u", "key", "'_", ",_", "attribute", "\\u", "type_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "software", "\\u", "attributes_", "=_", "Table_", "(_", "'", "software", "\\u", "attribute", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "software", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "software", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "attribute", "s", "\\u", "software", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "attribute", "\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "type", "\\u", "id", "\"_", ",_", "\"", "software", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "attribute", "s", "\\u", "software", "\\u", "id", "'_", ",_", "software", "\\u", "attributes_", "._", "c_", "._", "software", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "'_", ",_", "software", "\\u", "attributes_", "._", "c_", "._", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "environ", "menta", "ttr", "ibut", "e\\u", "type_", "=_", "Table_", "(_", "'", "environ", "menta", "ttr", "ibut", "e\\u", "type", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "\\u", "type", "'_", ",_", "Value", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Value", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "environ", "menta", "ttr", "ibut", "e\\u", "type", "\\u", "name", "\\u", "key", "'_", ",_", "environ", "menta", "ttr", "ibut", "e\\u", "type_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "environ", "ment", "\\u", "attributes_", "=_", "Table_", "(_", "'", "environ", "ment", "\\u", "attribute", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "environ", "ment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "environ", "ment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "environ", "ment", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "environ", "ment", "\\u", "attribute", "s", "\\u", "environ", "ment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "environ", "menta", "ttr", "ibut", "e\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "environ", "ment", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "type", "\\u", "id", "\"_", ",_", "\"", "environ", "ment", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "environ", "ment", "\\u", "attribute", "s", "\\u", "environ", "ment", "\\u", "id", "'_", ",_", "environ", "ment", "\\u", "attributes_", "._", "c_", "._", "environ", "ment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "environ", "ment", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "'_", ",_", "environ", "ment", "\\u", "attributes_", "._", "c_", "._", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "jobs_", "=_", "Table_", "(_", "'", "test\\u", "jobs", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "environ", "ment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "report", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "obj_", "(_", "\"", "email", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "parameter", "s", "'_", ",_", "TEXT_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "iss", "ched", "ule", "d", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "inactive_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "schedule", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "environ", "ment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "environ", "ment", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "jobs", "\\u", "environ", "ment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "schedule", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "schedule", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "jobs", "\\u", "schedule", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "jobs", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "jobs", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "jobs", "\\u", "user", "\\u", "id", "'_", ",_", "test\\u", "jobs_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "jobs", "\\u", "testsuite", "\\u", "id", "'_", ",_", "test\\u", "jobs_", "._", "c_", "._", "testsuite", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "jobs", "\\u", "name", "'_", ",_", "test\\u", "jobs_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "jobs", "\\u", "schedule", "\\u", "id", "'_", ",_", "test\\u", "jobs_", "._", "c_", "._", "schedule", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "jobs", "\\u", "environ", "ment", "\\u", "id", "'_", ",_", "test\\u", "jobs_", "._", "c_", "._", "environ", "ment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "jobs", "\\u", "name", "\\u", "key", "'_", ",_", "test\\u", "jobs_", "._", "c_", "._", "name_", ",_", "test\\u", "jobs_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "schedule_", "=_", "Table_", "(_", "'", "schedule", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "minute", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "hour", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "day", "\\u", "of", "\\u", "month", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "month", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "day", "\\u", "of", "\\u", "week", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "schedule", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "schedule", "\\u", "user", "\\u", "id", "'_", ",_", "schedule_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "results", "\\u", "data_", "=_", "Table_", "(_", "'", "test\\u", "results", "\\u", "data", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "data", "'_", ",_", "Js", "on", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "test\\u", "results", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "test\\u", "results", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "results", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "results", "\\u", "data\\u", "test\\u", "results", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "data\\u", "pkey", "'_", ",_", "test\\u", "results", "\\u", "data_", "._", "c_", "._", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "fk", "i", "\\u", "test\\u", "results", "\\u", "data\\u", "test\\u", "results", "\\u", "fkey", "'_", ",_", "test\\u", "results", "\\u", "data_", "._", "c_", "._", "test\\u", "results", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "results_", "=_", "Table_", "(_", "'", "test\\u", "results", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testc", "ase", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testi", "mple", "menta", "tion", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testv", "ersi", "on", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "teste", "r", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "environ", "ment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "build", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "parent", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "object", "type", "'_", ",_", "Test", "Object", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "startt", "ime", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "endtime", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "argu", "ment", "s", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "result", "'_", ",_", "Test", "Result", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "diagnostic", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "results", "location", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "report", "filename", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "valid", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "teste", "r", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "results", "\\u", "teste", "r", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "parent", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "results", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "parent", "\\u", "id", "\\u", "refs", "\\u", "test\\u", "results", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "build", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "project", "\\u", "version", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "results", "\\u", "build", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "environ", "ment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "environ", "ment", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "results", "\\u", "environ", "ment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testc", "ase", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "results", "\\u", "testc", "ase", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "results", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "testc", "ase", "\\u", "id", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "testc", "ase", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "build", "\\u", "id", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "build", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "parent", "\\u", "id", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "parent", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "teste", "r", "\\u", "id", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "teste", "r", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "testi", "mple", "menta", "tion", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "testi", "mple", "menta", "tion_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "environ", "ment", "\\u", "id", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "environ", "ment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "results", "\\u", "testsuite", "\\u", "id", "'_", ",_", "test\\u", "results_", "._", "c_", "._", "testsuite", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "trap", "s_", "=_", "Table_", "(_", "'", "trap", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "timestamp", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "trap", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "trap", "s", "\\u", "pkey", "'_", ",_", "trap", "s_", "._", "c_", "._", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cookies_", "=_", "Table_", "(_", "'", "cookie", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "comment", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "domain", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "max", "\\u", "age", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "path", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "version", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "secure", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "expir", "es", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "discard", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "comment", "\\u", "url", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "port", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "cookie", "s", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "cookie", "s", "\\u", "user", "\\u", "id", "'_", ",_", "cookies_", "._", "c_", "._", "user", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "group", "\\u", "permissions_", "=_", "Table_", "(_", "'", "auth", "\\u", "group", "\\u", "permissi", "ons", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "group", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "permissi", "on", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "group", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "group", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "group", "\\u", "permissi", "ons", "\\u", "group", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "permissi", "on", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "permissi", "on", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "group", "\\u", "permissi", "ons", "\\u", "permissi", "on", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "auth", "\\u", "group", "\\u", "permissi", "ons", "\\u", "group", "\\u", "id", "\\u", "key", "'_", ",_", "auth", "\\u", "group", "\\u", "permissions_", "._", "c_", "._", "group", "\\u", "id_", ",_", "auth", "\\u", "group", "\\u", "permissions_", "._", "c_", "._", "permissi", "on", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "user", "\\u", "groups_", "=_", "Table_", "(_", "'", "auth", "\\u", "user", "\\u", "group", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "group", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "group", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "group", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "user", "\\u", "group", "s", "\\u", "group", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "user", "\\u", "group", "s", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "auth", "\\u", "user", "\\u", "group", "s", "\\u", "user", "\\u", "id", "\\u", "key", "'_", ",_", "auth", "\\u", "user", "\\u", "groups_", "._", "c_", "._", "user", "\\u", "id_", ",_", "auth", "\\u", "user", "\\u", "groups_", "._", "c_", "._", "group", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "group_", "=_", "Table_", "(_", "'", "auth", "\\u", "group", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "auth", "\\u", "group", "\\u", "name", "\\u", "key", "'_", ",_", "auth", "\\u", "group_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "permission_", "=_", "Table_", "(_", "'", "auth", "\\u", "permissi", "on", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "50_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "user", "\\u", "user", "\\u", "permissions_", "=_", "Table_", "(_", "'", "auth", "\\u", "user", "\\u", "user", "\\u", "permissi", "ons", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "permissi", "on", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "permissi", "on", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "permissi", "on", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "user", "\\u", "user", "\\u", "permissi", "ons", "\\u", "permissi", "on", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "user", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "user", "\\u", "user", "\\u", "permissi", "ons", "\\u", "user", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "auth", "\\u", "user", "\\u", "user", "\\u", "permissi", "ons", "\\u", "user", "\\u", "id", "\\u", "key", "'_", ",_", "auth", "\\u", "user", "\\u", "user", "\\u", "permissions_", "._", "c_", "._", "user", "\\u", "id_", ",_", "auth", "\\u", "user", "\\u", "user", "\\u", "permissions_", "._", "c_", "._", "permissi", "on", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "user_", "=_", "Table_", "(_", "'", "auth", "\\u", "user", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "user", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "30_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "first", "\\u", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "30_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "middle", "\\u", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "30_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "last", "\\u", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "30_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "email", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "75_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "is", "\\u", "sta", "ff", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "is", "\\u", "active", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "is", "\\u", "super", "user", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "inactive_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "last", "\\u", "login", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "time", "\\u", "now_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "date", "\\u", "joine", "d", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "password", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "40_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "auth", "service", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "20_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "address", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "address", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "addresse", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "auth", "\\u", "user", "\\u", "address", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "auth", "\\u", "user", "\\u", "user", "name", "\\u", "key", "'_", ",_", "auth", "\\u", "user_", "._", "c_", "._", "username_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "component", "s", "\\u", "suites_", "=_", "Table_", "(_", "'", "component", "s", "\\u", "suites", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "component", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "component", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "component", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "component", "s", "\\u", "suites", "\\u", "component", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "component", "s", "\\u", "suites", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "component", "s", "\\u", "suites", "\\u", "component", "\\u", "id", "\\u", "key", "'_", ",_", "component", "s", "\\u", "suites_", "._", "c_", "._", "component", "\\u", "id_", ",_", "component", "s", "\\u", "suites_", "._", "c_", "._", "testsuite", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "projects_", "=_", "Table_", "(_", "'", "project", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "category", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "leader", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "created", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "category", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "project", "\\u", "category", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "project", "s", "\\u", "category", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "leader", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "contact", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "project", "s", "\\u", "leader", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "project", "s", "\\u", "name", "\\u", "key", "'_", ",_", "projects_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "project", "s", "\\u", "leader", "\\u", "id", "'_", ",_", "projects_", "._", "c_", "._", "leader", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "project", "s", "\\u", "category", "\\u", "id", "'_", ",_", "projects_", "._", "c_", "._", "category", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "project", "s", "\\u", "components_", "=_", "Table_", "(_", "'", "project", "s", "\\u", "component", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "project", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "component", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "component", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "component", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "project", "s", "\\u", "component", "s", "\\u", "component", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "project", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "project", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "project", "s", "\\u", "component", "s", "\\u", "project", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "project", "s", "\\u", "component", "s", "\\u", "project", "\\u", "id", "\\u", "key", "'_", ",_", "project", "s", "\\u", "components_", "._", "c_", "._", "project", "\\u", "id_", ",_", "project", "s", "\\u", "components_", "._", "c_", "._", "component", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "components_", "=_", "Table_", "(_", "'", "component", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "created", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "component", "s", "\\u", "name", "\\u", "key", "'_", ",_", "components_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "case", "s", "\\u", "areas_", "=_", "Table_", "(_", "'", "test\\u", "case", "s", "\\u", "area", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testc", "ase", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "functional", "area", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "functional", "area", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "functional", "\\u", "area", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "area", "s", "\\u", "functional", "area", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testc", "ase", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "area", "s", "\\u", "testc", "ase", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "area", "s", "\\u", "testc", "ase", "\\u", "id", "\\u", "key", "'_", ",_", "test\\u", "case", "s", "\\u", "areas_", "._", "c_", "._", "testc", "ase", "\\u", "id_", ",_", "test\\u", "case", "s", "\\u", "areas_", "._", "c_", "._", "functional", "area", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "cases_", "=_", "Table_", "(_", "'", "test\\u", "case", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "lastc", "hange", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "time", "\\u", "now_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "lastc", "hange", "author", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "author", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "reviewer", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "teste", "r", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "purpose", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "pass", "crite", "ria", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "start", "condition", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "end", "condition", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "procedure", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "comment", "s", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "priorit", "y", "'_", ",_", "Prior", "it", "y", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Prior", "it", "y", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "cycle", "'_", ",_", "Test", "Case", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Test", "Case", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "status", "'_", ",_", "Test", "Case", "Status_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Test", "Case", "Status_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "automat", "ed", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "inactive_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "interactive", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "inactive_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "valid", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testi", "mple", "menta", "tion", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "bug", "id", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "reference", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "time", "\\u", "estimate", "'_", ",_", "INTERVAL_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "#", " ", "for", " ", "manu", "al", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "author", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "author", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "reviewer", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "reviewer", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "teste", "r", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "teste", "r", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "lastc", "hange", "author", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "lastc", "hange", "author", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "reference", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "require", "ment", "\\u", "ref", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "require", "ment", "\\u", "ref", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "lastc", "hange", "author", "\\u", "id", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "lastc", "hange", "author", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "reviewer", "\\u", "id", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "reviewer", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "testi", "mple", "menta", "tion", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "testi", "mple", "menta", "tion_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "author", "\\u", "id", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "author", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "name", "\\u", "key", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "teste", "r", "\\u", "id", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "teste", "r", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "require", "ment", "\\u", "ref", "\\u", "id", "'_", ",_", "test\\u", "cases_", "._", "c_", "._", "reference", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "case", "s", "\\u", "prerequisite", "s_", "=_", "Table_", "(_", "'", "test\\u", "case", "s", "\\u", "prerequisite", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testc", "ase", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "prerequisite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testc", "ase", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "testc", "ase", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "prerequisite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "test\\u", "case", "s", "\\u", "relation", "\\u", "prerequisite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "case", "s", "\\u", "test\\u", "case", "s", "\\u", "id", "\\u", "key", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "case", "s", "\\u", "prerequisite", "s_", "._", "c_", "._", "testc", "ase", "\\u", "id_", ",_", "test\\u", "case", "s", "\\u", "prerequisite", "s_", "._", "c_", "._", "prerequisite", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "suites_", "=_", "Table_", "(_", "'", "test\\u", "suites", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "valid", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "lastc", "hange", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "time", "\\u", "now_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "lastc", "hange", "author", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "suit", "ei", "mple", "menta", "tion", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "project", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "purpose", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "lastc", "hange", "author", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "suites", "\\u", "lastc", "hange", "author", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "project", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "project", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "suites", "\\u", "project", "s", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "suites", "\\u", "lastc", "hange", "author", "\\u", "id", "'_", ",_", "test\\u", "suites_", "._", "c_", "._", "lastc", "hange", "author", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "suites", "\\u", "name", "\\u", "key", "'_", ",_", "test\\u", "suites_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "suites", "\\u", "project", "\\u", "id", "'_", ",_", "test\\u", "suites_", "._", "c_", "._", "project", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "suites", "\\u", "suit", "ei", "mple", "menta", "tion", "'_", ",_", "test\\u", "suites_", "._", "c_", "._", "suit", "ei", "mple", "menta", "tion_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "suites", "\\u", "testcases", "_", "=_", "Table_", "(_", "'", "test\\u", "suites", "\\u", "testcases", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testc", "ase", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testc", "ase", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "suites", "\\u", "testcases", "\\u", "testc", "ase", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "suites", "\\u", "testcases", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "suites", "\\u", "testcases", "\\u", "testsuite", "\\u", "id", "\\u", "key", "'_", ",_", "test\\u", "suites", "\\u", "testcases", "_", "._", "c_", "._", "testsuite", "\\u", "id_", ",_", "test\\u", "suites", "\\u", "testcases", "_", "._", "c_", "._", "testc", "ase", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "cases_", "=_", "Table_", "(_", "'", "use", "\\u", "case", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "#", " ", "full", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "purpose", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "s", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "use", "\\u", "case", "\\u", "name", "'_", ",_", "use", "\\u", "cases_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "risk", " ", "mana", "gm", "net", " ", "schema_", "\\u\\u\\uNL\\u\\u\\u_", "risk", "\\u", "factors_", "=_", "Table_", "(_", "'", "risk", "\\u", "factor", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "priorit", "y", "'_", ",_", "Prior", "it", "y", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Prior", "it", "y", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "likelihood", "'_", ",_", "Likelihood", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Likelihood", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "sever", "it", "y", "'_", ",_", "Severity", "Type_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "Severity", "Type_", "._", "get", "\\u", "default_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "testc", "ase", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "require", "ment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "risk", "\\u", "category", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "testc", "ase", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "case", "s", ".", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "risk", "\\u", "factor", "s", "\\u", "testc", "ase", "\\u", "id", "\\u", "fkey", "'_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "require", "ment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "require", "ment", "\\u", "ref", ".", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "risk", "\\u", "factor", "s", "\\u", "require", "ment", "\\u", "id", "\\u", "fkey", "'_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "risk", "\\u", "category", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "risk", "\\u", "category", ".", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "risk", "\\u", "factor", "s", "\\u", "risk", "\\u", "category", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "risk", "\\u", "factor", "s", "\\u", "testc", "ase", "\\u", "id", "'_", ",_", "risk", "\\u", "factors_", "._", "c_", "._", "testc", "ase", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "risk", "\\u", "factor", "s", "\\u", "require", "ment", "\\u", "ref", "\\u", "id", "'_", ",_", "risk", "\\u", "factors_", "._", "c_", "._", "require", "ment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "risk", "\\u", "factor", "s", "\\u", "risk", "\\u", "category", "\\u", "id", "'_", ",_", "risk", "\\u", "factors_", "._", "c_", "._", "risk", "\\u", "category", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "risk", "\\u", "category_", "=_", "Table_", "(_", "'", "risk", "\\u", "category", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "risk", "\\u", "category", "\\u", "name", "\\u", "key", "'_", ",_", "risk", "\\u", "category_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "require", "ment", "\\u", "ref_", "=_", "Table_", "(_", "'", "require", "ment", "\\u", "ref", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "uri", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "countr", "y", "\\u", "codes_", "=_", "Table_", "(_", "'", "countr", "y", "\\u", "codes", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "iso", "code", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "4_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "countr", "y", "\\u", "codes", "\\u", "iso", "code", "\\u", "key", "'_", ",_", "countr", "y", "\\u", "codes_", "._", "c_", "._", "iso", "code_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "suites", "\\u", "suites_", "=_", "Table_", "(_", "'", "test\\u", "suites", "\\u", "suites", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "from", "\\u", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "to", "\\u", "testsuite", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "from", "\\u", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "suites", "\\u", "suites", "\\u", "from", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "to", "\\u", "testsuite", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "test\\u", "suites", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "test\\u", "suites", "\\u", "suites", "\\u", "to", "\\u", "testsuite", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "test\\u", "suites", "\\u", "suites", "\\u", "from", "\\u", "testsuite", "\\u", "id", "\\u", "key", "'_", ",_", "test\\u", "suites", "\\u", "suites_", "._", "c_", "._", "from", "\\u", "testsuite", "\\u", "id_", ",_", "test\\u", "suites", "\\u", "suites_", "._", "c_", "._", "to", "\\u", "testsuite", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "countr", "y", "\\u", "sets_", "=_", "Table_", "(_", "'", "countr", "y", "\\u", "sets", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "countr", "y", "\\u", "sets", "\\u", "name", "\\u", "key", "'_", ",_", "countr", "y", "\\u", "sets_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "countr", "y", "\\u", "sets", "\\u", "countries_", "=_", "Table_", "(_", "'", "countr", "y", "\\u", "sets", "\\u", "countr", "ies", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "countr", "yse", "t", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "countr", "y", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "countr", "y", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "countr", "y", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "countr", "y", "\\u", "sets", "\\u", "countr", "ies", "\\u", "countr", "y", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "countr", "yse", "t", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "countr", "y", "\\u", "sets", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "countr", "y", "\\u", "sets", "\\u", "countr", "ies", "\\u", "countr", "yse", "t", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "countr", "y", "\\u", "sets", "\\u", "countr", "ies", "\\u", "countr", "yse", "t", "\\u", "id", "\\u", "key", "'_", ",_", "countr", "y", "\\u", "sets", "\\u", "countries_", "._", "c_", "._", "countr", "yse", "t", "\\u", "id_", ",_", "countr", "y", "\\u", "sets", "\\u", "countries_", "._", "c_", "._", "countr", "y", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "language", "\\u", "sets_", "=_", "Table_", "(_", "'", "language", "\\u", "sets", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "language", "\\u", "sets", "\\u", "name", "\\u", "key", "'_", ",_", "language", "\\u", "sets_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "language", "\\u", "sets", "\\u", "languages_", "=_", "Table_", "(_", "'", "language", "\\u", "sets", "\\u", "language", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "language", "set\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "language", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "language", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "language", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "language", "\\u", "sets", "\\u", "language", "s", "\\u", "language", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "language", "set\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "language", "\\u", "sets", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "language", "\\u", "sets", "\\u", "language", "s", "\\u", "language", "set\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "language", "\\u", "sets", "\\u", "language", "s", "\\u", "language", "set\\u", "id", "\\u", "key", "'_", ",_", "language", "\\u", "sets", "\\u", "languages_", "._", "c_", "._", "language", "set\\u", "id_", ",_", "language", "\\u", "sets", "\\u", "languages_", "._", "c_", "._", "language", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "corporat", "ion", "s", "\\u", "services_", "=_", "Table_", "(_", "'", "corporat", "ion", "s", "\\u", "service", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "corporat", "ion", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "functional", "area", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "corporat", "ion", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "corporat", "ion", "s", "\\u", "service", "s", "\\u", "corporat", "ion", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "functional", "area", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "functional", "\\u", "area", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "corporat", "ion", "s", "\\u", "service", "s", "\\u", "functional", "area", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "service", "s", "\\u", "corporat", "ion", "\\u", "id", "\\u", "key", "'_", ",_", "corporat", "ion", "s", "\\u", "services_", "._", "c_", "._", "corporat", "ion", "\\u", "id_", ",_", "corporat", "ion", "s", "\\u", "services_", "._", "c_", "._", "functional", "area", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "functional", "\\u", "area_", "=_", "Table_", "(_", "'", "functional", "\\u", "area", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "functional", "\\u", "area", "\\u", "name", "\\u", "key", "'_", ",_", "functional", "\\u", "area_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "software", "\\u", "variants_", "=_", "Table_", "(_", "'", "software", "\\u", "variant", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "software", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "software", "variant", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "software", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "variant", "s", "\\u", "software", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "software", "variant", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", "\\u", "variant", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "variant", "s", "\\u", "software", "variant", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "variant", "s", "\\u", "software", "\\u", "id", "\\u", "key", "'_", ",_", "software", "\\u", "variants_", "._", "c_", "._", "software", "\\u", "id_", ",_", "software", "\\u", "variants_", "._", "c_", "._", "software", "variant", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "software", "\\u", "variant_", "=_", "Table_", "(_", "'", "software", "\\u", "variant", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "language", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "countr", "y", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "encoding", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "countr", "y", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "countr", "y", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "variant", "\\u", "countr", "y", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "language", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "language", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "variant", "\\u", "language", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "variant", "\\u", "name", "\\u", "key", "'_", ",_", "software", "\\u", "variant_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "variant", "\\u", "language", "\\u", "id", "'_", ",_", "software", "\\u", "variant_", "._", "c_", "._", "language", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "variant", "\\u", "countr", "y", "\\u", "id", "'_", ",_", "software", "\\u", "variant_", "._", "c_", "._", "countr", "y", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "language", "\\u", "codes_", "=_", "Table_", "(_", "'", "language", "\\u", "codes", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "iso", "code", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "6_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "language", "\\u", "codes", "\\u", "iso", "code", "\\u", "key", "'_", ",_", "language", "\\u", "codes_", "._", "c_", "._", "iso", "code_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "language", "\\u", "codes", "\\u", "name", "\\u", "key", "'_", ",_", "language", "\\u", "codes_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "networks_", "=_", "Table_", "(_", "'", "network", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "64_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "layer", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "server", "\\u", "default_", "=_", "\"", "1", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "vlan", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "ip", "network", "'_", ",_", "Cid", "r_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "lower", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "s", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "lower", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "network", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "lower", "\\u", "id", "\\u", "refs", "\\u", "network", "s", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Check", "Constraint_", "(_", "'", "layer", " ", ">", " ", "0", " ", "AND", " ", " ", "layer", " ", "<", " ", "8", "'_", ",_", "name_", "=_", "'", "osi", "layer", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Check", "Constraint_", "(_", "'", "vlan", "id", " ", ">", " ", "0", " ", "AND", " ", " ", "vlan", "id", " ", "<", " ", "409", "4", "'_", ",_", "name_", "=_", "'", "vlan", "range", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "_", "=_", "Table_", "(_", "'", "equipment", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "model", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "ser", "no", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "location", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "subl", "ocation", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "adde", "dda", "te", "'_", ",_", "TIMESTAMP_", "(_", "timezone_", "=_", "True_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "default_", "=_", "time", "\\u", "now_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "comment", "s", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "language", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "owner", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "vendor", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "account", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "parent", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "active", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "language", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "language", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "language", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "model", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", "\\u", "model", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "vendor", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "vendor", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "owner", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "owner", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "location", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "location", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "location", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "account", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "account", "\\u", "ids", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "account", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "parent", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "parent", "\\u", "id", "\\u", "refs", "\\u", "equipment", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "model", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "language", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "language", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "owner", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "owner", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "vendor", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "vendor", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "location", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "location", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "account", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "account", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "parent", "\\u", "id", "'_", ",_", "equipment", "_", "._", "c_", "._", "parent", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IAN", "Ai", "f", "Type_", "\\u\\u\\uNL\\u\\u\\u_", "interface", "\\u", "type_", "=_", "Table_", "(_", "'", "interface", "\\u", "type", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "40_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "enumerati", "on", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "interfaces_", "=_", "Table_", "(_", "'", "interface", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "64_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "alias", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "64_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "ifi", "nde", "x", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "maca", "ddr", "'_", ",_", "MAC", "ADDR_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "vlan", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "ipadd", "r", "'_", ",_", "Inet", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "mtu", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "speed", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "status", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "interface", "\\u", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "parent", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "network", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "interface", "s", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "parent", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "interface", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "parent", "\\u", "id", "\\u", "refs", "\\u", "interface", "s", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "interface", "\\u", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "interface", "\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "interface", "\\u", "type", "\\u", "id", "\\u", "refs", "\\u", "interface", "s", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "network", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "network", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "network", "\\u", "id", "\\u", "refs", "\\u", "network", "s", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "interface", "s", "\\u", "parent", "\\u", "id", "'_", ",_", "interfaces_", "._", "c_", "._", "parent", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "interface", "s", "\\u", "equipment", "\\u", "id", "'_", ",_", "interfaces_", "._", "c_", "._", "equipment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "interface", "s", "\\u", "interface", "\\u", "type", "\\u", "id", "'_", ",_", "interfaces_", "._", "c_", "._", "interface", "\\u", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "interface", "s", "\\u", "network", "\\u", "id", "'_", ",_", "interfaces_", "._", "c_", "._", "network", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "attributes_", "=_", "Table_", "(_", "'", "equipment", "\\u", "attribute", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "attribute", "s", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "attribute", "\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "type", "\\u", "id", "\"_", ",_", "\"", "equipment", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "'_", ",_", "equipment", "\\u", "attributes_", "._", "c_", "._", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "attribute", "s", "\\u", "equipment", "\\u", "id", "'_", ",_", "equipment", "\\u", "attributes_", "._", "c_", "._", "equipment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "model", "\\u", "attributes_", "=_", "Table_", "(_", "'", "equipment", "\\u", "model", "\\u", "attribute", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "type", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "value", "'_", ",_", "Pickl", "e", "Text_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "model", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "model", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", "\\u", "model", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "attribute", "s", "\\u", "equipment", "model", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "type", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "attribute", "\\u", "type", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "type", "\\u", "id", "\"_", ",_", "\"", "equipment", "model", "\\u", "id", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "attribute", "s", "\\u", "type", "\\u", "id", "'_", ",_", "equipment", "\\u", "model", "\\u", "attributes_", "._", "c_", "._", "type", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "attribute", "s", "\\u", "equipment", "model", "\\u", "id", "'_", ",_", "equipment", "\\u", "model", "\\u", "attributes_", "._", "c_", "._", "equipment", "model", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "subco", "mpo", "nent", "s_", "=_", "Table_", "(_", "'", "equipment", "\\u", "subco", "mpo", "nent", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "from", "\\u", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "to", "\\u", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "from", "\\u", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "subco", "mpo", "nent", "s", "\\u", "from", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "to", "\\u", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "subco", "mpo", "nent", "s", "\\u", "to", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "subco", "mpo", "nent", "s", "\\u", "from", "\\u", "equipment", "\\u", "id", "\\u", "key", "'_", ",_", "equipment", "\\u", "subco", "mpo", "nent", "s_", "._", "c_", "._", "from", "\\u", "equipment", "\\u", "id_", ",_", "equipment", "\\u", "subco", "mpo", "nent", "s_", "._", "c_", "._", "to", "\\u", "equipment", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "software", "_", "=_", "Table_", "(_", "'", "equipment", "\\u", "software", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "software", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "software", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "software", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "software", "\\u", "software", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "software", "\\u", "equipment", "\\u", "id", "\\u", "key", "'_", ",_", "equipment", "\\u", "software", "_", "._", "c_", "._", "equipment", "\\u", "id_", ",_", "equipment", "\\u", "software", "_", "._", "c_", "._", "software", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "category_", "=_", "Table_", "(_", "'", "equipment", "\\u", "category", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "category", "\\u", "name", "\\u", "key", "'_", ",_", "equipment", "\\u", "category_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "model_", "=_", "Table_", "(_", "'", "equipment", "\\u", "model", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "manufactur", "er", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "category", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "spec", "s", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "pic", "ture", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "category", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", "\\u", "category", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "category", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "manufactur", "er", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "manufactur", "er", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "category", "\\u", "id", "'_", ",_", "equipment", "\\u", "model_", "._", "c_", "._", "category", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "manufactur", "er", "\\u", "id", "'_", ",_", "equipment", "\\u", "model_", "._", "c_", "._", "manufactur", "er", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "manufactur", "er", "\\u", "id", "\\u", "key", "'_", ",_", "equipment", "\\u", "model_", "._", "c_", "._", "manufactur", "er", "\\u", "id_", ",_", "equipment", "\\u", "model_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware_", "=_", "Table_", "(_", "'", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "model", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "software", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "model", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", "\\u", "model", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware", "\\u", "equipment", "model", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "software", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware", "\\u", "software", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware", "\\u", "equipment", "model", "\\u", "id", "\\u", "key", "'_", ",_", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware_", "._", "c_", "._", "equipment", "model", "\\u", "id_", ",_", "equipment", "\\u", "model", "\\u", "embedde", "dso", "ft", "ware_", "._", "c_", "._", "software", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "software", "_", "=_", "Table_", "(_", "'", "software", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "manufactur", "er", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "vendor", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "category", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "category", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", "\\u", "category", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "category", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "vendor", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "vendor", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "manufactur", "er", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "software", "\\u", "manufactur", "er", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "manufactur", "er", "\\u", "id", "'_", ",_", "software", "_", "._", "c_", "._", "manufactur", "er", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "name", "\\u", "key", "'_", ",_", "software", "_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "vendor", "\\u", "id", "'_", ",_", "software", "_", "._", "c_", "._", "vendor", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "category", "\\u", "id", "'_", ",_", "software", "_", "._", "c_", "._", "category", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "versions_", "=_", "Table_", "(_", "'", "project", "\\u", "version", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "project", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "major", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "obj_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "mino", "r", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "obj_", "(_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "subm", "inor", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "obj_", "(_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "build", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "valid", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "active_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "project", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "project", "s", ".", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "project", "\\u", "version", "s", "\\u", "project", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Unique", "Constraint_", "(_", "\"", "project", "\\u", "id", "\"_", ",_", "\"", "major", "\"_", ",_", "\"", "mino", "r", "\"_", ",_", "\"", "subm", "inor", "\"_", ",_", "\"", "build", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "project", "\\u", "version", "s", "\\u", "unique", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "project", "\\u", "version", "s", "\\u", "project", "\\u", "id", "'_", ",_", "project", "\\u", "versions_", "._", "c_", "._", "project", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "corporat", "ions_", "=_", "Table_", "(_", "'", "corporat", "ion", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "parent", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "note", "s", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "address", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "contact", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "countr", "y", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "contact", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "contact", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "contact", "\\u", "id", "\\u", "refs", "\\u", "contact", "s", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "parent", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "corporat", "ion", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "parent", "\\u", "id", "\\u", "refs", "\\u", "corporat", "ion", "s", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "countr", "y", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "countr", "y", "\\u", "codes", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "corporat", "ion", "s", "\\u", "countr", "y", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "address", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "addresse", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "corporat", "ion", "s", "\\u", "address", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "parent", "\\u", "id", "'_", ",_", "corporat", "ions_", "._", "c_", "._", "parent", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "name", "'_", ",_", "corporat", "ions_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "countr", "y", "\\u", "id", "'_", ",_", "corporat", "ions_", "._", "c_", "._", "countr", "y", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "contact", "\\u", "id", "'_", ",_", "corporat", "ions_", "._", "c_", "._", "contact", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "address", "\\u", "id", "'_", ",_", "corporat", "ions_", "._", "c_", "._", "address", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "corporat", "ion", "s", "\\u", "name", "\\u", "key", "'_", ",_", "corporat", "ions_", "._", "c_", "._", "name_", ",_", "corporat", "ions_", "._", "c_", "._", "countr", "y", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "environments_", "=_", "Table_", "(_", "'", "environ", "ment", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "255_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "owner", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "owner", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "auth", "\\u", "user", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "environ", "ment", "s", "\\u", "owner", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "SET", " ", "NULL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "environ", "ment", "s", "\\u", "name", "\\u", "key", "'_", ",_", "environments_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "environ", "ment", "s", "\\u", "owner", "\\u", "id", "'_", ",_", "environments_", "._", "c_", "._", "owner", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "teste", "qui", "pme", "nt_", "=_", "Table_", "(_", "'", "teste", "qui", "pme", "nt", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "equipment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "environ", "ment", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "UU", "T", "'_", ",_", "BOOLEAN", "_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "default", "\\u", "inactive_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "environ", "ment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "environ", "ment", "s", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "teste", "qui", "pme", "nt", "\\u", "environ", "ment", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "equipment", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "equipment", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "teste", "qui", "pme", "nt", "\\u", "equipment", "\\u", "id", "\\u", "fkey", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "onu", "pdate_", "=_", "\"", "CAS", "CA", "DE", "\"_", ",_", "ondelete_", "=_", "\"", "CAS", "CA", "DE", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "teste", "qui", "pme", "nt", "\\u", "equipment", "\\u", "id", "'_", ",_", "teste", "qui", "pme", "nt_", "._", "c_", "._", "equipment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "teste", "qui", "pme", "nt", "\\u", "environ", "ment", "\\u", "id", "'_", ",_", "teste", "qui", "pme", "nt_", "._", "c_", "._", "environ", "ment", "\\u", "id_", ",_", "unique_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "teste", "qui", "pme", "nt", "\\u", "roles_", "=_", "Table_", "(_", "'", "teste", "qui", "pme", "nt", "\\u", "role", "s", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "teste", "qui", "pme", "nt", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "software", "category", "\\u", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "software", "category", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "software", "\\u", "category", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "teste", "qui", "pme", "nt", "\\u", "role", "s", "\\u", "software", "category", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key", "Constraint_", "(_", "[_", "'", "teste", "qui", "pme", "nt", "\\u", "id", "'_", "]_", ",_", "[_", "'", "public", ".", "teste", "qui", "pme", "nt", ".", "id", "'_", "]_", ",_", "name_", "=_", "'", "teste", "qui", "pme", "nt", "\\u", "role", "s", "\\u", "teste", "qui", "pme", "nt", "\\u", "id", "\\u", "fkey", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "teste", "qui", "pme", "nt", "\\u", "role", "s", "\\u", "teste", "qui", "pme", "nt", "\\u", "id", "\\u", "key", "'_", ",_", "teste", "qui", "pme", "nt", "\\u", "roles_", "._", "c_", "._", "teste", "qui", "pme", "nt", "\\u", "id_", ",_", "teste", "qui", "pme", "nt", "\\u", "roles_", "._", "c_", "._", "software", "category", "\\u", "id_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "software", "\\u", "category_", "=_", "Table_", "(_", "'", "software", "\\u", "category", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "INTEGER_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "VARCHA", "R_", "(_", "length_", "=_", "80_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "description", "'_", ",_", "TEXT_", "(_", "length_", "=_", "None_", ",_", "convert", "\\u", "unicode_", "=_", "False_", ")_", ",_", "primary", "\\u", "key_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "schema_", "=_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Index_", "(_", "'", "index", "\\u", "software", "\\u", "category", "\\u", "name", "\\u", "key", "'_", ",_", "software", "\\u", "category_", "._", "c_", "._", "name_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "this", " ", "module", " ", "to", " ", "create", " ", "the", " ", "tables", ".", " ", "The", " ", "user", "/", "role", "/", "databa", "se", " ", "should_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "alr", "ead", "y", " ", "be", " ", "created", "._", "\\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 ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "autode", "bug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "create", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tname_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts_", ",_", "long", "opts_", ",_", "args_", "=_", "getopt_", "._", "getopt_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Ple", "ase", " ", "supply", " ", "a", " ", "databa", "se", " ", "URL", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "e", ".", "g", ":", " ", "postgres", "ql", "://", "pyco", "pia", "@", "local", "host", "/", "pyco", "pia", "\"_", ")_", "\\u\\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_", "=_", "create", "\\u", "engine_", "(_", "unicode_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "bind_", "=_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tname_", "in_", "args_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tbl_", "=_", "getattr_", "(_", "sys_", "._", "modules_", "[_", "\\u\\u", "name\\u\\u_", "]_", ",_", "tname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "tbl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tbl_", "._", "drop_", "(_", "check", "first_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tbl_", "._", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\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for config in self.sources['data_source']:\n if 'date_filter_field' in config:\n filters.update({config['date_filter_field']: self.config['date_span']})\n report_data = ICDSData(domain, filters, config['id']).data()\n for column in config['columns']:\n column_agg_func = column['agg_fun']\n column_name = column['column_name']\n column_data = 0\n if column_agg_func == 'sum':\n column_data = sum([x[column_name] for x in report_data])\n elif column_agg_func == 'count':\n column_data = len(report_data)\n\n data.update({\n column_name: data.get(column_name, 0) + column_data\n })\n return data", "metadata": "root.ICDSMixin.custom_data", "header": "['class', 'ICDSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 35 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "IC", "DS", "Mixin_", "(_", "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_", "custom", "\\u", "data_", "(_", "self_", ",_", "filters_", ",_", "domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "config_", "in_", "self_", "._", "sources_", "[_", "'", "data\\u", "source", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "date", "\\u", "filter", "\\u", "field", "'_", "in_", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filters_", "._", "update_", "(_", "{_", "config_", "[_", "'", "date", "\\u", "filter", "\\u", "field", "'_", "]_", ":_", "self_", "._", "config_", "[_", "'", "date", "\\u", "span", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "report", "\\u", "data_", "=_", "IC", "DS", "Data_", "(_", "domain_", ",_", "filters_", ",_", "config_", "[_", "'", "id", "'_", "]_", ")_", "._", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "column_", "in_", "config_", "[_", "'", "column", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "column", "\\u", "agg", "\\u", "func_", "=_", "column_", "[_", "'", "agg", "\\u", "fun", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "\\u", "name_", "=_", "column_", "[_", "'", "column", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "\\u", "data_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "column", "\\u", "agg", "\\u", "func_", "==_", "'", "sum", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "column", "\\u", "data_", "=_", "sum_", "(_", "[_", "x_", "[_", "column", "\\u", "name_", "]_", "for_", "x_", "in_", "report", "\\u", "data_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "column", "\\u", "agg", "\\u", "func_", "==_", "'", "count", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "column", "\\u", "data_", "=_", "len_", "(_", "report", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "column", "\\u", "name_", ":_", "data_", "._", "get_", "(_", "column", "\\u", "name_", ",_", "0_", ")_", "+_", "column", "\\u", "data_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
openstack/fuel-web/nailgun/nailgun/test/integration/test_fixture_uploading.py
[ { "content": " def test_upload_working(self):\n check = self.db.query(Node).all()\n self.assertEqual(len(list(check)), 8)", "metadata": "root.TestFixture.test_upload_working", "header": "['class', 'TestFixture', '(', 'BaseIntegrationTest', ',', 'DeploymentTasksTestMixin', ')', ':', '___EOS___']", "index": 53 } ]
[]
[]
0
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Fixture_", "(_", "Base", "Integrati", "on", "Test_", ",_", "Deployment", "Task", "s", "Test", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "upload", "\\u", "working", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check_", "=_", "self_", "._", "db_", "._", "query_", "(_", "Node_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "list_", "(_", "check_", ")_", ")_", ",_", "8_", ")_", "\\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 ]
Module is imported more than once
openstack/nova/nova/tests/functional/regressions/test_bug_1554631.py
[ { "content": "# Copyright 2016 IBM Corp.\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.\nfrom cinderclient import exceptions as cinder_exceptions\nimport mock\n\nfrom nova import test\nfrom nova.tests import fixtures as nova_fixtures\nfrom nova.tests.functional.api import client\nfrom nova.tests.unit import policy_fixture\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Module_", "is_", "imported_", "more_", "than_", "once_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2016", " ", "IB", "M", " ", "Cor", "p", "._", "\\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_", "from_", "cinde", "rcli", "ent_", "import_", "exceptions_", "as_", "cinde", "r", "\\u", "exceptions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nova_", "import_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "tests_", "import_", "fixtures_", "as_", "nova", "\\u", "fixtures_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "tests_", "._", "functional_", "._", "api_", "import_", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "tests_", "._", "unit_", "import_", "policy", "\\u", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
wickman/pystachio/tests/test_composite_types.py
[ { "content": "def test_bad_inputs():\n class Resources(Struct):\n cpu = Float\n ram = Required(Integer)\n with pytest.raises(AttributeError):\n Resources(herp = \"derp\")\n with pytest.raises(AttributeError):\n Resources({'foo': 'bar'})\n with pytest.raises(ValueError):\n Resources(None)", "metadata": "root.test_bad_inputs", "header": "['module', '___EOS___']", "index": 23 } ]
[]
[]
0
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "inputs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Resources_", "(_", "Struct_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cpu_", "=_", "Float_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ram_", "=_", "Required_", "(_", "Integer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Resources_", "(_", "her", "p_", "=_", "\"", "der", "p", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Resources_", "(_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Resources_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Redundant comparison
kayhayen/Nuitka/tests/basics/ComparisonChains.py
[ { "content": "def generator_function_with_chain():\n x = (1, 2, 3)\n\n yield x[0] < x[1] < x[2]", "metadata": "root.generator_function_with_chain", "header": "['module', '___EOS___']", "index": 74 } ]
[]
[]
0
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "generat", "or", "\\u", "function", "\\u", "with", "\\u", "chain_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "(_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "x_", "[_", "0_", "]_", "<_", "x_", "[_", "1_", "]_", "<_", "x_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
iancmcc/ouimeaux/ouimeaux/device/api/xsd/service.py
[ { "content": "def parseString(inString):\n from StringIO 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 = 'scpd'\n rootClass = scpd\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n return rootObj", "metadata": "root.parseString", "header": "['module', '___EOS___']", "index": 1580 } ]
[]
[]
0
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_", "parse", "String_", "(_", "in", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "String", "IO_", "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_", "=_", "'", "scp", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "scp", "d_", "\\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_", "return_", "root", "Obj_", "\\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 ]
Unreachable code
Rediker-Software/doac/tests/tests/handlers/test_bearer.py
[ { "content": " def test_validate(self):\n from doac.exceptions.base import InvalidToken\n from doac.exceptions.invalid_request import CredentialsNotProvided\n \n request = self.factory.get(\"/\")\n \n result = self.handler.validate(self.token.token, request)\n \n self.assertEqual(result, None)\n \n response = self.handler.validate(\"invalid\", request)\n \n self.assertNotEqual(response, None)\n self.assertEqual(response.status_code, 401)\n self.assertEqual(response[\"WWW-Authenticate\"], request_error_header(InvalidToken))\n \n response = self.handler.validate(\"\", request)\n \n self.assertNotEqual(response, None)\n self.assertEqual(response.status_code, 400)\n self.assertEqual(response[\"WWW-Authenticate\"], request_error_header(CredentialsNotProvided))", "metadata": "root.TestBearerHandler.test_validate", "header": "['class', 'TestBearerHandler', '(', 'TestCase', ')', ':', '___EOS___']", "index": 55 } ]
[]
[]
0
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Test", "Bear", "er", "Handler_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "validate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "do", "ac_", "._", "exceptions_", "._", "base_", "import_", "Inva", "lid", "Token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "do", "ac_", "._", "exceptions_", "._", "invalid", "\\u", "request_", "import_", "Cred", "ential", "s", "Not", "Provided", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "self_", "._", "factory_", "._", "get_", "(_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "handler_", "._", "validate_", "(_", "self_", "._", "token_", "._", "token_", ",_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "handler_", "._", "validate_", "(_", "\"", "invalid", "\"_", ",_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "response_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "\"", "WW", "W", "-", "Auth", "entica", "te", "\"_", "]_", ",_", "request", "\\u", "error", "\\u", "header_", "(_", "Inva", "lid", "Token_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "handler_", "._", "validate_", "(_", "\"\"_", ",_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "response_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "\"", "WW", "W", "-", "Auth", "entica", "te", "\"_", "]_", ",_", "request", "\\u", "error", "\\u", "header_", "(_", "Cred", "ential", "s", "Not", "Provided", "_", ")_", ")_" ]
[ 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 ]
Unused import
jezdez-archive/django-comment-utils/comment_utils/templatetags/moderated_comments.py
[ { "content": "\"\"\"\nTemplate tags designed to work with applications which use comment\nmoderation.\n\n\"\"\"\n\nfrom django import template\nfrom comment_utils.moderation import moderator\n\n\n\n\nregister = template.Library()\nregister.filter(comments_open)\nregister.filter(comments_moderated)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def comments_open(value):\n \"\"\"\n Return ``True`` if new comments are allowed for an object,\n ``False`` otherwise.\n \n \"\"\"\n return moderator.comments_open(value)", "metadata": "root.comments_open", "header": "['module', '___EOS___']", "index": 9 }, { "content": "def comments_moderated(value):\n \"\"\"\n Return ``True`` if new comments for an object are being\n automatically sent into moderation, ``False`` otherwise.\n \n \"\"\"\n return moderator.comments_moderated(value)", "metadata": "root.comments_moderated", "header": "['module', '___EOS___']", "index": 17 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Templa", "te", " ", "tags", " ", "design", "ed", " ", "to", " ", "work", " ", "with", " ", "applica", "tion", "s", " ", "whi", "ch", " ", "use", " ", "comment", "\\", "10", ";", "moder", "ation", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "import_", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "comment", "\\u", "utils_", "._", "moder", "ation_", "import_", "moderator", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "register_", "=_", "template_", "._", "Library_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "register_", "._", "filter_", "(_", "comment", "s", "\\u", "open_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "register_", "._", "filter_", "(_", "comment", "s", "\\u", "moderate", "d_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "comment", "s", "\\u", "open_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "``", "Tru", "e", "``", " ", "if", " ", "new", " ", "comment", "s", " ", "are", " ", "allow", "ed", " ", "for", " ", "an", " ", "object", ",", "\\", "10", ";", " ", " ", " ", " ", "``", "Fal", "se", "``", " ", "other", "wis", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "moderator", "_", "._", "comment", "s", "\\u", "open_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "comment", "s", "\\u", "moderate", "d_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "``", "Tru", "e", "``", " ", "if", " ", "new", " ", "comment", "s", " ", "for", " ", "an", " ", "object", " ", "are", " ", "bei", "ng", "\\", "10", ";", " ", " ", " ", " ", "automati", "call", "y", " ", "sent", " ", "int", "o", " ", "moder", "ation", ",", " ", "``", "Fal", "se", "``", " ", "other", "wis", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "moderator", "_", "._", "comment", "s", "\\u", "moderate", "d_", "(_", "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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Comparison of constants
datastax/python-driver/cassandra/cluster.py
[ { "content": " def _reprepare(self, prepare_message):\n cb = partial(self.session.submit, self._execute_after_prepare)\n request_id = self._query(self._current_host, prepare_message, cb=cb)\n if request_id is None:\n # try to submit the original prepared statement on some other host\n self.send_request()", "metadata": "root.ResponseFuture._reprepare", "header": "['class', 'ResponseFuture', '(', 'object', ')', ':', '___EOS___']", "index": 2949 } ]
[]
[]
0
true
[ "[CLS]_", "Compari", "son_", "of_", "constants_", "[SEP]_", "class_", "Respons", "e", "Future_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "repr", "epa", "re_", "(_", "self_", ",_", "prepar", "e\\u", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cb_", "=_", "partial_", "(_", "self_", "._", "session_", "._", "submit_", ",_", "self_", "._", "\\u", "execute", "\\u", "after", "\\u", "prepare_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "id_", "=_", "self_", "._", "\\u", "query_", "(_", "self_", "._", "\\u", "current", "\\u", "host_", ",_", "prepar", "e\\u", "message_", ",_", "cb_", "=_", "cb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request", "\\u", "id_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "submit", " ", "the", " ", "original", " ", "prepared", " ", "statem", "ent", " ", "on", " ", "some", " ", "other", " ", "host_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "send", "\\u", "request_", "(_", ")_", "\\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 ]
Testing equality to None
tomchristie/django-rest-framework/rest_framework/routers.py
[ { "content": " def register(self, prefix, viewset, base_name=None):\n if base_name is None:\n base_name = self.get_default_base_name(viewset)\n self.registry.append((prefix, viewset, base_name))", "metadata": "root.BaseRouter.register", "header": "['class', 'BaseRouter', '(', 'object', ')', ':', '___EOS___']", "index": 57 } ]
[]
[]
0
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Base", "Router_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "register_", "(_", "self_", ",_", "prefix_", ",_", "views", "et_", ",_", "base", "\\u", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "base", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "name_", "=_", "self_", "._", "get", "\\u", "default", "\\u", "base", "\\u", "name_", "(_", "views", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "registry_", "._", "append_", "(_", "(_", "prefix_", ",_", "views", "et_", ",_", "base", "\\u", "name_", ")_", ")_", "\\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 ]
Unused import
ReactiveX/RxPY/rx/linq/observable/timeout.py
[ { "content": "from datetime import datetime\n\nfrom rx.observable import Observable\nfrom rx.anonymousobservable import AnonymousObservable\nfrom rx.disposables import CompositeDisposable, SingleAssignmentDisposable, \\\n SerialDisposable\nfrom rx.concurrency import timeout_scheduler\nfrom rx.internal import extensionmethod\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@extensionmethod(Observable)\ndef timeout(self, duetime, other=None, scheduler=None):\n \"\"\"Returns the source observable sequence or the other observable\n sequence if duetime elapses.\n\n 1 - res = source.timeout(new Date()); # As a date\n 2 - res = source.timeout(5000); # 5 seconds\n # As a date and timeout observable\n 3 - res = source.timeout(datetime(), rx.Observable.return_value(42))\n # 5 seconds and timeout observable\n 4 - res = source.timeout(5000, rx.Observable.return_value(42))\n # As a date and timeout observable\n 5 - res = source.timeout(datetime(), rx.Observable.return_value(42),\n rx.Scheduler.timeout)\n # 5 seconds and timeout observable\n 6 - res = source.timeout(5000, rx.Observable.return_value(42),\n rx.Scheduler.timeout)\n\n Keyword arguments:\n :param datetime|int duetime: Absolute (specified as a datetime object) or\n relative time (specified as an integer denoting milliseconds) when a\n timeout occurs.\n :param Observable other: Sequence to return in case of a timeout. If not\n specified, a timeout error throwing sequence will be used.\n :param Scheduler scheduler: Scheduler to run the timeout timers on. If not\n specified, the timeout scheduler is used.\n\n :returns: The source sequence switching to the other sequence in case of\n a timeout.\n :rtype: Observable\n \"\"\"\n\n scheduler_method = None\n source = self\n\n other = other or Observable.throw_exception(Exception(\"Timeout\"))\n other = Observable.from_future(other)\n\n scheduler = scheduler or timeout_scheduler\n\n if isinstance(duetime, datetime):\n scheduler_method = scheduler.schedule_absolute\n else:\n scheduler_method = scheduler.schedule_relative\n\n def subscribe(observer):\n switched = [False]\n _id = [0]\n\n original = SingleAssignmentDisposable()\n subscription = SerialDisposable()\n timer = SerialDisposable()\n subscription.disposable = original\n\n def create_timer():\n my_id = _id[0]\n\n def action(scheduler, state=None):\n switched[0] = (_id[0] == my_id)\n timer_wins = switched[0]\n if timer_wins:\n\n subscription.disposable = other.subscribe(observer)\n\n timer.disposable = scheduler_method(duetime, action)\n\n create_timer()\n def on_next(x):\n on_next_wins = not switched[0]\n if on_next_wins:\n _id[0] += 1\n observer.on_next(x)\n create_timer()\n\n def on_error(e):\n on_error_wins = not switched[0]\n if on_error_wins:\n _id[0] += 1\n observer.on_error(e)\n\n def on_completed():\n on_completed_wins = not switched[0]\n if on_completed_wins:\n _id[0] += 1\n observer.on_completed()\n\n original.disposable = source.subscribe(on_next, on_error, on_completed)\n return CompositeDisposable(subscription, timer)\n return AnonymousObservable(subscribe)", "metadata": "root.timeout", "header": "['module', '___EOS___']", "index": 10 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "rx_", "._", "observable_", "import_", "Observable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "anonym", "ous", "observable_", "import_", "Ano", "nym", "ous", "Observable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "dispo", "sab", "les_", "import_", "Composit", "e", "Dispo", "sab", "le_", ",_", "Sing", "le", "Assign", "ment", "Dispo", "sab", "le_", ",_", "Ser", "ial", "Dispo", "sab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "concurrency", "_", "import_", "timeo", "ut", "\\u", "scheduler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rx_", "._", "internal_", "import_", "extensi", "on", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "extensi", "on", "method_", "(_", "Observable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "timeout_", "(_", "self_", ",_", "due", "time_", ",_", "other_", "=_", "None_", ",_", "scheduler_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "the", " ", "source", " ", "observable", " ", "sequence", " ", "or", " ", "the", " ", "other", " ", "observable", "\\", "10", ";", " ", " ", " ", " ", "sequence", " ", "if", " ", "due", "time", " ", "ela", "pse", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "1", " ", "-", " ", "res", " ", "=", " ", "source", ".", "timeo", "ut", "(", "new", " ", "Date", "())", ";", " ", "#", " ", "As", " ", "a", " ", "date", "\\", "10", ";", " ", " ", " ", " ", "2", " ", "-", " ", "res", " ", "=", " ", "source", ".", "timeo", "ut", "(", "5000", ");", " ", "#", " ", "5", " ", "second", "s", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "As", " ", "a", " ", "date", " ", "and", " ", "timeo", "ut", " ", "observable", "\\", "10", ";", " ", " ", " ", " ", "3", " ", "-", " ", "res", " ", "=", " ", "source", ".", "timeo", "ut", "(", "datetime", "()", ",", " ", "rx", ".", "Observa", "ble", ".", "return", "\\u", "value", "(", "4", "2", "))\\", "10", ";", " ", " ", " ", " ", "#", " ", "5", " ", "second", "s", " ", "and", " ", "timeo", "ut", " ", "observable", "\\", "10", ";", " ", " ", " ", " ", "4", " ", "-", " ", "res", " ", "=", " ", "source", ".", "timeo", "ut", "(", "5000", ",", " ", "rx", ".", "Observa", "ble", ".", "return", "\\u", "value", "(", "4", "2", "))\\", "10", ";", " ", " ", " ", " ", "#", " ", "As", " ", "a", " ", "date", " ", "and", " ", "timeo", "ut", " ", "observable", "\\", "10", ";", " ", " ", " ", " ", "5", " ", "-", " ", "res", " ", "=", " ", "source", ".", "timeo", "ut", "(", "datetime", "()", ",", " ", "rx", ".", "Observa", "ble", ".", "return", "\\u", "value", "(", "4", "2", "),", "\\", "10", ";", " ", " ", " ", "rx", ".", "Schedule", "r", ".", "timeo", "ut", ")", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "5", " ", "second", "s", " ", "and", " ", "timeo", "ut", " ", "observable", "\\", "10", ";", " ", " ", " ", " ", "6", " ", "-", " ", "res", " ", "=", " ", "source", ".", "timeo", "ut", "(", "5000", ",", " ", "rx", ".", "Observa", "ble", ".", "return", "\\u", "value", "(", "4", "2", "),", "\\", "10", ";", " ", " ", " ", "rx", ".", "Schedule", "r", ".", "timeo", "ut", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Key", "word", " ", "argu", "ment", "s", ":", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "datetime", "|", "int", " ", "due", "time", ":", " ", "Abs", "olute", " ", "(", "specified", " ", "as", " ", "a", " ", "datetime", " ", "object", ")", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "relative", " ", "time", " ", "(", "specified", " ", "as", " ", "an", " ", "integ", "er", " ", "deno", "ting", " ", "milliseconds", ")", " ", "whe", "n", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "timeo", "ut", " ", "occur", "s", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Observa", "ble", " ", "other", ":", " ", "Sequ", "ence", " ", "to", " ", "return", " ", "in", " ", "case", " ", "of", " ", "a", " ", "timeo", "ut", ".", " ", "If", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "specified", ",", " ", "a", " ", "timeo", "ut", " ", "error", " ", "throw", "ing", " ", "sequence", " ", "will", " ", "be", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Schedule", "r", " ", "schedule", "r", ":", " ", "Schedule", "r", " ", "to", " ", "run", " ", "the", " ", "timeo", "ut", " ", "timer", "s", " ", "on", ".", " ", "If", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "specified", ",", " ", "the", " ", "timeo", "ut", " ", "schedule", "r", " ", "is", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "source", " ", "sequence", " ", "switching", " ", "to", " ", "the", " ", "other", " ", "sequence", " ", "in", " ", "case", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "timeo", "ut", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Observa", "ble", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "schedule", "r", "\\u", "method_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "other_", "=_", "other_", "or_", "Observable_", "._", "throw", "\\u", "exception_", "(_", "Exception_", "(_", "\"", "Time", "out", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other_", "=_", "Observable_", "._", "from", "\\u", "future_", "(_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "scheduler_", "=_", "scheduler_", "or_", "timeo", "ut", "\\u", "scheduler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "due", "time_", ",_", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schedule", "r", "\\u", "method_", "=_", "scheduler_", "._", "schedule", "\\u", "absolute_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schedule", "r", "\\u", "method_", "=_", "scheduler_", "._", "schedule", "\\u", "relative_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "subscribe_", "(_", "observer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "switche", "d_", "=_", "[_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "id_", "=_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "original_", "=_", "Sing", "le", "Assign", "ment", "Dispo", "sab", "le_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscription_", "=_", "Ser", "ial", "Dispo", "sab", "le_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer_", "=_", "Ser", "ial", "Dispo", "sab", "le_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subscription_", "._", "dispo", "sab", "le_", "=_", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create", "\\u", "timer_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "\\u", "id_", "=_", "\\u", "id_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "action_", "(_", "scheduler_", ",_", "state_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "switche", "d_", "[_", "0_", "]_", "=_", "(_", "\\u", "id_", "[_", "0_", "]_", "==_", "my", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timer", "\\u", "wins_", "=_", "switche", "d_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timer", "\\u", "wins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "subscription_", "._", "dispo", "sab", "le_", "=_", "other_", "._", "subscribe_", "(_", "observer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "timer_", "._", "dispo", "sab", "le_", "=_", "schedule", "r", "\\u", "method_", "(_", "due", "time_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "create", "\\u", "timer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "on", "\\u", "next_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "next", "\\u", "wins_", "=_", "not_", "switche", "d_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "on", "\\u", "next", "\\u", "wins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "id_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observer_", "._", "on", "\\u", "next_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "timer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "error_", "(_", "e_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "error", "\\u", "wins_", "=_", "not_", "switche", "d_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "on", "\\u", "error", "\\u", "wins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "id_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observer_", "._", "on", "\\u", "error_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "completed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "complete", "d\\u", "wins_", "=_", "not_", "switche", "d_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "on", "\\u", "complete", "d\\u", "wins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "id_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observer_", "._", "on", "\\u", "completed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "original_", "._", "dispo", "sab", "le_", "=_", "source_", "._", "subscribe_", "(_", "on", "\\u", "next_", ",_", "on", "\\u", "error_", ",_", "on", "\\u", "completed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Composit", "e", "Dispo", "sab", "le_", "(_", "subscription_", ",_", "timer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Ano", "nym", "ous", "Observable_", "(_", "subscribe_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Wrong number of arguments in a call
apache/libcloud/libcloud/compute/drivers/azure.py
[ { "content": " @staticmethod\n def create_deployment_to_xml(name,\n package_url,\n label,\n configuration,\n start_deployment,\n treat_warnings_as_error,\n extended_properties):\n return AzureXmlSerializer.doc_from_data(\n 'CreateDeployment',\n [\n ('Name', name),\n ('PackageUrl', package_url),\n ('Label', label, AzureNodeDriver._encode_base64),\n ('Configuration', configuration),\n ('StartDeployment', start_deployment, _lower),\n ('TreatWarningsAsError', treat_warnings_as_error, _lower)\n ],\n extended_properties\n )", "metadata": "root.AzureXmlSerializer.create_deployment_to_xml", "header": "['class', 'AzureXmlSerializer', '(', 'object', ')', ':', '___EOS___']", "index": 2061 }, { "content": " @staticmethod\n def doc_from_data(document_element_name, data, extended_properties=None):\n doc = AzureXmlSerializer.doc_from_xml(document_element_name)\n AzureXmlSerializer.data_to_xml(data, doc)\n if extended_properties is not None:\n doc.append(\n AzureXmlSerializer.extended_properties_dict_to_xml_fragment(\n extended_properties\n )\n )\n\n result = ensure_string(ET.tostring(doc, encoding='utf-8'))\n return result", "metadata": "root.AzureXmlSerializer.doc_from_data", "header": "['class', 'AzureXmlSerializer', '(', 'object', ')', ':', '___EOS___']", "index": 2844 } ]
[]
[]
0
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "class_", "Az", "ure", "Xm", "l", "Serializer_", "(_", "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_", "create", "\\u", "deploy", "ment", "\\u", "to", "\\u", "xml_", "(_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "configuration_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "deployment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "treat", "\\u", "warn", "ings", "\\u", "as", "\\u", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extend", "ed", "\\u", "properties_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Az", "ure", "Xm", "l", "Serializer_", "._", "doc", "\\u", "from", "\\u", "data_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Creat", "e", "Deployment", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Name", "'_", ",_", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Packa", "ge", "Ur", "l", "'_", ",_", "package", "\\u", "url_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Label", "'_", ",_", "label_", ",_", "Az", "ure", "Node", "Driver_", "._", "\\u", "encode", "\\u", "base64_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Configura", "tion", "'_", ",_", "configuration_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Start", "Deployment", "'_", ",_", "start", "\\u", "deployment_", ",_", "\\u", "lower_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Treat", "Warnings", "As", "Error", "'_", ",_", "treat", "\\u", "warn", "ings", "\\u", "as", "\\u", "error_", ",_", "\\u", "lower_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extend", "ed", "\\u", "properties_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Az", "ure", "Xm", "l", "Serializer_", "(_", "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_", "doc", "\\u", "from", "\\u", "data_", "(_", "document", "\\u", "element", "\\u", "name_", ",_", "data_", ",_", "extend", "ed", "\\u", "properties_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "Az", "ure", "Xm", "l", "Serializer_", "._", "doc", "\\u", "from", "\\u", "xml_", "(_", "document", "\\u", "element", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Az", "ure", "Xm", "l", "Serializer_", "._", "data\\u", "to", "\\u", "xml_", "(_", "data_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "extend", "ed", "\\u", "properties_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Az", "ure", "Xm", "l", "Serializer_", "._", "extend", "ed", "\\u", "proper", "ties", "\\u", "dict", "\\u", "to", "\\u", "xml", "\\u", "fragment_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "extend", "ed", "\\u", "properties_", "\\u\\u\\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_", "result_", "=_", "ensure", "\\u", "string_", "(_", "ET_", "._", "tostring_", "(_", "doc_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4,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2 ]
Unnecessary 'else' clause in loop
MirantisWorkloadMobility/CloudFerry/cloudferry_devlab/cloudferry_devlab/tests/functional_test.py
[ { "content": " def filter_images(self, exclude_images_with_fields=None):\n if exclude_images_with_fields is None:\n exclude_images_with_fields = {}\n\n if exclude_images_with_fields.get('broken') is None:\n exclude_images_with_fields['broken'] = True\n\n if exclude_images_with_fields.get('upload_on_dst') is None:\n exclude_images_with_fields['upload_on_dst'] = True\n\n def _image_exclude_filter(images):\n filtered_images_name = []\n for image in images:\n for key, value in exclude_images_with_fields.iteritems():\n if key in image and image[key] == value:\n break\n else:\n filtered_images_name.append(image['name'])\n return filtered_images_name\n\n all_images = self.migration_utils.get_all_images_from_config()\n filtered_images = _image_exclude_filter(all_images)\n\n image_list = self.src_cloud.glanceclient.images.list(is_public=None)\n return [i for i in image_list if i.name in filtered_images]", "metadata": "root.FunctionalTest.filter_images", "header": "['class', 'FunctionalTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 183 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "necessar", "y_", "'", "else", "'_", "clause_", "in_", "loop_", "[SEP]_", "class_", "Function", "al", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "filter", "\\u", "images_", "(_", "self_", ",_", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "._", "get_", "(_", "'", "broken", "'_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "[_", "'", "broken", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "._", "get_", "(_", "'", "upload", "\\u", "on", "\\u", "dst", "'_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "[_", "'", "upload", "\\u", "on", "\\u", "dst", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "image", "\\u", "exclu", "de", "\\u", "filter_", "(_", "images_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter", "ed", "\\u", "images", "\\u", "name_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "exclu", "de", "\\u", "images", "\\u", "with", "\\u", "fields_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "key_", "in_", "image_", "and_", "image_", "[_", "key_", "]_", "==_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "filter", "ed", "\\u", "images", "\\u", "name_", "._", "append_", "(_", "image_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "filter", "ed", "\\u", "images", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "\\u", "images_", "=_", "self_", "._", "migrati", "on", "\\u", "utils_", "._", "get", "\\u", "all", "\\u", "images", "\\u", "from", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "ed", "\\u", "images_", "=_", "\\u", "image", "\\u", "exclu", "de", "\\u", "filter_", "(_", "all", "\\u", "images_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "list_", "=_", "self_", "._", "src", "\\u", "cloud_", "._", "gla", "nce", "client_", "._", "images_", "._", "list_", "(_", "is", "\\u", "public_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "i_", "for_", "i_", "in_", "image", "\\u", "list_", "if_", "i_", "._", "name_", "in_", "filter", "ed", "\\u", "images_", "]_", "\\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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 { "content": "import binascii\nimport json\nimport os\nfrom Crypto.Cipher import AES\n\nfrom keen import Padding\n\n__author__ = 'dkador'\n\n# the block size for the cipher object; must be 16, 24, or 32 for AES\nOLD_BLOCK_SIZE = 32\n\n\n\n\n\n\n\n\n\n\n# encrypt with AES-256-CBC, encode with hex\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def pad_aes256(s):\n \"\"\"\n Pads an input string to a given block size.\n :param s: string\n :returns: The padded string.\n \"\"\"\n if len(s) % AES.block_size == 0:\n return s\n\n return Padding.appendPadding(s, blocksize=AES.block_size)", "metadata": "root.pad_aes256", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def unpad_aes256(s):\n \"\"\"\n Removes padding from an input string based on a given block size.\n :param s: string\n :returns: The unpadded string.\n \"\"\"\n if not s:\n return s\n\n try:\n return Padding.removePadding(s, blocksize=AES.block_size)\n except AssertionError:\n # if there's an error while removing padding, just return s.\n return s", "metadata": "root.unpad_aes256", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def old_pad(s):\n \"\"\"\n Pads an input string to a given block size.\n :param s: string\n :returns: The padded string.\n \"\"\"\n if len(s) % OLD_BLOCK_SIZE == 0:\n return s\n\n return Padding.appendPadding(s, blocksize=OLD_BLOCK_SIZE)", "metadata": "root.old_pad", "header": "['module', '___EOS___']", "index": 41 }, { "content": "def old_unpad(s):\n \"\"\"\n Removes padding from an input string based on a given block size.\n :param s: string\n :returns: The unpadded string.\n \"\"\"\n if not s:\n return s\n\n try:\n return Padding.removePadding(s, blocksize=OLD_BLOCK_SIZE)\n except AssertionError:\n # if there's an error while removing padding, just return s.\n return s", "metadata": "root.old_unpad", "header": "['module', '___EOS___']", "index": 53 }, { "content": "def encode_aes256(key, plaintext):\n \"\"\"\n Utility method to encode some given plaintext with the given key. Important thing to note:\n\n This is not a general purpose encryption method - it has specific semantics (see below for\n details).\n\n Takes the given hex string key and converts it to a 256 bit binary blob. Then pads the given\n plaintext to AES block size which is always 16 bytes, regardless of AES key size. Then\n encrypts using AES-256-CBC using a random IV. Then converts both the IV and the ciphertext\n to hex. Finally returns the IV appended by the ciphertext.\n\n :param key: string, 64 hex chars long\n :param plaintext: string, any amount of data\n \"\"\"\n if len(key) != 64:\n raise TypeError(\"encode_aes256() expects a 256 bit key encoded as a 64 hex character string\")\n\n # generate AES.block_size cryptographically secure random bytes for our IV (initial value)\n iv = os.urandom(AES.block_size)\n # set up an AES cipher object\n cipher = AES.new(binascii.unhexlify(key.encode('ascii')), mode=AES.MODE_CBC, IV=iv)\n # encrypt the plaintext after padding it\n ciphertext = cipher.encrypt(pad_aes256(plaintext))\n # append the hexed IV and the hexed ciphertext\n iv_plus_encrypted = binascii.hexlify(iv) + binascii.hexlify(ciphertext)\n # return that\n return iv_plus_encrypted", "metadata": "root.encode_aes256", "header": "['module', '___EOS___']", "index": 70 }, { "content": "def decode_aes256(key, iv_plus_encrypted):\n \"\"\"\n Utility method to decode a payload consisting of the hexed IV + the hexed ciphertext using\n the given key. See above for more details.\n\n :param key: string, 64 hex characters long\n :param iv_plus_encrypted: string, a hexed IV + hexed ciphertext\n \"\"\"\n # grab first AES.block_size bytes (aka 2 * AES.block_size characters of hex) - that's the IV\n iv_size = 2 * AES.block_size\n hexed_iv = iv_plus_encrypted[:iv_size]\n # grab everything else - that's the ciphertext (aka encrypted message)\n hexed_ciphertext = iv_plus_encrypted[iv_size:]\n # unhex the iv and ciphertext\n iv = binascii.unhexlify(hexed_iv)\n ciphertext = binascii.unhexlify(hexed_ciphertext)\n # set up the correct AES cipher object\n cipher = AES.new(binascii.unhexlify(key.encode('ascii')), mode=AES.MODE_CBC, IV=iv)\n # decrypt!\n plaintext = cipher.decrypt(ciphertext)\n # return the unpadded version of this\n return unpad_aes256(plaintext)", "metadata": "root.decode_aes256", "header": "['module', '___EOS___']", "index": 100 }, { "content": "def old_encode_aes(key, plaintext):\n \"\"\"\n Utility method to encode some given plaintext with the given key. Important thing to note:\n\n This is not a general purpose encryption method - it has specific semantics (see below for\n details).\n\n Takes the given key, pads it to 32 bytes. Then takes the given plaintext and pads that to a\n 32 byte block size. Then encrypts using AES-256-CBC using a random IV. Then converts both the\n IV and the ciphertext to hex. Finally returns the IV appended by the ciphertext.\n\n :param key: string, <= 32 bytes long\n :param plaintext: string, any amount of data\n \"\"\"\n # generate 16 cryptographically secure random bytes for our IV (initial value)\n iv = os.urandom(16)\n # set up an AES cipher object\n cipher = AES.new(old_pad(key), mode=AES.MODE_CBC, IV=iv)\n # encrypte the plaintext after padding it\n ciphertext = cipher.encrypt(old_pad(plaintext))\n # append the hexed IV and the hexed ciphertext\n iv_plus_encrypted = binascii.hexlify(iv) + binascii.hexlify(ciphertext)\n # return that\n return iv_plus_encrypted", "metadata": "root.old_encode_aes", "header": "['module', '___EOS___']", "index": 124 }, { "content": "def old_decode_aes(key, iv_plus_encrypted):\n \"\"\"\n Utility method to decode a payload consisting of the hexed IV + the hexed ciphertext using\n the given key. See above for more details.\n\n :param key: string, <= 32 bytes long\n :param iv_plus_encrypted: string, a hexed IV + hexed ciphertext\n \"\"\"\n # grab first 16 bytes (aka 32 characters of hex) - that's the IV\n hexed_iv = iv_plus_encrypted[:32]\n # grab everything else - that's the ciphertext (aka encrypted message)\n hexed_ciphertext = iv_plus_encrypted[32:]\n # unhex the iv and ciphertext\n iv = binascii.unhexlify(hexed_iv)\n ciphertext = binascii.unhexlify(hexed_ciphertext)\n # set up the correct AES cipher object\n cipher = AES.new(old_pad(key), mode=AES.MODE_CBC, IV=iv)\n # decrypt!\n plaintext = cipher.decrypt(ciphertext)\n # return the unpadded version of this\n return old_unpad(plaintext)", "metadata": "root.old_decode_aes", "header": "['module', '___EOS___']", "index": 150 }, { "content": "def encrypt(api_key, options):\n options_string = json.dumps(options)\n if len(api_key) == 64:\n return encode_aes256(api_key, options_string)\n else:\n return old_encode_aes(api_key, options_string)", "metadata": "root.encrypt", "header": "['module', '___EOS___']", "index": 173 }, { "content": "def decrypt(api_key, scoped_key):\n if len(api_key) == 64:\n json_string = decode_aes256(api_key, scoped_key)\n else:\n json_string = old_decode_aes(api_key, scoped_key)\n try:\n return json.loads(json_string)\n except TypeError:\n return json.loads(json_string.decode())", "metadata": "root.decrypt", "header": "['module', '___EOS___']", "index": 181 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "binascii_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Crypto_", "._", "Cipher_", "import_", "AES_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ke", "en_", "import_", "Padding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "dk", "ador", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "block", " ", "size", " ", "for", " ", "the", " ", "cipher", " ", "object", ";", " ", "must", " ", "be", " ", "16", ",", " ", "24", ",", " ", "or", " ", "32", " ", "for", " ", "AES_", "\\u\\u\\uNL\\u\\u\\u_", "OLD", "\\u", "BLOCK", "\\u", "SIZE_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encrypt", " ", "with", " ", "AE", "S", "-", "256", "-", "CBC", ",", " ", "encode", " ", "with", " ", "hex_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "pad", "\\u", "aes", "256_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pad", "s", " ", "an", " ", "input", " ", "string", " ", "to", " ", "a", " ", "give", "n", " ", "block", " ", "size", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "s", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "padde", "d", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "s_", ")_", "%_", "AES_", "._", "block", "\\u", "size_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Padding_", "._", "append", "Padding_", "(_", "s_", ",_", "blocksize_", "=_", "AES_", "._", "block", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unpa", "d\\u", "aes", "256_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", "s", " ", "padd", "ing", " ", "from", " ", "an", " ", "input", " ", "string", " ", "based", " ", "on", " ", "a", " ", "give", "n", " ", "block", " ", "size", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "s", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "unpa", "dde", "d", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Padding_", "._", "remove", "Padding_", "(_", "s_", ",_", "blocksize_", "=_", "AES_", "._", "block", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "there", "'", "s", " ", "an", " ", "error", " ", "whi", "le", " ", "remo", "ving", " ", "padd", "ing", ",", " ", "just", " ", "return", " ", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "old", "\\u", "pad_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pad", "s", " ", "an", " ", "input", " ", "string", " ", "to", " ", "a", " ", "give", "n", " ", "block", " ", "size", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "s", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "padde", "d", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "s_", ")_", "%_", "OLD", "\\u", "BLOCK", "\\u", "SIZE_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Padding_", "._", "append", "Padding_", "(_", "s_", ",_", "blocksize_", "=_", "OLD", "\\u", "BLOCK", "\\u", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "old", "\\u", "unpa", "d_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", "s", " ", "padd", "ing", " ", "from", " ", "an", " ", "input", " ", "string", " ", "based", " ", "on", " ", "a", " ", "give", "n", " ", "block", " ", "size", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "s", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "unpa", "dde", "d", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Padding_", "._", "remove", "Padding_", "(_", "s_", ",_", "blocksize_", "=_", "OLD", "\\u", "BLOCK", "\\u", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "there", "'", "s", " ", "an", " ", "error", " ", "whi", "le", " ", "remo", "ving", " ", "padd", "ing", ",", " ", "just", " ", "return", " ", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "\\u", "aes", "256_", "(_", "key_", ",_", "plaintext_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Utili", "ty", " ", "method", " ", "to", " ", "encode", " ", "some", " ", "give", "n", " ", "plain", "text", " ", "with", " ", "the", " ", "give", "n", " ", "key", ".", " ", "Importa", "nt", " ", "thing", " ", "to", " ", "note", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "not", " ", "a", " ", "genera", "l", " ", "purpose", " ", "encrypt", "ion", " ", "method", " ", "-", " ", "it", " ", "has", " ", "specific", " ", "semantics", " ", "(", "see", " ", "belo", "w", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "deta", "il", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Tak", "es", " ", "the", " ", "give", "n", " ", "hex", " ", "string", " ", "key", " ", "and", " ", "convert", "s", " ", "it", " ", "to", " ", "a", " ", "256", " ", "bit", " ", "binar", "y", " ", "blob", ".", " ", "The", "n", " ", "pads", " ", "the", " ", "give", "n", "\\", "10", ";", " ", " ", " ", " ", "plain", "text", " ", "to", " ", "AE", "S", " ", "block", " ", "size", " ", "whi", "ch", " ", "is", " ", "alw", "ay", "s", " ", "16", " ", "bytes", ",", " ", "rega", "rd", "less", " ", "of", " ", "AE", "S", " ", "key", " ", "size", ".", " ", "The", "n", "\\", "10", ";", " ", " ", " ", " ", "encrypt", "s", " ", "usi", "ng", " ", "AE", "S", "-", "256", "-", "CBC", " ", "usi", "ng", " ", "a", " ", "random", " ", "IV", ".", " ", "The", "n", " ", "convert", "s", " ", "bot", "h", " ", "the", " ", "IV", " ", "and", " ", "the", " ", "cipher", "text", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "hex", ".", " ", "Final", "ly", " ", "return", "s", " ", "the", " ", "IV", " ", "append", "ed", " ", "by", " ", "the", " ", "cipher", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "string", ",", " ", "64", " ", "hex", " ", "char", "s", " ", "long", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "plain", "text", ":", " ", "string", ",", " ", "any", " ", "amo", "unt", " ", "of", " ", "data", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "key_", ")_", "!=_", "64_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "encode", "\\u", "aes", "256", "()", " ", "expect", "s", " ", "a", " ", "256", " ", "bit", " ", "key", " ", "encode", "d", " ", "as", " ", "a", " ", "64", " ", "hex", " ", "character", " ", "string", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "AE", "S", ".", "block", "\\u", "size", " ", "crypto", "graphical", "ly", " ", "secure", " ", "random", " ", "bytes", " ", "for", " ", "our", " ", "IV", " ", "(", "initial", " ", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "iv_", "=_", "os_", "._", "urandom_", "(_", "AES_", "._", "block", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "an", " ", "AE", "S", " ", "cipher", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "cipher_", "=_", "AES_", "._", "new_", "(_", "binascii_", "._", "unhexlify_", "(_", "key_", "._", "encode_", "(_", "'", "ascii", "'_", ")_", ")_", ",_", "mode_", "=_", "AES_", "._", "MODE", "\\u", "CBC", "_", ",_", "IV", "_", "=_", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "encrypt", " ", "the", " ", "plain", "text", " ", "after", " ", "padd", "ing", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "ciphertext_", "=_", "cipher_", "._", "encrypt_", "(_", "pad", "\\u", "aes", "256_", "(_", "plaintext_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "append", " ", "the", " ", "hex", "ed", " ", "IV", " ", "and", " ", "the", " ", "hex", "ed", " ", "ciphertext_", "\\u\\u\\uNL\\u\\u\\u_", "iv", "\\u", "plus", "\\u", "encrypted_", "=_", "binascii_", "._", "hexlify_", "(_", "iv_", ")_", "+_", "binascii_", "._", "hexlify_", "(_", "ciphertext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "iv", "\\u", "plus", "\\u", "encrypted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "\\u", "aes", "256_", "(_", "key_", ",_", "iv", "\\u", "plus", "\\u", "encrypted_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Utili", "ty", " ", "method", " ", "to", " ", "decode", " ", "a", " ", "payload", " ", "consi", "stin", "g", " ", "of", " ", "the", " ", "hex", "ed", " ", "IV", " ", "+", " ", "the", " ", "hex", "ed", " ", "cipher", "text", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "give", "n", " ", "key", ".", " ", "See", " ", "above", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "string", ",", " ", "64", " ", "hex", " ", "character", "s", " ", "long", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "iv", "\\u", "plus", "\\u", "encrypt", "ed", ":", " ", "string", ",", " ", "a", " ", "hex", "ed", " ", "IV", " ", "+", " ", "hex", "ed", " ", "cipher", "text", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gra", "b", " ", "first", " ", "AE", "S", ".", "block", "\\u", "size", " ", "bytes", " ", "(", "aka", " ", "2", " ", "*", " ", "AE", "S", ".", "block", "\\u", "size", " ", "character", "s", " ", "of", " ", "hex", ")", " ", "-", " ", "tha", "t", "'", "s", " ", "the", " ", "IV", "_", "\\u\\u\\uNL\\u\\u\\u_", "iv", "\\u", "size_", "=_", "2_", "*_", "AES_", "._", "block", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hex", "ed", "\\u", "iv_", "=_", "iv", "\\u", "plus", "\\u", "encrypted_", "[_", ":_", "iv", "\\u", "size_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gra", "b", " ", "every", "thing", " ", "else", " ", "-", " ", "tha", "t", "'", "s", " ", "the", " ", "cipher", "text", " ", "(", "aka", " ", "encrypt", "ed", " ", "message", ")_", "\\u\\u\\uNL\\u\\u\\u_", "hex", "ed", "\\u", "ciphertext_", "=_", "iv", "\\u", "plus", "\\u", "encrypted_", "[_", "iv", "\\u", "size_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "unh", "ex", " ", "the", " ", "iv", " ", "and", " ", "ciphertext_", "\\u\\u\\uNL\\u\\u\\u_", "iv_", "=_", "binascii_", "._", "unhexlify_", "(_", "hex", "ed", "\\u", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ciphertext_", "=_", "binascii_", "._", "unhexlify_", "(_", "hex", "ed", "\\u", "ciphertext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "the", " ", "correct", " ", "AE", "S", " ", "cipher", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "cipher_", "=_", "AES_", "._", "new_", "(_", "binascii_", "._", "unhexlify_", "(_", "key_", "._", "encode_", "(_", "'", "ascii", "'_", ")_", ")_", ",_", "mode_", "=_", "AES_", "._", "MODE", "\\u", "CBC", "_", ",_", "IV", "_", "=_", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "decrypt", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "plaintext_", "=_", "cipher_", "._", "decrypt_", "(_", "ciphertext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "unpa", "dde", "d", " ", "version", " ", "of", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "unpa", "d\\u", "aes", "256_", "(_", "plaintext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "old", "\\u", "encode", "\\u", "aes", "_", "(_", "key_", ",_", "plaintext_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Utili", "ty", " ", "method", " ", "to", " ", "encode", " ", "some", " ", "give", "n", " ", "plain", "text", " ", "with", " ", "the", " ", "give", "n", " ", "key", ".", " ", "Importa", "nt", " ", "thing", " ", "to", " ", "note", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "not", " ", "a", " ", "genera", "l", " ", "purpose", " ", "encrypt", "ion", " ", "method", " ", "-", " ", "it", " ", "has", " ", "specific", " ", "semantics", " ", "(", "see", " ", "belo", "w", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "deta", "il", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Tak", "es", " ", "the", " ", "give", "n", " ", "key", ",", " ", "pads", " ", "it", " ", "to", " ", "32", " ", "bytes", ".", " ", "The", "n", " ", "take", "s", " ", "the", " ", "give", "n", " ", "plain", "text", " ", "and", " ", "pads", " ", "tha", "t", " ", "to", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "32", " ", "byte", " ", "block", " ", "size", ".", " ", "The", "n", " ", "encrypt", "s", " ", "usi", "ng", " ", "AE", "S", "-", "256", "-", "CBC", " ", "usi", "ng", " ", "a", " ", "random", " ", "IV", ".", " ", "The", "n", " ", "convert", "s", " ", "bot", "h", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "IV", " ", "and", " ", "the", " ", "cipher", "text", " ", "to", " ", "hex", ".", " ", "Final", "ly", " ", "return", "s", " ", "the", " ", "IV", " ", "append", "ed", " ", "by", " ", "the", " ", "cipher", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "string", ",", " ", "<=", " ", "32", " ", "bytes", " ", "long", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "plain", "text", ":", " ", "string", ",", " ", "any", " ", "amo", "unt", " ", "of", " ", "data", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "generat", "e", " ", "16", " ", "crypto", "graphical", "ly", " ", "secure", " ", "random", " ", "bytes", " ", "for", " ", "our", " ", "IV", " ", "(", "initial", " ", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "iv_", "=_", "os_", "._", "urandom_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "an", " ", "AE", "S", " ", "cipher", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "cipher_", "=_", "AES_", "._", "new_", "(_", "old", "\\u", "pad_", "(_", "key_", ")_", ",_", "mode_", "=_", "AES_", "._", "MODE", "\\u", "CBC", "_", ",_", "IV", "_", "=_", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "encrypt", "e", " ", "the", " ", "plain", "text", " ", "after", " ", "padd", "ing", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "ciphertext_", "=_", "cipher_", "._", "encrypt_", "(_", "old", "\\u", "pad_", "(_", "plaintext_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "append", " ", "the", " ", "hex", "ed", " ", "IV", " ", "and", " ", "the", " ", "hex", "ed", " ", "ciphertext_", "\\u\\u\\uNL\\u\\u\\u_", "iv", "\\u", "plus", "\\u", "encrypted_", "=_", "binascii_", "._", "hexlify_", "(_", "iv_", ")_", "+_", "binascii_", "._", "hexlify_", "(_", "ciphertext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "iv", "\\u", "plus", "\\u", "encrypted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "old", "\\u", "decode", "\\u", "aes", "_", "(_", "key_", ",_", "iv", "\\u", "plus", "\\u", "encrypted_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Utili", "ty", " ", "method", " ", "to", " ", "decode", " ", "a", " ", "payload", " ", "consi", "stin", "g", " ", "of", " ", "the", " ", "hex", "ed", " ", "IV", " ", "+", " ", "the", " ", "hex", "ed", " ", "cipher", "text", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "give", "n", " ", "key", ".", " ", "See", " ", "above", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "string", ",", " ", "<=", " ", "32", " ", "bytes", " ", "long", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "iv", "\\u", "plus", "\\u", "encrypt", "ed", ":", " ", "string", ",", " ", "a", " ", "hex", "ed", " ", "IV", " ", "+", " ", "hex", "ed", " ", "cipher", "text", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gra", "b", " ", "first", " ", "16", " ", "bytes", " ", "(", "aka", " ", "32", " ", "character", "s", " ", "of", " ", "hex", ")", " ", "-", " ", "tha", "t", "'", "s", " ", "the", " ", "IV", "_", "\\u\\u\\uNL\\u\\u\\u_", "hex", "ed", "\\u", "iv_", "=_", "iv", "\\u", "plus", "\\u", "encrypted_", "[_", ":_", "32_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gra", "b", " ", "every", "thing", " ", "else", " ", "-", " ", "tha", "t", "'", "s", " ", "the", " ", "cipher", "text", " ", "(", "aka", " ", "encrypt", "ed", " ", "message", ")_", "\\u\\u\\uNL\\u\\u\\u_", "hex", "ed", "\\u", "ciphertext_", "=_", "iv", "\\u", "plus", "\\u", "encrypted_", "[_", "32_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "unh", "ex", " ", "the", " ", "iv", " ", "and", " ", "ciphertext_", "\\u\\u\\uNL\\u\\u\\u_", "iv_", "=_", "binascii_", "._", "unhexlify_", "(_", "hex", "ed", "\\u", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ciphertext_", "=_", "binascii_", "._", "unhexlify_", "(_", "hex", "ed", "\\u", "ciphertext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "the", " ", "correct", " ", "AE", "S", " ", "cipher", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "cipher_", "=_", "AES_", "._", "new_", "(_", "old", "\\u", "pad_", "(_", "key_", ")_", ",_", "mode_", "=_", "AES_", "._", "MODE", "\\u", "CBC", "_", ",_", "IV", "_", "=_", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "decrypt", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "plaintext_", "=_", "cipher_", "._", "decrypt_", "(_", "ciphertext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "unpa", "dde", "d", " ", "version", " ", "of", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "old", "\\u", "unpa", "d_", "(_", "plaintext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encrypt_", "(_", "api", "\\u", "key_", ",_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options", "\\u", "string_", "=_", "json_", "._", "dumps_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "api", "\\u", "key_", ")_", "==_", "64_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "encode", "\\u", "aes", "256_", "(_", "api", "\\u", "key_", ",_", "options", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "old", "\\u", "encode", "\\u", "aes", "_", "(_", "api", "\\u", "key_", ",_", "options", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decrypt_", "(_", "api", "\\u", "key_", ",_", "scoped", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "api", "\\u", "key_", ")_", "==_", "64_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "string_", "=_", "decode", "\\u", "aes", "256_", "(_", "api", "\\u", "key_", ",_", "scoped", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "string_", "=_", "old", "\\u", "decode", "\\u", "aes", "_", "(_", "api", "\\u", "key_", ",_", "scoped", "\\u", "key_", ")_", "\\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_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", "._", "decode_", "(_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
racker/rackspace-monitoring/demo/web/app.py
[ { "content": "import os\nimport sys\n\nroot_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nweb_dir = os.path.join(root_dir, 'demo', 'web')\nsys.path.insert(0, root_dir)\n\nimport cherrypy\nfrom jinja2 import Environment, FileSystemLoader\n\nfrom rackspace_monitoring.types import Provider\nfrom rackspace_monitoring.providers import get_driver\n\nenv = Environment(loader=FileSystemLoader(os.path.join(web_dir, 'templates')))\n\n\ncherrypy.tools.allow = cherrypy.Tool('on_start_resource', http_methods_allowed)\n\n\n\ncherrypy.tree.mount(Root(), script_name='/')\ncherrypy.config.update({'engine.autoreload_on': False})", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def http_methods_allowed(methods=['GET', 'HEAD']):\n method = cherrypy.request.method.upper()\n if method not in methods:\n cherrypy.response.headers['Allow'] = \", \".join(methods)\n raise cherrypy.HTTPError(405)", "metadata": "root.http_methods_allowed", "header": "['module', '___EOS___']", "index": 15 }, { "content": "class Root:\n\n\n", "metadata": "root.Root", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def _driver(self):\n cookie = cherrypy.request.cookie\n username = None\n apikey = None\n\n if cookie.has_key('monitoring_username'):\n username = cookie['monitoring_username'].value\n if cookie.has_key('monitoring_apikey'):\n apikey = cookie['monitoring_apikey'].value\n\n raxMon = get_driver(Provider.RACKSPACE)\n driver = raxMon(username, apikey, ex_force_base_url=\"https://ele-api.k1k.me/v1.0\")\n return driver", "metadata": "root.Root._driver", "header": "['class', 'Root', ':', '___EOS___']", "index": 24 }, { "content": " @cherrypy.expose\n def list_entities(self):\n driver = self._driver()\n entities = driver.list_entities()\n print entities\n tmpl = env.get_template('list_entities.html')\n return tmpl.render(entities=entities)", "metadata": "root.Root.list_entities", "header": "['class', 'Root', ':', '___EOS___']", "index": 38 }, { "content": " @cherrypy.expose\n @cherrypy.tools.allow(methods=['POST'])\n def setapikey(self, username, apikey):\n cherrypy.response.cookie['monitoring_username'] = username\n cherrypy.response.cookie['monitoring_apikey'] = apikey\n raise cherrypy.HTTPRedirect('/list_entities')", "metadata": "root.Root.setapikey", "header": "['class', 'Root', ':', '___EOS___']", "index": 46 }, { "content": " @cherrypy.expose\n def index(self):\n cookie = cherrypy.request.cookie\n if cookie.has_key('monitoring_username') and cookie.has_key('monitoring_apikey'):\n return self.list_entities()\n else:\n tmpl = env.get_template('index.html')\n return tmpl.render()", "metadata": "root.Root.index", "header": "['class', 'Root', ':', '___EOS___']", "index": 53 } ]
[]
[]
0
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_", "\\u\\u\\uNL\\u\\u\\u_", "root", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "web", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "root", "\\u", "dir_", ",_", "'", "demo", "'_", ",_", "'", "web", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "root", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "cherrypy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jinja2_", "import_", "Environment_", ",_", "File", "System", "Loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "racks", "pace\\u", "monitorin", "g_", "._", "types_", "import_", "Provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "racks", "pace\\u", "monitorin", "g_", "._", "providers_", "import_", "get", "\\u", "driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "=_", "Environment_", "(_", "loader_", "=_", "File", "System", "Loader_", "(_", "os_", "._", "path_", "._", "join_", "(_", "web", "\\u", "dir_", ",_", "'", "template", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cherrypy_", "._", "tools_", "._", "allow_", "=_", "cherrypy_", "._", "Tool_", "(_", "'", "on", "\\u", "start", "\\u", "resource", "'_", ",_", "http", "\\u", "method", "s", "\\u", "allowed_", ")_", "\\u\\u\\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_", "cherrypy_", "._", "tree_", "._", "mount_", "(_", "Root_", "(_", ")_", ",_", "script", "\\u", "name_", "=_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cherrypy_", "._", "config_", "._", "update_", "(_", "{_", "'", "eng", "ine", ".", "autore", "load", "\\u", "on", "'_", ":_", "False_", "}_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "http", "\\u", "method", "s", "\\u", "allowed_", "(_", "methods_", "=_", "[_", "'", "GET", "'_", ",_", "'", "HEAD", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "cherrypy_", "._", "request_", "._", "method_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method_", "not_", "in_", "methods_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cherrypy_", "._", "response_", "._", "headers_", "[_", "'", "All", "ow", "'_", "]_", "=_", "\",", " ", "\"_", "._", "join_", "(_", "methods_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "cherrypy_", "._", "HTTP", "Error_", "(_", "405_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Root_", ":_", "\\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_", "Root_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "driver_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cookie_", "=_", "cherrypy_", "._", "request_", "._", "cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "apikey_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cookie_", "._", "has", "\\u", "key_", "(_", "'", "monitorin", "g", "\\u", "user", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "cookie_", "[_", "'", "monitorin", "g", "\\u", "user", "name", "'_", "]_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cookie_", "._", "has", "\\u", "key_", "(_", "'", "monitorin", "g", "\\u", "api", "key", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apikey_", "=_", "cookie_", "[_", "'", "monitorin", "g", "\\u", "api", "key", "'_", "]_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rax", "Mon", "_", "=_", "get", "\\u", "driver_", "(_", "Provider_", "._", "RACK", "SPACE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "driver_", "=_", "rax", "Mon", "_", "(_", "username_", ",_", "apikey_", ",_", "ex", "\\u", "force", "\\u", "base", "\\u", "url_", "=_", "\"", "https", "://", "ele", "-", "api", ".", "k", "1", "k", ".", "me", "/", "v1", ".0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Root_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "cherrypy_", "._", "expose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "\\u", "entities_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "=_", "self_", "._", "\\u", "driver_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entities_", "=_", "driver_", "._", "list", "\\u", "entities_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "entities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpl_", "=_", "env_", "._", "get", "\\u", "template_", "(_", "'", "list", "\\u", "entit", "ies", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tmpl_", "._", "render_", "(_", "entities_", "=_", "entities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Root_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "cherrypy_", "._", "expose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "cherrypy_", "._", "tools_", "._", "allow_", "(_", "methods_", "=_", "[_", "'", "POST", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "seta", "pike", "y_", "(_", "self_", ",_", "username_", ",_", "apikey_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cherrypy_", "._", "response_", "._", "cookie_", "[_", "'", "monitorin", "g", "\\u", "user", "name", "'_", "]_", "=_", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cherrypy_", "._", "response_", "._", "cookie_", "[_", "'", "monitorin", "g", "\\u", "api", "key", "'_", "]_", "=_", "apikey_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "cherrypy_", "._", "HTTP", "Redirect_", "(_", "'/", "list", "\\u", "entit", "ies", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Root_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "cherrypy_", "._", "expose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cookie_", "=_", "cherrypy_", "._", "request_", "._", "cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cookie_", "._", "has", "\\u", "key_", "(_", "'", "monitorin", "g", "\\u", "user", "name", "'_", ")_", "and_", "cookie_", "._", "has", "\\u", "key_", "(_", "'", "monitorin", "g", "\\u", "api", "key", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "list", "\\u", "entities_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmpl_", "=_", "env_", "._", "get", "\\u", "template_", "(_", "'", "index", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmpl_", "._", "render_", "(_", ")_", "\\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, 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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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Implicit string concatenation in a list
OpenMDAO/OpenMDAO-Framework/openmdao.test/src/openmdao/test/execcomp.py
[ { "content": " def execute(self):\n ''' ExecComp execute function '''\n global _expr_dict\n if self.trace:\n for var in self.list_inputs(connected=True):\n print \"%s.%s = %s\" % (self.name,var,getattr(self,var))\n for var in self.list_outputs(connected=True):\n print \"%s.%s = %s\" % (self.name,var,getattr(self,var))\n for expr in self.codes:\n exec(expr, _expr_dict, self.__dict__ )\n \n if self.sleep:\n time.sleep(self.sleep)\n\n if self.trace:\n for var in self.list_inputs(connected=True):\n print \"%s.%s = %s\" % (self.name,var,getattr(self,var))\n for var in self.list_outputs(connected=True):\n print \"%s.%s = %s\" % (self.name,var,getattr(self,var))", "metadata": "root.ExecComp.execute", "header": "['class', 'ExecComp', '(', 'Component', ')', ':', '___EOS___']", "index": 65 } ]
[]
[]
0
true
[ "[CLS]_", "Implicit", "_", "string_", "concate", "nation_", "in_", "a_", "list_", "[SEP]_", "class_", "Exe", "c", "Comp_", "(_", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Exe", "c", "Comp", " ", "execute", " ", "function", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "\\u", "expr", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "trace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "var_", "in_", "self_", "._", "list", "\\u", "inputs_", "(_", "connected_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", ".", "%", "s", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "name_", ",_", "var_", ",_", "getattr_", "(_", "self_", ",_", "var_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "var_", "in_", "self_", "._", "list", "\\u", "outputs_", "(_", "connected_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", ".", "%", "s", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "name_", ",_", "var_", ",_", "getattr_", "(_", "self_", ",_", "var_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "expr_", "in_", "self_", "._", "codes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec_", "(_", "expr_", ",_", "\\u", "expr", "\\u", "dict_", ",_", "self_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "sleep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "self_", "._", "sleep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "trace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "var_", "in_", "self_", "._", "list", "\\u", "inputs_", "(_", "connected_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", ".", "%", "s", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "name_", ",_", "var_", ",_", "getattr_", "(_", "self_", ",_", "var_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "var_", "in_", "self_", "._", "list", "\\u", "outputs_", "(_", "connected_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "s", ".", "%", "s", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "name_", ",_", "var_", ",_", "getattr_", "(_", "self_", ",_", "var_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/books/__init__.py
[ { "content": " def GetThumbnailLink(self):\n \"\"\"Returns the atom.Link object representing the thumbnail URI.\"\"\"\n for i in self.link:\n if i.rel == THUMBNAIL_REL:\n return i", "metadata": "root.Book.GetThumbnailLink", "header": "['class', 'Book', '(', '_AtomFromString', ',', 'gdata', '.', 'GDataEntry', ')', ':', '___EOS___']", "index": 387 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Book_", "(_", "\\u", "Atom", "Fro", "m", "String_", ",_", "gdata_", "._", "GD", "ata", "Entry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Thumb", "nail", "Link_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "the", " ", "atom", ".", "Link", " ", "object", " ", "represent", "ing", " ", "the", " ", "thumbnail", " ", "URI", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "self_", "._", "link_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "._", "rel_", "==_", "THUMB", "NA", "IL", "\\u", "REL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", "\\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 ]
Except block handles 'BaseException'
Parkayun/initpy/initpy/creator.py
[ { "content": "def downloader(args):\n url = args.download\n from urllib2 import urlopen, HTTPError\n try:\n res = urlopen(url)\n except HTTPError:\n from initpy.prompt import color_print\n color_print(\"Wrong downloadable url!\", \"red\")\n return\n from initpy.compact import StringIO\n from zipfile import ZipFile, BadZipfile\n try:\n template_zip = ZipFile(StringIO(res.read()))\n except BadZipfile:\n from initpy.prompt import color_print\n color_print(\"initpy only support zip file!\", \"red\")\n return\n from os import path, getcwd, mkdir\n proj_path = path.join(getcwd(), args.name)\n try:\n mkdir(proj_path)\n except OSError:\n # Folder Exists\n pass\n zip_root = template_zip.namelist()[0]\n for fn in template_zip.namelist()[1:]:\n file_name = fn.replace(zip_root, '')\n file_path = path.join(proj_path, file_name)\n if file_path.endswith('/'):\n try:\n mkdir(file_path)\n except OSError:\n # Folder Exists\n pass\n else:\n _file = open(file_path, 'w')\n _file.write(template_zip.read(fn))\n _file.close()", "metadata": "root.downloader", "header": "['module', '___EOS___']", "index": 178 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "downloader_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "args_", "._", "download_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib2_", "import_", "urlopen_", ",_", "HTTP", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "urlopen_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "HTTP", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "init", "py_", "._", "prompt_", "import_", "color", "\\u", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "color", "\\u", "print_", "(_", "\"", "Wro", "ng", " ", "download", "able", " ", "url", "!\"_", ",_", "\"", "red", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "init", "py_", "._", "compact_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zipfile_", "import_", "Zip", "File_", ",_", "Ba", "d", "Zip", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "zip_", "=_", "Zip", "File_", "(_", "String", "IO_", "(_", "res_", "._", "read_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Ba", "d", "Zip", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "init", "py_", "._", "prompt_", "import_", "color", "\\u", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "color", "\\u", "print_", "(_", "\"", "init", "py", " ", "only", " ", "support", " ", "zip", " ", "file", "!\"_", ",_", "\"", "red", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "os_", "import_", "path_", ",_", "getcwd_", ",_", "mkdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proj", "\\u", "path_", "=_", "path_", "._", "join_", "(_", "getcwd_", "(_", ")_", ",_", "args_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mkdir_", "(_", "proj", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fold", "er", " ", "Exists_", "\\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_", "zip", "\\u", "root_", "=_", "template", "\\u", "zip_", "._", "namelist_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fn_", "in_", "template", "\\u", "zip_", "._", "namelist_", "(_", ")_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "name_", "=_", "fn_", "._", "replace_", "(_", "zip", "\\u", "root_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "path_", "=_", "path_", "._", "join_", "(_", "proj", "\\u", "path_", ",_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "file", "\\u", "path_", "._", "endswith_", "(_", "'/'_", ")_", ":_", "\\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 ", " _", "mkdir_", "(_", "file", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fold", "er", " ", "Exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "file_", "=_", "open_", "(_", "file", "\\u", "path_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "file_", "._", "write_", "(_", "template", "\\u", "zip_", "._", "read_", "(_", "fn_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "file_", "._", "close_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
opps/opps/opps/archives/admin.py
[ { "content": "# coding: utf-8\nfrom django.contrib import admin\nfrom django.contrib.auth import get_user_model\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.admin import apply_opps_rules\nfrom opps.core.permissions.admin import AdminViewPermission\n\nfrom .models import File\n\n\n\nadmin.site.register(File, FileAdmin)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@apply_opps_rules('archives')\nclass FileAdmin(AdminViewPermission):\n search_fields = ['title', 'slug']\n raw_id_fields = ['user']\n list_display = ['title', 'slug', 'download_link', 'published']\n ordering = ('-date_available',)\n list_filter = ['date_available', 'published']\n prepopulated_fields = {\"slug\": [\"title\"]}\n\n fieldsets = (\n (_(u'Identification'), {\n 'fields': ('site', 'title', 'slug',)}),\n (_(u'Content'), {\n 'fields': ('description', 'archive', 'archive_link', 'tags')}),\n (_(u'Publication'), {\n 'classes': ('extrapretty'),\n 'fields': ('published', 'date_available',)}),\n )\n\n download_link.short_description = _(u'download')\n download_link.allow_tags = True\n", "metadata": "root.FileAdmin", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def download_link(self, obj):\n download_url = ''\n if obj.archive:\n download_url = obj.archive.url\n elif obj.archive_link:\n download_url = obj.archive_link\n\n html = '<a href=\"{0}\">{1}</a>'.format(\n download_url,\n unicode(_(u'Download')))\n return html", "metadata": "root.FileAdmin.download_link", "header": "['class', 'FileAdmin', '(', 'AdminViewPermission', ')', ':', '___EOS___']", "index": 31 }, { "content": " def save_model(self, request, obj, form, change):\n if not change:\n obj.user = get_user_model().objects.get(pk=request.user.pk)\n obj.date_insert = timezone.now()\n obj.date_update = timezone.now()\n obj.save()", "metadata": "root.FileAdmin.save_model", "header": "['class', 'FileAdmin', '(', 'AdminViewPermission', ')', ':', '___EOS___']", "index": 45 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "codi", "ng", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "contrib_", "import_", "admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "get", "\\u", "user", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "timezone_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "uge", "ttext", "\\u", "lazy_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "opp", "s_", "._", "core_", "._", "admin_", "import_", "appl", "y", "\\u", "opp", "s", "\\u", "rules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "opp", "s_", "._", "core_", "._", "permissions_", "._", "admin_", "import_", "Admi", "n", "View", "Permission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "models_", "import_", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "admin_", "._", "site_", "._", "register_", "(_", "File_", ",_", "File", "Admin_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "appl", "y", "\\u", "opp", "s", "\\u", "rules_", "(_", "'", "archives", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "File", "Admin_", "(_", "Admi", "n", "View", "Permission_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "fields_", "=_", "[_", "'", "title", "'_", ",_", "'", "slug", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "id", "\\u", "fields_", "=_", "[_", "'", "user", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "display_", "=_", "[_", "'", "title", "'_", ",_", "'", "slug", "'_", ",_", "'", "download", "\\u", "link", "'_", ",_", "'", "publi", "shed", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ordering_", "=_", "(_", "'-", "date", "\\u", "avail", "able", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "filter_", "=_", "[_", "'", "date", "\\u", "avail", "able", "'_", ",_", "'", "publi", "shed", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prepo", "pulat", "ed", "\\u", "fields_", "=_", "{_", "\"", "slug", "\"_", ":_", "[_", "\"", "title", "\"_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fieldsets_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u_", "(_", "u", "'", "Identif", "ication", "'_", ")_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fields", "'_", ":_", "(_", "'", "site", "'_", ",_", "'", "title", "'_", ",_", "'", "slug", "'_", ",_", ")_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u_", "(_", "u", "'", "Conten", "t", "'_", ")_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fields", "'_", ":_", "(_", "'", "description", "'_", ",_", "'", "archive", "'_", ",_", "'", "archive", "\\u", "link", "'_", ",_", "'", "tags", "'_", ")_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u_", "(_", "u", "'", "Public", "ation", "'_", ")_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "classe", "s", "'_", ":_", "(_", "'", "extra", "pretty", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fields", "'_", ":_", "(_", "'", "publi", "shed", "'_", ",_", "'", "date", "\\u", "avail", "able", "'_", ",_", ")_", "}_", ")_", ",_", "\\u\\u\\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_", "download", "\\u", "link_", "._", "short", "\\u", "description_", "=_", "\\u_", "(_", "u", "'", "download", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "\\u", "link_", "._", "allow", "\\u", "tags_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "File", "Admin_", "(_", "Admi", "n", "View", "Permission_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "download", "\\u", "link_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "url_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "obj_", "._", "archive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "url_", "=_", "obj_", "._", "archive_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "obj_", "._", "archive", "\\u", "link_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "url_", "=_", "obj_", "._", "archive", "\\u", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html_", "=_", "'<", "a", " ", "href", "=\"", "{", "0", "}\">", "{", "1", "}", "</", "a", ">'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "\\u_", "(_", "u", "'", "Down", "load", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "html_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "Admin_", "(_", "Admi", "n", "View", "Permission_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "save", "\\u", "model_", "(_", "self_", ",_", "request_", ",_", "obj_", ",_", "form_", ",_", "change_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "change_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "._", "user_", "=_", "get", "\\u", "user", "\\u", "model_", "(_", ")_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "request_", "._", "user_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "date", "\\u", "insert_", "=_", "timezone_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "obj_", "._", "date", "\\u", "update_", "=_", "timezone_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "save_", "(_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
xhtml2pdf/xhtml2pdf/demo/tgpisa/start-tgpisa.py
[ { "content": "#!C:\\Python25\\python.exe\n# -*- coding: utf-8 -*-\n\"\"\"Start script for the tgpisa TurboGears project.\n\nThis script is only needed during development for running from the project\ndirectory. When the project is installed, easy_install will create a\nproper start script.\n\"\"\"\n\nimport sys\n\nfrom tgpisa.commands import start, ConfigurationError\n\nif __name__ == \"__main__\":\n try:\n start()\n except ConfigurationError, exc:\n sys.stderr.write(str(exc))\n sys.exit(1)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "C", ":\\\\", "Pyth", "on2", "5", "\\\\", "python", ".", "exe_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Start", " ", "script", " ", "for", " ", "the", " ", "tg", "pis", "a", " ", "Turb", "o", "Gea", "rs", " ", "project", ".", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "script", " ", "is", " ", "only", " ", "need", "ed", " ", "dur", "ing", " ", "develop", "ment", " ", "for", " ", "runn", "ing", " ", "from", " ", "the", " ", "project", "\\", "10", ";", "director", "y", ".", " ", "Whe", "n", " ", "the", " ", "project", " ", "is", " ", "install", "ed", ",", " ", "easy", "\\u", "install", " ", "will", " ", "create", " ", "a", "\\", "10", ";", "proper", " ", "start", " ", "script", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tg", "pis", "a_", "._", "commands_", "import_", "start_", ",_", "Configura", "tion", "Error_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Configura", "tion", "Error_", ",_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "str_", "(_", "exc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\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 ]
Constant in conditional expression or statement
nlloyd/SubliminalCollaborator/libs/twisted/web/xmlrpc.py
[ { "content": " def connectionMade(self):\n self._response = None\n self.sendCommand('POST', self.factory.path)\n self.sendHeader('User-Agent', 'Twisted/XMLRPClib')\n self.sendHeader('Host', self.factory.host)\n self.sendHeader('Content-type', 'text/xml')\n self.sendHeader('Content-length', str(len(self.factory.payload)))\n if self.factory.user:\n auth = '%s:%s' % (self.factory.user, self.factory.password)\n auth = auth.encode('base64').strip()\n self.sendHeader('Authorization', 'Basic %s' % (auth,))\n self.endHeaders()\n self.transport.write(self.factory.payload)", "metadata": "root.QueryProtocol.connectionMade", "header": "['class', 'QueryProtocol', '(', 'http', '.', 'HTTPClient', ')', ':', '___EOS___']", "index": 333 } ]
[]
[]
0
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "class_", "Query", "Protocol_", "(_", "http_", "._", "HTTP", "Client_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "connecti", "on", "Made", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Command_", "(_", "'", "POST", "'_", ",_", "self_", "._", "factory_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Header_", "(_", "'", "User", "-", "Agent", "'_", ",_", "'", "Twi", "sted", "/", "XMLRPC", "lib", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Header_", "(_", "'", "Host", "'_", ",_", "self_", "._", "factory_", "._", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Header_", "(_", "'", "Conten", "t", "-", "type", "'_", ",_", "'", "text", "/", "xml", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Header_", "(_", "'", "Conten", "t", "-", "length", "'_", ",_", "str_", "(_", "len_", "(_", "self_", "._", "factory_", "._", "payload_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "factory_", "._", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auth_", "=_", "'%", "s", ":", "%", "s", "'_", "%_", "(_", "self_", "._", "factory_", "._", "user_", ",_", "self_", "._", "factory_", "._", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth_", "=_", "auth_", "._", "encode_", "(_", "'", "base64", "'_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "Header_", "(_", "'", "Authoriz", "ation", "'_", ",_", "'", "Basic", " ", "%", "s", "'_", "%_", "(_", "auth_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "end", "Headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transport_", "._", "write_", "(_", "self_", "._", "factory_", "._", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/communication/sfa/rspecs/elements/versions/pgv2DiskImage.py
[ { "content": " @staticmethod\n def get_images(xml, filter={}):\n xpath = './default:disk_image | ./disk_image'\n image_elems = xml.xpath(xpath)\n images = []\n for image_elem in image_elems:\n image = DiskImage(image_elem.attrib, image_elem)\n images.append(image)\n return images", "metadata": "root.PGv2DiskImage.get_images", "header": "['class', 'PGv2DiskImage', ':', '___EOS___']", "index": 14 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "PG", "v2", "Disk", "Image_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "images_", "(_", "xml_", ",_", "filter_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xpath_", "=_", "'./", "default", ":", "disk", "\\u", "image", " ", "|", " ", "./", "disk", "\\u", "image", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "xpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image", "\\u", "elem_", "in_", "image", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image_", "=_", "Disk", "Image_", "(_", "image", "\\u", "elem_", "._", "attrib_", ",_", "image", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "._", "append_", "(_", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "images_" ]
[ 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 ]
Unused import
pyinvoke/invoke/tests/parser/argument.py
[ { "content": "from spec import Spec, eq_, skip, ok_, raises\n\nfrom invoke.parser import Argument\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Argument_(Spec):\n class init:\n \"__init__\"\n def may_take_names_list(self):\n names = ('--foo', '-f')\n a = Argument(names=names)\n # herp a derp\n for name in names:\n assert name in a.names\n\n def may_take_name_arg(self):\n assert '-b' in Argument(name='-b').names\n\n @raises(TypeError)\n def must_get_at_least_one_name(self):\n Argument()\n\n def default_arg_is_name_not_names(self):\n assert 'b' in Argument('b').names\n\n def can_declare_positional(self):\n eq_(Argument(name='foo', positional=True).positional, True)\n\n def positional_is_False_by_default(self):\n eq_(Argument(name='foo').positional, False)\n\n def can_set_attr_name_to_control_name_attr(self):\n a = Argument('foo', attr_name='bar')\n eq_(a.name, 'bar') # not 'foo'\n\n class string:\n \"__str__\"\n\n def shows_useful_info(self):\n eq_(\n str(Argument(names=('name', 'nick1', 'nick2'))),\n \"<Argument: {0} ({1})>\".format('name', 'nick1, nick2')\n )\n\n def does_not_show_nickname_parens_if_no_nicknames(self):\n eq_(\n str(Argument('name')),\n \"<Argument: name>\"\n )\n\n def shows_positionalness(self):\n eq_(\n str(Argument('name', positional=True)),\n \"<Argument: name*>\"\n )\n\n class repr:\n \"__repr__\"\n\n def just_aliases_dunder_str(self):\n a = Argument(names=('name', 'name2'))\n eq_(str(a), repr(a))\n\n class kind_kwarg:\n \"'kind' kwarg\"\n\n def is_optional(self):\n Argument(name='a')\n Argument(name='b', kind=int)\n\n def defaults_to_str(self):\n eq_(Argument('a').kind, str)\n\n def non_bool_implies_value_needed(self):\n assert Argument(name='a', kind=int).takes_value\n\n def bool_implies_no_value_needed(self):\n assert not Argument(name='a', kind=bool).takes_value\n\n def bool_implies_default_False_not_None(self):\n # Right now, parsing a bool flag not given results in None\n # TODO: may want more nuance here -- False when a --no-XXX flag is\n # given, True if --XXX, None if not seen?\n # Only makes sense if we add automatic --no-XXX stuff (think\n # ./configure)\n skip()\n\n @raises(ValueError)\n def may_validate_on_set(self):\n Argument('a', kind=int).value = 'five'\n\n class names:\n def returns_tuple_of_all_names(self):\n eq_(Argument(names=('--foo', '-b')).names, ('--foo', '-b'))\n eq_(Argument(name='--foo').names, ('--foo',))\n\n def is_normalized_to_a_tuple(self):\n ok_(isinstance(Argument(names=('a', 'b')).names, tuple))\n\n class name:\n def returns_first_name(self):\n eq_(Argument(names=('a', 'b')).name, 'a')\n\n class nicknames:\n def returns_rest_of_names(self):\n eq_(Argument(names=('a', 'b')).nicknames, ('b',))\n\n class takes_value:\n def True_by_default(self):\n assert Argument(name='a').takes_value\n\n def False_if_kind_is_bool(self):\n assert not Argument(name='-b', kind=bool).takes_value\n\n class value_set:\n \"value=\"\n def available_as_dot_raw_value(self):\n \"available as .raw_value\"\n a = Argument('a')\n a.value = 'foo'\n eq_(a.raw_value, 'foo')\n\n def untransformed_appears_as_dot_value(self):\n \"untransformed, appears as .value\"\n a = Argument('a', kind=str)\n a.value = 'foo'\n eq_(a.value, 'foo')\n\n def transformed_appears_as_dot_value_with_original_as_raw_value(self):\n \"transformed, modified value is .value, original is .raw_value\"\n a = Argument('a', kind=int)\n a.value = '5'\n eq_(a.value, 5)\n eq_(a.raw_value, '5')\n\n class value:\n def returns_default_if_not_set(self):\n a = Argument('a', default=25)\n eq_(a.value, 25)\n\n class raw_value:\n def is_None_when_no_value_was_actually_seen(self):\n a = Argument('a', kind=int)\n eq_(a.raw_value, None)\n\n class set_value:\n def casts_by_default(self):\n a = Argument('a', kind=int)\n a.set_value('5')\n eq_(a.value, 5)\n\n def allows_setting_value_without_casting(self):\n a = Argument('a', kind=int)\n a.set_value('5', cast=False)\n eq_(a.value, '5')", "metadata": "root.Argument_", "header": "['module', '___EOS___']", "index": 5 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "spec_", "import_", "Spec_", ",_", "eq\\u_", ",_", "skip_", ",_", "ok\\u_", ",_", "raises_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "invoke_", "._", "parser_", "import_", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Arg", "ument", "\\u_", "(_", "Spec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "init_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\\u\\u", "init", "\\u\\u\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "may", "\\u", "take", "\\u", "names", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "(_", "'--", "foo", "'_", ",_", "'-", "f", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Argument_", "(_", "names_", "=_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "her", "p", " ", "a", " ", "der", "p_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "name_", "in_", "a_", "._", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "may", "\\u", "take", "\\u", "name", "\\u", "arg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "'-", "b", "'_", "in_", "Argument_", "(_", "name_", "=_", "'-", "b", "'_", ")_", "._", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Type", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "must", "\\u", "get", "\\u", "at", "\\u", "leas", "t", "\\u", "one", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Argument_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "default", "\\u", "arg", "\\u", "is", "\\u", "name", "\\u", "not", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "'", "b", "'_", "in_", "Argument_", "(_", "'", "b", "'_", ")_", "._", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "can", "\\u", "declar", "e\\u", "positional", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "Argument_", "(_", "name_", "=_", "'", "foo", "'_", ",_", "positional", "_", "=_", "True_", ")_", "._", "positional", "_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "positional", "\\u", "is", "\\u", "Fal", "se", "\\u", "by", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "Argument_", "(_", "name_", "=_", "'", "foo", "'_", ")_", "._", "positional", "_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "can", "\\u", "set\\u", "attr", "\\u", "name", "\\u", "to", "\\u", "control", "\\u", "name", "\\u", "attr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Argument_", "(_", "'", "foo", "'_", ",_", "attr", "\\u", "name_", "=_", "'", "bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "name_", ",_", "'", "bar", "'_", ")_", "#", " ", "not", " ", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\\u\\u", "str", "\\u\\u\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "show", "s", "\\u", "usef", "ul", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "Argument_", "(_", "names_", "=_", "(_", "'", "name", "'_", ",_", "'", "nick", "1", "'_", ",_", "'", "nick", "2", "'_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Arg", "ument", ":", " ", "{", "0", "}", " ", "({", "1", "})", ">\"_", "._", "format_", "(_", "'", "name", "'_", ",_", "'", "nick", "1", ",", " ", "nick", "2", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "doe", "s", "\\u", "not", "\\u", "show", "\\u", "nick", "name", "\\u", "paren", "s", "\\u", "if", "\\u", "no", "\\u", "nick", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "Argument_", "(_", "'", "name", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Arg", "ument", ":", " ", "name", ">\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "s", "\\u", "positional", "ness_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "Argument_", "(_", "'", "name", "'_", ",_", "positional", "_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"<", "Arg", "ument", ":", " ", "name", "*>", "\"_", "\\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_", "class_", "repr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\\u\\u", "repr", "\\u\\u\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "just", "\\u", "alias", "es", "\\u", "dun", "der", "\\u", "str_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Argument_", "(_", "names_", "=_", "(_", "'", "name", "'_", ",_", "'", "name2", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "str_", "(_", "a_", ")_", ",_", "repr_", "(_", "a_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "kind", "\\u", "kwarg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"'", "kind", "'", " ", "kwarg", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "is", "\\u", "optional_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Argument_", "(_", "name_", "=_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Argument_", "(_", "name_", "=_", "'", "b", "'_", ",_", "kind_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "default", "s", "\\u", "to", "\\u", "str_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "Argument_", "(_", "'", "a", "'_", ")_", "._", "kind_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "non", "\\u", "bool\\u", "implies", "\\u", "value", "\\u", "needed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "Argument_", "(_", "name_", "=_", "'", "a", "'_", ",_", "kind_", "=_", "int_", ")_", "._", "take", "s", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bool\\u", "implies", "\\u", "no", "\\u", "value", "\\u", "needed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "Argument_", "(_", "name_", "=_", "'", "a", "'_", ",_", "kind_", "=_", "bool_", ")_", "._", "take", "s", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bool\\u", "implies", "\\u", "default", "\\u", "Fal", "se", "\\u", "not", "\\u", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Rig", "ht", " ", "now", ",", " ", "pars", "ing", " ", "a", " ", "bool", " ", "flag", " ", "not", " ", "give", "n", " ", "results", " ", "in", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "may", " ", "want", " ", "more", " ", "nu", "anc", "e", " ", "here", " ", "--", " ", "Fal", "se", " ", "whe", "n", " ", "a", " ", "--", "no", "-", "XX", "X", " ", "flag", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", "n", ",", " ", "Tru", "e", " ", "if", " ", "--", "XX", "X", ",", " ", "Non", "e", " ", "if", " ", "not", " ", "see", "n", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "make", "s", " ", "sense", " ", "if", " ", "we", " ", "add", " ", "automati", "c", " ", "--", "no", "-", "XX", "X", " ", "stu", "ff", " ", "(", "think", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "./", "configur", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "may", "\\u", "validat", "e\\u", "on", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Argument_", "(_", "'", "a", "'_", ",_", "kind_", "=_", "int_", ")_", "._", "value_", "=_", "'", "five", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "return", "s", "\\u", "tuple", "\\u", "of", "\\u", "all", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "Argument_", "(_", "names_", "=_", "(_", "'--", "foo", "'_", ",_", "'-", "b", "'_", ")_", ")_", "._", "names_", ",_", "(_", "'--", "foo", "'_", ",_", "'-", "b", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "Argument_", "(_", "name_", "=_", "'--", "foo", "'_", ")_", "._", "names_", ",_", "(_", "'--", "foo", "'_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "normali", "zed", "\\u", "to", "\\u", "a", "\\u", "tuple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ok\\u_", "(_", "isinstance_", "(_", "Argument_", "(_", "names_", "=_", "(_", "'", "a", "'_", ",_", "'", "b", "'_", ")_", ")_", "._", "names_", ",_", "tuple_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "return", "s", "\\u", "first", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "Argument_", "(_", "names_", "=_", "(_", "'", "a", "'_", ",_", "'", "b", "'_", ")_", ")_", "._", "name_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "nick", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "return", "s", "\\u", "rest", "\\u", "of", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "Argument_", "(_", "names_", "=_", "(_", "'", "a", "'_", ",_", "'", "b", "'_", ")_", ")_", "._", "nick", "names_", ",_", "(_", "'", "b", "'_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "take", "s", "\\u", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "Tru", "e\\u", "by", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "Argument_", "(_", "name_", "=_", "'", "a", "'_", ")_", "._", "take", "s", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Fal", "se", "\\u", "if", "\\u", "kind", "\\u", "is", "\\u", "bool_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "Argument_", "(_", "name_", "=_", "'-", "b", "'_", ",_", "kind_", "=_", "bool_", ")_", "._", "take", "s", "\\u", "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_", "class_", "value", "\\u", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "value", "=\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "avail", "able", "\\u", "as", "\\u", "dot", "\\u", "raw", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "avail", "able", " ", "as", " ", ".", "raw", "\\u", "value", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "value_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "raw", "\\u", "value_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "untr", "ans", "formed", "\\u", "appear", "s", "\\u", "as", "\\u", "dot", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "untr", "ans", "formed", ",", " ", "appear", "s", " ", "as", " ", ".", "value", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ",_", "kind_", "=_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "value_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "value_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "transforme", "d\\u", "appear", "s", "\\u", "as", "\\u", "dot", "\\u", "value", "\\u", "with", "\\u", "original", "\\u", "as", "\\u", "raw", "\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "transforme", "d", ",", " ", "modifi", "ed", " ", "value", " ", "is", " ", ".", "value", ",", " ", "original", " ", "is", " ", ".", "raw", "\\u", "value", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ",_", "kind_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "value_", "=_", "'", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "value_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "raw", "\\u", "value_", ",_", "'", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "return", "s", "\\u", "default", "\\u", "if", "\\u", "not", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ",_", "default_", "=_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "value_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "raw", "\\u", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "is", "\\u", "Non", "e\\u", "whe", "n", "\\u", "no", "\\u", "value", "\\u", "was", "\\u", "actual", "ly", "\\u", "seen_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ",_", "kind_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "raw", "\\u", "value_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "set\\u", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "cast", "s", "\\u", "by", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ",_", "kind_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "set\\u", "value_", "(_", "'", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "value_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "allow", "s", "\\u", "setti", "ng", "\\u", "value", "\\u", "with", "out", "\\u", "casting", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "Argument_", "(_", "'", "a", "'_", ",_", "kind_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "._", "set\\u", "value_", "(_", "'", "5", "'_", ",_", "cast_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "a_", "._", "value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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
AppScale/appscale/AppServer/lib/django-1.5/django/core/serializers/xml_serializer.py
[ { "content": " def _handle_fk_field_node(self, node, field):\n \"\"\"\n Handle a <field> node for a ForeignKey\n \"\"\"\n # Check if there is a child node named 'None', returning None if so.\n if node.getElementsByTagName('None'):\n return None\n else:\n if hasattr(field.rel.to._default_manager, 'get_by_natural_key'):\n keys = node.getElementsByTagName('natural')\n if keys:\n # If there are 'natural' subelements, it must be a natural key\n field_value = [getInnerText(k).strip() for k in keys]\n obj = field.rel.to._default_manager.db_manager(self.db).get_by_natural_key(*field_value)\n obj_pk = getattr(obj, field.rel.field_name)\n # If this is a natural foreign key to an object that\n # has a FK/O2O as the foreign key, use the FK value\n if field.rel.to._meta.pk.rel:\n obj_pk = obj_pk.pk\n else:\n # Otherwise, treat like a normal PK\n field_value = getInnerText(node).strip()\n obj_pk = field.rel.to._meta.get_field(field.rel.field_name).to_python(field_value)\n return obj_pk\n else:\n field_value = getInnerText(node).strip()\n return field.rel.to._meta.get_field(field.rel.field_name).to_python(field_value)", "metadata": "root.Deserializer._handle_fk_field_node", "header": "['class', 'Deserializer', '(', 'base', '.', 'Deserializer', ')', ':', '___EOS___']", "index": 218 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Deserializ", "er_", "(_", "base_", "._", "Deserializ", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "handle", "\\u", "fk", "\\u", "field", "\\u", "node_", "(_", "self_", ",_", "node_", ",_", "field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "a", " ", "<", "field", ">", " ", "node", " ", "for", " ", "a", " ", "Fore", "ign", "Key", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "there", " ", "is", " ", "a", " ", "child", " ", "node", " ", "named", " ", "'", "Non", "e", "',", " ", "return", "ing", " ", "Non", "e", " ", "if", " ", "so", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "node_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "'", "Non", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "field_", "._", "rel_", "._", "to_", "._", "\\u", "default", "\\u", "manager_", ",_", "'", "get", "\\u", "by", "\\u", "natur", "al", "\\u", "key", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "node_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "'", "natur", "al", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "there", " ", "are", " ", "'", "natur", "al", "'", " ", "subel", "ement", "s", ",", " ", "it", " ", "must", " ", "be", " ", "a", " ", "natur", "al", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "field", "\\u", "value_", "=_", "[_", "get", "In", "ner", "Text_", "(_", "k_", ")_", "._", "strip_", "(_", ")_", "for_", "k_", "in_", "keys_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "=_", "field_", "._", "rel_", "._", "to_", "._", "\\u", "default", "\\u", "manager_", "._", "db", "\\u", "manager_", "(_", "self_", "._", "db_", ")_", "._", "get", "\\u", "by", "\\u", "natur", "al", "\\u", "key_", "(_", "*_", "field", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj", "\\u", "pk_", "=_", "getattr_", "(_", "obj_", ",_", "field_", "._", "rel_", "._", "field", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "is", " ", "a", " ", "natur", "al", " ", "foreign", " ", "key", " ", "to", " ", "an", " ", "object", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "a", " ", "FK", "/", "O", "2", "O", " ", "as", " ", "the", " ", "foreign", " ", "key", ",", " ", "use", " ", "the", " ", "FK", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "field_", "._", "rel_", "._", "to_", "._", "\\u", "meta_", "._", "pk_", "._", "rel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "obj", "\\u", "pk_", "=_", "obj", "\\u", "pk_", "._", "pk_", "\\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_", "#", " ", "Ot", "her", "wis", "e", ",", " ", "treat", " ", "like", " ", "a", " ", "normal", " ", "PK", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "field", "\\u", "value_", "=_", "get", "In", "ner", "Text_", "(_", "node_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj", "\\u", "pk_", "=_", "field_", "._", "rel_", "._", "to_", "._", "\\u", "meta_", "._", "get", "\\u", "field_", "(_", "field_", "._", "rel_", "._", "field", "\\u", "name_", ")_", "._", "to", "\\u", "python_", "(_", "field", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "obj", "\\u", "pk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "\\u", "value_", "=_", "get", "In", "ner", "Text_", "(_", "node_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "field_", "._", "rel_", "._", "to_", "._", "\\u", "meta_", "._", "get", "\\u", "field_", "(_", "field_", "._", "rel_", "._", "field", "\\u", "name_", ")_", "._", "to", "\\u", "python_", "(_", "field", "\\u", "value_", ")_", "\\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, 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, 2, 2 ]
Variable defined multiple times
robclewley/compneuro/Ch10_model.py
[ { "content": "def makeHHneuron(name, par_args, ic_args, const_I=False,\n rand_seed=None, with_IA=False, adapt_AHP=False, gentype='vode'):\n if gentype in ['vode', 'euler']:\n targetlang = 'python'\n else:\n targetlang = 'C'\n if const_I:\n Iapp_str = 'Iapp'\n else:\n Iapp_str = 'Iapp(t)'\n Isignal_vardict = make_noise_signal(0.1, 6000, 0, 0.4, 1, rand_seed)\n vfn_str = '(%s-ionic(v, r, h)+As*sin(2*pi*t*f/1000.)+An*noise_sig)/tau_v' % Iapp_str\n if with_IA:\n rfn_str = '(1.29*v+0.79+3.3*pow(v+0.38,2)-r)/tau_r'\n else:\n rfn_str = '(1.35*v+1.03-r)/tau_r'\n if adapt_AHP:\n hfn_str = '(11*(v+0.754)*(v+0.69)-h)/tau_h'\n else:\n # burst type\n hfn_str = '(9.3*(v+0.7)-h)/tau_h'\n\n auxfndict = {'ionic': (['vv', 'rr', 'hh'],\n '13*(1.37+3.67*vv+2.51*vv*vv)*(vv-Ena)+gr*rr*(vv-Er)+gh*hh*(vv-Eh)')}\n if not const_I:\n auxfndict['Iapp'] = (['t'], 'if(t<thalf, kI*t-0.25, max(kI*(2*thalf-t)-0.25,-0.25))')\n\n DSargs = args()\n DSargs.varspecs = {'v': vfn_str, 'r': rfn_str, 'h': hfn_str,\n 'noise': 'An*noise_sig',\n 'sine': 'As*sin(2*pi*t*f/1000.)'}\n DSargs.inputs = {'noise_sig': Isignal_vardict['noise1']}\n DSargs.auxvars = ['noise', 'sine']\n if not const_I:\n DSargs.varspecs['I'] = 'Iapp(t)'\n DSargs.auxvars.append('I')\n DSargs.pars = par_args\n DSargs.fnspecs = auxfndict\n DSargs.xdomain = {'v': [-2, 2], 'r': [0,1], 'h': [0,1]}\n DSargs.algparams = {'init_step':0.1,\n 'max_pts': 1000000}\n if gentype == 'vode':\n DSargs.algparams['stiff'] = True\n DSargs.checklevel = 0\n DSargs.ics = ic_args\n DSargs.name = name\n\n # Event definitions\n thresh_ev = Events.makeZeroCrossEvent('v', 1,\n {'name': 'thresh_ev',\n 'eventtol': 1e-5,\n 'precise': True,\n 'term': False},\n varnames=['v'],\n targetlang=targetlang)\n\n min_ev = Events.makeZeroCrossEvent('(%s-ionic(v, r, h)+As*sin(2*pi*t*f/1000.)+An*noise_sig)/tau_v' % Iapp_str, 1,\n {'name': 'min_ev',\n 'eventtol': 1e-5,\n 'precise': True,\n 'term': False},\n varnames=['v', 'r', 'h'],\n parnames=par_args.keys(),\n inputnames=['noise_sig'],\n fnspecs=auxfndict,\n targetlang=targetlang)\n\n DSargs.events = [thresh_ev, min_ev]\n if gentype == 'vode':\n return Generator.Vode_ODEsystem(DSargs)\n elif gentype == 'euler':\n return Generator.Euler_ODEsystem(DSargs)\n elif gentype == 'radau':\n return Generator.Radau_ODEsystem(DSargs)\n elif gentype == 'dopri':\n return Generator.Dopri_ODEsystem(DSargs)\n else:\n raise NotImplementedError(\"Unknown ODE system type: %s\"%gentype)", "metadata": "root.makeHHneuron", "header": "['module', '___EOS___']", "index": 9 } ]
[]
[]
0
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "HH", "neuron_", "(_", "name_", ",_", "par", "\\u", "args_", ",_", "ic", "\\u", "args_", ",_", "const", "\\u", "I_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rand", "\\u", "seed_", "=_", "None_", ",_", "with", "\\u", "IA", "_", "=_", "False_", ",_", "adapt", "\\u", "AH", "P_", "=_", "False_", ",_", "gent", "ype_", "=_", "'", "vod", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "gent", "ype_", "in_", "[_", "'", "vod", "e", "'_", ",_", "'", "euler", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "lang_", "=_", "'", "python", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "lang_", "=_", "'", "C", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "const", "\\u", "I_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Ia", "pp", "\\u", "str_", "=_", "'", "Ia", "pp", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Ia", "pp", "\\u", "str_", "=_", "'", "Ia", "pp", "(", "t", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Isi", "gna", "l\\u", "vard", "ict_", "=_", "make", "\\u", "noise", "\\u", "signal_", "(_", "0.1_", ",_", "6000_", ",_", "0_", ",_", "0.4_", ",_", "1_", ",_", "rand", "\\u", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vf", "n", "\\u", "str_", "=_", "'(", "%", "s", "-", "ioni", "c", "(", "v", ",", " ", "r", ",", " ", "h", ")+", "As", "*", "sin", "(", "2", "*", "pi", "*", "t", "*", "f", "/", "1000", ".)", "+", "An", "*", "noise", "\\u", "sig", ")/", "tau", "\\u", "v", "'_", "%_", "Ia", "pp", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "IA", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rf", "n", "\\u", "str_", "=_", "'(", "1.2", "9", "*", "v", "+0", ".7", "9", "+", "3.3", "*", "pow", "(", "v", "+0", ".3", "8", ",", "2", ")-", "r", ")/", "tau", "\\u", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rf", "n", "\\u", "str_", "=_", "'(", "1.3", "5", "*", "v", "+", "1.0", "3", "-", "r", ")/", "tau", "\\u", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "adapt", "\\u", "AH", "P_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hf", "n", "\\u", "str_", "=_", "'(", "11", "*(", "v", "+0", ".75", "4", ")*", "(", "v", "+0", ".6", "9", ")-", "h", ")/", "tau", "\\u", "h", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "burst", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hf", "n", "\\u", "str_", "=_", "'(", "9.3", "*(", "v", "+0", ".7", ")-", "h", ")/", "tau", "\\u", "h", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "aux", "fn", "dict_", "=_", "{_", "'", "ioni", "c", "'_", ":_", "(_", "[_", "'", "vv", "'_", ",_", "'", "rr", "'_", ",_", "'", "hh", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "13", "*(", "1.3", "7", "+", "3.6", "7", "*", "vv", "+", "2.5", "1", "*", "vv", "*", "vv", ")*", "(", "vv", "-", "En", "a", ")+", "gr", "*", "rr", "*(", "vv", "-", "Er", ")+", "gh", "*", "hh", "*(", "vv", "-", "Eh", ")'_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "const", "\\u", "I_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "aux", "fn", "dict_", "[_", "'", "Ia", "pp", "'_", "]_", "=_", "(_", "[_", "'", "t", "'_", "]_", ",_", "'", "if", "(", "t", "<", "tha", "lf", ",", " ", "k", "I", "*", "t", "-0", ".2", "5", ",", " ", "max", "(", "k", "I", "*(", "2", "*", "tha", "lf", "-", "t", ")-", "0.25", ",-", "0.25", "))'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "DS", "args_", "=_", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "vars", "pec", "s_", "=_", "{_", "'", "v", "'_", ":_", "vf", "n", "\\u", "str_", ",_", "'", "r", "'_", ":_", "rf", "n", "\\u", "str_", ",_", "'", "h", "'_", ":_", "hf", "n", "\\u", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "noise", "'_", ":_", "'", "An", "*", "noise", "\\u", "sig", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sine", "'_", ":_", "'", "As", "*", "sin", "(", "2", "*", "pi", "*", "t", "*", "f", "/", "1000", ".)", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "inputs_", "=_", "{_", "'", "noise", "\\u", "sig", "'_", ":_", "Isi", "gna", "l\\u", "vard", "ict_", "[_", "'", "noise", "1", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "aux", "vars_", "=_", "[_", "'", "noise", "'_", ",_", "'", "sine", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "const", "\\u", "I_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DS", "args_", "._", "vars", "pec", "s_", "[_", "'", "I", "'_", "]_", "=_", "'", "Ia", "pp", "(", "t", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "aux", "vars_", "._", "append_", "(_", "'", "I", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "DS", "args_", "._", "pars_", "=_", "par", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "fn", "specs_", "=_", "aux", "fn", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "xd", "omain", "_", "=_", "{_", "'", "v", "'_", ":_", "[_", "-_", "2_", ",_", "2_", "]_", ",_", "'", "r", "'_", ":_", "[_", "0_", ",_", "1_", "]_", ",_", "'", "h", "'_", ":_", "[_", "0_", ",_", "1_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "alg", "params_", "=_", "{_", "'", "init", "\\u", "step", "'_", ":_", "0.1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "pts", "'_", ":_", "1000000_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "gent", "ype_", "==_", "'", "vod", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DS", "args_", "._", "alg", "params_", "[_", "'", "sti", "ff", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "DS", "args_", "._", "check", "level_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "ics_", "=_", "ic", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Event", " ", "definitions_", "\\u\\u\\uNL\\u\\u\\u_", "thresh", "\\u", "ev_", "=_", "Events_", "._", "make", "Zero", "Cross", "Event_", "(_", "'", "v", "'_", ",_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "name", "'_", ":_", "'", "thresh", "\\u", "ev", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "tol", "'_", ":_", "1e-5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "precise", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "term", "'_", ":_", "False_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "varnames", "_", "=_", "[_", "'", "v", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "lang_", "=_", "target", "lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "ev_", "=_", "Events_", "._", "make", "Zero", "Cross", "Event_", "(_", "'(", "%", "s", "-", "ioni", "c", "(", "v", ",", " ", "r", ",", " ", "h", ")+", "As", "*", "sin", "(", "2", "*", "pi", "*", "t", "*", "f", "/", "1000", ".)", "+", "An", "*", "noise", "\\u", "sig", ")/", "tau", "\\u", "v", "'_", "%_", "Ia", "pp", "\\u", "str_", ",_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "name", "'_", ":_", "'", "min", "\\u", "ev", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "tol", "'_", ":_", "1e-5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "precise", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "term", "'_", ":_", "False_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "varnames", "_", "=_", "[_", "'", "v", "'_", ",_", "'", "r", "'_", ",_", "'", "h", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "par", "names_", "=_", "par", "\\u", "args_", "._", "keys_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input", "names_", "=_", "[_", "'", "noise", "\\u", "sig", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fn", "specs_", "=_", "aux", "fn", "dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "lang_", "=_", "target", "lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DS", "args_", "._", "events_", "=_", "[_", "thresh", "\\u", "ev_", ",_", "min", "\\u", "ev_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "gent", "ype_", "==_", "'", "vod", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Generator_", "._", "Vo", "de", "\\u", "ODE", "system_", "(_", "DS", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "gent", "ype_", "==_", "'", "euler", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Generator_", "._", "Euler", "\\u", "ODE", "system_", "(_", "DS", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "gent", "ype_", "==_", "'", "rad", "au", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Generator_", "._", "Rad", "au", "\\u", "ODE", "system_", "(_", "DS", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "gent", "ype_", "==_", "'", "dop", "ri", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Generator_", "._", "Do", "pri", "\\u", "ODE", "system_", "(_", "DS", "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 ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"", "Un", "know", "n", " ", "ODE", " ", "system", " ", "type", ":", " ", "%", "s", "\"_", "%_", "gent", "ype_", ")_" ]
[ 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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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 ]
Unused import
wq/wq.io/parsers/xls.py
[ { "content": "import xlrd\nimport datetime\nimport math\nfrom .base import TableParser\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class WorkbookParser(TableParser):\n workbook = None\n worksheet = None\n sheet_name = 0\n start_row = None\n column_count = None\n no_pickle_parser = ['workbook', 'worksheet']\n binary = True\n\n\n\n\n\n\n\n", "metadata": "root.WorkbookParser", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def parse(self):\n self.parse_workbook()\n if self.sheet_name is None:\n self.data = [{'name': name, 'data': self.get_sheet_by_name(name)}\n for name in self.sheet_names]\n return\n\n sheet_name = self.sheet_name\n if isinstance(self.sheet_name, int):\n sheet_name = self.sheet_names[sheet_name]\n\n self.parse_worksheet(sheet_name)\n\n if self.header_row is None:\n if self.start_row is not None:\n self.header_row = self.start_row - 1\n else:\n self.column_count = 0\n\n def checkval(cell):\n if cell.value is not None and cell.value != '':\n return True\n return False\n\n search_rows = min(len(self.worksheet) - 1, self.max_header_row)\n for row in range(search_rows, -1, -1):\n count = len(list(filter(checkval, self.worksheet[row])))\n if count >= self.column_count:\n self.column_count = count\n self.header_row = row\n\n if self.start_row is None:\n self.start_row = self.header_row + 1\n\n if self.field_names is None:\n rows = self.worksheet[self.header_row:self.start_row]\n self.field_names = [\n str(c.value) or 'c%s' % i for i, c in enumerate(rows[0])\n ]\n for row in rows[1:]:\n for i, c in enumerate(row):\n self.field_names[i] += \"\\n\" + str(c.value)\n\n seen_fields = set()\n for i, field in enumerate(self.field_names):\n if field in seen_fields:\n field += str(i)\n self.field_names[i] = field\n seen_fields.add(field)\n\n self.data = list(map(self.parse_row, self.worksheet[self.start_row:]))\n\n self.extra_data = {}\n if self.header_row > 0:\n for r in range(0, self.header_row):\n for c, cell in enumerate(self.worksheet[r]):\n val = self.get_value(cell)\n if val is not None and val != '':\n self.extra_data.setdefault(r, {})\n self.extra_data[r][c] = val", "metadata": "root.WorkbookParser.parse", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 15 }, { "content": " def parse_workbook(self):\n raise NotImplementedError", "metadata": "root.WorkbookParser.parse_workbook", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 76 }, { "content": " @property\n def sheet_names(self):\n raise NotImplementedError", "metadata": "root.WorkbookParser.sheet_names", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 79 }, { "content": " def get_sheet_by_name(self, name):\n raise NotImplementedError", "metadata": "root.WorkbookParser.get_sheet_by_name", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 83 }, { "content": " def parse_worksheet(self, name):\n raise NotImplementedError", "metadata": "root.WorkbookParser.parse_worksheet", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 86 }, { "content": " def parse_row(self, row):\n raise NotImplementedError", "metadata": "root.WorkbookParser.parse_row", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 89 }, { "content": " def get_value(self, cell):\n raise NotImplementedError", "metadata": "root.WorkbookParser.get_value", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 92 }, { "content": " def dump(self, file=None):\n if file is None:\n file = self.file\n write, close = self.open_worksheet(file)\n for i, field in enumerate(self.field_names):\n write(0, i, field)\n for r, row in enumerate(self.data):\n for c, field in enumerate(self.field_names):\n write(r + 1, c, row[field])\n close()", "metadata": "root.WorkbookParser.dump", "header": "['class', 'WorkbookParser', '(', 'TableParser', ')', ':', '___EOS___']", "index": 95 }, { "content": "class ExcelParser(WorkbookParser):\n\n\n\n\n\n", "metadata": "root.ExcelParser", "header": "['module', '___EOS___']", "index": 107 }, { "content": " def parse_workbook(self):\n self.workbook = xlrd.open_workbook(file_contents=self.file.read())", "metadata": "root.ExcelParser.parse_workbook", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 108 }, { "content": " @property\n def sheet_names(self):\n return self.workbook.sheet_names()", "metadata": "root.ExcelParser.sheet_names", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 111 }, { "content": " def get_sheet_by_name(self, name):\n return self.workbook.sheet_by_name(name)", "metadata": "root.ExcelParser.get_sheet_by_name", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 115 }, { "content": " def parse_worksheet(self, name):\n worksheet = self.get_sheet_by_name(name)\n self.worksheet = [worksheet.row(i) for i in range(worksheet.nrows)]", "metadata": "root.ExcelParser.parse_worksheet", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 118 }, { "content": " def parse_row(self, row):\n return {name: self.get_value(row[i])\n for i, name in enumerate(self.get_field_names())\n if i < len(row)}", "metadata": "root.ExcelParser.parse_row", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 122 }, { "content": " def get_value(self, cell):\n if cell.ctype == xlrd.XL_CELL_DATE:\n time, date = math.modf(cell.value)\n tpl = xlrd.xldate_as_tuple(cell.value, self.workbook.datemode)\n if date and time:\n return datetime.datetime(*tpl)\n elif date:\n return datetime.date(*tpl[0:3])\n else:\n return datetime.time(*tpl[3:6])\n return cell.value", "metadata": "root.ExcelParser.get_value", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 127 }, { "content": " def open_worksheet(self, file):\n if getattr(self, 'filename', '').endswith('.xls'):\n import xlwt\n workbook = xlwt.Workbook()\n worksheet = workbook.add_sheet('Sheet 1')\n\n def close():\n workbook.save(file)\n else:\n import xlsxwriter\n workbook = xlsxwriter.Workbook(file)\n worksheet = workbook.add_worksheet()\n\n def close():\n workbook.close()\n return worksheet.write, close", "metadata": "root.ExcelParser.open_worksheet", "header": "['class', 'ExcelParser', '(', 'WorkbookParser', ')', ':', '___EOS___']", "index": 139 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "xlr", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "base_", "import_", "Table", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workbook_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sheet", "\\u", "name_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "row_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "\\u", "count_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "pickle", "\\u", "parser_", "=_", "[_", "'", "workbook", "'_", ",_", "'", "worksheet", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "=_", "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_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "parse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parse", "\\u", "workbook_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "sheet", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "data_", "=_", "[_", "{_", "'", "name", "'_", ":_", "name_", ",_", "'", "data", "'_", ":_", "self_", "._", "get", "\\u", "sheet", "\\u", "by", "\\u", "name_", "(_", "name_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", "in_", "self_", "._", "sheet", "\\u", "names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sheet", "\\u", "name_", "=_", "self_", "._", "sheet", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "self_", "._", "sheet", "\\u", "name_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sheet", "\\u", "name_", "=_", "self_", "._", "sheet", "\\u", "names_", "[_", "sheet", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parse", "\\u", "worksheet_", "(_", "sheet", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "header", "\\u", "row_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start", "\\u", "row_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "header", "\\u", "row_", "=_", "self_", "._", "start", "\\u", "row_", "-_", "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_", "._", "column", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "check", "val_", "(_", "cell_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "cell_", "._", "value_", "is_", "not_", "None_", "and_", "cell_", "._", "value_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "search", "\\u", "rows_", "=_", "min_", "(_", "len_", "(_", "self_", "._", "worksheet_", ")_", "-_", "1_", ",_", "self_", "._", "max", "\\u", "header", "\\u", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "range_", "(_", "search", "\\u", "rows_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "count_", "=_", "len_", "(_", "list_", "(_", "filter_", "(_", "check", "val_", ",_", "self_", "._", "worksheet_", "[_", "row_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "count_", ">=_", "self_", "._", "column", "\\u", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "column", "\\u", "count_", "=_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "header", "\\u", "row_", "=_", "row_", "\\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_", "self_", "._", "start", "\\u", "row_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "\\u", "row_", "=_", "self_", "._", "header", "\\u", "row_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "field", "\\u", "names_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rows_", "=_", "self_", "._", "worksheet_", "[_", "self_", "._", "header", "\\u", "row_", ":_", "self_", "._", "start", "\\u", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "field", "\\u", "names_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "c_", "._", "value_", ")_", "or_", "'", "c", "%", "s", "'_", "%_", "i_", "for_", "i_", ",_", "c_", "in_", "enumerate_", "(_", "rows_", "[_", "0_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "rows_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", ",_", "c_", "in_", "enumerate_", "(_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "field", "\\u", "names_", "[_", "i_", "]_", "+=_", "\"\\\\", "n", "\"_", "+_", "str_", "(_", "c_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "see", "n", "\\u", "fields_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "field_", "in_", "enumerate_", "(_", "self_", "._", "field", "\\u", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "field_", "in_", "see", "n", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "field_", "+=_", "str_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "field", "\\u", "names_", "[_", "i_", "]_", "=_", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "see", "n", "\\u", "fields_", "._", "add_", "(_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "data_", "=_", "list_", "(_", "map_", "(_", "self_", "._", "parse", "\\u", "row_", ",_", "self_", "._", "worksheet_", "[_", "self_", "._", "start", "\\u", "row_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "extra", "\\u", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "header", "\\u", "row_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "range_", "(_", "0_", ",_", "self_", "._", "header", "\\u", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c_", ",_", "cell_", "in_", "enumerate_", "(_", "self_", "._", "worksheet_", "[_", "r_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "val_", "=_", "self_", "._", "get", "\\u", "value_", "(_", "cell_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", "is_", "not_", "None_", "and_", "val_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "extra", "\\u", "data_", "._", "setdefault_", "(_", "r_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "extra", "\\u", "data_", "[_", "r_", "]_", "[_", "c_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\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_", "def_", "parse", "\\u", "workbook_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\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_", "sheet", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sheet", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "worksheet_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "row_", "(_", "self_", ",_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "value_", "(_", "self_", ",_", "cell_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Workbook", "Parser_", "(_", "Table", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump_", "(_", "self_", ",_", "file_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "file_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "=_", "self_", "._", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "write_", ",_", "close_", "=_", "self_", "._", "open", "\\u", "worksheet_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "field_", "in_", "enumerate_", "(_", "self_", "._", "field", "\\u", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write_", "(_", "0_", ",_", "i_", ",_", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", ",_", "row_", "in_", "enumerate_", "(_", "self_", "._", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c_", ",_", "field_", "in_", "enumerate_", "(_", "self_", "._", "field", "\\u", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write_", "(_", "r_", "+_", "1_", ",_", "c_", ",_", "row_", "[_", "field_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\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_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "parse", "\\u", "workbook_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "workbook_", "=_", "xlr", "d_", "._", "open", "\\u", "workbook_", "(_", "file", "\\u", "contents_", "=_", "self_", "._", "file_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\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_", "sheet", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "workbook_", "._", "sheet", "\\u", "names_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sheet", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "workbook_", "._", "sheet", "\\u", "by", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "worksheet_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "worksheet_", "=_", "self_", "._", "get", "\\u", "sheet", "\\u", "by", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "worksheet_", "=_", "[_", "worksheet_", "._", "row_", "(_", "i_", ")_", "for_", "i_", "in_", "range_", "(_", "worksheet_", "._", "nrows_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "row_", "(_", "self_", ",_", "row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "name_", ":_", "self_", "._", "get", "\\u", "value_", "(_", "row_", "[_", "i_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "name_", "in_", "enumerate_", "(_", "self_", "._", "get", "\\u", "field", "\\u", "names_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "i_", "<_", "len_", "(_", "row_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "value_", "(_", "self_", ",_", "cell_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cell_", "._", "ctype_", "==_", "xlr", "d_", "._", "XL", "\\u", "CELL", "\\u", "DATE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", ",_", "date_", "=_", "math_", "._", "mod", "f_", "(_", "cell_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tpl_", "=_", "xlr", "d_", "._", "xl", "date", "\\u", "as", "\\u", "tuple_", "(_", "cell_", "._", "value_", ",_", "self_", "._", "workbook_", "._", "date", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "date_", "and_", "time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "datetime_", "(_", "*_", "tpl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "date_", "(_", "*_", "tpl_", "[_", "0_", ":_", "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 ", " _", "return_", "datetime_", "._", "time_", "(_", "*_", "tpl_", "[_", "3_", ":_", "6_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cell_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exce", "l", "Parser_", "(_", "Workbook", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "open", "\\u", "worksheet_", "(_", "self_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "getattr_", "(_", "self_", ",_", "'", "filename", "'_", ",_", "''_", ")_", "._", "endswith_", "(_", "'.", "xls", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "xl", "wt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "workbook_", "=_", "xl", "wt_", "._", "Workbook", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet_", "=_", "workbook_", "._", "add", "\\u", "sheet_", "(_", "'", "She", "et", " ", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "close_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workbook_", "._", "save_", "(_", "file_", ")_", "\\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 ", " _", "import_", "xls", "xw", "riter", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "workbook_", "=_", "xls", "xw", "riter", "_", "._", "Workbook", "_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worksheet_", "=_", "workbook_", "._", "add", "\\u", "worksheet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "close_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workbook_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "worksheet_", "._", "write_", ",_", "close_" ]
[ 4, 4, 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 2, 2 ]
Except block handles 'BaseException'
openshift/openshift-ansible/inventory/openstack/hosts/nova.py
[ { "content": "#!/usr/bin/env python2\n\n# pylint: skip-file\n\n# (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>\n#\n# This file is part of Ansible,\n#\n# Ansible 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# Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.\n\nimport sys\nimport re\nimport os\nimport ConfigParser\nfrom novaclient import client as nova_client\n\ntry:\n import json\nexcept ImportError:\n import simplejson as json\n\n###################################################\n# executed with no parameters, return the list of\n# all groups and hosts\n\nNOVA_CONFIG_FILES = [os.path.join(os.path.dirname(os.path.realpath(__file__)), \"nova.ini\"),\n os.path.expanduser(os.environ.get('ANSIBLE_CONFIG', \"~/nova.ini\")),\n \"/etc/ansible/nova.ini\"]\n\nNOVA_DEFAULTS = {\n 'auth_system': None,\n 'region_name': None,\n 'service_type': 'compute',\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\nconfig = nova_load_config_file()\nif not config:\n sys.exit('Unable to find configfile in %s' % ', '.join(NOVA_CONFIG_FILES))\n\n# Load up connections info based on config and then environment\n# variables\nusername = (get_fallback(config, 'username') or\n os.environ.get('OS_USERNAME', None))\napi_key = (get_fallback(config, 'api_key') or\n os.environ.get('OS_PASSWORD', None))\nauth_url = (get_fallback(config, 'auth_url') or\n os.environ.get('OS_AUTH_URL', None))\nproject_id = (get_fallback(config, 'project_id') or\n os.environ.get('OS_TENANT_NAME', None))\nregion_name = (get_fallback(config, 'region_name') or\n os.environ.get('OS_REGION_NAME', None))\nauth_system = (get_fallback(config, 'auth_system') or\n os.environ.get('OS_AUTH_SYSTEM', None))\n\n# Determine what type of IP is preferred to return\nprefer_private = False\ntry:\n prefer_private = config.getboolean('openstack', 'prefer_private')\nexcept ConfigParser.NoOptionError:\n pass\n\nclient = nova_client.Client(\n version=config.get('openstack', 'version'),\n username=username,\n api_key=api_key,\n auth_url=auth_url,\n region_name=region_name,\n project_id=project_id,\n auth_system=auth_system,\n service_type=config.get('openstack', 'service_type'),\n)\n\n# Default or added list option\nif (len(sys.argv) == 2 and sys.argv[1] == '--list') or len(sys.argv) == 1:\n groups = {'_meta': {'hostvars': {}}}\n # Cycle on servers\n for server in client.servers.list():\n access_ip = get_ips(server)\n\n # Push to name group of 1\n push(groups, server.name, access_ip)\n\n # Run through each metadata item and add instance to it\n for key, value in server.metadata.iteritems():\n composed_key = to_safe('tag_{0}_{1}'.format(key, value))\n push(groups, composed_key, access_ip)\n\n # Do special handling of group for backwards compat\n # inventory groups\n group = server.metadata['group'] if 'group' in server.metadata else 'undefined'\n push(groups, group, access_ip)\n\n # Add vars to _meta key for performance optimization in\n # Ansible 1.3+\n groups['_meta']['hostvars'][access_ip] = get_metadata(server)\n\n # Return server list\n print(json.dumps(groups, sort_keys=True, indent=2))\n sys.exit(0)\n\n#####################################################\n# executed with a hostname as a parameter, return the\n# variables for that host\n\nelif len(sys.argv) == 3 and (sys.argv[1] == '--host'):\n results = {}\n ips = []\n for server in client.servers.list():\n if sys.argv[2] in (get_ips(server) or []):\n results = get_metadata(server)\n print(json.dumps(results, sort_keys=True, indent=2))\n sys.exit(0)\n\nelse:\n print \"usage: --list ..OR.. --host <hostname>\"\n sys.exit(1)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "skip", "-", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "c", ")", " ", "2012", ",", " ", "Marc", "o", " ", "Vit", "o", " ", "Mos", "car", "ito", "lo", " ", "<", "marc", "o", "@", "aga", "ve", "e", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "Ans", "ibl", "e", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ans", "ibl", "e", " ", "is", " ", "free", " ", "software", ":", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "as", " ", "publi", "shed", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ",", " ", "eit", "her", " ", "version", " ", "3", " ", "of", " ", "the", " ", "License", ",", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ans", "ibl", "e", " ", "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", " ", "Ans", "ibl", "e", ".", " ", " ", "If", " ", "not", ",", " ", "see", " ", "<", "http", "://", "www", ".", "gnu", ".", "org", "/", "license", "s", "/>", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "novaclient", "_", "import_", "client_", "as_", "nova", "\\u", "client_", "\\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_", "json_", "\\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_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "executed", " ", "with", " ", "no", " ", "parameter", "s", ",", " ", "return", " ", "the", " ", "list", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "group", "s", " ", "and", " ", "hosts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "NOV", "A", "\\u", "CONFIG", "\\u", "FILES_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ",_", "\"", "nova", ".", "ini", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "expanduser_", "(_", "os_", "._", "environ_", "._", "get_", "(_", "'", "ANSI", "BL", "E", "\\u", "CONFIG", "'_", ",_", "\"~/", "nova", ".", "ini", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"/", "etc", "/", "ansi", "ble", "/", "nova", ".", "ini", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NOV", "A", "\\u", "DEFAULTS_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", "\\u", "system", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "region", "\\u", "name", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "\\u", "type", "'_", ":_", "'", "compute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "config_", "=_", "nova", "\\u", "load", "\\u", "config", "\\u", "file_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "'", "Una", "ble", " ", "to", " ", "find", " ", "configf", "ile", " ", "in", " ", "%", "s", "'_", "%_", "',", " ", "'_", "._", "join_", "(_", "NOV", "A", "\\u", "CONFIG", "\\u", "FILES_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "up", " ", "connections", " ", "info", " ", "based", " ", "on", " ", "config", " ", "and", " ", "then", " ", "environment_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "username_", "=_", "(_", "get", "\\u", "fallback_", "(_", "config_", ",_", "'", "user", "name", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "._", "get_", "(_", "'", "OS", "\\u", "USER", "NAME", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "api", "\\u", "key_", "=_", "(_", "get", "\\u", "fallback_", "(_", "config_", ",_", "'", "api", "\\u", "key", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "._", "get_", "(_", "'", "OS", "\\u", "PASS", "WORD", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "url_", "=_", "(_", "get", "\\u", "fallback_", "(_", "config_", ",_", "'", "auth", "\\u", "url", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "._", "get_", "(_", "'", "OS", "\\u", "AUTH", "\\u", "URL", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project", "\\u", "id_", "=_", "(_", "get", "\\u", "fallback_", "(_", "config_", ",_", "'", "project", "\\u", "id", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "._", "get_", "(_", "'", "OS", "\\u", "TENANT", "\\u", "NAME", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "region", "\\u", "name_", "=_", "(_", "get", "\\u", "fallback_", "(_", "config_", ",_", "'", "region", "\\u", "name", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "._", "get_", "(_", "'", "OS", "\\u", "REGION", "\\u", "NAME", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "system_", "=_", "(_", "get", "\\u", "fallback_", "(_", "config_", ",_", "'", "auth", "\\u", "system", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "._", "get_", "(_", "'", "OS", "\\u", "AUTH", "\\u", "SYSTEM", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "what", " ", "type", " ", "of", " ", "IP", " ", "is", " ", "prefer", "red", " ", "to", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "prefer", "\\u", "private_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefer", "\\u", "private_", "=_", "config_", "._", "getboolean_", "(_", "'", "openst", "ack", "'_", ",_", "'", "prefer", "\\u", "private", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Config", "Parser_", "._", "No", "Optio", "n", "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_", "client_", "=_", "nova", "\\u", "client_", "._", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "config_", "._", "get_", "(_", "'", "openst", "ack", "'_", ",_", "'", "version", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "api", "\\u", "key_", "=_", "api", "\\u", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "url_", "=_", "auth", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "region", "\\u", "name_", "=_", "region", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "id_", "=_", "project", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "system_", "=_", "auth", "\\u", "system_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "type_", "=_", "config_", "._", "get_", "(_", "'", "openst", "ack", "'_", ",_", "'", "service", "\\u", "type", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Default", " ", "or", " ", "adde", "d", " ", "list", " ", "option_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "2_", "and_", "sys_", "._", "argv_", "[_", "1_", "]_", "==_", "'--", "list", "'_", ")_", "or_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "groups_", "=_", "{_", "'\\u", "meta", "'_", ":_", "{_", "'", "host", "vars", "'_", ":_", "{_", "}_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cycle", " ", "on", " ", "servers_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "server_", "in_", "client_", "._", "servers_", "._", "list_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "access", "\\u", "ip_", "=_", "get", "\\u", "ips_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Push", " ", "to", " ", "name", " ", "group", " ", "of", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "push_", "(_", "groups_", ",_", "server_", "._", "name_", ",_", "access", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "through", " ", "each", " ", "metadata", " ", "item", " ", "and", " ", "add", " ", "instance", " ", "to", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "server_", "._", "metadata_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compose", "d\\u", "key_", "=_", "to", "\\u", "safe_", "(_", "'", "tag", "\\u{", "0", "}\\u", "{", "1", "}'_", "._", "format_", "(_", "key_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "push_", "(_", "groups_", ",_", "compose", "d\\u", "key_", ",_", "access", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "special", " ", "handling", " ", "of", " ", "group", " ", "for", " ", "back", "ward", "s", " ", "compat_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inventor", "y", " ", "groups_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "group_", "=_", "server_", "._", "metadata_", "[_", "'", "group", "'_", "]_", "if_", "'", "group", "'_", "in_", "server_", "._", "metadata_", "else_", "'", "undefined", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "push_", "(_", "groups_", ",_", "group_", ",_", "access", "\\u", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "vars", " ", "to", " ", "\\u", "meta", " ", "key", " ", "for", " ", "perform", "anc", "e", " ", "optimization", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ans", "ibl", "e", " ", "1.3", "+_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "[_", "'\\u", "meta", "'_", "]_", "[_", "'", "host", "vars", "'_", "]_", "[_", "access", "\\u", "ip_", "]_", "=_", "get", "\\u", "metadata_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "server", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "json_", "._", "dumps_", "(_", "groups_", ",_", "sort", "\\u", "keys_", "=_", "True_", ",_", "indent_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "executed", " ", "with", " ", "a", " ", "host", "name", " ", "as", " ", "a", " ", "parameter", ",", " ", "return", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "les", " ", "for", " ", "tha", "t", " ", "host_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "3_", "and_", "(_", "sys_", "._", "argv_", "[_", "1_", "]_", "==_", "'--", "host", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ips_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "server_", "in_", "client_", "._", "servers_", "._", "list_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sys_", "._", "argv_", "[_", "2_", "]_", "in_", "(_", "get", "\\u", "ips_", "(_", "server_", ")_", "or_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "get", "\\u", "metadata_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "json_", "._", "dumps_", "(_", "results_", ",_", "sort", "\\u", "keys_", "=_", "True_", ",_", "indent_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "usage", ":", " ", "--", "list", " ", " ", "..", "OR", "..", " ", "--", "host", " ", "<", "host", "name", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uDEDENT\\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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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
hpk42/p4p/attic/play_async_print2.py
[ { "content": "# based on http://stackoverflow.com/questions/2082387/reading-input-from-raw-input-without-having-the-prompt-overwritten-by-other-th\n\nfrom rl import readline\nfrom threading import Thread, Timer\n\nfrom sys import stdout\nfrom struct import unpack\nfrom fcntl import ioctl\nfrom termios import TIOCGWINSZ\n\n\nprompt = '> '\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n Thread(target=cli).start()\n Timer(2, interrupt).start()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def clear_readline():\n # Next line said to be reasonably portable for various Unixes\n _, cols = unpack('hh', ioctl(stdout, TIOCGWINSZ, '1234'))\n length = len(readline.get_line_buffer()) + len(prompt)\n lines = length / cols\n # ANSI escape sequences (All VT100 except ESC[0G)\n stdout.write('\\x1b[2K') # Clear current line\n stdout.write('\\x1b[1A\\x1b[2K' * lines) # Move cursor up and clear line\n stdout.write('\\x1b[0G') # Move to start of line", "metadata": "root.clear_readline", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def interrupt():\n clear_readline()\n print('Interrupting cow -- moo!')\n readline.redisplay(True)\n Timer(2, interrupt).start()", "metadata": "root.interrupt", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def cli():\n while True:\n raw_input(prompt)", "metadata": "root.cli", "header": "['module', '___EOS___']", "index": 32 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "based", " ", "on", " ", "http", "://", "stack", "overflow", ".", "com", "/", "question", "s", "/", "208", "238", "7", "/", "readi", "ng", "-", "input", "-", "from", "-", "raw", "-", "input", "-", "with", "out", "-", "hav", "ing", "-", "the", "-", "prompt", "-", "overwrit", "ten", "-", "by", "-", "other", "-", "th_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "rl_", "import_", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Thread_", ",_", "Timer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sys_", "import_", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "struct_", "import_", "unpack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fcntl_", "import_", "ioct", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "termios_", "import_", "TIO", "CG", "WIN", "SZ", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prompt_", "=_", "'>", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "Thread_", "(_", "target_", "=_", "cli_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Timer_", "(_", "2_", ",_", "interrupt", "_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "clear", "\\u", "readline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ne", "xt", " ", "line", " ", "sai", "d", " ", "to", " ", "be", " ", "reason", "abl", "y", " ", "portab", "le", " ", "for", " ", "vari", "ous", " ", "Uni", "xes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u_", ",_", "cols_", "=_", "unpack_", "(_", "'", "hh", "'_", ",_", "ioct", "l_", "(_", "stdout_", ",_", "TIO", "CG", "WIN", "SZ", "_", ",_", "'", "1234", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "len_", "(_", "readline_", "._", "get", "\\u", "line", "\\u", "buffer_", "(_", ")_", ")_", "+_", "len_", "(_", "prompt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "length_", "/_", "cols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ANSI", " ", "escape", " ", "sequence", "s", " ", "(", "All", " ", "VT", "100", " ", "except", " ", "ESC", "[", "0", "G", ")_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "._", "write_", "(_", "'\\\\", "x1", "b", "[", "2", "K", "'_", ")_", "#", " ", "Clear", " ", "current", " ", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "write_", "(_", "'\\\\", "x1", "b", "[", "1", "A", "\\\\", "x1", "b", "[", "2", "K", "'_", "*_", "lines_", ")_", "#", " ", "Move", " ", "cursor", " ", "up", " ", "and", " ", "clear", " ", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "write_", "(_", "'\\\\", "x1", "b", "[", "0", "G", "'_", ")_", "#", " ", "Move", " ", "to", " ", "start", " ", "of", " ", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "interrupt", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clear", "\\u", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Interr", "upti", "ng", " ", "cow", " ", "--", " ", "moo", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "readline_", "._", "redis", "play_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Timer_", "(_", "2_", ",_", "interrupt", "_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cli_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "input_", "(_", "prompt_", ")_", "\\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, 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-naarad/sports_naarad/barclay.py
[ { "content": " def Fixtures(self, type_return='string'):\n url = \"http://www.premierleague.com/en-gb/matchday/matches.html?paramClubId=ALL&paramComp_8=true&view=.dateSeason\"\n\n res = requests.get(url, stream=True, proxies=proxy_dict)\n soup = bs4.BeautifulSoup(res.text, parser)\n fixtures_time = []\n fixtures_location = []\n fixtures_clubs = []\n fixture_table = soup.select('.contentTable')\n for tables in fixture_table:\n date = tables.select('th')\n date[0] = str(date[0].text)\n fixtures_t = tables.select('.time')\n for i in range(len(fixtures_t)):\n fixtures_time.append(str(fixtures_t[i].text) + ', ' + date[0])\n\n fixtures_c = tables.select('.clubs a')\n for i in range(len(fixtures_c)):\n fixtures_clubs.append(str(fixtures_c[i].text))\n\n fixtures_l = tables.select('.location a')\n for i in range(len(fixtures_l)):\n fixtures_location.append(str(fixtures_l[i].text))\n\n temp = list(zip(fixtures_clubs, fixtures_time, fixtures_location))\n if type_return == 'dict':\n return temp\n return str(temp)", "metadata": "root.Barclay.Fixtures", "header": "['class', 'Barclay', '(', 'object', ')', ':', '___EOS___']", "index": 169 } ]
[]
[]
0
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Barc", "lay_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Fix", "tures", "_", "(_", "self_", ",_", "type", "\\u", "return_", "=_", "'", "string", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"", "http", "://", "www", ".", "premi", "erl", "ea", "gue", ".", "com", "/", "en", "-", "gb", "/", "match", "day", "/", "matche", "s", ".", "html", "?", "param", "Club", "Id", "=", "ALL", "&", "param", "Comp", "\\u", "8", "=", "true", "&", "view", "=.", "date", "Season", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "requests_", "._", "get_", "(_", "url_", ",_", "stream_", "=_", "True_", ",_", "proxies_", "=_", "proxy", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soup_", "=_", "bs4_", "._", "Bea", "uti", "ful", "Soup_", "(_", "res_", "._", "text_", ",_", "parser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture", "s", "\\u", "time_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture", "s", "\\u", "location_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture", "s", "\\u", "club", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture", "\\u", "table_", "=_", "soup_", "._", "select_", "(_", "'.", "content", "Table", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tables_", "in_", "fixture", "\\u", "table_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "date_", "=_", "tables_", "._", "select_", "(_", "'", "th", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date_", "[_", "0_", "]_", "=_", "str_", "(_", "date_", "[_", "0_", "]_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture", "s", "\\u", "t_", "=_", "tables_", "._", "select_", "(_", "'.", "time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "fixture", "s", "\\u", "t_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixture", "s", "\\u", "time_", "._", "append_", "(_", "str_", "(_", "fixture", "s", "\\u", "t_", "[_", "i_", "]_", "._", "text_", ")_", "+_", "',", " ", "'_", "+_", "date_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixture", "s", "\\u", "c_", "=_", "tables_", "._", "select_", "(_", "'.", "club", "s", " ", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "fixture", "s", "\\u", "c_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixture", "s", "\\u", "club", "s_", "._", "append_", "(_", "str_", "(_", "fixture", "s", "\\u", "c_", "[_", "i_", "]_", "._", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixture", "s", "\\u", "l_", "=_", "tables_", "._", "select_", "(_", "'.", "location", " ", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "fixture", "s", "\\u", "l_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixture", "s", "\\u", "location_", "._", "append_", "(_", "str_", "(_", "fixture", "s", "\\u", "l_", "[_", "i_", "]_", "._", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "temp_", "=_", "list_", "(_", "zip_", "(_", "fixture", "s", "\\u", "club", "s_", ",_", "fixture", "s", "\\u", "time_", ",_", "fixture", "s", "\\u", "location_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type", "\\u", "return_", "==_", "'", "dict", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "temp_", "\\u\\u\\uNEWLIN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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 ]
Module is imported with 'import' and 'import from'
SALib/SALib/SALib/tests/test_regression.py
[ { "content": "from __future__ import division\n\nimport sys\n\nfrom nose.tools import with_setup\nfrom numpy.testing import assert_allclose\n\nfrom SALib.analyze import delta\nfrom SALib.analyze import dgsm\nfrom SALib.analyze import fast\nfrom SALib.analyze import sobol\nfrom SALib.sample import fast_sampler\nfrom SALib.sample import finite_diff\nfrom SALib.sample import latin\nfrom SALib.sample import saltelli\nimport numpy as np\n\nfrom ..analyze import morris\nfrom ..sample.morris import sample\nfrom ..test_functions import Ishigami\nfrom ..util import read_param_file\nfrom .test_util import teardown\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 } ]
[]
[]
0
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "with", "\\u", "setup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "._", "testing_", "import_", "assert", "\\u", "allclose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "dg", "sm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "fast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "analyze_", "import_", "sob", "ol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "fast", "\\u", "sampler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "finite", "\\u", "diff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "latin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SAL", "ib_", "._", "sample_", "import_", "salt", "elli", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "._", "analyze_", "import_", "mor", "ris_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "sample_", "._", "mor", "ris_", "import_", "sample_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "test\\u", "functions_", "import_", "Is", "hi", "gam", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "util_", "import_", "read", "\\u", "param", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "test\\u", "util_", "import_", "teardown_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Comparison using is when operands support `__eq__`
ossxp-com/repo/git_command.py
[ { "content": "#\n# Copyright (C) 2008 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport sys\nimport subprocess\nimport tempfile\nfrom signal import SIGTERM\nfrom error import GitError\nfrom trace import REPO_TRACE, IsTrace, Trace\n\nGIT = 'git'\nMIN_GIT_VERSION = (1, 5, 4)\nGIT_DIR = 'GIT_DIR'\n\nLAST_GITDIR = None\nLAST_CWD = None\n\n_ssh_proxy_path = None\n_ssh_sock_path = None\n_ssh_clients = []\n\n\n\n\n\n\n_git_version = None\n\ngit = _GitCall()\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def version_tuple(self):\n global _git_version\n\n if _git_version is None:\n ver_str = git.version()\n if ver_str.startswith('git version '):\n _git_version = tuple(\n map(lambda x: int(x),\n ver_str[len('git version '):].strip().split('.')[0:3]\n ))\n else:\n print >>sys.stderr, 'fatal: \"%s\" unsupported' % ver_str\n sys.exit(1)\n return _git_version", "metadata": "root._GitCall.version_tuple", "header": "['class', '_GitCall', '(', 'object', ')', ':', '___EOS___']", "index": 83 } ]
[]
[]
0
false
[ "[CLS]_", "Compari", "son_", "using_", "is_", "when_", "operands_", "support_", " _", "`_", "\\u\\u", "eq\\u\\u_", "`_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2008", " ", "The", " ", "And", "roid", " ", "Open", " ", "Sou", "rce", " ", "Project_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "signal_", "import_", "SIGTERM_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "error_", "import_", "Git", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "trace_", "import_", "REPO", "\\u", "TRACE", "_", ",_", "Is", "Trace_", ",_", "Trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "GIT", "_", "=_", "'", "git", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MIN", "\\u", "GIT", "\\u", "VERSION_", "=_", "(_", "1_", ",_", "5_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GIT", "\\u", "DIR_", "=_", "'", "GIT", "\\u", "DIR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LAS", "T", "\\u", "GIT", "DIR_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LAS", "T", "\\u", "CW", "D_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "ssh", "\\u", "proxy", "\\u", "path_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "ssh", "\\u", "sock", "\\u", "path_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "ssh", "\\u", "clients_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "git", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "git_", "=_", "\\u", "Git", "Call_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Git", "Call_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "version", "\\u", "tuple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "\\u", "git", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "git", "\\u", "version_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ver", "\\u", "str_", "=_", "git_", "._", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ver", "\\u", "str_", "._", "startswith_", "(_", "'", "git", " ", "version", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "git", "\\u", "version_", "=_", "tuple_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "map_", "(_", "lambda_", "x_", ":_", "int_", "(_", "x_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ver", "\\u", "str_", "[_", "len_", "(_", "'", "git", " ", "version", " ", "'_", ")_", ":_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "'.'_", ")_", "[_", "0_", ":_", "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 ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "fat", "al", ":", " ", "\"%", "s", "\"", " ", "unsup", "porte", "d", "'_", "%_", "ver", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u", "git", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Deprecated slice method
dragoon/django-selenium/django_selenium/testcases.py
[ { "content": " def __getitem__(self, key):\n \"\"\"Return item from the internal sequence, bypassing ``__getattribute__``\"\"\"\n return object.__getattribute__(self, 'elements')[key]", "metadata": "root.SeleniumElement.__getitem__", "header": "['class', 'SeleniumElement', '(', 'object', ')', ':', '___EOS___']", "index": 47 } ]
[]
[]
0
true
[ "[CLS]_", "Dep", "reca", "ted_", "slice_", "method_", "[SEP]_", "class_", "Selen", "ium", "Element_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\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 ", " _", "\"\"\"", "Return", " ", "item", " ", "from", " ", "the", " ", "internal", " ", "sequence", ",", " ", "bypass", "ing", " ", "``", "\\u\\u", "getattr", "ibut", "e\\u", "\\u`", "`\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "object_", "._", "\\u\\u", "getattribute\\u\\u_", "(_", "self_", ",_", "'", "element", "s", "'_", ")_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
saltstack/salt/tests/integration/states/rabbitmq_vhost.py
[ { "content": "# -*- coding: utf-8 -*-\n\n'''\nTests for the rabbitmq state\n'''\n# Import python libs\nfrom __future__ import absolute_import\nimport os\n\n# Import Salt Testing libs\nfrom salttesting.helpers import ensure_in_syspath\nensure_in_syspath('../../')\n\n# Import salt libs\nimport integration\n\n\n\n\nif __name__ == '__main__':\n from integration import run_tests\n run_tests(RabbitVHostTestCase)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class RabbitVHostTestCase(integration.ModuleCase,\n integration.SaltReturnAssertsMixIn):\n '''\n Validate the rabbitmq virtual host states.\n '''\n\n", "metadata": "root.RabbitVHostTestCase", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def setUp(self):\n super(RabbitVHostTestCase, self).setUp()\n rabbit_installed = self.run_function('cmd.has_exec', ['rabbitmqctl'])\n\n if not rabbit_installed:\n self.skipTest('rabbitmq-server not installed')\n if os.geteuid() != 0:\n self.skipTest('You must be root to run this test')", "metadata": "root.RabbitVHostTestCase.setUp", "header": "['class', 'RabbitVHostTestCase', '(', 'integration', '.', 'ModuleCase', ',', '___NL___', 'integration', '.', 'SaltReturnAssertsMixIn', ')', ':', '___EOS___']", "index": 22 }, { "content": " def test_present(self):\n '''\n rabbitmq_vhost.present null_host\n '''\n ret = self.run_state(\n 'rabbitmq_vhost.present', name='null_host', test=True\n )\n self.assertSaltFalseReturn(ret)", "metadata": "root.RabbitVHostTestCase.test_present", "header": "['class', 'RabbitVHostTestCase', '(', 'integration', '.', 'ModuleCase', ',', '___NL___', 'integration', '.', 'SaltReturnAssertsMixIn', ')', ':', '___EOS___']", "index": 31 }, { "content": " def absent(self):\n '''\n rabbitmq_vhost.absent null_host\n '''\n ret = self.run_state(\n 'rabbitmq_vhost.absent', name='null_host', test=True\n )\n self.assertSaltFalseReturn(ret)", "metadata": "root.RabbitVHostTestCase.absent", "header": "['class', 'RabbitVHostTestCase', '(', 'integration', '.', 'ModuleCase', ',', '___NL___', 'integration', '.', 'SaltReturnAssertsMixIn', ')', ':', '___EOS___']", "index": 40 } ]
[]
[]
0
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", ";", "Test", "s", " ", "for", " ", "the", " ", "rabbitmq", " ", "state", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Import", " ", "python", " ", "libs_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Import", " ", "Sal", "t", " ", "Test", "ing", " ", "libs_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "salt", "testing_", "._", "helpers_", "import_", "ensure", "\\u", "in", "\\u", "sysp", "ath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensure", "\\u", "in", "\\u", "sysp", "ath_", "(_", "'../../", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Import", " ", "salt", " ", "libs_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "integration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "from_", "integration_", "import_", "run", "\\u", "tests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "tests_", "(_", "Ra", "bbi", "t", "VH", "ost", "Test", "Case_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Ra", "bbi", "t", "VH", "ost", "Test", "Case_", "(_", "integration_", "._", "Modul", "e", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "integration_", "._", "Sal", "t", "Return", "Assert", "s", "Mix", "In_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Validate", " ", "the", " ", "rabbitmq", " ", "virtual", " ", "host", " ", "state", "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_", "Ra", "bbi", "t", "VH", "ost", "Test", "Case_", "(_", "integration_", "._", "Modul", "e", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "integration_", "._", "Sal", "t", "Return", "Assert", "s", "Mix", "In_", ")_", ":_", "\\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 ", " _", "super_", "(_", "Ra", "bbi", "t", "VH", "ost", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rabbit", "\\u", "installed_", "=_", "self_", "._", "run", "\\u", "function_", "(_", "'", "cmd", ".", "has", "\\u", "exec", "'_", ",_", "[_", "'", "rabbitmq", "ctl", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "rabbit", "\\u", "installed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "'", "rabbitmq", "-", "server", " ", "not", " ", "install", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "gete", "uid_", "(_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "'", "You", " ", "must", " ", "be", " ", "root", " ", "to", " ", "run", " ", "this", " ", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "bbi", "t", "VH", "ost", "Test", "Case_", "(_", "integration_", "._", "Modul", "e", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "integration_", "._", "Sal", "t", "Return", "Assert", "s", "Mix", "In_", ")_", ":_", "\\u\\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", "present_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "rabbitmq", "\\u", "vhost", ".", "presen", "t", " ", "null", "\\u", "host", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "run", "\\u", "state_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rabbitmq", "\\u", "vhost", ".", "presen", "t", "'_", ",_", "name_", "=_", "'", "null", "\\u", "host", "'_", ",_", "test_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Sal", "t", "Fal", "se", "Return_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "bbi", "t", "VH", "ost", "Test", "Case_", "(_", "integration_", "._", "Modul", "e", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "integration_", "._", "Sal", "t", "Return", "Assert", "s", "Mix", "In_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "absen", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "rabbitmq", "\\u", "vhost", ".", "absen", "t", " ", "null", "\\u", "host", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "run", "\\u", "state_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rabbitmq", "\\u", "vhost", ".", "absen", "t", "'_", ",_", "name_", "=_", "'", "null", "\\u", "host", "'_", ",_", "test_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Sal", "t", "Fal", "se", "Return_", "(_", "ret_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
fengsp/plan/plan/testsuite/commands.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\n plan.testsuite.commands\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests the command line tools for Plan.\n\n :copyright: (c) 2014 by Shipeng Feng.\n :license: BSD, see LICENSE for more details.\n\"\"\"\n\nimport unittest\n\nimport click\nfrom click.testing import CliRunner\n\nfrom plan.commands import Echo\nfrom plan.testsuite import BaseTestCase\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class EchoTestRunner(object):\n\n", "metadata": "root.EchoTestRunner", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __init__(self):\n self.runner = CliRunner()", "metadata": "root.EchoTestRunner.__init__", "header": "['class', 'EchoTestRunner', '(', 'object', ')', ':', '___EOS___']", "index": 22 }, { "content": " def invoke(self, echo_method, message):\n @click.command()\n @click.argument('message')\n def command(message):\n echo_method(message)\n return self.runner.invoke(command, [message])", "metadata": "root.EchoTestRunner.invoke", "header": "['class', 'EchoTestRunner', '(', 'object', ')', ':', '___EOS___']", "index": 25 }, { "content": "class EchoTestCase(BaseTestCase):\n\n\n\n\n\n\n\n\n\n", "metadata": "root.EchoTestCase", "header": "['module', '___EOS___']", "index": 33 }, { "content": " def setup(self):\n self.runner = EchoTestRunner()", "metadata": "root.EchoTestCase.setup", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": " def teardown(self):\n self.runner = None", "metadata": "root.EchoTestCase.teardown", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 38 }, { "content": " def test_echo(self):\n result = self.runner.invoke(Echo.echo, 'echo')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, 'echo\\n')", "metadata": "root.EchoTestCase.test_echo", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 41 }, { "content": " def test_secho(self):\n result = self.runner.invoke(Echo.secho, 'secho')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, 'secho\\n')", "metadata": "root.EchoTestCase.test_secho", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 46 }, { "content": " def test_message(self):\n result = self.runner.invoke(Echo.message, 'message')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, '[message] message\\n')", "metadata": "root.EchoTestCase.test_message", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_write(self):\n result = self.runner.invoke(Echo.write, 'write')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, '[write] write\\n')", "metadata": "root.EchoTestCase.test_write", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_fail(self):\n result = self.runner.invoke(Echo.fail, 'fail')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, '[fail] fail\\n')", "metadata": "root.EchoTestCase.test_fail", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 61 }, { "content": " def test_add(self):\n result = self.runner.invoke(Echo.add, 'add')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, '[add] add\\n')", "metadata": "root.EchoTestCase.test_add", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 66 }, { "content": " def test_done_with_message(self):\n result = self.runner.invoke(Echo.done, 'done')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, '[done] done\\n')", "metadata": "root.EchoTestCase.test_done_with_message", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 71 }, { "content": " def test_done_without_message(self):\n result = self.runner.invoke(Echo.done, '')\n self.assert_true(result.exit_code == 0)\n self.assert_equal(result.output, '[done]!\\n')", "metadata": "root.EchoTestCase.test_done_without_message", "header": "['class', 'EchoTestCase', '(', 'BaseTestCase', ')', ':', '___EOS___']", "index": 76 }, { "content": "def suite():\n suite = unittest.TestSuite()\n suite.addTest(unittest.makeSuite(EchoTestCase))\n return suite", "metadata": "root.suite", "header": "['module', '___EOS___']", "index": 82 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "plan", ".", "testsuite", ".", "command", "s", "\\", "10", ";", " ", " ", " ", " ", "~~~~~~~~~~~", "~~~~~~~~~~~", "~", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "the", " ", "command", " ", "line", " ", "tool", "s", " ", "for", " ", "Plan", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", ":", " ", "(", "c", ")", " ", "2014", " ", "by", " ", "Ship", "eng", " ", "Fen", "g", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "license", ":", " ", "BS", "D", ",", " ", "see", " ", "LICENSE", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";\"\"\"_", "\\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_", "import_", "click_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "click_", "._", "testing_", "import_", "Cli", "Runner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "plan_", "._", "commands_", "import_", "Ech", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "plan_", "._", "testsuite_", "import_", "Base", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Ech", "o", "Test", "Runner_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Runner_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "runner_", "=_", "Cli", "Runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Runner_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "invoke_", "(_", "self_", ",_", "echo", "\\u", "method_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "click_", "._", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "click_", "._", "argument_", "(_", "'", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "command_", "(_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "echo", "\\u", "method_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "runner_", "._", "invoke_", "(_", "command_", ",_", "[_", "message_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "runner_", "=_", "Ech", "o", "Test", "Runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "teardown_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "runner_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "echo_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "echo_", ",_", "'", "echo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'", "echo", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sec", "ho_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "sec", "ho_", ",_", "'", "sec", "ho", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'", "sec", "ho", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "message_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "message_", ",_", "'", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'[", "message", "]", " ", "message", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "write_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "write_", ",_", "'", "write", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'[", "write", "]", " ", "write", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fail_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "fail_", ",_", "'", "fail", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'[", "fail", "]", " ", "fail", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "add_", ",_", "'", "add", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'[", "add", "]", " ", "add", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "don", "e\\u", "with", "\\u", "message_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "done_", ",_", "'", "don", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'[", "don", "e", "]", " ", "don", "e", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Test", "Case_", "(_", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "don", "e\\u", "with", "out", "\\u", "message_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "Ech", "o_", "._", "done_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "true_", "(_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "equal_", "(_", "result_", "._", "output_", ",_", "'[", "don", "e", "]", "!\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "suite_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "._", "add", "Test_", "(_", "unittest_", "._", "make", "Suite_", "(_", "Ech", "o", "Test", "Case_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "suite_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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content": "import unittest\nfrom lib import RecordingsSaver\nfrom cloudasr.test_doubles import SocketSpy\nfrom cloudasr.messages.helpers import *\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestRecordingsSaver(unittest.TestCase):\n\n\n\n", "metadata": "root.TestRecordingsSaver", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def setUp(self):\n self.model = RecordingsModelSpy()\n self.socket = SocketSpy()\n self.create_socket = lambda: self.socket\n self.saver = RecordingsSaver(self.create_socket, self.model, self.socket.has_next_message)", "metadata": "root.TestRecordingsSaver.setUp", "header": "['class', 'TestRecordingsSaver', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 8 }, { "content": " def test_saver_saves_recordings_received_via_socket(self):\n self.run_saver([\n createSaverMessage(1, 0, 1, 'en-GB', b'body 1', 44100, [(1.0, 'Hello World 1!')]).SerializeToString(),\n createSaverMessage(2, 0, 2, 'en-GB', b'body 2', 44100, [(1.0, 'Hello World 2!')]).SerializeToString(),\n ])\n\n self.assertThatSaverSavedRecordings([\n (1, 0, 1, 'en-GB', b'body 1', 44100, [{'confidence': 1.0, 'transcript': 'Hello World 1!'}]),\n (2, 0, 2, 'en-GB', b'body 2', 44100, [{'confidence': 1.0, 'transcript': 'Hello World 2!'}])\n ])", "metadata": "root.TestRecordingsSaver.test_saver_saves_recordings_received_via_socket", "header": "['class', 'TestRecordingsSaver', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 14 }, { "content": " def run_saver(self, messages):\n self.socket.set_messages(messages)\n self.saver.run()", "metadata": "root.TestRecordingsSaver.run_saver", "header": "['class', 'TestRecordingsSaver', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def assertThatSaverSavedRecordings(self, recordings):\n self.assertEquals(recordings, self.model.saved_recordings)", "metadata": "root.TestRecordingsSaver.assertThatSaverSavedRecordings", "header": "['class', 'TestRecordingsSaver', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": "class RecordingsModelSpy:\n\n", "metadata": "root.RecordingsModelSpy", "header": "['module', '___EOS___']", "index": 33 }, { "content": " def __init__(self):\n self.saved_recordings = []", "metadata": "root.RecordingsModelSpy.__init__", "header": "['class', 'RecordingsModelSpy', ':', '___EOS___']", "index": 35 }, { "content": " def save_recording(self, id, part, chunk_id, model, body, frame_rate, alternatives):\n self.saved_recordings.append((id, part, chunk_id, model, body, frame_rate, alternatives))", "metadata": "root.RecordingsModelSpy.save_recording", "header": "['class', 'RecordingsModelSpy', ':', '___EOS___']", "index": 38 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lib_", "import_", "Record", "ings", "Saver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cloud", "as", "r_", "._", "test\\u", "double", "s_", "import_", "Sock", "et", "Spy", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cloud", "as", "r_", "._", "messages_", "._", "helpers_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Record", "ings", "Saver_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Record", "ings", "Saver_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model_", "=_", "Record", "ings", "Model", "Spy", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "=_", "Sock", "et", "Spy", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "\\u", "socket_", "=_", "lambda_", ":_", "self_", "._", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "saver_", "=_", "Record", "ings", "Saver_", "(_", "self_", "._", "create", "\\u", "socket_", ",_", "self_", "._", "model_", ",_", "self_", "._", "socket_", "._", "has", "\\u", "next", "\\u", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Record", "ings", "Saver_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "saver", "\\u", "save", "s", "\\u", "recordings", "\\u", "receive", "d\\u", "via", "\\u", "socket_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run", "\\u", "saver_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "create", "Save", "r", "Message_", "(_", "1_", ",_", "0_", ",_", "1_", ",_", "'", "en", "-", "GB", "'_", ",_", "b", "'", "body", " ", "1", "'_", ",_", "4410", "0_", ",_", "[_", "(_", "1.0_", ",_", "'", "Hell", "o", " ", "Wor", "ld", " ", "1", "!'_", ")_", "]_", ")_", "._", "Seriali", "ze", "To", "String_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "create", "Save", "r", "Message_", "(_", "2_", ",_", "0_", ",_", "2_", ",_", "'", "en", "-", "GB", "'_", ",_", "b", "'", "body", " ", "2", "'_", ",_", "4410", "0_", ",_", "[_", "(_", "1.0_", ",_", "'", "Hell", "o", " ", "Wor", "ld", " ", "2", "!'_", ")_", "]_", ")_", "._", "Seriali", "ze", "To", "String_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Tha", "t", "Save", "r", "Save", "d", "Record", "ings_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "0_", ",_", "1_", ",_", "'", "en", "-", "GB", "'_", ",_", "b", "'", "body", " ", "1", "'_", ",_", "4410", "0_", ",_", "[_", "{_", "'", "confidence", "'_", ":_", "1.0_", ",_", "'", "transcri", "pt", "'_", ":_", "'", "Hell", "o", " ", "Wor", "ld", " ", "1", "!'_", "}_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "0_", ",_", "2_", ",_", "'", "en", "-", "GB", "'_", ",_", "b", "'", "body", " ", "2", "'_", ",_", "4410", "0_", ",_", "[_", "{_", "'", "confidence", "'_", ":_", "1.0_", ",_", "'", "transcri", "pt", "'_", ":_", "'", "Hell", "o", " ", "Wor", "ld", " ", "2", "!'_", "}_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Record", "ings", "Saver_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "saver_", "(_", "self_", ",_", "messages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "socket_", "._", "set\\u", "messages_", "(_", "messages_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "saver_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Record", "ings", "Saver_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "assert", "Tha", "t", "Save", "r", "Save", "d", "Record", "ings_", "(_", "self_", ",_", "recordings", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "recordings", "_", ",_", "self_", "._", "model_", "._", "saved", "\\u", "recordings", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "ings", "Model", "Spy", "_", ":_", "\\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_", "Record", "ings", "Model", "Spy", "_", ":_", "\\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 ", " _", "self_", "._", "saved", "\\u", "recordings", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "ings", "Model", "Spy", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "recording_", "(_", "self_", ",_", "id_", ",_", "part_", ",_", "chunk", "\\u", "id_", ",_", "model_", ",_", "body_", ",_", "frame", "\\u", "rate_", ",_", "alternatives", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "saved", "\\u", "recordings", "_", "._", "append_", "(_", "(_", "id_", ",_", "part_", ",_", "chunk", "\\u", "id_", ",_", "model_", ",_", "body_", ",_", "frame", "\\u", "rate_", ",_", "alternatives", "_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
CGATOxford/cgat/legacy/ScopTester.py
[ { "content": " def GetAlignandum( self, nid, nrdb_from, nrdb_to ):\n\n n = self.mTableNeighbours.GetNumNeighbours( nid )\n \n if n >= self.mMinProfileSize:\n \n profile = alignlib.makeEmptyProfile( self.mRegularizor, self.mLogOddor )\n\n pairsdblib.fillProfileNeighbours( profile,\n self.mConnectionPairsdb,\n nid,\n self.mTableNameNeighbours,\n self.mMaxLinesMali,\n 0,\n self.mMaxLevel,\n self.mMinLevel )\n if self.mLogLevel >= 3:\n print \"# ------> using profile for rep %i\" % nid\n \n else:\n profile = pairsdblib.makeSequenceFromPicasso( self.mConnectionPairsdb, nid )\n if self.mLogLevel >= 3:\n print \"# ------> using sequence for rep %i\" % nid\n \n profile.useSegment( nrdb_from, nrdb_to )\n \n return profile, (str(n),)", "metadata": "root.ScopTesterProfiles.GetAlignandum", "header": "['class', 'ScopTesterProfiles', '(', 'ScopTester', ')', ':', '___EOS___']", "index": 227 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Sco", "p", "Tester", "Profil", "es_", "(_", "Sco", "p", "Tester_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Align", "and", "um_", "(_", "self_", ",_", "nid_", ",_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "self_", "._", "m", "Table", "Neigh", "bour", "s_", "._", "Get", "Num", "Neigh", "bour", "s_", "(_", "nid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "n_", ">=_", "self_", "._", "m", "Min", "Profil", "e", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profile_", "=_", "align", "lib_", "._", "make", "Emp", "ty", "Profile_", "(_", "self_", "._", "m", "Regula", "riz", "or_", ",_", "self_", "._", "m", "Log", "Od", "dor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pair", "sdb", "lib_", "._", "fill", "Profil", "e", "Neigh", "bour", "s_", "(_", "profile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Table", "Name", "Neigh", "bour", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Max", "Line", "s", "Mal", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Max", "Level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "m", "Min", "Level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "------", ">", " ", "usi", "ng", " ", "profile", " ", "for", " ", "rep", " ", "%", "i", "\"_", "%_", "nid_", "\\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 ", " _", "profile_", "=_", "pair", "sdb", "lib_", "._", "make", "Sequ", "ence", "Fro", "m", "Pic", "ass", "o_", "(_", "self_", "._", "m", "Connect", "ion", "Pair", "sdb", "_", ",_", "nid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "m", "Log", "Level_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"#", " ", "------", ">", " ", "usi", "ng", " ", "sequence", " ", "for", " ", "rep", " ", "%", "i", "\"_", "%_", "nid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "profile_", "._", "use", "Segment_", "(_", "nr", "db", "\\u", "from_", ",_", "nr", "db", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "profile_", ",_", "(_", "str_", "(_", "n_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Missing call to `__init__` during object initialization
CybOXProject/python-cybox/cybox/objects/artifact_object.py
[ { "content": " def __init__(self, compression_mechanism=None):\n super(Compression, self).__init__()\n self.compression_mechanism = compression_mechanism", "metadata": "root.Compression.__init__", "header": "['class', 'Compression', '(', 'Packaging', ')', ':', '___EOS___']", "index": 217 }, { "content": "class ZlibCompression(Compression):\n\n\n", "metadata": "root.ZlibCompression", "header": "['module', '___EOS___']", "index": 258 }, { "content": " def __init__(self):\n super(ZlibCompression, self).__init__(\"zlib\")", "metadata": "root.ZlibCompression.__init__", "header": "['class', 'ZlibCompression', '(', 'Compression', ')', ':', '___EOS___']", "index": 260 } ]
[]
[]
0
false
[ "[CLS]_", "Missing", "_", "call_", "to_", " _", "`_", "\\u\\u", "init\\u\\u_", "`_", "dur", "ing_", "object_", "initialization", "_", "[SEP]_", "class_", "Compress", "ion_", "(_", "Packa", "ging", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "compress", "ion", "\\u", "mechanism", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Compress", "ion_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "compress", "ion", "\\u", "mechanism", "_", "=_", "compress", "ion", "\\u", "mechanism", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Zl", "ib", "Compress", "ion_", "(_", "Compress", "ion_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Zl", "ib", "Compress", "ion_", "(_", "Compress", "ion_", ")_", ":_", "\\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 ", " _", "super_", "(_", "Zl", "ib", "Compress", "ion_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "\"", "zli", "b", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
larsyencken/anytop/anytop/top.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# top.py\n# anytop\n#\n\n\"\"\"\nLive updating frequency distributions on streaming data.\n\"\"\"\n\nimport os\nimport sys\nimport curses\nimport time\nimport threading\nimport heapq\nimport logging\nimport codecs\nimport locale\n\nimport click\n\nfrom anytop import (\n common,\n accumulate\n)\n\nlocale.setlocale(locale.LC_ALL, 'en_US.UTF-8')\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def anytop(win, istream=sys.stdin, n=None):\n \"Visualize the incoming lines by their distribution.\"\n if sys.version_info.major == 2:\n istream = codecs.getreader('utf8')(istream)\n common.init_win(win)\n if n:\n accumulator = accumulate.WindowAccumulator(n)\n else:\n accumulator = accumulate.Accumulator()\n lock = threading.Lock()\n logging.debug('Starting UI thread')\n ui = AnyTopUI(win, lock, accumulator)\n ui.start()\n\n try:\n for line in common.robust_line_iter(istream):\n if ui.error:\n return ui.error\n\n logging.debug('INPUT: requesting lock')\n lock.acquire()\n logging.debug('INPUT: lock acquired')\n accumulator.consume(line)\n lock.release()\n logging.debug('INPUT: lock released')\n\n logging.debug('INPUT: finished')\n\n # wait for CTRL-C\n # XXX we should display that the input was exhausted\n logging.debug('INPUT: exhausted')\n while True:\n time.sleep(3600)\n\n except KeyboardInterrupt:\n logging.debug('INPUT: got CTRL-C')\n ui.stop()\n ui.join()\n\n finally:\n ui.stop()\n ui.join()\n\n return ui.error", "metadata": "root.anytop", "header": "['module', '___EOS___']", "index": 31 }, { "content": "class AnyTopUI(threading.Thread):\n 'The ncurses user interface thread.'\n\n\n\n", "metadata": "root.AnyTopUI", "header": "['module', '___EOS___']", "index": 77 }, { "content": " def __init__(self, win, lock, accumulator):\n self.win = win\n self.acc = accumulator\n self.lock = lock\n self.error = None\n self._stop_event = threading.Event()\n super(AnyTopUI, self).__init__()", "metadata": "root.AnyTopUI.__init__", "header": "['class', 'AnyTopUI', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 79 }, { "content": " def stop(self):\n logging.debug('UI: flagged as stopped')\n self._stop_event.set()", "metadata": "root.AnyTopUI.stop", "header": "['class', 'AnyTopUI', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 87 }, { "content": " def stopped(self):\n return self._stop_event.is_set()", "metadata": "root.AnyTopUI.stopped", "header": "['class', 'AnyTopUI', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 91 }, { "content": " def run(self):\n try:\n while not self.stopped():\n logging.debug('UI: requesting lock')\n\n self.lock.acquire()\n logging.debug('UI: lock acquired')\n dist = self.acc.to_dist()\n logging.debug('UI: lock released')\n self.lock.release()\n\n self.refresh_display(dist)\n time.sleep(1)\n\n except Exception as e:\n self.lock.release()\n self.error = e\n return", "metadata": "root.AnyTopUI.run", "header": "['class', 'AnyTopUI', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 94 }, { "content": " def refresh_display(self, d):\n \"Redraw the screen with the current data.\"\n logging.debug('UI: refreshing the display')\n self.win.erase()\n height, width = self.win.getmaxyx()\n logging.debug('UI: size is %d x %d' % (width, height))\n\n n = len(d)\n s = sum(d.values())\n\n largest_keys = heapq.nlargest(min(n, height - 2), d, key=d.__getitem__)\n largest = [(d[l], l) for l in largest_keys]\n\n logging.debug('UI: redraw call')\n self.win.redrawwin()\n self.win.addstr(0, 0, '%d keys, %d counts' % (n, s))\n if largest:\n w = max(6, len(str(max(c for (c, k) in largest))))\n k_len = width - w - 4\n template = u' %%%dd %%s' % w\n for i, (c, k) in enumerate(largest):\n line = (template % (c, k[:k_len]))[:width]\n try:\n self.win.addstr(i + 2, 0, line.encode('utf8'))\n except:\n raise Exception(\"couldn't draw: '%s'\"\n % line.encode('utf8'))\n\n logging.debug('UI: refresh')\n self.win.refresh()", "metadata": "root.AnyTopUI.refresh_display", "header": "['class', 'AnyTopUI', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 113 }, { "content": "@click.command()\n@click.option('-l', '--window', type=int, default=None,\n help='Display stats for a rolling window of data.')\n@click.option('--debug', is_flag=True, help='Enable debug logging.')\ndef main(window=None, debug=False):\n \"\"\"\n Live updating frequency distributions on streaming data. Like top, but\n for any line-by-line input. Pipe data in on stdin, and watch it be counted\n in real-time.\n \"\"\"\n if debug:\n if os.path.exists('debug.log'):\n os.remove('debug.log')\n\n logging.basicConfig(filename='debug.log', level=logging.DEBUG)\n\n if window:\n err = curses.wrapper(anytop, n=window)\n else:\n err = curses.wrapper(anytop)\n\n if err:\n raise err", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 145 } ]
[]
[]
0
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_", "#", " ", " ", "top", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "anyt", "op_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Live", " ", "updat", "ing", " ", "freque", "nc", "y", " ", "distribu", "tion", "s", " ", "on", " ", "stream", "ing", " ", "data", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "curses_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "heapq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "click_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "anyt", "op_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "common_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accumulate", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "locale_", "._", "setlocal", "e_", "(_", "locale_", "._", "LC", "\\u", "ALL_", ",_", "'", "en", "\\u", "US", ".", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "anyt", "op_", "(_", "win_", ",_", "istr", "eam_", "=_", "sys_", "._", "stdin_", ",_", "n_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Visuali", "ze", " ", "the", " ", "inco", "ming", " ", "lines", " ", "by", " ", "thei", "r", " ", "distribu", "tion", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "._", "major_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "istr", "eam_", "=_", "codecs_", "._", "getre", "ader_", "(_", "'", "utf", "8", "'_", ")_", "(_", "istr", "eam_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common_", "._", "init", "\\u", "win_", "(_", "win_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accumulator_", "=_", "accumulate", "_", "._", "Window", "Accumulat", "or_", "(_", "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 ", " _", "accumulator_", "=_", "accumulate", "_", "._", "Accumulat", "or_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lock_", "=_", "threading_", "._", "Lock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "Start", "ing", " ", "UI", " ", "thread", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui_", "=_", "Any", "Top", "UI_", "(_", "win_", ",_", "lock_", ",_", "accumulator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "common_", "._", "robust", "\\u", "line", "\\u", "iter_", "(_", "istr", "eam_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ui_", "._", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ui_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "INPUT", ":", " ", "request", "ing", " ", "lock", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lock_", "._", "acquire_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "INPUT", ":", " ", "lock", " ", "acquired", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accumulator_", "._", "consume_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lock_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "INPUT", ":", " ", "lock", " ", "released", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "INPUT", ":", " ", "finish", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait", " ", "for", " ", "CTR", "L", "-", "C_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "we", " ", "shou", "ld", " ", "display", " ", "tha", "t", " ", "the", " ", "input", " ", "was", " ", "exhaust", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "INPUT", ":", " ", "exhaust", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "3600_", ")_", "\\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_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "'", "INPUT", ":", " ", "got", " ", "CTR", "L", "-", "C", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui_", "._", "join_", "(_", ")_", "\\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 ", " _", "ui_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ui_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Any", "Top", "UI_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "The", " ", "ncu", "rse", "s", " ", "user", " ", "interface", " ", "thread", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Any", "Top", "UI_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "win_", ",_", "lock_", ",_", "accumulator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "win_", "=_", "win_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "acc_", "=_", "accumulator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lock_", "=_", "lock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stop", "\\u", "event_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Any", "Top", "UI_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Any", "Top", "UI_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "flagged", " ", "as", " ", "stopp", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stop", "\\u", "event_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Any", "Top", "UI_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stopped_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "stop", "\\u", "event_", "._", "is", "\\u", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Any", "Top", "UI_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "not_", "self_", "._", "stopped_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "request", "ing", " ", "lock", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lock_", "._", "acquire_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "lock", " ", "acquired", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dist_", "=_", "self_", "._", "acc_", "._", "to", "\\u", "dist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "lock", " ", "released", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lock_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "refre", "sh", "\\u", "display_", "(_", "dist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "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_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lock_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Any", "Top", "UI_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refre", "sh", "\\u", "display_", "(_", "self_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Red", "raw", " ", "the", " ", "screen", " ", "with", " ", "the", " ", "current", " ", "data", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "refre", "shing", " ", "the", " ", "display", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "win_", "._", "erase_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "height_", ",_", "width_", "=_", "self_", "._", "win_", "._", "getma", "xy", "x_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "size", " ", "is", " ", "%", "d", " ", "x", " ", "%", "d", "'_", "%_", "(_", "width_", ",_", "height_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n_", "=_", "len_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "sum_", "(_", "d_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "large", "st", "\\u", "keys_", "=_", "heapq_", "._", "nla", "rge", "st_", "(_", "min_", "(_", "n_", ",_", "height_", "-_", "2_", ")_", ",_", "d_", ",_", "key_", "=_", "d_", "._", "\\u\\u", "getitem\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "large", "st_", "=_", "[_", "(_", "d_", "[_", "l_", "]_", ",_", "l_", ")_", "for_", "l_", "in_", "large", "st", "\\u", "keys_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "redraw", " ", "call", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "win_", "._", "redraw", "win_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "win_", "._", "addstr_", "(_", "0_", ",_", "0_", ",_", "'%", "d", " ", "keys", ",", " ", "%", "d", " ", "count", "s", "'_", "%_", "(_", "n_", ",_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "large", "st_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "max_", "(_", "6_", ",_", "len_", "(_", "str_", "(_", "max_", "(_", "c_", "for_", "(_", "c_", ",_", "k_", ")_", "in_", "large", "st_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k", "\\u", "len_", "=_", "width_", "-_", "w_", "-_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "u", "'", " ", "%%%", "dd", " ", " ", "%%", "s", "'_", "%_", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "(_", "c_", ",_", "k_", ")_", "in_", "enumerate_", "(_", "large", "st_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "(_", "template_", "%_", "(_", "c_", ",_", "k_", "[_", ":_", "k", "\\u", "len_", "]_", ")_", ")_", "[_", ":_", "width_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "win_", "._", "addstr_", "(_", "i_", "+_", "2_", ",_", "0_", ",_", "line_", "._", "encode_", "(_", "'", "utf", "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 ", " ", "_", "raise_", "Exception_", "(_", "\"", "coul", "dn", "'", "t", " ", "draw", ":", " ", "'%", "s", "'\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "line_", "._", "encode_", "(_", "'", "utf", "8", "'_", ")_", ")_", "\\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_", "logging_", "._", "debug_", "(_", "'", "UI", ":", " ", "refre", "sh", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "win_", "._", "refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "click_", "._", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "click_", "._", "option_", "(_", "'-", "l", "'_", ",_", "'--", "window", "'_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Display", " ", "stats", " ", "for", " ", "a", " ", "rolling", " ", "window", " ", "of", " ", "data", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "click_", "._", "option_", "(_", "'--", "debug", "'_", ",_", "is", "\\u", "flag_", "=_", "True_", ",_", "help_", "=_", "'", "Enable", " ", "debug", " ", "logg", "ing", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "main_", "(_", "window_", "=_", "None_", ",_", "debug_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Live", " ", "updat", "ing", " ", "freque", "nc", "y", " ", "distribu", "tion", "s", " ", "on", " ", "stream", "ing", " ", "data", ".", " ", "Lik", "e", " ", "top", ",", " ", "but", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "any", " ", "line", "-", "by", "-", "line", " ", "input", ".", " ", "Pipe", " ", "data", " ", "in", " ", "on", " ", "std", "in", ",", " ", "and", " ", "watch", " ", "it", " ", "be", " ", "counted", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "real", "-", "time", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "exists_", "(_", "'", "debug", ".", "log", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "'", "debug", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "filename_", "=_", "'", "debug", ".", "log", "'_", ",_", "level_", "=_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "window_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err_", "=_", "curses_", "._", "wrapper_", "(_", "anyt", "op_", ",_", "n_", "=_", "window_", ")_", "\\u\\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_", "=_", "curses_", "._", "wrapper_", "(_", "anyt", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "err_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
iron-io/iron_worker_python/iron_worker.py
[ { "content": "class Task:\n id = None\n project = None\n code_id = None\n code_history_id = None\n schedule_id = None\n status = None\n code_name = None\n code_rev = None\n created_at = None\n updated_at = None\n start_time = None\n end_time = None\n duration = None\n timeout = 3600\n message = None\n delay = 0\n start_at = None\n end_at = None\n next_start = None\n last_run_time = None\n run_times = None\n run_count = None\n run_every = None\n percent = None\n payload = None\n priority = 0\n label = None\n cluster = None\n\n scheduled = False\n repeating = False\n\n __json_attrs = [\"payload\"]\n __rfc3339_attrs = [\"created_at\", \"updated_at\", \"start_at\", \"end_at\",\n \"next_start\", \"last_run_time\"]\n __timestamp_attrs = [\"start_time\", \"end_time\"]\n __schedule_attrs = [\"start_at\", \"end_at\", \"next_start\", \"last_run_time\",\n \"run_count\", \"run_every\"]\n __repeating_attrs = [\"end_at\", \"next_start\", \"run_every\"]\n __aliases = {\n \"project\": \"project_id\",\n \"msg\": \"message\"\n }\n __ignore = [\"message\"]\n\n\n\n", "metadata": "root.Task", "header": "['module', '___EOS___']", "index": 30 } ]
[]
[]
0
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_", "class_", "Task_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code", "\\u", "histo", "ry", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "schedule", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code", "\\u", "rev_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created", "\\u", "at_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "d\\u", "at_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "time_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timeout_", "=_", "3600_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delay_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "at_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "at_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "start_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "run", "\\u", "time_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "times_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "count_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "every_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priority_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cluster_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "schedule", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repeatin", "g_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "json", "\\u", "attrs_", "=_", "[_", "\"", "payload", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "rfc", "333", "9", "\\u", "attrs_", "=_", "[_", "\"", "created", "\\u", "at", "\"_", ",_", "\"", "update", "d\\u", "at", "\"_", ",_", "\"", "start", "\\u", "at", "\"_", ",_", "\"", "end", "\\u", "at", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "next", "\\u", "start", "\"_", ",_", "\"", "last", "\\u", "run", "\\u", "time", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "timestamp", "\\u", "attrs_", "=_", "[_", "\"", "start", "\\u", "time", "\"_", ",_", "\"", "end", "\\u", "time", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "schedule", "\\u", "attrs_", "=_", "[_", "\"", "start", "\\u", "at", "\"_", ",_", "\"", "end", "\\u", "at", "\"_", ",_", "\"", "next", "\\u", "start", "\"_", ",_", "\"", "last", "\\u", "run", "\\u", "time", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "run", "\\u", "count", "\"_", ",_", "\"", "run", "\\u", "every", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "repeatin", "g", "\\u", "attrs_", "=_", "[_", "\"", "end", "\\u", "at", "\"_", ",_", "\"", "next", "\\u", "start", "\"_", ",_", "\"", "run", "\\u", "every", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "aliases_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\"_", ":_", "\"", "project", "\\u", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "msg", "\"_", ":_", "\"", "message", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "ignore_", "=_", "[_", "\"", "message", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
frankban/django-endless-pagination/endless_pagination/tests/integration/test_digg.py
[ { "content": " def test_no_next_link_in_last_page(self):\n # Ensure there is no forward link on the last page.\n self.get(page=10)\n self.asserLinksEqual(0, self.NEXT)", "metadata": "root.DiggPaginationTest.test_no_next_link_in_last_page", "header": "['class', 'DiggPaginationTest', '(', 'SeleniumTestCase', ')', ':', '___EOS___']", "index": 48 } ]
[]
[]
0
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Dig", "g", "Pagination", "Test_", "(_", "Selen", "ium", "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", "next", "\\u", "link", "\\u", "in", "\\u", "last", "\\u", "page_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "there", " ", "is", " ", "no", " ", "forward", " ", "link", " ", "on", " ", "the", " ", "last", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "get_", "(_", "page_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ass", "er", "Link", "s", "Equal_", "(_", "0_", ",_", "self_", "._", "NEXT", "_", ")_" ]
[ 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 ]
Unused local variable
ferventdesert/tnpy/src/tngraph.py
[ { "content": "def addNode(A,entity,nodes):\n nodeid= id(entity);\n name= str(entity);\n if nodeid not in nodes:\n A.add_node(name);\n nodes[nodeid]=entity;\n if isinstance(entity, SQE):\n for child in entity.MatchEntities:\n addNode(A,child,nodes);\n A.add_edge(name,str(child));\n for child in entity.RewriteEntities:\n addNode(A,child,nodes);\n A.add_edge(name,str(child));\n elif isinstance(entity, TE):\n for child in entity.Tables:\n addNode(A,child,nodes);\n A.add_edge(name,str(child));\n\n\n\n A.add_node(entity)", "metadata": "root.addNode", "header": "['module', '___EOS___']", "index": 10 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "add", "Node_", "(_", "A_", ",_", "entity_", ",_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nodeid_", "=_", "id_", "(_", "entity_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "str_", "(_", "entity_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "nodeid_", "not_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "._", "add", "\\u", "node_", "(_", "name_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "[_", "nodeid_", "]_", "=_", "entity_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "entity_", ",_", "SQ", "E_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "child_", "in_", "entity_", "._", "Match", "Entities_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "Node_", "(_", "A_", ",_", "child_", ",_", "nodes_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "add", "\\u", "edge_", "(_", "name_", ",_", "str_", "(_", "child_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "child_", "in_", "entity_", "._", "Rewrite", "Entities_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "Node_", "(_", "A_", ",_", "child_", ",_", "nodes_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "add", "\\u", "edge_", "(_", "name_", ",_", "str_", "(_", "child_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "entity_", ",_", "TE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "child_", "in_", "entity_", "._", "Tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "Node_", "(_", "A_", ",_", "child_", ",_", "nodes_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "._", "add", "\\u", "edge_", "(_", "name_", ",_", "str_", "(_", "child_", ")_", ")_", ";_", "\\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_", "A_", "._", "add", "\\u", "node_", "(_", "entity_", ")_", "\\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 ]
Except block handles 'BaseException'
dustin/py-github/github/github.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright (c) 2005-2008 Dustin Sallings <dustin@spy.net>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n#\n# <http://www.opensource.org/licenses/mit-license.php>\n\"\"\"\nInterface to github's API (v2).\n\nBasic usage:\n\ng = GitHub()\n\nfor r in g.user.search('dustin'):\n print r.name\n\nSee the GitHub docs or README.markdown for more usage.\n\nCopyright (c) 2007 Dustin Sallings <dustin@spy.net>\n\"\"\"\n\nimport sys\nimport xml\nimport xml.dom.minidom\n\ntry: import simplejson as json\nexcept ImportError: import json\n\nfrom urllib import urlencode\n\nimport hclient\n\n\n_types = {\n 'string': _string_parser,\n 'integer': lambda x: int(_string_parser(x)),\n 'float': lambda x: float(_string_parser(x)),\n 'datetime': _string_parser,\n 'boolean': lambda x: _string_parser(x) == 'true'\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Load the known types.\nfor __t in (t for t in list(globals().values()) if hasattr(t, 'parses')):\n _types[__t.parses] = __t\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2005", "-", "2008", " ", " ", "Du", "stin", " ", "Sal", "ling", "s", " ", "<", "dust", "in", "@", "spy", ".", "net", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "http", "://", "www", ".", "opens", "ource", ".", "org", "/", "license", "s", "/", "mit", "-", "license", ".", "php", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Interface", " ", "to", " ", "git", "hub", "'", "s", " ", "API", " ", "(", "v2", ").", "\\", "10", ";", "\\", "10", ";", "Basic", " ", "usage", ":", "\\", "10", ";", "\\", "10", ";", "g", " ", "=", " ", "Git", "Hub", "()", "\\", "10", ";", "\\", "10", ";", "for", " ", "r", " ", "in", " ", "g", ".", "user", ".", "search", "('", "dust", "in", "')", ":", "\\", "10", ";", " ", " ", " ", " ", "print", " ", "r", ".", "name", "\\", "10", ";", "\\", "10", ";", "See", " ", "the", " ", "Git", "Hub", " ", "docs", " ", "or", " ", "READ", "ME", ".", "mark", "down", " ", "for", " ", "more", " ", "usage", ".", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2007", " ", " ", "Du", "stin", " ", "Sal", "ling", "s", " ", "<", "dust", "in", "@", "spy", ".", "net", ">", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xml_", "._", "dom_", "._", "minidom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Import", "Error_", ":_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "urllib_", "import_", "urlencode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "hc", "lient_", "\\u\\u\\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", "types_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "string", "'_", ":_", "\\u", "string", "\\u", "parser_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "integ", "er", "'_", ":_", "lambda_", "x_", ":_", "int_", "(_", "\\u", "string", "\\u", "parser_", "(_", "x_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "float", "'_", ":_", "lambda_", "x_", ":_", "float_", "(_", "\\u", "string", "\\u", "parser_", "(_", "x_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "datetime", "'_", ":_", "\\u", "string", "\\u", "parser_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "boolean", "'_", ":_", "lambda_", "x_", ":_", "\\u", "string", "\\u", "parser_", "(_", "x_", ")_", "==_", "'", "true", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "the", " ", "know", "n", " ", "types", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "\\u\\u", "t_", "in_", "(_", "t_", "for_", "t_", "in_", "list_", "(_", "globals_", "(_", ")_", "._", "values_", "(_", ")_", ")_", "if_", "hasattr_", "(_", "t_", ",_", "'", "parse", "s", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "types_", "[_", "\\u\\u", "t_", "._", "parse", "s_", "]_", "=_", "\\u\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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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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 ]
First parameter of a method is not named 'self'
ImageEngine/gaffer/python/GafferAppleseed/AppleseedRender.py
[ { "content": "\tdef _createRenderer( self ) :\n\n\t\tfileName = self[\"fileName\"].getValue()\n\t\tdirectory = os.path.dirname( fileName )\n\t\tif directory :\n\t\t\tself._makeDir( directory )\n\n\t\trenderer = IECoreAppleseed.Renderer( fileName )\n\t\treturn renderer", "metadata": "root.AppleseedRender._createRenderer", "header": "['class', 'AppleseedRender', '(', 'GafferScene', '.', 'ExecutableRender', ')', ':', '___EOS___']", "index": 82 } ]
[]
[]
0
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Apple", "seed", "Render_", "(_", "Ga", "ffer", "Scene_", "._", "Executable", "Render_", ")_", ":_", "\\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", "create", "Renderer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "file", "Name_", "=_", "self_", "[_", "\"", "file", "Name", "\"_", "]_", "._", "get", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "directory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "\\u", "make", "Dir_", "(_", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "renderer_", "=_", "IE", "Core", "Apple", "seed_", "._", "Renderer_", "(_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "renderer_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ericholscher/django-test-utils/test_utils/urls.py
[ { "content": "from django.conf.urls.defaults import *\n\nimport test_utils.views as test_views\n\nurlpatterns = patterns('',\n url(r'^set_logging/(?P<filename>.*?)/',\n test_views.set_logging,\n name='test_utils_set_logging'),\n url(r'^set_logging/',\n test_views.set_logging,\n name='test_utils_set_logging'),\n url(r'^show_log/',\n test_views.show_log,\n name='test_utils_show_log'),\n )\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "conf_", "._", "urls_", "._", "defaults_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "test\\u", "utils_", "._", "views_", "as_", "test\\u", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urlpatterns_", "=_", "patterns_", "(_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "set\\u", "logg", "ing", "/(", "?", "P", "<", "filename", ">.*?", ")/", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "views_", "._", "set\\u", "logging_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "test\\u", "util", "s", "\\u", "set\\u", "logg", "ing", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "set\\u", "logg", "ing", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "views_", "._", "set\\u", "logging_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "test\\u", "util", "s", "\\u", "set\\u", "logg", "ing", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "show", "\\u", "log", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "views_", "._", "show", "\\u", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "test\\u", "util", "s", "\\u", "show", "\\u", "log", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
ganeti/ganeti/lib/vcluster.py
[ { "content": "def _RemoveNodePrefix(path, _noderoot=_VIRT_NODEROOT):\n \"\"\"Removes the node-specific prefix from a path.\n\n This is the opposite of L{AddNodePrefix} and removes a node-local prefix\n path.\n\n \"\"\"\n assert os.path.isabs(path), \"Path not absolute: \" + path\n\n norm_path = os.path.normpath(path)\n\n if _noderoot:\n # Make sure path is actually below node root\n norm_root = os.path.normpath(_noderoot)\n root_with_sep = \"%s%s\" % (norm_root, os.sep)\n prefix = os.path.commonprefix([root_with_sep, norm_path])\n\n if prefix == root_with_sep:\n result = norm_path[len(norm_root):]\n else:\n raise RuntimeError(\"Path '%s' is not below node root '%s'\" %\n (path, _noderoot))\n else:\n result = norm_path\n\n assert os.path.isabs(result), \"Path not absolute: \" + path\n\n return result", "metadata": "root._RemoveNodePrefix", "header": "['module', '___EOS___']", "index": 214 } ]
[]
[]
0
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_", "\\u", "Remove", "Node", "Prefix_", "(_", "path_", ",_", "\\u", "node", "root_", "=_", "\\u", "VIR", "T", "\\u", "NODE", "ROOT_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", "s", " ", "the", " ", "node", "-", "specific", " ", "prefix", " ", "from", " ", "a", " ", "path", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "opposite", " ", "of", " ", "L", "{", "Add", "Node", "Pref", "ix", "}", " ", "and", " ", "remove", "s", " ", "a", " ", "node", "-", "local", " ", "prefix", "\\", "10", ";", " ", " ", "path", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "isabs_", "(_", "path_", ")_", ",_", "\"", "Path", " ", "not", " ", "abs", "olute", ":", " ", "\"_", "+_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "norm", "\\u", "path_", "=_", "os_", "._", "path_", "._", "normpath_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "node", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "path", " ", "is", " ", "actual", "ly", " ", "belo", "w", " ", "node", " ", "root_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "norm", "\\u", "root_", "=_", "os_", "._", "path_", "._", "normpath_", "(_", "\\u", "node", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "\\u", "with", "\\u", "sep_", "=_", "\"%", "s", "%", "s", "\"_", "%_", "(_", "norm", "\\u", "root_", ",_", "os_", "._", "sep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "os_", "._", "path_", "._", "common", "prefix_", "(_", "[_", "root", "\\u", "with", "\\u", "sep_", ",_", "norm", "\\u", "path_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "prefix_", "==_", "root", "\\u", "with", "\\u", "sep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "norm", "\\u", "path_", "[_", "len_", "(_", "norm", "\\u", "root_", ")_", ":_", "]_", "\\u\\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_", "(_", "\"", "Path", " ", "'%", "s", "'", " ", "is", " ", "not", " ", "belo", "w", " ", "node", " ", "root", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "path_", ",_", "\\u", "node", "root_", ")_", ")_", "\\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 ", " _", "result_", "=_", "norm", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "isabs_", "(_", "result_", ")_", ",_", "\"", "Path", " ", "not", " ", "abs", "olute", ":", " ", "\"_", "+_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jdf/processing.py/mode/formatter/autopep8.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright (C) 2010-2011 Hideo Hattori\n# Copyright (C) 2011-2013 Hideo Hattori, Steven Myint\n# Copyright (C) 2013-2014 Hideo Hattori, Steven Myint, Bill Wendling\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\n# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n\n\"\"\"Automatically formats Python code to conform to the PEP 8 style guide.\n\nFixes that only need be done once can be added by adding a function of the form\n\"fix_<code>(source)\" to this module. They should return the fixed source code.\nThese fixes are picked up by apply_global_fixes().\n\nFixes that depend on pep8 should be added as methods to FixPEP8. See the class\ndocumentation for more information.\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport bisect\nimport codecs\nimport collections\nimport copy\nimport difflib\nimport fnmatch\nimport inspect\nimport io\nimport itertools\nimport keyword\nimport locale\nimport os\nimport re\nimport signal\nimport sys\nimport token\nimport tokenize\n\nimport pep8\n\n\ntry:\n unicode\nexcept NameError:\n unicode = str\n\n\n__version__ = '1.0.1a0'\n\n\nCR = '\\r'\nLF = '\\n'\nCRLF = '\\r\\n'\n\n\nPYTHON_SHEBANG_REGEX = re.compile(r'^#!.*\\bpython[23]?\\b\\s*$')\n\n\n# For generating line shortening candidates.\nSHORTEN_OPERATOR_GROUPS = frozenset([\n frozenset([',']),\n frozenset(['%']),\n frozenset([',', '(', '[', '{']),\n frozenset(['%', '(', '[', '{']),\n frozenset([',', '(', '[', '{', '%', '+', '-', '*', '/', '//']),\n frozenset(['%', '+', '-', '*', '/', '//']),\n])\n\n\nDEFAULT_IGNORE = 'E24'\nDEFAULT_INDENT_SIZE = 4\n\n\n# W602 is handled separately due to the need to avoid \"with_traceback\".\nCODE_TO_2TO3 = {\n 'E721': ['idioms'],\n 'W601': ['has_key'],\n 'W603': ['ne'],\n 'W604': ['repr'],\n 'W690': ['apply',\n 'except',\n 'exitfunc',\n 'import',\n 'numliterals',\n 'operator',\n 'paren',\n 'reduce',\n 'renames',\n 'standarderror',\n 'sys_exc',\n 'throw',\n 'tuple_params',\n 'xreadlines']}\n\n\n\n\n\n\n\n\npep8.register_check(extended_blank_lines)\n\n\ndel pep8._checks['logical_line'][pep8.continued_indentation]\npep8.register_check(continued_indentation)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# A convenient way to handle tokens.\nToken = collections.namedtuple('Token', ['token_type', 'token_string',\n 'spos', 'epos', 'line'])\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_cached_tokenizer = CachedTokenizer()\ngenerate_tokens = _cached_tokenizer.generate_tokens\n\n\nif __name__ == '__main__':\n sys.exit(main())", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def open_with_encoding(filename, encoding=None, mode='r'):\n \"\"\"Return opened file with a specific encoding.\"\"\"\n if not encoding:\n encoding = detect_encoding(filename)\n\n return io.open(filename, mode=mode, encoding=encoding,\n newline='') # Preserve line endings", "metadata": "root.open_with_encoding", "header": "['module', '___EOS___']", "index": 117 }, { "content": "def detect_encoding(filename):\n \"\"\"Return file encoding.\"\"\"\n return 'utf-8' # modified for processing.py", "metadata": "root.detect_encoding", "header": "['module', '___EOS___']", "index": 126 }, { "content": "def readlines_from_file(filename):\n \"\"\"Return contents of file.\"\"\"\n with open_with_encoding(filename) as input_file:\n return input_file.readlines()", "metadata": "root.readlines_from_file", "header": "['module', '___EOS___']", "index": 131 }, { "content": "def extended_blank_lines(logical_line,\n blank_lines,\n indent_level,\n previous_logical):\n \"\"\"Check for missing blank lines after class declaration.\"\"\"\n if previous_logical.startswith('class '):\n if (\n logical_line.startswith(('def ', 'class ', '@')) or\n pep8.DOCSTRING_REGEX.match(logical_line)\n ):\n if indent_level and not blank_lines:\n yield (0, 'E309 expected 1 blank line after class declaration')\n elif previous_logical.startswith('def '):\n if blank_lines and pep8.DOCSTRING_REGEX.match(logical_line):\n yield (0, 'E303 too many blank lines ({0})'.format(blank_lines))\n elif pep8.DOCSTRING_REGEX.match(previous_logical):\n # Missing blank line between class docstring and method declaration.\n if (\n indent_level and\n not blank_lines and\n logical_line.startswith(('def ')) and\n '(self' in logical_line\n ):\n yield (0, 'E301 expected 1 blank line, found 0')", "metadata": "root.extended_blank_lines", "header": "['module', '___EOS___']", "index": 137 }, { "content": "def continued_indentation(logical_line, tokens, indent_level, indent_char,\n noqa):\n \"\"\"Override pep8's function to provide indentation information.\"\"\"\n first_row = tokens[0][2][0]\n nrows = 1 + tokens[-1][2][0] - first_row\n if noqa or nrows == 1:\n return\n\n # indent_next tells us whether the next block is indented. Assuming\n # that it is indented by 4 spaces, then we should not allow 4-space\n # indents on the final continuation line. In turn, some other\n # indents are allowed to have an extra 4 spaces.\n indent_next = logical_line.endswith(':')\n\n row = depth = 0\n valid_hangs = (\n (DEFAULT_INDENT_SIZE,)\n if indent_char != '\\t' else (DEFAULT_INDENT_SIZE,\n 2 * DEFAULT_INDENT_SIZE)\n )\n\n # Remember how many brackets were opened on each line.\n parens = [0] * nrows\n\n # Relative indents of physical lines.\n rel_indent = [0] * nrows\n\n # For each depth, collect a list of opening rows.\n open_rows = [[0]]\n # For each depth, memorize the hanging indentation.\n hangs = [None]\n\n # Visual indents.\n indent_chances = {}\n last_indent = tokens[0][2]\n indent = [last_indent[1]]\n\n last_token_multiline = None\n line = None\n last_line = ''\n last_line_begins_with_multiline = False\n for token_type, text, start, end, line in tokens:\n\n newline = row < start[0] - first_row\n if newline:\n row = start[0] - first_row\n newline = (not last_token_multiline and\n token_type not in (tokenize.NL, tokenize.NEWLINE))\n last_line_begins_with_multiline = last_token_multiline\n\n if newline:\n # This is the beginning of a continuation line.\n last_indent = start\n\n # Record the initial indent.\n rel_indent[row] = pep8.expand_indent(line) - indent_level\n\n # Identify closing bracket.\n close_bracket = (token_type == tokenize.OP and text in ']})')\n\n # Is the indent relative to an opening bracket line?\n for open_row in reversed(open_rows[depth]):\n hang = rel_indent[row] - rel_indent[open_row]\n hanging_indent = hang in valid_hangs\n if hanging_indent:\n break\n if hangs[depth]:\n hanging_indent = (hang == hangs[depth])\n\n visual_indent = (not close_bracket and hang > 0 and\n indent_chances.get(start[1]))\n\n if close_bracket and indent[depth]:\n # Closing bracket for visual indent.\n if start[1] != indent[depth]:\n yield (start, 'E124 {0}'.format(indent[depth]))\n elif close_bracket and not hang:\n pass\n elif indent[depth] and start[1] < indent[depth]:\n # Visual indent is broken.\n yield (start, 'E128 {0}'.format(indent[depth]))\n elif (hanging_indent or\n (indent_next and\n rel_indent[row] == 2 * DEFAULT_INDENT_SIZE)):\n # Hanging indent is verified.\n if close_bracket:\n yield (start, 'E123 {0}'.format(indent_level +\n rel_indent[open_row]))\n hangs[depth] = hang\n elif visual_indent is True:\n # Visual indent is verified.\n indent[depth] = start[1]\n elif visual_indent in (text, unicode):\n # Ignore token lined up with matching one from a previous line.\n pass\n else:\n one_indented = (indent_level + rel_indent[open_row] +\n DEFAULT_INDENT_SIZE)\n # Indent is broken.\n if hang <= 0:\n error = ('E122', one_indented)\n elif indent[depth]:\n error = ('E127', indent[depth])\n elif hang > DEFAULT_INDENT_SIZE:\n error = ('E126', one_indented)\n else:\n hangs[depth] = hang\n error = ('E121', one_indented)\n\n yield (start, '{0} {1}'.format(*error))\n\n # Look for visual indenting.\n if (parens[row] and token_type not in (tokenize.NL, tokenize.COMMENT)\n and not indent[depth]):\n indent[depth] = start[1]\n indent_chances[start[1]] = True\n # Deal with implicit string concatenation.\n elif (token_type in (tokenize.STRING, tokenize.COMMENT) or\n text in ('u', 'ur', 'b', 'br')):\n indent_chances[start[1]] = unicode\n # Special case for the \"if\" statement because len(\"if (\") is equal to\n # 4.\n elif not indent_chances and not row and not depth and text == 'if':\n indent_chances[end[1] + 1] = True\n elif text == ':' and line[end[1]:].isspace():\n open_rows[depth].append(row)\n\n # Keep track of bracket depth.\n if token_type == tokenize.OP:\n if text in '([{':\n depth += 1\n indent.append(0)\n hangs.append(None)\n if len(open_rows) == depth:\n open_rows.append([])\n open_rows[depth].append(row)\n parens[row] += 1\n elif text in ')]}' and depth > 0:\n # Parent indents should not be more than this one.\n prev_indent = indent.pop() or last_indent[1]\n hangs.pop()\n for d in range(depth):\n if indent[d] > prev_indent:\n indent[d] = 0\n for ind in list(indent_chances):\n if ind >= prev_indent:\n del indent_chances[ind]\n del open_rows[depth + 1:]\n depth -= 1\n if depth:\n indent_chances[indent[depth]] = True\n for idx in range(row, -1, -1):\n if parens[idx]:\n parens[idx] -= 1\n break\n assert len(indent) == depth + 1\n if (\n start[1] not in indent_chances and\n # This is for purposes of speeding up E121 (GitHub #90).\n not last_line.rstrip().endswith(',')\n ):\n # Allow to line up tokens.\n indent_chances[start[1]] = text\n\n last_token_multiline = (start[0] != end[0])\n if last_token_multiline:\n rel_indent[end[0] - first_row] = rel_indent[row]\n\n last_line = line\n\n if (\n indent_next and\n not last_line_begins_with_multiline and\n pep8.expand_indent(line) == indent_level + DEFAULT_INDENT_SIZE\n ):\n pos = (start[0], indent[0] + 4)\n yield (pos, 'E125 {0}'.format(indent_level +\n 2 * DEFAULT_INDENT_SIZE))", "metadata": "root.continued_indentation", "header": "['module', '___EOS___']", "index": 164 }, { "content": "class FixPEP8(object):\n\n \"\"\"Fix invalid code.\n\n Fixer methods are prefixed \"fix_\". The _fix_source() method looks for these\n automatically.\n\n The fixer method can take either one or two arguments (in addition to\n self). The first argument is \"result\", which is the error information from\n pep8. The second argument, \"logical\", is required only for logical-line\n fixes.\n\n The fixer method can return the list of modified lines or None. An empty\n list would mean that no changes were made. None would mean that only the\n line reported in the pep8 error was modified. Note that the modified line\n numbers that are returned are indexed at 1. This typically would correspond\n with the line number reported in the pep8 error information.\n\n [fixed method list]\n - e121,e122,e123,e124,e125,e126,e127,e128,e129\n - e201,e202,e203\n - e211\n - e221,e222,e223,e224,e225\n - e231\n - e251\n - e261,e262\n - e271,e272,e273,e274\n - e301,e302,e303\n - e401\n - e502\n - e701,e702\n - e711\n - w291\n\n \"\"\"\n\n\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.FixPEP8", "header": "['module', '___EOS___']", "index": 346 }, { "content": " def __init__(self, filename,\n options,\n contents=None,\n long_line_ignore_cache=None):\n self.filename = filename\n if contents is None:\n self.source = readlines_from_file(filename)\n else:\n sio = io.StringIO(contents)\n self.source = sio.readlines()\n self.options = options\n self.indent_word = _get_indentword(''.join(self.source))\n\n self.long_line_ignore_cache = (\n set() if long_line_ignore_cache is None\n else long_line_ignore_cache)\n\n # Many fixers are the same even though pep8 categorizes them\n # differently.\n self.fix_e121 = self._fix_reindent\n self.fix_e122 = self._fix_reindent\n self.fix_e123 = self._fix_reindent\n self.fix_e124 = self._fix_reindent\n self.fix_e126 = self._fix_reindent\n self.fix_e127 = self._fix_reindent\n self.fix_e128 = self._fix_reindent\n self.fix_e129 = self._fix_reindent\n self.fix_e202 = self.fix_e201\n self.fix_e203 = self.fix_e201\n self.fix_e211 = self.fix_e201\n self.fix_e221 = self.fix_e271\n self.fix_e222 = self.fix_e271\n self.fix_e223 = self.fix_e271\n self.fix_e226 = self.fix_e225\n self.fix_e227 = self.fix_e225\n self.fix_e228 = self.fix_e225\n self.fix_e241 = self.fix_e271\n self.fix_e242 = self.fix_e224\n self.fix_e261 = self.fix_e262\n self.fix_e272 = self.fix_e271\n self.fix_e273 = self.fix_e271\n self.fix_e274 = self.fix_e271\n self.fix_e309 = self.fix_e301\n self.fix_e501 = (\n self.fix_long_line_logically if\n options and (options.aggressive >= 2 or options.experimental) else\n self.fix_long_line_physically)\n self.fix_e703 = self.fix_e702\n\n self._ws_comma_done = False", "metadata": "root.FixPEP8.__init__", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 382 }, { "content": " def _fix_source(self, results):\n try:\n (logical_start, logical_end) = _find_logical(self.source)\n logical_support = True\n except (SyntaxError, tokenize.TokenError): # pragma: no cover\n logical_support = False\n\n completed_lines = set()\n for result in sorted(results, key=_priority_key):\n if result['line'] in completed_lines:\n continue\n\n fixed_methodname = 'fix_' + result['id'].lower()\n if hasattr(self, fixed_methodname):\n fix = getattr(self, fixed_methodname)\n\n line_index = result['line'] - 1\n original_line = self.source[line_index]\n\n is_logical_fix = len(inspect.getargspec(fix).args) > 2\n if is_logical_fix:\n logical = None\n if logical_support:\n logical = _get_logical(self.source,\n result,\n logical_start,\n logical_end)\n if logical and set(range(\n logical[0][0] + 1,\n logical[1][0] + 1)).intersection(\n completed_lines):\n continue\n\n modified_lines = fix(result, logical)\n else:\n modified_lines = fix(result)\n\n if modified_lines is None:\n # Force logical fixes to report what they modified.\n assert not is_logical_fix\n\n if self.source[line_index] == original_line:\n modified_lines = []\n\n if modified_lines:\n completed_lines.update(modified_lines)\n elif modified_lines == []: # Empty list means no fix\n if self.options.verbose >= 2:\n print(\n '---> Not fixing {f} on line {l}'.format(\n f=result['id'], l=result['line']),\n file=sys.stderr)\n else: # We assume one-line fix when None.\n completed_lines.add(result['line'])\n else:\n if self.options.verbose >= 3:\n print(\n \"---> '{0}' is not defined.\".format(fixed_methodname),\n file=sys.stderr)\n\n info = result['info'].strip()\n print('---> {0}:{1}:{2}:{3}'.format(self.filename,\n result['line'],\n result['column'],\n info),\n file=sys.stderr)", "metadata": "root.FixPEP8._fix_source", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 433 }, { "content": " def fix(self):\n \"\"\"Return a version of the source code with PEP 8 violations fixed.\"\"\"\n pep8_options = {\n 'ignore': self.options.ignore,\n 'select': self.options.select,\n 'max_line_length': self.options.max_line_length,\n }\n results = _execute_pep8(pep8_options, self.source)\n\n if self.options.verbose:\n progress = {}\n for r in results:\n if r['id'] not in progress:\n progress[r['id']] = set()\n progress[r['id']].add(r['line'])\n print('---> {n} issue(s) to fix {progress}'.format(\n n=len(results), progress=progress), file=sys.stderr)\n\n if self.options.line_range:\n start, end = self.options.line_range\n results = [r for r in results\n if start <= r['line'] <= end]\n\n self._fix_source(filter_results(source=''.join(self.source),\n results=results,\n aggressive=self.options.aggressive))\n\n if self.options.line_range:\n # If number of lines has changed then change line_range.\n count = sum(sline.count('\\n')\n for sline in self.source[start - 1:end])\n self.options.line_range[1] = start + count - 1\n\n return ''.join(self.source)", "metadata": "root.FixPEP8.fix", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 500 }, { "content": " def _fix_reindent(self, result):\n \"\"\"Fix a badly indented line.\n\n This is done by adding or removing from its initial indent only.\n\n \"\"\"\n num_indent_spaces = int(result['info'].split()[1])\n line_index = result['line'] - 1\n target = self.source[line_index]\n\n self.source[line_index] = ' ' * num_indent_spaces + target.lstrip()", "metadata": "root.FixPEP8._fix_reindent", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 535 }, { "content": " def fix_e125(self, result):\n \"\"\"Fix indentation undistinguish from the next logical line.\"\"\"\n num_indent_spaces = int(result['info'].split()[1])\n line_index = result['line'] - 1\n target = self.source[line_index]\n\n spaces_to_add = num_indent_spaces - len(_get_indentation(target))\n indent = len(_get_indentation(target))\n modified_lines = []\n\n while len(_get_indentation(self.source[line_index])) >= indent:\n self.source[line_index] = (' ' * spaces_to_add +\n self.source[line_index])\n modified_lines.append(1 + line_index) # Line indexed at 1.\n line_index -= 1\n\n return modified_lines", "metadata": "root.FixPEP8.fix_e125", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 547 }, { "content": " def fix_e201(self, result):\n \"\"\"Remove extraneous whitespace.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n offset = result['column'] - 1\n\n # Avoid pep8 bug (https://github.com/jcrocholl/pep8/issues/268).\n if offset < 0:\n return []\n\n if is_probably_part_of_multiline(target):\n return []\n\n fixed = fix_whitespace(target,\n offset=offset,\n replacement='')\n\n self.source[line_index] = fixed", "metadata": "root.FixPEP8.fix_e201", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 565 }, { "content": " def fix_e224(self, result):\n \"\"\"Remove extraneous whitespace around operator.\"\"\"\n target = self.source[result['line'] - 1]\n offset = result['column'] - 1\n fixed = target[:offset] + target[offset:].replace('\\t', ' ')\n self.source[result['line'] - 1] = fixed", "metadata": "root.FixPEP8.fix_e224", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 584 }, { "content": " def fix_e225(self, result):\n \"\"\"Fix missing whitespace around operator.\"\"\"\n target = self.source[result['line'] - 1]\n offset = result['column'] - 1\n fixed = target[:offset] + ' ' + target[offset:]\n\n # Only proceed if non-whitespace characters match.\n # And make sure we don't break the indentation.\n if (\n fixed.replace(' ', '') == target.replace(' ', '') and\n _get_indentation(fixed) == _get_indentation(target)\n ):\n self.source[result['line'] - 1] = fixed\n else:\n return []", "metadata": "root.FixPEP8.fix_e225", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 591 }, { "content": " def fix_e231(self, result):\n \"\"\"Add missing whitespace.\"\"\"\n # Optimize for comma case. This will fix all commas in the full source\n # code in one pass. Don't do this more than once. If it fails the first\n # time, there is no point in trying again.\n if ',' in result['info'] and not self._ws_comma_done:\n self._ws_comma_done = True\n original = ''.join(self.source)\n new = refactor(original, ['ws_comma'])\n if original.strip() != new.strip():\n self.source = [new]\n return range(1, 1 + len(original))\n\n line_index = result['line'] - 1\n target = self.source[line_index]\n offset = result['column']\n fixed = target[:offset] + ' ' + target[offset:]\n self.source[line_index] = fixed", "metadata": "root.FixPEP8.fix_e231", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 607 }, { "content": " def fix_e251(self, result):\n \"\"\"Remove whitespace around parameter '=' sign.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n\n # This is necessary since pep8 sometimes reports columns that goes\n # past the end of the physical line. This happens in cases like,\n # foo(bar\\n=None)\n c = min(result['column'] - 1,\n len(target) - 1)\n\n if target[c].strip():\n fixed = target\n else:\n fixed = target[:c].rstrip() + target[c:].lstrip()\n\n # There could be an escaped newline\n #\n # def foo(a=\\\n # 1)\n if fixed.endswith(('=\\\\\\n', '=\\\\\\r\\n', '=\\\\\\r')):\n self.source[line_index] = fixed.rstrip('\\n\\r \\t\\\\')\n self.source[line_index + 1] = self.source[line_index + 1].lstrip()\n return [line_index + 1, line_index + 2] # Line indexed at 1\n\n self.source[result['line'] - 1] = fixed", "metadata": "root.FixPEP8.fix_e251", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 626 }, { "content": " def fix_e262(self, result):\n \"\"\"Fix spacing after comment hash.\"\"\"\n target = self.source[result['line'] - 1]\n offset = result['column']\n\n code = target[:offset].rstrip(' \\t#')\n comment = target[offset:].lstrip(' \\t#')\n\n fixed = code + (' # ' + comment if comment.strip() else '\\n')\n\n self.source[result['line'] - 1] = fixed", "metadata": "root.FixPEP8.fix_e262", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 653 }, { "content": " def fix_e271(self, result):\n \"\"\"Fix extraneous whitespace around keywords.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n offset = result['column'] - 1\n\n if is_probably_part_of_multiline(target):\n return []\n\n fixed = fix_whitespace(target,\n offset=offset,\n replacement=' ')\n\n if fixed == target:\n return []\n else:\n self.source[line_index] = fixed", "metadata": "root.FixPEP8.fix_e271", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 665 }, { "content": " def fix_e301(self, result):\n \"\"\"Add missing blank line.\"\"\"\n cr = '\\n'\n self.source[result['line'] - 1] = cr + self.source[result['line'] - 1]", "metadata": "root.FixPEP8.fix_e301", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 683 }, { "content": " def fix_e302(self, result):\n \"\"\"Add missing 2 blank lines.\"\"\"\n add_linenum = 2 - int(result['info'].split()[-1])\n cr = '\\n' * add_linenum\n self.source[result['line'] - 1] = cr + self.source[result['line'] - 1]", "metadata": "root.FixPEP8.fix_e302", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 688 }, { "content": " def fix_e303(self, result):\n \"\"\"Remove extra blank lines.\"\"\"\n delete_linenum = int(result['info'].split('(')[1].split(')')[0]) - 2\n delete_linenum = max(1, delete_linenum)\n\n # We need to count because pep8 reports an offset line number if there\n # are comments.\n cnt = 0\n line = result['line'] - 2\n modified_lines = []\n while cnt < delete_linenum and line >= 0:\n if not self.source[line].strip():\n self.source[line] = ''\n modified_lines.append(1 + line) # Line indexed at 1\n cnt += 1\n line -= 1\n\n return modified_lines", "metadata": "root.FixPEP8.fix_e303", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 694 }, { "content": " def fix_e304(self, result):\n \"\"\"Remove blank line following function decorator.\"\"\"\n line = result['line'] - 2\n if not self.source[line].strip():\n self.source[line] = ''", "metadata": "root.FixPEP8.fix_e304", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 713 }, { "content": " def fix_e401(self, result):\n \"\"\"Put imports on separate lines.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n offset = result['column'] - 1\n\n if not target.lstrip().startswith('import'):\n return []\n\n indentation = re.split(pattern=r'\\bimport\\b',\n string=target, maxsplit=1)[0]\n fixed = (target[:offset].rstrip('\\t ,') + '\\n' +\n indentation + 'import ' + target[offset:].lstrip('\\t ,'))\n self.source[line_index] = fixed", "metadata": "root.FixPEP8.fix_e401", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 719 }, { "content": " def fix_long_line_logically(self, result, logical):\n \"\"\"Try to make lines fit within --max-line-length characters.\"\"\"\n if (\n not logical or\n len(logical[2]) == 1 or\n self.source[result['line'] - 1].lstrip().startswith('#')\n ):\n return self.fix_long_line_physically(result)\n\n start_line_index = logical[0][0]\n end_line_index = logical[1][0]\n logical_lines = logical[2]\n\n previous_line = get_item(self.source, start_line_index - 1, default='')\n next_line = get_item(self.source, end_line_index + 1, default='')\n\n single_line = join_logical_line(''.join(logical_lines))\n\n try:\n fixed = self.fix_long_line(\n target=single_line,\n previous_line=previous_line,\n next_line=next_line,\n original=''.join(logical_lines))\n except (SyntaxError, tokenize.TokenError):\n return self.fix_long_line_physically(result)\n\n if fixed:\n for line_index in range(start_line_index, end_line_index + 1):\n self.source[line_index] = ''\n self.source[start_line_index] = fixed\n return range(start_line_index + 1, end_line_index + 1)\n else:\n return []", "metadata": "root.FixPEP8.fix_long_line_logically", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 734 }, { "content": " def fix_long_line_physically(self, result):\n \"\"\"Try to make lines fit within --max-line-length characters.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n\n previous_line = get_item(self.source, line_index - 1, default='')\n next_line = get_item(self.source, line_index + 1, default='')\n\n try:\n fixed = self.fix_long_line(\n target=target,\n previous_line=previous_line,\n next_line=next_line,\n original=target)\n except (SyntaxError, tokenize.TokenError):\n return []\n\n if fixed:\n self.source[line_index] = fixed\n return [line_index + 1]\n else:\n return []", "metadata": "root.FixPEP8.fix_long_line_physically", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 769 }, { "content": " def fix_long_line(self, target, previous_line,\n next_line, original):\n cache_entry = (target, previous_line, next_line)\n if cache_entry in self.long_line_ignore_cache:\n return []\n\n if target.lstrip().startswith('#'):\n # Wrap commented lines.\n return shorten_comment(\n line=target,\n max_line_length=self.options.max_line_length,\n last_comment=not next_line.lstrip().startswith('#'))\n\n fixed = get_fixed_long_line(\n target=target,\n previous_line=previous_line,\n original=original,\n indent_word=self.indent_word,\n max_line_length=self.options.max_line_length,\n aggressive=self.options.aggressive,\n experimental=self.options.experimental,\n verbose=self.options.verbose)\n if fixed and not code_almost_equal(original, fixed):\n return fixed\n else:\n self.long_line_ignore_cache.add(cache_entry)\n return None", "metadata": "root.FixPEP8.fix_long_line", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 792 }, { "content": " def fix_e502(self, result):\n \"\"\"Remove extraneous escape of newline.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n self.source[line_index] = target.rstrip('\\n\\r \\t\\\\') + '\\n'", "metadata": "root.FixPEP8.fix_e502", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 820 }, { "content": " def fix_e701(self, result):\n \"\"\"Put colon-separated compound statement on separate lines.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n c = result['column']\n\n # Avoid pep8 bug (https://github.com/jcrocholl/pep8/issues/268).\n if line_index > 0 and '\\\\' in self.source[line_index - 1]:\n return []\n\n fixed_source = (target[:c] + '\\n' +\n _get_indentation(target) + self.indent_word +\n target[c:].lstrip('\\n\\r \\t\\\\'))\n self.source[result['line'] - 1] = fixed_source\n return [result['line'], result['line'] + 1]", "metadata": "root.FixPEP8.fix_e701", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 826 }, { "content": " def fix_e702(self, result, logical):\n \"\"\"Put semicolon-separated compound statement on separate lines.\"\"\"\n if not logical:\n return [] # pragma: no cover\n logical_lines = logical[2]\n\n line_index = result['line'] - 1\n target = self.source[line_index]\n\n if target.rstrip().endswith('\\\\'):\n # Normalize '1; \\\\\\n2' into '1; 2'.\n self.source[line_index] = target.rstrip('\\n \\r\\t\\\\')\n self.source[line_index + 1] = self.source[line_index + 1].lstrip()\n return [line_index + 1, line_index + 2]\n\n if target.rstrip().endswith(';'):\n self.source[line_index] = target.rstrip('\\n \\r\\t;') + '\\n'\n return [line_index + 1]\n\n offset = result['column'] - 1\n first = target[:offset].rstrip(';').rstrip()\n second = (_get_indentation(logical_lines[0]) +\n target[offset:].lstrip(';').lstrip())\n\n self.source[line_index] = first + '\\n' + second\n return [line_index + 1]", "metadata": "root.FixPEP8.fix_e702", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 842 }, { "content": " def fix_e711(self, result):\n \"\"\"Fix comparison with None.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n offset = result['column'] - 1\n\n right_offset = offset + 2\n if right_offset >= len(target):\n return []\n\n left = target[:offset].rstrip()\n center = target[offset:right_offset]\n right = target[right_offset:].lstrip()\n\n if not right.startswith('None'):\n return []\n\n if center.strip() == '==':\n new_center = 'is'\n elif center.strip() == '!=':\n new_center = 'is not'\n else:\n return []\n\n self.source[line_index] = ' '.join([left, new_center, right])", "metadata": "root.FixPEP8.fix_e711", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 869 }, { "content": " def fix_e712(self, result):\n \"\"\"Fix comparison with boolean.\"\"\"\n line_index = result['line'] - 1\n target = self.source[line_index]\n offset = result['column'] - 1\n\n # Handle very easy \"not\" special cases.\n if re.match(r'^\\s*if \\w+ == False:$', target):\n self.source[line_index] = re.sub(r'if (\\w+) == False:',\n r'if not \\1:', target, count=1)\n elif re.match(r'^\\s*if \\w+ != True:$', target):\n self.source[line_index] = re.sub(r'if (\\w+) != True:',\n r'if not \\1:', target, count=1)\n else:\n right_offset = offset + 2\n if right_offset >= len(target):\n return []\n\n left = target[:offset].rstrip()\n center = target[offset:right_offset]\n right = target[right_offset:].lstrip()\n\n # Handle simple cases only.\n new_right = None\n if center.strip() == '==':\n if re.match(r'\\bTrue\\b', right):\n new_right = re.sub(r'\\bTrue\\b *', '', right, count=1)\n elif center.strip() == '!=':\n if re.match(r'\\bFalse\\b', right):\n new_right = re.sub(r'\\bFalse\\b *', '', right, count=1)\n\n if new_right is None:\n return []\n\n if new_right[0].isalnum():\n new_right = ' ' + new_right\n\n self.source[line_index] = left + new_right", "metadata": "root.FixPEP8.fix_e712", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 895 }, { "content": " def fix_w291(self, result):\n \"\"\"Remove trailing whitespace.\"\"\"\n fixed_line = self.source[result['line'] - 1].rstrip()\n self.source[result['line'] - 1] = fixed_line + '\\n'", "metadata": "root.FixPEP8.fix_w291", "header": "['class', 'FixPEP8', '(', 'object', ')', ':', '___EOS___']", "index": 934 }, { "content": "def get_fixed_long_line(target, previous_line, original,\n indent_word=' ', max_line_length=79,\n aggressive=False, experimental=False, verbose=False):\n \"\"\"Break up long line and return result.\n\n Do this by generating multiple reformatted candidates and then\n ranking the candidates to heuristically select the best option.\n\n \"\"\"\n indent = _get_indentation(target)\n source = target[len(indent):]\n assert source.lstrip() == source\n\n # Check for partial multiline.\n tokens = list(generate_tokens(source))\n\n candidates = shorten_line(\n tokens, source, indent,\n indent_word,\n max_line_length,\n aggressive=aggressive,\n experimental=experimental,\n previous_line=previous_line)\n\n # Also sort alphabetically as a tie breaker (for determinism).\n candidates = sorted(\n sorted(set(candidates).union([target, original])),\n key=lambda x: line_shortening_rank(x,\n indent_word,\n max_line_length))\n\n if verbose >= 4:\n print(('-' * 79 + '\\n').join([''] + candidates + ['']),\n file=codecs.getwriter('utf-8')(sys.stderr.buffer\n if hasattr(sys.stderr,\n 'buffer')\n else sys.stderr))\n\n if candidates:\n return candidates[0]", "metadata": "root.get_fixed_long_line", "header": "['module', '___EOS___']", "index": 940 }, { "content": "def join_logical_line(logical_line):\n \"\"\"Return single line based on logical line input.\"\"\"\n indentation = _get_indentation(logical_line)\n\n return indentation + untokenize_without_newlines(\n generate_tokens(logical_line.lstrip())) + '\\n'", "metadata": "root.join_logical_line", "header": "['module', '___EOS___']", "index": 982 }, { "content": "def untokenize_without_newlines(tokens):\n \"\"\"Return source code based on tokens.\"\"\"\n text = ''\n last_row = 0\n last_column = -1\n\n for t in tokens:\n token_string = t[1]\n (start_row, start_column) = t[2]\n (end_row, end_column) = t[3]\n\n if start_row > last_row:\n last_column = 0\n if (\n (start_column > last_column or token_string == '\\n') and\n not text.endswith(' ')\n ):\n text += ' '\n\n if token_string != '\\n':\n text += token_string\n\n last_row = end_row\n last_column = end_column\n\n return text", "metadata": "root.untokenize_without_newlines", "header": "['module', '___EOS___']", "index": 990 }, { "content": "def _find_logical(source_lines):\n # Make a variable which is the index of all the starts of lines.\n logical_start = []\n logical_end = []\n last_newline = True\n parens = 0\n for t in generate_tokens(''.join(source_lines)):\n if t[0] in [tokenize.COMMENT, tokenize.DEDENT,\n tokenize.INDENT, tokenize.NL,\n tokenize.ENDMARKER]:\n continue\n if not parens and t[0] in [tokenize.NEWLINE, tokenize.SEMI]:\n last_newline = True\n logical_end.append((t[3][0] - 1, t[2][1]))\n continue\n if last_newline and not parens:\n logical_start.append((t[2][0] - 1, t[2][1]))\n last_newline = False\n if t[0] == tokenize.OP:\n if t[1] in '([{':\n parens += 1\n elif t[1] in '}])':\n parens -= 1\n return (logical_start, logical_end)", "metadata": "root._find_logical", "header": "['module', '___EOS___']", "index": 1018 }, { "content": "def _get_logical(source_lines, result, logical_start, logical_end):\n \"\"\"Return the logical line corresponding to the result.\n\n Assumes input is already E702-clean.\n\n \"\"\"\n row = result['line'] - 1\n col = result['column'] - 1\n ls = None\n le = None\n for i in range(0, len(logical_start), 1):\n assert logical_end\n x = logical_end[i]\n if x[0] > row or (x[0] == row and x[1] > col):\n le = x\n ls = logical_start[i]\n break\n if ls is None:\n return None\n original = source_lines[ls[0]:le[0] + 1]\n return ls, le, original", "metadata": "root._get_logical", "header": "['module', '___EOS___']", "index": 1044 }, { "content": "def get_item(items, index, default=None):\n if 0 <= index < len(items):\n return items[index]\n else:\n return default", "metadata": "root.get_item", "header": "['module', '___EOS___']", "index": 1067 }, { "content": "def reindent(source, indent_size):\n \"\"\"Reindent all lines.\"\"\"\n reindenter = Reindenter(source)\n return reindenter.run(indent_size)", "metadata": "root.reindent", "header": "['module', '___EOS___']", "index": 1074 }, { "content": "def code_almost_equal(a, b):\n \"\"\"Return True if code is similar.\n\n Ignore whitespace when comparing specific line.\n\n \"\"\"\n split_a = split_and_strip_non_empty_lines(a)\n split_b = split_and_strip_non_empty_lines(b)\n\n if len(split_a) != len(split_b):\n return False\n\n for index in range(len(split_a)):\n if ''.join(split_a[index].split()) != ''.join(split_b[index].split()):\n return False\n\n return True", "metadata": "root.code_almost_equal", "header": "['module', '___EOS___']", "index": 1080 }, { "content": "def split_and_strip_non_empty_lines(text):\n \"\"\"Return lines split by newline.\n\n Ignore empty lines.\n\n \"\"\"\n return [line.strip() for line in text.splitlines() if line.strip()]", "metadata": "root.split_and_strip_non_empty_lines", "header": "['module', '___EOS___']", "index": 1099 }, { "content": "def fix_e265(source, aggressive=False): # pylint: disable=unused-argument\n \"\"\"Format block comments.\"\"\"\n if '#' not in source:\n # Optimization.\n return source\n\n ignored_line_numbers = multiline_string_lines(\n source,\n include_docstrings=True) | set(commented_out_code_lines(source))\n\n fixed_lines = []\n sio = io.StringIO(source)\n for (index, line) in enumerate(sio.readlines()):\n line_number = index + 1 # processing.py\n if (\n line.lstrip().startswith('#') and\n line_number not in ignored_line_numbers\n ):\n indentation = _get_indentation(line)\n line = line.lstrip()\n\n # Normalize beginning if not a shebang.\n if len(line) > 1:\n if (\n # Leave multiple spaces like '# ' alone.\n (line.count('#') > 1 or line[1].isalnum())\n # Leave stylistic outlined blocks alone.\n and not line.rstrip().endswith('#')\n ):\n line = '# ' + line.lstrip('# \\t')\n\n fixed_lines.append(indentation + line)\n else:\n fixed_lines.append(line)\n\n return ''.join(fixed_lines)", "metadata": "root.fix_e265", "header": "['module', '___EOS___']", "index": 1108 }, { "content": "def refactor(source, fixer_names, ignore=None):\n \"\"\"Return refactored code using lib2to3.\n\n Skip if ignore string is produced in the refactored code.\n\n \"\"\"\n return source # processing.py", "metadata": "root.refactor", "header": "['module', '___EOS___']", "index": 1146 }, { "content": "def code_to_2to3(select, ignore):\n fixes = set()\n for code, fix in CODE_TO_2TO3.items():\n if code_match(code, select=select, ignore=ignore):\n fixes |= set(fix)\n return fixes", "metadata": "root.code_to_2to3", "header": "['module', '___EOS___']", "index": 1155 }, { "content": "def fix_2to3(source, aggressive=True, select=None, ignore=None):\n \"\"\"Fix various deprecated code (via lib2to3).\"\"\"\n if not aggressive:\n return source\n\n select = select or []\n ignore = ignore or []\n\n return refactor(source,\n code_to_2to3(select=select,\n ignore=ignore))", "metadata": "root.fix_2to3", "header": "['module', '___EOS___']", "index": 1163 }, { "content": "def fix_w602(source, aggressive=True):\n \"\"\"Fix deprecated form of raising exception.\"\"\"\n if not aggressive:\n return source\n\n return refactor(source, ['raise'],\n ignore='with_traceback')", "metadata": "root.fix_w602", "header": "['module', '___EOS___']", "index": 1176 }, { "content": "def find_newline(source):\n \"\"\"Return type of newline used in source.\n\n Input is a list of lines.\n\n \"\"\"\n assert not isinstance(source, unicode)\n\n counter = collections.defaultdict(int)\n for line in source:\n if line.endswith(CRLF):\n counter[CRLF] += 1\n elif line.endswith(CR):\n counter[CR] += 1\n elif line.endswith(LF):\n counter[LF] += 1\n\n return (sorted(counter, key=counter.get, reverse=True) or [LF])[0]", "metadata": "root.find_newline", "header": "['module', '___EOS___']", "index": 1185 }, { "content": "def _get_indentword(source):\n \"\"\"Return indentation type.\"\"\"\n indent_word = ' ' # Default in case source has no indentation\n try:\n for t in generate_tokens(source):\n if t[0] == token.INDENT:\n indent_word = t[1]\n break\n except (SyntaxError, tokenize.TokenError):\n pass\n return indent_word", "metadata": "root._get_indentword", "header": "['module', '___EOS___']", "index": 1205 }, { "content": "def _get_indentation(line):\n \"\"\"Return leading whitespace.\"\"\"\n if line.strip():\n non_whitespace_index = len(line) - len(line.lstrip())\n return line[:non_whitespace_index]\n else:\n return ''", "metadata": "root._get_indentation", "header": "['module', '___EOS___']", "index": 1218 }, { "content": "def get_diff_text(old, new, filename):\n \"\"\"Return text of unified diff between old and new.\"\"\"\n newline = '\\n'\n diff = difflib.unified_diff(\n old, new,\n 'original/' + filename,\n 'fixed/' + filename,\n lineterm=newline)\n\n text = ''\n for line in diff:\n text += line\n\n # Work around missing newline (http://bugs.python.org/issue2142).\n if text and not line.endswith(newline):\n text += newline + r'\\ No newline at end of file' + newline\n\n return text", "metadata": "root.get_diff_text", "header": "['module', '___EOS___']", "index": 1227 }, { "content": "def _priority_key(pep8_result):\n \"\"\"Key for sorting PEP8 results.\n\n Global fixes should be done first. This is important for things like\n indentation.\n\n \"\"\"\n priority = [\n # Fix multiline colon-based before semicolon based.\n 'e701',\n # Break multiline statements early.\n 'e702',\n # Things that make lines longer.\n 'e225', 'e231',\n # Remove extraneous whitespace before breaking lines.\n 'e201',\n # Shorten whitespace in comment before resorting to wrapping.\n 'e262'\n ]\n middle_index = 10000\n lowest_priority = [\n # We need to shorten lines last since the logical fixer can get in a\n # loop, which causes us to exit early.\n 'e501'\n ]\n key = pep8_result['id'].lower()\n try:\n return priority.index(key)\n except ValueError:\n try:\n return middle_index + lowest_priority.index(key) + 1\n except ValueError:\n return middle_index", "metadata": "root._priority_key", "header": "['module', '___EOS___']", "index": 1247 }, { "content": "def shorten_line(tokens, source, indentation, indent_word, max_line_length,\n aggressive=False, experimental=False, previous_line=''):\n \"\"\"Separate line at OPERATOR.\n\n Multiple candidates will be yielded.\n\n \"\"\"\n for candidate in _shorten_line(tokens=tokens,\n source=source,\n indentation=indentation,\n indent_word=indent_word,\n aggressive=aggressive,\n previous_line=previous_line):\n yield candidate\n\n if aggressive:\n for key_token_strings in SHORTEN_OPERATOR_GROUPS:\n shortened = _shorten_line_at_tokens(\n tokens=tokens,\n source=source,\n indentation=indentation,\n indent_word=indent_word,\n key_token_strings=key_token_strings,\n aggressive=aggressive)\n\n if shortened is not None and shortened != source:\n yield shortened\n\n if experimental:\n for shortened in _shorten_line_at_tokens_new(\n tokens=tokens,\n source=source,\n indentation=indentation,\n max_line_length=max_line_length):\n\n yield shortened", "metadata": "root.shorten_line", "header": "['module', '___EOS___']", "index": 1282 }, { "content": "def _shorten_line(tokens, source, indentation, indent_word,\n aggressive=False, previous_line=''):\n \"\"\"Separate line at OPERATOR.\n\n The input is expected to be free of newlines except for inside multiline\n strings and at the end.\n\n Multiple candidates will be yielded.\n\n \"\"\"\n for (token_type,\n token_string,\n start_offset,\n end_offset) in token_offsets(tokens):\n\n if (\n token_type == tokenize.COMMENT and\n not is_probably_part_of_multiline(previous_line) and\n not is_probably_part_of_multiline(source) and\n not source[start_offset + 1:].strip().lower().startswith(\n ('noqa', 'pragma:', 'pylint:'))\n ):\n # Move inline comments to previous line.\n first = source[:start_offset]\n second = source[start_offset:]\n yield (indentation + second.strip() + '\\n' +\n indentation + first.strip() + '\\n')\n elif token_type == token.OP and token_string != '=':\n # Don't break on '=' after keyword as this violates PEP 8.\n\n assert token_type != token.INDENT\n\n first = source[:end_offset]\n\n second_indent = indentation\n if first.rstrip().endswith('('):\n second_indent += indent_word\n elif '(' in first:\n second_indent += ' ' * (1 + first.find('('))\n else:\n second_indent += indent_word\n\n second = (second_indent + source[end_offset:].lstrip())\n if (\n not second.strip() or\n second.lstrip().startswith('#')\n ):\n continue\n\n # Do not begin a line with a comma\n if second.lstrip().startswith(','):\n continue\n # Do end a line with a dot\n if first.rstrip().endswith('.'):\n continue\n if token_string in '+-*/':\n fixed = first + ' \\\\' + '\\n' + second\n else:\n fixed = first + '\\n' + second\n\n # Only fix if syntax is okay.\n if check_syntax(normalize_multiline(fixed)\n if aggressive else fixed):\n yield indentation + fixed", "metadata": "root._shorten_line", "header": "['module', '___EOS___']", "index": 1320 }, { "content": "class ReformattedLines(object):\n\n \"\"\"The reflowed lines of atoms.\n\n Each part of the line is represented as an \"atom.\" They can be moved\n around when need be to get the optimal formatting.\n\n \"\"\"\n\n ###########################################################################\n # Private Classes\n\n class _Indent(object):\n\n \"\"\"Represent an indentation in the atom stream.\"\"\"\n\n def __init__(self, indent_amt):\n self._indent_amt = indent_amt\n\n def emit(self):\n return ' ' * self._indent_amt\n\n @property\n def size(self):\n return self._indent_amt\n\n class _Space(object):\n\n \"\"\"Represent a space in the atom stream.\"\"\"\n\n def emit(self):\n return ' '\n\n @property\n def size(self):\n return 1\n\n class _LineBreak(object):\n\n \"\"\"Represent a line break in the atom stream.\"\"\"\n\n def emit(self):\n return '\\n'\n\n @property\n def size(self):\n return 0\n\n\n\n ###########################################################################\n # Public Methods\n\n\n\n\n\n\n\n\n\n\n\n\n ###########################################################################\n # Private Methods\n\n\n\n\n\n", "metadata": "root.ReformattedLines", "header": "['module', '___EOS___']", "index": 1391 }, { "content": " def __init__(self, max_line_length):\n self._max_line_length = max_line_length\n self._lines = []\n self._bracket_depth = 0\n self._prev_item = None\n self._prev_prev_item = None", "metadata": "root.ReformattedLines.__init__", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1439 }, { "content": " def __repr__(self):\n return self.emit()", "metadata": "root.ReformattedLines.__repr__", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1446 }, { "content": " def add(self, obj, indent_amt, break_after_open_bracket):\n if isinstance(obj, Atom):\n self._add_item(obj, indent_amt)\n return\n\n self._add_container(obj, indent_amt, break_after_open_bracket)", "metadata": "root.ReformattedLines.add", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1452 }, { "content": " def add_comment(self, item):\n self._lines.append(self._Space())\n self._lines.append(self._Space())\n self._lines.append(item)", "metadata": "root.ReformattedLines.add_comment", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1459 }, { "content": " def add_indent(self, indent_amt):\n self._lines.append(self._Indent(indent_amt))", "metadata": "root.ReformattedLines.add_indent", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1464 }, { "content": " def add_line_break(self, indent):\n self._lines.append(self._LineBreak())\n self.add_indent(len(indent))", "metadata": "root.ReformattedLines.add_line_break", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1467 }, { "content": " def add_line_break_at(self, index, indent_amt):\n self._lines.insert(index, self._LineBreak())\n self._lines.insert(index + 1, self._Indent(indent_amt))", "metadata": "root.ReformattedLines.add_line_break_at", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1471 }, { "content": " def add_space_if_needed(self, curr_text, equal=False):\n if (\n not self._lines or isinstance(\n self._lines[-1], (self._LineBreak, self._Indent, self._Space))\n ):\n return\n\n prev_text = unicode(self._prev_item)\n prev_prev_text = (\n unicode(self._prev_prev_item) if self._prev_prev_item else '')\n\n if (\n # The previous item was a keyword or identifier and the current\n # item isn't an operator that doesn't require a space.\n ((self._prev_item.is_keyword or self._prev_item.is_string or\n self._prev_item.is_name or self._prev_item.is_number) and\n (curr_text[0] not in '([{.,:}])' or\n (curr_text[0] == '=' and equal))) or\n\n # Don't place spaces around a '.', unless it's in an 'import'\n # statement.\n ((prev_prev_text != 'from' and prev_text[-1] != '.' and\n curr_text != 'import') and\n\n # Don't place a space before a colon.\n curr_text[0] != ':' and\n\n # Don't split up ending brackets by spaces.\n ((prev_text[-1] in '}])' and curr_text[0] not in '.,}])') or\n\n # Put a space after a colon or comma.\n prev_text[-1] in ':,' or\n\n # Put space around '=' if asked to.\n (equal and prev_text == '=') or\n\n # Put spaces around non-unary arithmetic operators.\n ((self._prev_prev_item and\n (prev_text not in '+-' and\n (self._prev_prev_item.is_name or\n self._prev_prev_item.is_number or\n self._prev_prev_item.is_string)) and\n prev_text in ('+', '-', '%', '*', '/', '//', '**')))))\n ):\n self._lines.append(self._Space())", "metadata": "root.ReformattedLines.add_space_if_needed", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1475 }, { "content": " def previous_item(self):\n \"\"\"Return the previous non-whitespace item.\"\"\"\n return self._prev_item", "metadata": "root.ReformattedLines.previous_item", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1521 }, { "content": " def fits_on_current_line(self, item_extent):\n return self.current_size() + item_extent <= self._max_line_length", "metadata": "root.ReformattedLines.fits_on_current_line", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1525 }, { "content": " def current_size(self):\n \"\"\"The size of the current line minus the indentation.\"\"\"\n size = 0\n for item in reversed(self._lines):\n size += item.size\n if isinstance(item, self._LineBreak):\n break\n\n return size", "metadata": "root.ReformattedLines.current_size", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1528 }, { "content": " def line_empty(self):\n return (self._lines and\n isinstance(self._lines[-1],\n (self._LineBreak, self._Indent)))", "metadata": "root.ReformattedLines.line_empty", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1538 }, { "content": " def emit(self):\n string = ''\n for item in self._lines:\n if isinstance(item, self._LineBreak):\n string = string.rstrip()\n string += item.emit()\n\n return string.rstrip() + '\\n'", "metadata": "root.ReformattedLines.emit", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1543 }, { "content": " def _add_item(self, item, indent_amt):\n \"\"\"Add an item to the line.\n\n Reflow the line to get the best formatting after the item is\n inserted. The bracket depth indicates if the item is being\n inserted inside of a container or not.\n\n \"\"\"\n if self._prev_item and self._prev_item.is_string and item.is_string:\n # Place consecutive string literals on separate lines.\n self._lines.append(self._LineBreak())\n self._lines.append(self._Indent(indent_amt))\n\n item_text = unicode(item)\n if self._lines and self._bracket_depth:\n # Adding the item into a container.\n self._prevent_default_initializer_splitting(item, indent_amt)\n\n if item_text in '.,)]}':\n self._split_after_delimiter(item, indent_amt)\n\n elif self._lines and not self.line_empty():\n # Adding the item outside of a container.\n if self.fits_on_current_line(len(item_text)):\n self._enforce_space(item)\n\n else:\n # Line break for the new item.\n self._lines.append(self._LineBreak())\n self._lines.append(self._Indent(indent_amt))\n\n self._lines.append(item)\n self._prev_item, self._prev_prev_item = item, self._prev_item\n\n if item_text in '([{':\n self._bracket_depth += 1\n\n elif item_text in '}])':\n self._bracket_depth -= 1\n assert self._bracket_depth >= 0", "metadata": "root.ReformattedLines._add_item", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1555 }, { "content": " def _add_container(self, container, indent_amt, break_after_open_bracket):\n actual_indent = indent_amt + 1\n\n if (\n unicode(self._prev_item) != '=' and\n not self.line_empty() and\n not self.fits_on_current_line(\n container.size + self._bracket_depth + 2)\n ):\n\n if unicode(container)[0] == '(' and self._prev_item.is_name:\n # Don't split before the opening bracket of a call.\n break_after_open_bracket = True\n actual_indent = indent_amt + 4\n elif (\n break_after_open_bracket or\n unicode(self._prev_item) not in '([{'\n ):\n # If the container doesn't fit on the current line and the\n # current line isn't empty, place the container on the next\n # line.\n self._lines.append(self._LineBreak())\n self._lines.append(self._Indent(indent_amt))\n break_after_open_bracket = False\n else:\n actual_indent = self.current_size() + 1\n break_after_open_bracket = False\n\n if isinstance(container, (ListComprehension, IfExpression)):\n actual_indent = indent_amt\n\n # Increase the continued indentation only if recursing on a\n # container.\n container.reflow(self, ' ' * actual_indent,\n break_after_open_bracket=break_after_open_bracket)", "metadata": "root.ReformattedLines._add_container", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1596 }, { "content": " def _prevent_default_initializer_splitting(self, item, indent_amt):\n \"\"\"Prevent splitting between a default initializer.\n\n When there is a default initializer, it's best to keep it all on\n the same line. It's nicer and more readable, even if it goes\n over the maximum allowable line length. This goes back along the\n current line to determine if we have a default initializer, and,\n if so, to remove extraneous whitespaces and add a line\n break/indent before it if needed.\n\n \"\"\"\n if unicode(item) == '=':\n # This is the assignment in the initializer. Just remove spaces for\n # now.\n self._delete_whitespace()\n return\n\n if (not self._prev_item or not self._prev_prev_item or\n unicode(self._prev_item) != '='):\n return\n\n self._delete_whitespace()\n prev_prev_index = self._lines.index(self._prev_prev_item)\n\n if (\n isinstance(self._lines[prev_prev_index - 1], self._Indent) or\n self.fits_on_current_line(item.size + 1)\n ):\n # The default initializer is already the only item on this line.\n # Don't insert a newline here.\n return\n\n # Replace the space with a newline/indent combo.\n if isinstance(self._lines[prev_prev_index - 1], self._Space):\n del self._lines[prev_prev_index - 1]\n\n self.add_line_break_at(self._lines.index(self._prev_prev_item),\n indent_amt)", "metadata": "root.ReformattedLines._prevent_default_initializer_splitting", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1632 }, { "content": " def _split_after_delimiter(self, item, indent_amt):\n \"\"\"Split the line only after a delimiter.\"\"\"\n self._delete_whitespace()\n\n if self.fits_on_current_line(item.size):\n return\n\n last_space = None\n for item in reversed(self._lines):\n if (\n last_space and\n (not isinstance(item, Atom) or not item.is_colon)\n ):\n break\n else:\n last_space = None\n if isinstance(item, self._Space):\n last_space = item\n if isinstance(item, (self._LineBreak, self._Indent)):\n return\n\n if not last_space:\n return\n\n self.add_line_break_at(self._lines.index(last_space), indent_amt)", "metadata": "root.ReformattedLines._split_after_delimiter", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1671 }, { "content": " def _enforce_space(self, item):\n \"\"\"Enforce a space in certain situations.\n\n There are cases where we will want a space where normally we\n wouldn't put one. This just enforces the addition of a space.\n\n \"\"\"\n if isinstance(self._lines[-1],\n (self._Space, self._LineBreak, self._Indent)):\n return\n\n if not self._prev_item:\n return\n\n item_text = unicode(item)\n prev_text = unicode(self._prev_item)\n\n # Prefer a space around a '.' in an import statement, and between the\n # 'import' and '('.\n if (\n (item_text == '.' and prev_text == 'from') or\n (item_text == 'import' and prev_text == '.') or\n (item_text == '(' and prev_text == 'import')\n ):\n self._lines.append(self._Space())", "metadata": "root.ReformattedLines._enforce_space", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1697 }, { "content": " def _delete_whitespace(self):\n \"\"\"Delete all whitespace from the end of the line.\"\"\"\n while isinstance(self._lines[-1], (self._Space, self._LineBreak,\n self._Indent)):\n del self._lines[-1]", "metadata": "root.ReformattedLines._delete_whitespace", "header": "['class', 'ReformattedLines', '(', 'object', ')', ':', '___EOS___']", "index": 1723 }, { "content": "class Atom(object):\n\n \"\"\"The smallest unbreakable unit that can be reflowed.\"\"\"\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Atom", "header": "['module', '___EOS___']", "index": 1730 }, { "content": " def __init__(self, atom):\n self._atom = atom", "metadata": "root.Atom.__init__", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1734 }, { "content": " def __repr__(self):\n return self._atom.token_string", "metadata": "root.Atom.__repr__", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1737 }, { "content": " def __len__(self):\n return self.size", "metadata": "root.Atom.__len__", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1740 }, { "content": " def reflow(\n self, reflowed_lines, continued_indent, extent,\n break_after_open_bracket=False,\n is_list_comp_or_if_expr=False,\n next_is_dot=False\n ):\n if self._atom.token_type == tokenize.COMMENT:\n reflowed_lines.add_comment(self)\n return\n\n total_size = extent if extent else self.size\n\n if self._atom.token_string not in ',:([{}])':\n # Some atoms will need an extra 1-sized space token after them.\n total_size += 1\n\n prev_item = reflowed_lines.previous_item()\n if (\n not is_list_comp_or_if_expr and\n not reflowed_lines.fits_on_current_line(total_size) and\n not (next_is_dot and\n reflowed_lines.fits_on_current_line(self.size + 1)) and\n not reflowed_lines.line_empty() and\n not self.is_colon and\n not (prev_item and prev_item.is_name and\n unicode(self) == '(')\n ):\n # Start a new line if there is already something on the line and\n # adding this atom would make it go over the max line length.\n reflowed_lines.add_line_break(continued_indent)\n else:\n reflowed_lines.add_space_if_needed(unicode(self))\n\n reflowed_lines.add(self, len(continued_indent),\n break_after_open_bracket)", "metadata": "root.Atom.reflow", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1743 }, { "content": " def emit(self):\n return self.__repr__()", "metadata": "root.Atom.emit", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1779 }, { "content": " @property\n def is_keyword(self):\n return keyword.iskeyword(self._atom.token_string)", "metadata": "root.Atom.is_keyword", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1782 }, { "content": " @property\n def is_string(self):\n return self._atom.token_type == tokenize.STRING", "metadata": "root.Atom.is_string", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1786 }, { "content": " @property\n def is_name(self):\n return self._atom.token_type == tokenize.NAME", "metadata": "root.Atom.is_name", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1790 }, { "content": " @property\n def is_number(self):\n return self._atom.token_type == tokenize.NUMBER", "metadata": "root.Atom.is_number", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1794 }, { "content": " @property\n def is_comma(self):\n return self._atom.token_string == ','", "metadata": "root.Atom.is_comma", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1798 }, { "content": " @property\n def is_colon(self):\n return self._atom.token_string == ':'", "metadata": "root.Atom.is_colon", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1802 }, { "content": " @property\n def size(self):\n return len(self._atom.token_string)", "metadata": "root.Atom.size", "header": "['class', 'Atom', '(', 'object', ')', ':', '___EOS___']", "index": 1806 }, { "content": "class Container(object):\n\n \"\"\"Base class for all container types.\"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Container", "header": "['module', '___EOS___']", "index": 1811 }, { "content": " def __init__(self, items):\n self._items = items", "metadata": "root.Container.__init__", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1815 }, { "content": " def __repr__(self):\n string = ''\n last_was_keyword = False\n\n for item in self._items:\n if item.is_comma:\n string += ', '\n elif item.is_colon:\n string += ': '\n else:\n item_string = unicode(item)\n if (\n string and\n (last_was_keyword or\n (not string.endswith(tuple('([{,.:}]) ')) and\n not item_string.startswith(tuple('([{,.:}])'))))\n ):\n string += ' '\n string += item_string\n\n last_was_keyword = item.is_keyword\n return string", "metadata": "root.Container.__repr__", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1818 }, { "content": " def __iter__(self):\n for element in self._items:\n yield element", "metadata": "root.Container.__iter__", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1841 }, { "content": " def __getitem__(self, idx):\n return self._items[idx]", "metadata": "root.Container.__getitem__", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1845 }, { "content": " def reflow(self, reflowed_lines, continued_indent,\n break_after_open_bracket=False):\n last_was_container = False\n for (index, item) in enumerate(self._items):\n next_item = get_item(self._items, index + 1)\n\n if isinstance(item, Atom):\n is_list_comp_or_if_expr = (\n isinstance(self, (ListComprehension, IfExpression)))\n item.reflow(reflowed_lines, continued_indent,\n self._get_extent(index),\n is_list_comp_or_if_expr=is_list_comp_or_if_expr,\n next_is_dot=(next_item and\n unicode(next_item) == '.'))\n if last_was_container and item.is_comma:\n reflowed_lines.add_line_break(continued_indent)\n last_was_container = False\n else: # isinstance(item, Container)\n reflowed_lines.add(item, len(continued_indent),\n break_after_open_bracket)\n last_was_container = not isinstance(item, (ListComprehension,\n IfExpression))\n\n if (\n break_after_open_bracket and index == 0 and\n # Prefer to keep empty containers together instead of\n # separating them.\n unicode(item) == self.open_bracket and\n (not next_item or unicode(next_item) != self.close_bracket) and\n (len(self._items) != 3 or not isinstance(next_item, Atom))\n ):\n reflowed_lines.add_line_break(continued_indent)\n break_after_open_bracket = False\n else:\n next_next_item = get_item(self._items, index + 2)\n if (\n unicode(item) not in ['.', '%', 'in'] and\n next_item and not isinstance(next_item, Container) and\n unicode(next_item) != ':' and\n next_next_item and (not isinstance(next_next_item, Atom) or\n unicode(next_item) == 'not') and\n not reflowed_lines.line_empty() and\n not reflowed_lines.fits_on_current_line(\n self._get_extent(index + 1) + 2)\n ):\n reflowed_lines.add_line_break(continued_indent)", "metadata": "root.Container.reflow", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1848 }, { "content": " def _get_extent(self, index):\n \"\"\"The extent of the full element.\n\n E.g., the length of a function call or keyword.\n\n \"\"\"\n extent = 0\n prev_item = get_item(self._items, index - 1)\n seen_dot = prev_item and unicode(prev_item) == '.'\n while index < len(self._items):\n item = get_item(self._items, index)\n index += 1\n\n if isinstance(item, (ListComprehension, IfExpression)):\n break\n\n if isinstance(item, Container):\n if prev_item and prev_item.is_name:\n if seen_dot:\n extent += 1\n else:\n extent += item.size\n\n prev_item = item\n continue\n elif (unicode(item) not in ['.', '=', ':', 'not'] and\n not item.is_name and not item.is_string):\n break\n\n if unicode(item) == '.':\n seen_dot = True\n\n extent += item.size\n prev_item = item\n\n return extent", "metadata": "root.Container._get_extent", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1895 }, { "content": " @property\n def is_string(self):\n return False", "metadata": "root.Container.is_string", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1932 }, { "content": " @property\n def size(self):\n return len(self.__repr__())", "metadata": "root.Container.size", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1936 }, { "content": " @property\n def is_keyword(self):\n return False", "metadata": "root.Container.is_keyword", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1940 }, { "content": " @property\n def is_name(self):\n return False", "metadata": "root.Container.is_name", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1944 }, { "content": " @property\n def is_comma(self):\n return False", "metadata": "root.Container.is_comma", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1948 }, { "content": " @property\n def is_colon(self):\n return False", "metadata": "root.Container.is_colon", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1952 }, { "content": " @property\n def open_bracket(self):\n return None", "metadata": "root.Container.open_bracket", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1956 }, { "content": " @property\n def close_bracket(self):\n return None", "metadata": "root.Container.close_bracket", "header": "['class', 'Container', '(', 'object', ')', ':', '___EOS___']", "index": 1960 }, { "content": "class Tuple(Container):\n\n \"\"\"A high-level representation of a tuple.\"\"\"\n\n", "metadata": "root.Tuple", "header": "['module', '___EOS___']", "index": 1965 }, { "content": " @property\n def open_bracket(self):\n return '('", "metadata": "root.Tuple.open_bracket", "header": "['class', 'Tuple', '(', 'Container', ')', ':', '___EOS___']", "index": 1969 }, { "content": " @property\n def close_bracket(self):\n return ')'", "metadata": "root.Tuple.close_bracket", "header": "['class', 'Tuple', '(', 'Container', ')', ':', '___EOS___']", "index": 1973 }, { "content": "class List(Container):\n\n \"\"\"A high-level representation of a list.\"\"\"\n\n", "metadata": "root.List", "header": "['module', '___EOS___']", "index": 1978 }, { "content": " @property\n def open_bracket(self):\n return '['", "metadata": "root.List.open_bracket", "header": "['class', 'List', '(', 'Container', ')', ':', '___EOS___']", "index": 1982 }, { "content": " @property\n def close_bracket(self):\n return ']'", "metadata": "root.List.close_bracket", "header": "['class', 'List', '(', 'Container', ')', ':', '___EOS___']", "index": 1986 }, { "content": "class DictOrSet(Container):\n\n \"\"\"A high-level representation of a dictionary or set.\"\"\"\n\n", "metadata": "root.DictOrSet", "header": "['module', '___EOS___']", "index": 1991 }, { "content": " @property\n def open_bracket(self):\n return '{'", "metadata": "root.DictOrSet.open_bracket", "header": "['class', 'DictOrSet', '(', 'Container', ')', ':', '___EOS___']", "index": 1995 }, { "content": " @property\n def close_bracket(self):\n return '}'", "metadata": "root.DictOrSet.close_bracket", "header": "['class', 'DictOrSet', '(', 'Container', ')', ':', '___EOS___']", "index": 1999 }, { "content": "class ListComprehension(Container):\n\n \"\"\"A high-level representation of a list comprehension.\"\"\"\n", "metadata": "root.ListComprehension", "header": "['module', '___EOS___']", "index": 2004 }, { "content": " @property\n def size(self):\n length = 0\n for item in self._items:\n if isinstance(item, IfExpression):\n break\n length += item.size\n return length", "metadata": "root.ListComprehension.size", "header": "['class', 'ListComprehension', '(', 'Container', ')', ':', '___EOS___']", "index": 2008 }, { "content": "class IfExpression(Container):\n\n \"\"\"A high-level representation of an if-expression.\"\"\"", "metadata": "root.IfExpression", "header": "['module', '___EOS___']", "index": 2018 }, { "content": "def _parse_container(tokens, index, for_or_if=None):\n \"\"\"Parse a high-level container, such as a list, tuple, etc.\"\"\"\n\n # Store the opening bracket.\n items = [Atom(Token(*tokens[index]))]\n index += 1\n\n num_tokens = len(tokens)\n while index < num_tokens:\n tok = Token(*tokens[index])\n\n if tok.token_string in ',)]}':\n # First check if we're at the end of a list comprehension or\n # if-expression. Don't add the ending token as part of the list\n # comprehension or if-expression, because they aren't part of those\n # constructs.\n if for_or_if == 'for':\n return (ListComprehension(items), index - 1)\n\n elif for_or_if == 'if':\n return (IfExpression(items), index - 1)\n\n # We've reached the end of a container.\n items.append(Atom(tok))\n\n # If not, then we are at the end of a container.\n if tok.token_string == ')':\n # The end of a tuple.\n return (Tuple(items), index)\n\n elif tok.token_string == ']':\n # The end of a list.\n return (List(items), index)\n\n elif tok.token_string == '}':\n # The end of a dictionary or set.\n return (DictOrSet(items), index)\n\n elif tok.token_string in '([{':\n # A sub-container is being defined.\n (container, index) = _parse_container(tokens, index)\n items.append(container)\n\n elif tok.token_string == 'for':\n (container, index) = _parse_container(tokens, index, 'for')\n items.append(container)\n\n elif tok.token_string == 'if':\n (container, index) = _parse_container(tokens, index, 'if')\n items.append(container)\n\n else:\n items.append(Atom(tok))\n\n index += 1\n\n return (None, None)", "metadata": "root._parse_container", "header": "['module', '___EOS___']", "index": 2023 }, { "content": "def _parse_tokens(tokens):\n \"\"\"Parse the tokens.\n\n This converts the tokens into a form where we can manipulate them\n more easily.\n\n \"\"\"\n\n index = 0\n parsed_tokens = []\n\n num_tokens = len(tokens)\n while index < num_tokens:\n tok = Token(*tokens[index])\n\n assert tok.token_type != token.INDENT\n if tok.token_type == tokenize.NEWLINE:\n # There's only one newline and it's at the end.\n break\n\n if tok.token_string in '([{':\n (container, index) = _parse_container(tokens, index)\n if not container:\n return None\n parsed_tokens.append(container)\n else:\n parsed_tokens.append(Atom(tok))\n\n index += 1\n\n return parsed_tokens", "metadata": "root._parse_tokens", "header": "['module', '___EOS___']", "index": 2082 }, { "content": "def _reflow_lines(parsed_tokens, indentation, max_line_length,\n start_on_prefix_line):\n \"\"\"Reflow the lines so that it looks nice.\"\"\"\n\n if unicode(parsed_tokens[0]) == 'def':\n # A function definition gets indented a bit more.\n continued_indent = indentation + ' ' * 2 * DEFAULT_INDENT_SIZE\n else:\n continued_indent = indentation + ' ' * DEFAULT_INDENT_SIZE\n\n break_after_open_bracket = not start_on_prefix_line\n\n lines = ReformattedLines(max_line_length)\n lines.add_indent(len(indentation.lstrip('\\r\\n')))\n\n if not start_on_prefix_line:\n # If splitting after the opening bracket will cause the first element\n # to be aligned weirdly, don't try it.\n first_token = get_item(parsed_tokens, 0)\n second_token = get_item(parsed_tokens, 1)\n\n if (\n first_token and second_token and\n unicode(second_token)[0] == '(' and\n len(indentation) + len(first_token) + 1 == len(continued_indent)\n ):\n return None\n\n for item in parsed_tokens:\n lines.add_space_if_needed(unicode(item), equal=True)\n\n save_continued_indent = continued_indent\n if start_on_prefix_line and isinstance(item, Container):\n start_on_prefix_line = False\n continued_indent = ' ' * (lines.current_size() + 1)\n\n item.reflow(lines, continued_indent, break_after_open_bracket)\n continued_indent = save_continued_indent\n\n return lines.emit()", "metadata": "root._reflow_lines", "header": "['module', '___EOS___']", "index": 2115 }, { "content": "def _shorten_line_at_tokens_new(tokens, source, indentation,\n max_line_length):\n \"\"\"Shorten the line taking its length into account.\n\n The input is expected to be free of newlines except for inside\n multiline strings and at the end.\n\n \"\"\"\n # Yield the original source so to see if it's a better choice than the\n # shortened candidate lines we generate here.\n yield indentation + source\n\n parsed_tokens = _parse_tokens(tokens)\n\n if parsed_tokens:\n # Perform two reflows. The first one starts on the same line as the\n # prefix. The second starts on the line after the prefix.\n fixed = _reflow_lines(parsed_tokens, indentation, max_line_length,\n start_on_prefix_line=True)\n if fixed and check_syntax(normalize_multiline(fixed.lstrip())):\n yield fixed\n\n fixed = _reflow_lines(parsed_tokens, indentation, max_line_length,\n start_on_prefix_line=False)\n if fixed and check_syntax(normalize_multiline(fixed.lstrip())):\n yield fixed", "metadata": "root._shorten_line_at_tokens_new", "header": "['module', '___EOS___']", "index": 2157 }, { "content": "def _shorten_line_at_tokens(tokens, source, indentation, indent_word,\n key_token_strings, aggressive):\n \"\"\"Separate line by breaking at tokens in key_token_strings.\n\n The input is expected to be free of newlines except for inside\n multiline strings and at the end.\n\n \"\"\"\n offsets = []\n for (index, _t) in enumerate(token_offsets(tokens)):\n (token_type,\n token_string,\n start_offset,\n end_offset) = _t\n\n assert token_type != token.INDENT\n\n if token_string in key_token_strings:\n # Do not break in containers with zero or one items.\n unwanted_next_token = {\n '(': ')',\n '[': ']',\n '{': '}'}.get(token_string)\n if unwanted_next_token:\n if (\n get_item(tokens,\n index + 1,\n default=[None, None])[1] == unwanted_next_token or\n get_item(tokens,\n index + 2,\n default=[None, None])[1] == unwanted_next_token\n ):\n continue\n\n if (\n index > 2 and token_string == '(' and\n tokens[index - 1][1] in ',(%['\n ):\n # Don't split after a tuple start, or before a tuple start if\n # the tuple is in a list.\n continue\n\n if end_offset < len(source) - 1:\n # Don't split right before newline.\n offsets.append(end_offset)\n else:\n # Break at adjacent strings. These were probably meant to be on\n # separate lines in the first place.\n previous_token = get_item(tokens, index - 1)\n if (\n token_type == tokenize.STRING and\n previous_token and previous_token[0] == tokenize.STRING\n ):\n offsets.append(start_offset)\n\n current_indent = None\n fixed = None\n for line in split_at_offsets(source, offsets):\n if fixed:\n fixed += '\\n' + current_indent + line\n\n for symbol in '([{':\n if line.endswith(symbol):\n current_indent += indent_word\n else:\n # First line.\n fixed = line\n assert not current_indent\n current_indent = indent_word\n\n assert fixed is not None\n\n if check_syntax(normalize_multiline(fixed)\n if aggressive > 1 else fixed):\n return indentation + fixed\n else:\n return None", "metadata": "root._shorten_line_at_tokens", "header": "['module', '___EOS___']", "index": 2185 }, { "content": "def token_offsets(tokens):\n \"\"\"Yield tokens and offsets.\"\"\"\n end_offset = 0\n previous_end_row = 0\n previous_end_column = 0\n for t in tokens:\n token_type = t[0]\n token_string = t[1]\n (start_row, start_column) = t[2]\n (end_row, end_column) = t[3]\n\n # Account for the whitespace between tokens.\n end_offset += start_column\n if previous_end_row == start_row:\n end_offset -= previous_end_column\n\n # Record the start offset of the token.\n start_offset = end_offset\n\n # Account for the length of the token itself.\n end_offset += len(token_string)\n\n yield (token_type,\n token_string,\n start_offset,\n end_offset)\n\n previous_end_row = end_row\n previous_end_column = end_column", "metadata": "root.token_offsets", "header": "['module', '___EOS___']", "index": 2264 }, { "content": "def normalize_multiline(line):\n \"\"\"Normalize multiline-related code that will cause syntax error.\n\n This is for purposes of checking syntax.\n\n \"\"\"\n if line.startswith('def ') and line.rstrip().endswith(':'):\n return line + ' pass'\n elif line.startswith('return '):\n return 'def _(): ' + line\n elif line.startswith('@'):\n return line + 'def _(): pass'\n elif line.startswith('class '):\n return line + ' pass'\n else:\n return line", "metadata": "root.normalize_multiline", "header": "['module', '___EOS___']", "index": 2295 }, { "content": "def fix_whitespace(line, offset, replacement):\n \"\"\"Replace whitespace at offset and return fixed line.\"\"\"\n # Replace escaped newlines too\n left = line[:offset].rstrip('\\n\\r \\t\\\\')\n right = line[offset:].lstrip('\\n\\r \\t\\\\')\n if right.startswith('#'):\n return line\n else:\n return left + replacement + right", "metadata": "root.fix_whitespace", "header": "['module', '___EOS___']", "index": 2313 }, { "content": "def _execute_pep8(pep8_options, source):\n \"\"\"Execute pep8 via python method calls.\"\"\"\n class QuietReport(pep8.BaseReport):\n\n \"\"\"Version of checker that does not print.\"\"\"\n\n def __init__(self, options):\n super(QuietReport, self).__init__(options)\n self.__full_error_results = []\n\n def error(self, line_number, offset, text, _):\n \"\"\"Collect errors.\"\"\"\n code = super(QuietReport, self).error(line_number, offset, text, _)\n if code:\n self.__full_error_results.append(\n {'id': code,\n 'line': line_number,\n 'column': offset + 1,\n 'info': text})\n\n def full_error_results(self):\n \"\"\"Return error results in detail.\n\n Results are in the form of a list of dictionaries. Each\n dictionary contains 'id', 'line', 'column', and 'info'.\n\n \"\"\"\n return self.__full_error_results\n\n checker = pep8.Checker('', lines=source,\n reporter=QuietReport, **pep8_options)\n checker.check_all()\n return checker.report.full_error_results()", "metadata": "root._execute_pep8", "header": "['module', '___EOS___']", "index": 2324 }, { "content": "def _remove_leading_and_normalize(line):\n return line.lstrip().rstrip(CR + LF) + '\\n'", "metadata": "root._remove_leading_and_normalize", "header": "['module', '___EOS___']", "index": 2359 }, { "content": "class Reindenter(object):\n\n \"\"\"Reindents badly-indented code to uniformly use four-space indentation.\n\n Released to the public domain, by Tim Peters, 03 October 2000.\n\n \"\"\"\n\n\n", "metadata": "root.Reindenter", "header": "['module', '___EOS___']", "index": 2363 }, { "content": " def __init__(self, input_text):\n sio = io.StringIO(input_text)\n source_lines = sio.readlines()\n\n self.string_content_line_numbers = multiline_string_lines(input_text)\n\n # File lines, rstripped & tab-expanded. Dummy at start is so\n # that we can use tokenize's 1-based line numbering easily.\n # Note that a line is all-blank iff it is a newline.\n self.lines = []\n for index, line in enumerate(source_lines):\n line_number = index + 1 # processing.py\n # Do not modify if inside a multiline string.\n if line_number in self.string_content_line_numbers:\n self.lines.append(line)\n else:\n # Only expand leading tabs.\n self.lines.append(_get_indentation(line).expandtabs() +\n _remove_leading_and_normalize(line))\n\n self.lines.insert(0, None)\n self.index = 1 # index into self.lines of next line\n self.input_text = input_text", "metadata": "root.Reindenter.__init__", "header": "['class', 'Reindenter', '(', 'object', ')', ':', '___EOS___']", "index": 2371 }, { "content": " def run(self, indent_size=DEFAULT_INDENT_SIZE):\n \"\"\"Fix indentation and return modified line numbers.\n\n Line numbers are indexed at 1.\n\n \"\"\"\n if indent_size < 1:\n return self.input_text\n\n try:\n stats = _reindent_stats(tokenize.generate_tokens(self.getline))\n except (SyntaxError, tokenize.TokenError):\n return self.input_text\n # Remove trailing empty lines.\n lines = self.lines\n while lines and lines[-1] == '\\n':\n lines.pop()\n # Sentinel.\n stats.append((len(lines), 0))\n # Map count of leading spaces to # we want.\n have2want = {}\n # Program after transformation.\n after = []\n # Copy over initial empty lines -- there's nothing to do until\n # we see a line with *something* on it.\n i = stats[0][0]\n after.extend(lines[1:i])\n for i in range(len(stats) - 1):\n thisstmt, thislevel = stats[i]\n nextstmt = stats[i + 1][0]\n have = _leading_space_count(lines[thisstmt])\n want = thislevel * indent_size\n if want < 0:\n # A comment line.\n if have:\n # An indented comment line. If we saw the same\n # indentation before, reuse what it most recently\n # mapped to.\n want = have2want.get(have, -1)\n if want < 0:\n # Then it probably belongs to the next real stmt.\n for j in range(i + 1, len(stats) - 1):\n jline, jlevel = stats[j]\n if jlevel >= 0:\n if have == _leading_space_count(lines[jline]):\n want = jlevel * indent_size\n break\n if want < 0: # Maybe it's a hanging\n # comment like this one,\n # in which case we should shift it like its base\n # line got shifted.\n for j in range(i - 1, -1, -1):\n jline, jlevel = stats[j]\n if jlevel >= 0:\n want = (have + _leading_space_count(\n after[jline - 1]) -\n _leading_space_count(lines[jline]))\n break\n if want < 0:\n # Still no luck -- leave it alone.\n want = have\n else:\n want = 0\n assert want >= 0\n have2want[have] = want\n diff = want - have\n if diff == 0 or have == 0:\n after.extend(lines[thisstmt:nextstmt])\n else:\n for index, line in enumerate(lines[thisstmt:nextstmt]):\n line_number = index + thisstmt\n if line_number in self.string_content_line_numbers:\n after.append(line)\n elif diff > 0:\n if line == '\\n':\n after.append(line)\n else:\n after.append(' ' * diff + line)\n else:\n remove = min(_leading_space_count(line), -diff)\n after.append(line[remove:])\n\n return ''.join(after)", "metadata": "root.Reindenter.run", "header": "['class', 'Reindenter', '(', 'object', ')', ':', '___EOS___']", "index": 2395 }, { "content": " def getline(self):\n \"\"\"Line-getter for tokenize.\"\"\"\n if self.index >= len(self.lines):\n line = ''\n else:\n line = self.lines[self.index]\n self.index += 1\n return line", "metadata": "root.Reindenter.getline", "header": "['class', 'Reindenter', '(', 'object', ')', ':', '___EOS___']", "index": 2479 }, { "content": "def _reindent_stats(tokens):\n \"\"\"Return list of (lineno, indentlevel) pairs.\n\n One for each stmt and comment line. indentlevel is -1 for comment lines, as\n a signal that tokenize doesn't know what to do about them; indeed, they're\n our headache!\n\n \"\"\"\n find_stmt = 1 # Next token begins a fresh stmt?\n level = 0 # Current indent level.\n stats = []\n\n for t in tokens:\n token_type = t[0]\n sline = t[2][0]\n line = t[4]\n\n if token_type == tokenize.NEWLINE:\n # A program statement, or ENDMARKER, will eventually follow,\n # after some (possibly empty) run of tokens of the form\n # (NL | COMMENT)* (INDENT | DEDENT+)?\n find_stmt = 1\n\n elif token_type == tokenize.INDENT:\n find_stmt = 1\n level += 1\n\n elif token_type == tokenize.DEDENT:\n find_stmt = 1\n level -= 1\n\n elif token_type == tokenize.COMMENT:\n if find_stmt:\n stats.append((sline, -1))\n # But we're still looking for a new stmt, so leave\n # find_stmt alone.\n\n elif token_type == tokenize.NL:\n pass\n\n elif find_stmt:\n # This is the first \"real token\" following a NEWLINE, so it\n # must be the first token of the next program statement, or an\n # ENDMARKER.\n find_stmt = 0\n if line: # Not endmarker.\n stats.append((sline, level))\n\n return stats", "metadata": "root._reindent_stats", "header": "['module', '___EOS___']", "index": 2489 }, { "content": "def _leading_space_count(line):\n \"\"\"Return number of leading spaces in line.\"\"\"\n i = 0\n while i < len(line) and line[i] == ' ':\n i += 1\n return i", "metadata": "root._leading_space_count", "header": "['module', '___EOS___']", "index": 2540 }, { "content": "def refactor_with_2to3(source_text, fixer_names):\n \"\"\"Use lib2to3 to refactor the source.\n\n Return the refactored source code.\n\n \"\"\"\n from lib2to3.refactor import RefactoringTool\n fixers = ['lib2to3.fixes.fix_' + name for name in fixer_names]\n tool = RefactoringTool(fixer_names=fixers, explicit=fixers)\n\n from lib2to3.pgen2 import tokenize as lib2to3_tokenize\n try:\n return unicode(tool.refactor_string(source_text, name=''))\n except lib2to3_tokenize.TokenError:\n return source_text", "metadata": "root.refactor_with_2to3", "header": "['module', '___EOS___']", "index": 2548 }, { "content": "def check_syntax(code):\n \"\"\"Return True if syntax is okay.\"\"\"\n try:\n return compile(code, '<string>', 'exec')\n except (SyntaxError, TypeError, UnicodeDecodeError):\n return False", "metadata": "root.check_syntax", "header": "['module', '___EOS___']", "index": 2565 }, { "content": "def filter_results(source, results, aggressive):\n \"\"\"Filter out spurious reports from pep8.\n\n If aggressive is True, we allow possibly unsafe fixes (E711, E712).\n\n \"\"\"\n non_docstring_string_line_numbers = multiline_string_lines(\n source, include_docstrings=False)\n all_string_line_numbers = multiline_string_lines(\n source, include_docstrings=True)\n\n commented_out_code_line_numbers = commented_out_code_lines(source)\n\n for r in results:\n issue_id = r['id'].lower()\n\n if r['line'] in non_docstring_string_line_numbers:\n if issue_id.startswith(('e1', 'e501', 'w191')):\n continue\n\n if r['line'] in all_string_line_numbers:\n if issue_id in ['e501']:\n continue\n\n # We must offset by 1 for lines that contain the trailing contents of\n # multiline strings.\n if not aggressive and (r['line'] + 1) in all_string_line_numbers:\n # Do not modify multiline strings in non-aggressive mode. Remove\n # trailing whitespace could break doctests.\n if issue_id.startswith(('w29', 'w39')):\n continue\n\n if aggressive <= 0:\n if issue_id.startswith(('e711', 'w6')):\n continue\n\n if aggressive <= 1:\n if issue_id.startswith(('e712', )):\n continue\n\n if r['line'] in commented_out_code_line_numbers:\n if issue_id.startswith(('e26', 'e501')):\n continue\n\n yield r", "metadata": "root.filter_results", "header": "['module', '___EOS___']", "index": 2573 }, { "content": "def multiline_string_lines(source, include_docstrings=False):\n \"\"\"Return line numbers that are within multiline strings.\n\n The line numbers are indexed at 1.\n\n Docstrings are ignored.\n\n \"\"\"\n line_numbers = set()\n previous_token_type = ''\n try:\n for t in generate_tokens(source):\n token_type = t[0]\n start_row = t[2][0]\n end_row = t[3][0]\n\n if token_type == tokenize.STRING and start_row != end_row:\n if (\n include_docstrings or\n previous_token_type != tokenize.INDENT\n ):\n # We increment by one since we want the contents of the\n # string.\n line_numbers |= set(range(1 + start_row, 1 + end_row))\n\n previous_token_type = token_type\n except (SyntaxError, tokenize.TokenError):\n pass\n\n return line_numbers", "metadata": "root.multiline_string_lines", "header": "['module', '___EOS___']", "index": 2620 }, { "content": "def commented_out_code_lines(source):\n \"\"\"Return line numbers of comments that are likely code.\n\n Commented-out code is bad practice, but modifying it just adds even more\n clutter.\n\n \"\"\"\n line_numbers = []\n try:\n for t in generate_tokens(source):\n token_type = t[0]\n token_string = t[1]\n start_row = t[2][0]\n line = t[4]\n\n # Ignore inline comments.\n if not line.lstrip().startswith('#'):\n continue\n\n if token_type == tokenize.COMMENT:\n stripped_line = token_string.lstrip('#').strip()\n if (\n ' ' in stripped_line and\n '#' not in stripped_line and\n check_syntax(stripped_line)\n ):\n line_numbers.append(start_row)\n except (SyntaxError, tokenize.TokenError):\n pass\n\n return line_numbers", "metadata": "root.commented_out_code_lines", "header": "['module', '___EOS___']", "index": 2652 }, { "content": "def shorten_comment(line, max_line_length, last_comment=False):\n \"\"\"Return trimmed or split long comment line.\n\n If there are no comments immediately following it, do a text wrap.\n Doing this wrapping on all comments in general would lead to jagged\n comment text.\n\n \"\"\"\n assert len(line) > max_line_length\n line = line.rstrip()\n\n # PEP 8 recommends 72 characters for comment text.\n indentation = _get_indentation(line) + '# '\n max_line_length = min(max_line_length,\n len(indentation) + 72)\n\n MIN_CHARACTER_REPEAT = 5\n if (\n len(line) - len(line.rstrip(line[-1])) >= MIN_CHARACTER_REPEAT and\n not line[-1].isalnum()\n ):\n # Trim comments that end with things like ---------\n return line[:max_line_length] + '\\n'\n elif last_comment and re.match(r'\\s*#+\\s*\\w+', line):\n import textwrap\n split_lines = textwrap.wrap(line.lstrip(' \\t#'),\n initial_indent=indentation,\n subsequent_indent=indentation,\n width=max_line_length,\n break_long_words=False,\n break_on_hyphens=False)\n return '\\n'.join(split_lines) + '\\n'\n else:\n return line + '\\n'", "metadata": "root.shorten_comment", "header": "['module', '___EOS___']", "index": 2685 }, { "content": "def normalize_line_endings(lines, newline):\n \"\"\"Return fixed line endings.\n\n All lines will be modified to use the most common line ending.\n\n \"\"\"\n return [line.rstrip('\\n\\r') + newline for line in lines]", "metadata": "root.normalize_line_endings", "header": "['module', '___EOS___']", "index": 2721 }, { "content": "def mutual_startswith(a, b):\n return b.startswith(a) or a.startswith(b)", "metadata": "root.mutual_startswith", "header": "['module', '___EOS___']", "index": 2730 }, { "content": "def code_match(code, select, ignore):\n if ignore:\n assert not isinstance(ignore, unicode)\n for ignored_code in [c.strip() for c in ignore]:\n if mutual_startswith(code.lower(), ignored_code.lower()):\n return False\n\n if select:\n assert not isinstance(select, unicode)\n for selected_code in [c.strip() for c in select]:\n if mutual_startswith(code.lower(), selected_code.lower()):\n return True\n return False\n\n return True", "metadata": "root.code_match", "header": "['module', '___EOS___']", "index": 2734 }, { "content": "def fix_code(source, options=None):\n \"\"\"Return fixed source code.\"\"\"\n if not options:\n options = parse_args([''])\n\n if not isinstance(source, unicode):\n source = source.decode(locale.getpreferredencoding(False))\n\n sio = io.StringIO(source)\n return fix_lines(sio.readlines(), options=options)", "metadata": "root.fix_code", "header": "['module', '___EOS___']", "index": 2751 }, { "content": "def fix_lines(source_lines, options, filename=''):\n \"\"\"Return fixed source code.\"\"\"\n # Transform everything to line feed. Then change them back to original\n # before returning fixed source code.\n original_newline = find_newline(source_lines)\n tmp_source = ''.join(normalize_line_endings(source_lines, '\\n'))\n\n # Keep a history to break out of cycles.\n previous_hashes = set()\n\n if options.line_range:\n fixed_source = apply_local_fixes(tmp_source, options)\n else:\n # Apply global fixes only once (for efficiency).\n fixed_source = apply_global_fixes(tmp_source, options)\n\n passes = 0\n long_line_ignore_cache = set()\n while hash(fixed_source) not in previous_hashes:\n if options.pep8_passes >= 0 and passes > options.pep8_passes:\n break\n passes += 1\n\n previous_hashes.add(hash(fixed_source))\n\n tmp_source = copy.copy(fixed_source)\n\n fix = FixPEP8(\n filename,\n options,\n contents=tmp_source,\n long_line_ignore_cache=long_line_ignore_cache)\n\n fixed_source = fix.fix()\n\n sio = io.StringIO(fixed_source)\n return ''.join(normalize_line_endings(sio.readlines(), original_newline))", "metadata": "root.fix_lines", "header": "['module', '___EOS___']", "index": 2763 }, { "content": "def fix_file(filename, options=None, output=None):\n if not options:\n options = parse_args([filename])\n\n original_source = readlines_from_file(filename)\n\n fixed_source = original_source\n\n if options.in_place or output:\n encoding = detect_encoding(filename)\n\n if output:\n output = codecs.getwriter(encoding)(output.buffer\n if hasattr(output, 'buffer')\n else output)\n\n output = LineEndingWrapper(output)\n\n fixed_source = fix_lines(fixed_source, options, filename=filename)\n\n if options.diff:\n new = io.StringIO(fixed_source)\n new = new.readlines()\n diff = get_diff_text(original_source, new, filename)\n if output:\n output.write(diff)\n output.flush()\n else:\n return diff\n elif options.in_place:\n fp = open_with_encoding(filename, encoding=encoding,\n mode='w')\n fp.write(fixed_source)\n fp.close()\n else:\n if output:\n output.write(fixed_source)\n output.flush()\n else:\n return fixed_source", "metadata": "root.fix_file", "header": "['module', '___EOS___']", "index": 2802 }, { "content": "def global_fixes():\n \"\"\"Yield multiple (code, function) tuples.\"\"\"\n for function in globals().values():\n if inspect.isfunction(function):\n arguments = inspect.getargspec(function)[0]\n if arguments[:1] != ['source']:\n continue\n\n code = extract_code_from_function(function)\n if code:\n yield (code, function)", "metadata": "root.global_fixes", "header": "['module', '___EOS___']", "index": 2844 }, { "content": "def apply_global_fixes(source, options, where='global'):\n \"\"\"Run global fixes on source code.\n\n These are fixes that only need be done once (unlike those in\n FixPEP8, which are dependent on pep8).\n\n \"\"\"\n if code_match('E101', select=options.select, ignore=options.ignore):\n source = reindent(source,\n indent_size=options.indent_size)\n\n for (code, function) in global_fixes():\n if code_match(code, select=options.select, ignore=options.ignore):\n if options.verbose:\n print('---> Applying {0} fix for {1}'.format(where,\n code.upper()),\n file=sys.stderr)\n source = function(source,\n aggressive=options.aggressive)\n\n source = fix_2to3(source,\n aggressive=options.aggressive,\n select=options.select,\n ignore=options.ignore)\n\n return source", "metadata": "root.apply_global_fixes", "header": "['module', '___EOS___']", "index": 2857 }, { "content": "def apply_local_fixes(source, options):\n \"\"\"Ananologus to apply_global_fixes, but runs only those which makes sense\n for the given line_range.\n\n Do as much as we can without breaking code.\n\n \"\"\"\n def find_ge(a, x):\n \"\"\"Find leftmost item greater than or equal to x.\"\"\"\n i = bisect.bisect_left(a, x)\n if i != len(a):\n return i, a[i]\n return len(a) - 1, a[-1]\n\n def find_le(a, x):\n \"\"\"Find rightmost value less than or equal to x.\"\"\"\n i = bisect.bisect_right(a, x)\n if i:\n return i - 1, a[i - 1]\n return 0, a[0]\n\n def local_fix(source, start_log, end_log,\n start_lines, end_lines, indents, last_line):\n \"\"\"apply_global_fixes to the source between start_log and end_log.\n\n The subsource must be the correct syntax of a complete python program\n (but all lines may share an indentation). The subsource's shared indent\n is removed, fixes are applied and the indent prepended back. Taking\n care to not reindent strings.\n\n last_line is the strict cut off (options.line_range[1]), so that\n lines after last_line are not modified.\n\n \"\"\"\n if end_log < start_log:\n return source\n\n ind = indents[start_log]\n indent = _get_indentation(source[start_lines[start_log]])\n\n sl = slice(start_lines[start_log], end_lines[end_log] + 1)\n\n subsource = source[sl]\n # Remove indent from subsource.\n if ind:\n for line_no in start_lines[start_log:end_log + 1]:\n pos = line_no - start_lines[start_log]\n subsource[pos] = subsource[pos][ind:]\n\n # Fix indentation of subsource.\n fixed_subsource = apply_global_fixes(''.join(subsource),\n options,\n where='local')\n fixed_subsource = fixed_subsource.splitlines(True)\n\n # Add back indent for non multi-line strings lines.\n msl = multiline_string_lines(''.join(fixed_subsource),\n include_docstrings=False)\n for i, line in enumerate(fixed_subsource):\n if not i + 1 in msl:\n fixed_subsource[i] = indent + line if line != '\\n' else line\n\n # We make a special case to look at the final line, if it's a multiline\n # *and* the cut off is somewhere inside it, we take the fixed\n # subset up until last_line, this assumes that the number of lines\n # does not change in this multiline line.\n changed_lines = len(fixed_subsource)\n if (start_lines[end_log] != end_lines[end_log]\n and end_lines[end_log] > last_line):\n after_end = end_lines[end_log] - last_line\n fixed_subsource = (fixed_subsource[:-after_end] +\n source[sl][-after_end:])\n changed_lines -= after_end\n\n options.line_range[1] = (options.line_range[0] +\n changed_lines - 1)\n\n return (source[:start_lines[start_log]] +\n fixed_subsource +\n source[end_lines[end_log] + 1:])\n\n def is_continued_stmt(line,\n continued_stmts=frozenset(['else', 'elif',\n 'finally', 'except'])):\n return re.split('[ :]', line.strip(), 1)[0] in continued_stmts\n\n assert options.line_range\n start, end = options.line_range\n start -= 1\n end -= 1\n last_line = end # We shouldn't modify lines after this cut-off.\n\n logical = _find_logical(source)\n\n if not logical[0]:\n # Just blank lines, this should imply that it will become '\\n' ?\n return apply_global_fixes(source, options)\n\n start_lines, indents = zip(*logical[0])\n end_lines, _ = zip(*logical[1])\n\n source = source.splitlines(True)\n\n start_log, start = find_ge(start_lines, start)\n end_log, end = find_le(start_lines, end)\n\n # Look behind one line, if it's indented less than current indent\n # then we can move to this previous line knowing that its\n # indentation level will not be changed.\n if (start_log > 0\n and indents[start_log - 1] < indents[start_log]\n and not is_continued_stmt(source[start_log - 1])):\n start_log -= 1\n start = start_lines[start_log]\n\n while start < end:\n\n if is_continued_stmt(source[start]):\n start_log += 1\n start = start_lines[start_log]\n continue\n\n ind = indents[start_log]\n for t in itertools.takewhile(lambda t: t[1][1] >= ind,\n enumerate(logical[0][start_log:])):\n n_log, n = start_log + t[0], t[1][0]\n # start shares indent up to n.\n\n if n <= end:\n source = local_fix(source, start_log, n_log,\n start_lines, end_lines,\n indents, last_line)\n start_log = n_log if n == end else n_log + 1\n start = start_lines[start_log]\n continue\n\n else:\n # Look at the line after end and see if allows us to reindent.\n after_end_log, after_end = find_ge(start_lines, end + 1)\n\n if indents[after_end_log] > indents[start_log]:\n start_log, start = find_ge(start_lines, start + 1)\n continue\n\n if (indents[after_end_log] == indents[start_log]\n and is_continued_stmt(source[after_end])):\n # find n, the beginning of the last continued statement\n # Apply fix to previous block if there is one.\n only_block = True\n for n, n_ind in logical[0][start_log:end_log + 1][::-1]:\n if n_ind == ind and not is_continued_stmt(source[n]):\n n_log = start_lines.index(n)\n source = local_fix(source, start_log, n_log - 1,\n start_lines, end_lines,\n indents, last_line)\n start_log = n_log + 1\n start = start_lines[start_log]\n only_block = False\n break\n if only_block:\n end_log, end = find_le(start_lines, end - 1)\n continue\n\n source = local_fix(source, start_log, end_log,\n start_lines, end_lines,\n indents, last_line)\n break\n\n return ''.join(source)", "metadata": "root.apply_local_fixes", "header": "['module', '___EOS___']", "index": 2885 }, { "content": "def extract_code_from_function(function):\n \"\"\"Return code handled by function.\"\"\"\n if not function.__name__.startswith('fix_'):\n return None\n\n code = re.sub('^fix_', '', function.__name__)\n if not code:\n return None\n\n try:\n int(code[1:])\n except ValueError:\n return None\n\n return code", "metadata": "root.extract_code_from_function", "header": "['module', '___EOS___']", "index": 3056 }, { "content": "def create_parser():\n \"\"\"Return command-line parser.\"\"\"\n # Do import locally to be friendly to those who use autopep8 as a library\n # and are supporting Python 2.6.\n import argparse\n\n parser = argparse.ArgumentParser(description=docstring_summary(__doc__),\n prog='autopep8')\n parser.add_argument('--version', action='version',\n version='%(prog)s ' + __version__)\n parser.add_argument('-v', '--verbose', action='count', dest='verbose',\n default=0,\n help='print verbose messages; '\n 'multiple -v result in more verbose messages')\n parser.add_argument('-d', '--diff', action='store_true', dest='diff',\n help='print the diff for the fixed source')\n parser.add_argument('-i', '--in-place', action='store_true',\n help='make changes to files in place')\n parser.add_argument('-r', '--recursive', action='store_true',\n help='run recursively over directories; '\n 'must be used with --in-place or --diff')\n parser.add_argument('-j', '--jobs', type=int, metavar='n', default=1,\n help='number of parallel jobs; '\n 'match CPU count if value is less than 1')\n parser.add_argument('-p', '--pep8-passes', metavar='n',\n default=-1, type=int,\n help='maximum number of additional pep8 passes '\n '(default: infinite)')\n parser.add_argument('-a', '--aggressive', action='count', default=0,\n help='enable non-whitespace changes; '\n 'multiple -a result in more aggressive changes')\n parser.add_argument('--experimental', action='store_true',\n help='enable experimental fixes')\n parser.add_argument('--exclude', metavar='globs',\n help='exclude file/directory names that match these '\n 'comma-separated globs')\n parser.add_argument('--list-fixes', action='store_true',\n help='list codes for fixes; '\n 'used by --ignore and --select')\n parser.add_argument('--ignore', metavar='errors', default='',\n help='do not fix these errors/warnings '\n '(default: {0})'.format(DEFAULT_IGNORE))\n parser.add_argument('--select', metavar='errors', default='',\n help='fix only these errors/warnings (e.g. E4,W)')\n parser.add_argument('--max-line-length', metavar='n', default=79, type=int,\n help='set maximum allowed line length '\n '(default: %(default)s)')\n parser.add_argument('--range', metavar='line', dest='line_range',\n default=None, type=int, nargs=2,\n help='only fix errors found within this inclusive '\n 'range of line numbers (e.g. 1 99); '\n 'line numbers are indexed at 1')\n parser.add_argument('--indent-size', default=DEFAULT_INDENT_SIZE,\n type=int, metavar='n',\n help='number of spaces per indent level '\n '(default %(default)s)')\n parser.add_argument('files', nargs='*',\n help=\"files to format or '-' for standard in\")\n\n return parser", "metadata": "root.create_parser", "header": "['module', '___EOS___']", "index": 3073 }, { "content": "def parse_args(arguments):\n \"\"\"Parse command-line options.\"\"\"\n parser = create_parser()\n args = parser.parse_args(arguments)\n\n if not args.files and not args.list_fixes:\n parser.error('incorrect number of arguments')\n\n args.files = [decode_filename(name) for name in args.files]\n\n if '-' in args.files:\n if len(args.files) > 1:\n parser.error('cannot mix stdin and regular files')\n\n if args.diff:\n parser.error('--diff cannot be used with standard input')\n\n if args.in_place:\n parser.error('--in-place cannot be used with standard input')\n\n if args.recursive:\n parser.error('--recursive cannot be used with standard input')\n\n if len(args.files) > 1 and not (args.in_place or args.diff):\n parser.error('autopep8 only takes one filename as argument '\n 'unless the \"--in-place\" or \"--diff\" args are '\n 'used')\n\n if args.recursive and not (args.in_place or args.diff):\n parser.error('--recursive must be used with --in-place or --diff')\n\n if args.exclude and not args.recursive:\n parser.error('--exclude is only relevant when used with --recursive')\n\n if args.in_place and args.diff:\n parser.error('--in-place and --diff are mutually exclusive')\n\n if args.max_line_length <= 0:\n parser.error('--max-line-length must be greater than 0')\n\n if args.select:\n args.select = args.select.split(',')\n\n if args.ignore:\n args.ignore = args.ignore.split(',')\n elif not args.select:\n if args.aggressive:\n # Enable everything by default if aggressive.\n args.select = ['E', 'W']\n else:\n args.ignore = DEFAULT_IGNORE.split(',')\n\n if args.exclude:\n args.exclude = args.exclude.split(',')\n else:\n args.exclude = []\n\n if args.jobs < 1:\n # Do not import multiprocessing globally in case it is not supported\n # on the platform.\n import multiprocessing\n args.jobs = multiprocessing.cpu_count()\n\n if args.jobs > 1 and not args.in_place:\n parser.error('parallel jobs requires --in-place')\n\n return args", "metadata": "root.parse_args", "header": "['module', '___EOS___']", "index": 3135 }, { "content": "def decode_filename(filename):\n \"\"\"Return Unicode filename.\"\"\"\n if isinstance(filename, unicode):\n return filename\n else:\n return filename.decode(sys.getfilesystemencoding())", "metadata": "root.decode_filename", "header": "['module', '___EOS___']", "index": 3204 }, { "content": "def supported_fixes():\n \"\"\"Yield pep8 error codes that autopep8 fixes.\n\n Each item we yield is a tuple of the code followed by its\n description.\n\n \"\"\"\n yield ('E101', docstring_summary(reindent.__doc__))\n\n instance = FixPEP8(filename=None, options=None, contents='')\n for attribute in dir(instance):\n code = re.match('fix_([ew][0-9][0-9][0-9])', attribute)\n if code:\n yield (\n code.group(1).upper(),\n re.sub(r'\\s+', ' ',\n docstring_summary(getattr(instance, attribute).__doc__))\n )\n\n for (code, function) in sorted(global_fixes()):\n yield (code.upper() + (4 - len(code)) * ' ',\n re.sub(r'\\s+', ' ', docstring_summary(function.__doc__)))\n\n for code in sorted(CODE_TO_2TO3):\n yield (code.upper() + (4 - len(code)) * ' ',\n re.sub(r'\\s+', ' ', docstring_summary(fix_2to3.__doc__)))", "metadata": "root.supported_fixes", "header": "['module', '___EOS___']", "index": 3212 }, { "content": "def docstring_summary(docstring):\n \"\"\"Return summary of docstring.\"\"\"\n return docstring.split('\\n')[0]", "metadata": "root.docstring_summary", "header": "['module', '___EOS___']", "index": 3240 }, { "content": "def line_shortening_rank(candidate, indent_word, max_line_length):\n \"\"\"Return rank of candidate.\n\n This is for sorting candidates.\n\n \"\"\"\n if not candidate.strip():\n return 0\n\n rank = 0\n lines = candidate.split('\\n')\n\n offset = 0\n if (\n not lines[0].lstrip().startswith('#') and\n lines[0].rstrip()[-1] not in '([{'\n ):\n for (opening, closing) in ('()', '[]', '{}'):\n # Don't penalize empty containers that aren't split up. Things like\n # this \"foo(\\n )\" aren't particularly good.\n opening_loc = lines[0].find(opening)\n closing_loc = lines[0].find(closing)\n if opening_loc >= 0:\n if closing_loc < 0 or closing_loc != opening_loc + 1:\n offset = max(offset, 1 + opening_loc)\n\n current_longest = max(offset + len(x.strip()) for x in lines)\n\n rank += 4 * max(0, current_longest - max_line_length)\n\n rank += len(lines)\n\n # Too much variation in line length is ugly.\n rank += 2 * standard_deviation(len(line) for line in lines)\n\n bad_staring_symbol = {\n '(': ')',\n '[': ']',\n '{': '}'}.get(lines[0][-1])\n\n if len(lines) > 1:\n if (\n bad_staring_symbol and\n lines[1].lstrip().startswith(bad_staring_symbol)\n ):\n rank += 20\n\n for lineno, current_line in enumerate(lines):\n current_line = current_line.strip()\n\n if current_line.startswith('#'):\n continue\n\n for bad_start in ['.', '%', '+', '-', '/']:\n if current_line.startswith(bad_start):\n rank += 100\n\n # Do not tolerate operators on their own line.\n if current_line == bad_start:\n rank += 1000\n\n if current_line.endswith(('(', '[', '{', '.')):\n # Avoid lonely opening. They result in longer lines.\n if len(current_line) <= len(indent_word):\n rank += 100\n\n # Avoid the ugliness of \", (\\n\".\n if (\n current_line.endswith('(') and\n current_line[:-1].rstrip().endswith(',')\n ):\n rank += 100\n\n # Also avoid the ugliness of \"foo.\\nbar\"\n if current_line.endswith('.'):\n rank += 100\n\n if has_arithmetic_operator(current_line):\n rank += 100\n\n if current_line.endswith(('%', '(', '[', '{')):\n rank -= 20\n\n # Try to break list comprehensions at the \"for\".\n if current_line.startswith('for '):\n rank -= 50\n\n if current_line.endswith('\\\\'):\n # If a line ends in \\-newline, it may be part of a\n # multiline string. In that case, we would like to know\n # how long that line is without the \\-newline. If it's\n # longer than the maximum, or has comments, then we assume\n # that the \\-newline is an okay candidate and only\n # penalize it a bit.\n total_len = len(current_line)\n lineno += 1\n while lineno < len(lines):\n total_len += len(lines[lineno])\n\n if lines[lineno].lstrip().startswith('#'):\n total_len = max_line_length\n break\n\n if not lines[lineno].endswith('\\\\'):\n break\n\n lineno += 1\n\n if total_len < max_line_length:\n rank += 10\n else:\n rank += 1\n\n # Prefer breaking at commas rather than colon.\n if ',' in current_line and current_line.endswith(':'):\n rank += 10\n\n rank += 10 * count_unbalanced_brackets(current_line)\n\n return max(0, rank)", "metadata": "root.line_shortening_rank", "header": "['module', '___EOS___']", "index": 3245 }, { "content": "def standard_deviation(numbers):\n \"\"\"Return standard devation.\"\"\"\n numbers = list(numbers)\n if not numbers:\n return 0\n mean = sum(numbers) / len(numbers)\n return (sum((n - mean) ** 2 for n in numbers) /\n len(numbers)) ** .5", "metadata": "root.standard_deviation", "header": "['module', '___EOS___']", "index": 3367 }, { "content": "def has_arithmetic_operator(line):\n \"\"\"Return True if line contains any arithmetic operators.\"\"\"\n for operator in pep8.ARITHMETIC_OP:\n if operator in line:\n return True\n\n return False", "metadata": "root.has_arithmetic_operator", "header": "['module', '___EOS___']", "index": 3377 }, { "content": "def count_unbalanced_brackets(line):\n \"\"\"Return number of unmatched open/close brackets.\"\"\"\n count = 0\n for opening, closing in ['()', '[]', '{}']:\n count += abs(line.count(opening) - line.count(closing))\n\n return count", "metadata": "root.count_unbalanced_brackets", "header": "['module', '___EOS___']", "index": 3386 }, { "content": "def split_at_offsets(line, offsets):\n \"\"\"Split line at offsets.\n\n Return list of strings.\n\n \"\"\"\n result = []\n\n previous_offset = 0\n current_offset = 0\n for current_offset in sorted(offsets):\n if current_offset < len(line) and previous_offset != current_offset:\n result.append(line[previous_offset:current_offset].strip())\n previous_offset = current_offset\n\n result.append(line[current_offset:])\n\n return result", "metadata": "root.split_at_offsets", "header": "['module', '___EOS___']", "index": 3395 }, { "content": "class LineEndingWrapper(object):\n\n r\"\"\"Replace line endings to work with sys.stdout.\n\n It seems that sys.stdout expects only '\\n' as the line ending, no matter\n the platform. Otherwise, we get repeated line endings.\n\n \"\"\"\n\n\n", "metadata": "root.LineEndingWrapper", "header": "['module', '___EOS___']", "index": 3415 }, { "content": " def __init__(self, output):\n self.__output = output", "metadata": "root.LineEndingWrapper.__init__", "header": "['class', 'LineEndingWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 3424 }, { "content": " def write(self, s):\n self.__output.write(s.replace('\\r\\n', '\\n').replace('\\r', '\\n'))", "metadata": "root.LineEndingWrapper.write", "header": "['class', 'LineEndingWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 3427 }, { "content": " def flush(self):\n self.__output.flush()", "metadata": "root.LineEndingWrapper.flush", "header": "['class', 'LineEndingWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 3430 }, { "content": "def match_file(filename, exclude):\n \"\"\"Return True if file is okay for modifying/recursing.\"\"\"\n base_name = os.path.basename(filename)\n\n if base_name.startswith('.'):\n return False\n\n for pattern in exclude:\n if fnmatch.fnmatch(base_name, pattern):\n return False\n\n if not os.path.isdir(filename) and not is_python_file(filename):\n return False\n\n return True", "metadata": "root.match_file", "header": "['module', '___EOS___']", "index": 3434 }, { "content": "def find_files(filenames, recursive, exclude):\n \"\"\"Yield filenames.\"\"\"\n while filenames:\n name = filenames.pop(0)\n if recursive and os.path.isdir(name):\n for root, directories, children in os.walk(name):\n filenames += [os.path.join(root, f) for f in children\n if match_file(os.path.join(root, f),\n exclude)]\n directories[:] = [d for d in directories\n if match_file(os.path.join(root, d),\n exclude)]\n else:\n yield name", "metadata": "root.find_files", "header": "['module', '___EOS___']", "index": 3451 }, { "content": "def _fix_file(parameters):\n \"\"\"Helper function for optionally running fix_file() in parallel.\"\"\"\n if parameters[1].verbose:\n print('[file:{0}]'.format(parameters[0]), file=sys.stderr)\n try:\n fix_file(*parameters)\n except IOError as error:\n print(unicode(error), file=sys.stderr)", "metadata": "root._fix_file", "header": "['module', '___EOS___']", "index": 3467 }, { "content": "def fix_multiple_files(filenames, options, output=None):\n \"\"\"Fix list of files.\n\n Optionally fix files recursively.\n\n \"\"\"\n filenames = find_files(filenames, options.recursive, options.exclude)\n if options.jobs > 1:\n import multiprocessing\n pool = multiprocessing.Pool(options.jobs)\n pool.map(_fix_file,\n [(name, options) for name in filenames])\n else:\n for name in filenames:\n _fix_file((name, options, output))", "metadata": "root.fix_multiple_files", "header": "['module', '___EOS___']", "index": 3477 }, { "content": "def is_python_file(filename):\n \"\"\"Return True if filename is Python file.\"\"\"\n if filename.endswith('.py'):\n return True\n\n try:\n with open_with_encoding(filename) as f:\n first_line = f.readlines(1)[0]\n except (IOError, IndexError):\n return False\n\n if not PYTHON_SHEBANG_REGEX.match(first_line):\n return False\n\n return True", "metadata": "root.is_python_file", "header": "['module', '___EOS___']", "index": 3494 }, { "content": "def is_probably_part_of_multiline(line):\n \"\"\"Return True if line is likely part of a multiline string.\n\n When multiline strings are involved, pep8 reports the error as being\n at the start of the multiline string, which doesn't work for us.\n\n \"\"\"\n return (\n '\"\"\"' in line or\n \"'''\" in line or\n line.rstrip().endswith('\\\\')\n )", "metadata": "root.is_probably_part_of_multiline", "header": "['module', '___EOS___']", "index": 3511 }, { "content": "def main():\n \"\"\"Tool main.\"\"\"\n try:\n # Exit on broken pipe.\n signal.signal(signal.SIGPIPE, signal.SIG_DFL)\n except AttributeError: # pragma: no cover\n # SIGPIPE is not available on Windows.\n pass\n\n try:\n args = parse_args(sys.argv[1:])\n\n if args.list_fixes:\n for code, description in sorted(supported_fixes()):\n print('{code} - {description}'.format(\n code=code, description=description))\n return 0\n\n if args.files == ['-']:\n assert not args.in_place\n\n # LineEndingWrapper is unnecessary here due to the symmetry between\n # standard in and standard out.\n sys.stdout.write(fix_code(sys.stdin.read(), args))\n else:\n if args.in_place or args.diff:\n args.files = list(set(args.files))\n else:\n assert len(args.files) == 1\n assert not args.recursive\n\n fix_multiple_files(args.files, args, sys.stdout)\n except KeyboardInterrupt:\n return 1 # pragma: no cover", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 3525 }, { "content": "class CachedTokenizer(object):\n\n \"\"\"A one-element cache around tokenize.generate_tokens().\n\n Original code written by Ned Batchelder, in coverage.py.\n\n \"\"\"\n\n", "metadata": "root.CachedTokenizer", "header": "['module', '___EOS___']", "index": 3561 }, { "content": " def __init__(self):\n self.last_text = None\n self.last_tokens = None", "metadata": "root.CachedTokenizer.__init__", "header": "['class', 'CachedTokenizer', '(', 'object', ')', ':', '___EOS___']", "index": 3569 }, { "content": " def generate_tokens(self, text):\n \"\"\"A stand-in for tokenize.generate_tokens().\"\"\"\n if text != self.last_text:\n string_io = io.StringIO(text)\n self.last_tokens = list(\n tokenize.generate_tokens(string_io.readline)\n )\n self.last_text = text\n return self.last_tokens", "metadata": "root.CachedTokenizer.generate_tokens", "header": "['class', 'CachedTokenizer', '(', 'object', ')', ':', '___EOS___']", "index": 3573 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2010", "-", "2011", " ", "Hi", "deo", " ", "Hat", "tori", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2011", "-", "2013", " ", "Hi", "deo", " ", "Hat", "tori", ",", " ", "Ste", "ven", " ", "My", "int_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2013", "-", "2014", " ", "Hi", "deo", " ", "Hat", "tori", ",", " ", "Ste", "ven", " ", "My", "int", ",", " ", "Bill", " ", "Wen", "dli", "ng_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",", " ", "OUT", " ", "OF", " ", "OR", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Automat", "ical", "ly", " ", "formats", " ", "Pyth", "on", " ", "code", " ", "to", " ", "conform", " ", "to", " ", "the", " ", "PE", "P", " ", "8", " ", "style", " ", "guide", ".", "\\", "10", ";", "\\", "10", ";", "Fix", "es", " ", "tha", "t", " ", "only", " ", "need", " ", "be", " ", "don", "e", " ", "onc", "e", " ", "can", " ", "be", " ", "adde", "d", " ", "by", " ", "addin", "g", " ", "a", " ", "function", " ", "of", " ", "the", " ", "form", "\\", "10", ";", "\"", "fix", "\\u", "<", "code", ">(", "source", ")\"", " ", "to", " ", "this", " ", "module", ".", " ", "The", "y", " ", "shou", "ld", " ", "return", " ", "the", " ", "fixed", " ", "source", " ", "code", ".", "\\", "10", ";", "The", "se", " ", "fixes", " ", "are", " ", "picked", " ", "up", " ", "by", " ", "appl", "y", "\\u", "global", "\\u", "fixes", "()", ".", "\\", "10", ";", "\\", "10", ";", "Fix", "es", " ", "tha", "t", " ", "depend", " ", "on", " ", "pep", "8", " ", "shou", "ld", " ", "be", " ", "adde", "d", " ", "as", " ", "method", "s", " ", "to", " ", "Fix", "PE", "P", "8", ".", " ", "See", " ", "the", " ", "class", "\\", "10", ";", "documentation", " ", "for", " ", "more", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "bisect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "difflib", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fnmatch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "inspect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "keyword_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tokenize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pep", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unicode_", "=_", "str_", "\\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", "version\\u\\u_", "=_", "'", "1.0", ".1", "a0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CR", "_", "=_", "'\\\\", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LF", "_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CRL", "F_", "=_", "'\\\\", "r", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PYTHON", "\\u", "SHE", "BAN", "G", "\\u", "REGEX_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "#!", ".*\\\\", "bpy", "tho", "n", "[", "23", "]?", "\\\\", "b", "\\\\", "s", "*$'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "generat", "ing", " ", "line", " ", "shorten", "ing", " ", "candidate", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "SHORT", "EN", "\\u", "OPERATOR", "\\u", "GROUPS", "_", "=_", "frozenset_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "','_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "'%'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "','_", ",_", "'('_", ",_", "'['_", ",_", "'{'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "'%'_", ",_", "'('_", ",_", "'['_", ",_", "'{'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "','_", ",_", "'('_", ",_", "'['_", ",_", "'{'_", ",_", "'%'_", ",_", "'+'_", ",_", "'-'_", ",_", "'*'_", ",_", "'/'_", ",_", "'//'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "'%'_", ",_", "'+'_", ",_", "'-'_", ",_", "'*'_", ",_", "'/'_", ",_", "'//'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "IGNORE", "_", "=_", "'", "E2", "4", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "W", "602", " ", "is", " ", "handle", "d", " ", "separately", " ", "due", " ", "to", " ", "the", " ", "need", " ", "to", " ", "avoid", " ", "\"", "with", "\\u", "traceback", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "CODE", "\\u", "TO", "\\u", "2", "TO", "3_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "E", "721", "'_", ":_", "[_", "'", "idiom", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "W", "601", "'_", ":_", "[_", "'", "has", "\\u", "key", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "W", "603", "'_", ":_", "[_", "'", "ne", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "W", "604", "'_", ":_", "[_", "'", "repr", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "W", "690", "'_", ":_", "[_", "'", "appl", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "except", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "exit", "func", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "import", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "literal", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "opera", "tor", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "paren", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reduce", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rename", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "standard", "error", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sys", "\\u", "exc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "throw", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tuple", "\\u", "params", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xre", "adl", "ine", "s", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pep", "8_", "._", "register", "\\u", "check_", "(_", "extend", "ed", "\\u", "blank", "\\u", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "pep", "8_", "._", "\\u", "checks_", "[_", "'", "logical", "\\u", "line", "'_", "]_", "[_", "pep", "8_", "._", "continue", "d\\u", "indentation_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pep", "8_", "._", "register", "\\u", "check_", "(_", "continue", "d\\u", "indentation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "convenien", "t", " ", "way", " ", "to", " ", "handle", " ", "token", "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_", "Token_", "=_", "collections_", "._", "namedtuple_", "(_", "'", "Token", "'_", ",_", "[_", "'", "token", "\\u", "type", "'_", ",_", "'", "token", "\\u", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spo", "s", "'_", ",_", "'", "epo", "s", "'_", ",_", "'", "line", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "cache", "d\\u", "tokenizer_", "=_", "Cache", "d", "Tokenizer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "e\\u", "tokens_", "=_", "\\u", "cache", "d\\u", "tokenizer_", "._", "generat", "e\\u", "tokens_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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 ", " _", "sys_", "._", "exit_", "(_", "main_", "(_", ")_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "open", "\\u", "with", "\\u", "encoding_", "(_", "filename_", ",_", "encoding_", "=_", "None_", ",_", "mode_", "=_", "'", "r", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "opene", "d", " ", "file", " ", "with", " ", "a", " ", "specific", " ", "encoding", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "encoding_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encoding_", "=_", "detect", "\\u", "encoding_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "io_", "._", "open_", "(_", "filename_", ",_", "mode_", "=_", "mode_", ",_", "encoding_", "=_", "encoding_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "newline_", "=_", "''_", ")_", "#", " ", "Pres", "erve", " ", "line", " ", "ending", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "detect", "\\u", "encoding_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "file", " ", "encoding", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", "utf", "-", "8", "'_", "#", " ", "modifi", "ed", " ", "for", " ", "process", "ing", ".", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "readline", "s", "\\u", "from", "\\u", "file_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "content", "s", " ", "of", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open", "\\u", "with", "\\u", "encoding_", "(_", "filename_", ")_", "as_", "input", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "input", "\\u", "file_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extend", "ed", "\\u", "blank", "\\u", "lines_", "(_", "logical", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "blank", "\\u", "lines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "logical", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "for", " ", "missi", "ng", " ", "blank", " ", "lines", " ", "after", " ", "class", " ", "declaration", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "previ", "ous", "\\u", "logical", "_", "._", "startswith_", "(_", "'", "class", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "line_", "._", "startswith_", "(_", "(_", "'", "def", " ", "'_", ",_", "'", "class", " ", "'_", ",_", "'@'_", ")_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "pep", "8_", "._", "DOCS", "TRING", "\\u", "REGEX_", "._", "match_", "(_", "logical", "\\u", "line_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "indent", "\\u", "level_", "and_", "not_", "blank", "\\u", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "0_", ",_", "'", "E3", "09", " ", "expected", " ", "1", " ", "blank", " ", "line", " ", "after", " ", "class", " ", "declaration", "'_", ")_", "\\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_", "previ", "ous", "\\u", "logical", "_", "._", "startswith_", "(_", "'", "def", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "blank", "\\u", "lines_", "and_", "pep", "8_", "._", "DOCS", "TRING", "\\u", "REGEX_", "._", "match_", "(_", "logical", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "0_", ",_", "'", "E3", "03", " ", "too", " ", "many", " ", "blank", " ", "lines", " ", "({", "0", "})'_", "._", "format_", "(_", "blank", "\\u", "lines_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "pep", "8_", "._", "DOCS", "TRING", "\\u", "REGEX_", "._", "match_", "(_", "previ", "ous", "\\u", "logical", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Missing", " ", "blank", " ", "line", " ", "bet", "ween", " ", "class", " ", "docstr", "ing", " ", "and", " ", "method", " ", "declaration", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "level_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "blank", "\\u", "lines_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "line_", "._", "startswith_", "(_", "(_", "'", "def", " ", "'_", ")_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "self", "'_", "in_", "logical", "\\u", "line_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "0_", ",_", "'", "E3", "01", " ", "expected", " ", "1", " ", "blank", " ", "line", ",", " ", "found", " ", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "continue", "d\\u", "indentation_", "(_", "logical", "\\u", "line_", ",_", "tokens_", ",_", "indent", "\\u", "level_", ",_", "indent", "\\u", "char_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "no", "qa_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Override", " ", "pep", "8", "'", "s", " ", "function", " ", "to", " ", "provide", " ", "indent", "ation", " ", "informati", "on", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "row_", "=_", "tokens_", "[_", "0_", "]_", "[_", "2_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nrows_", "=_", "1_", "+_", "tokens_", "[_", "-_", "1_", "]_", "[_", "2_", "]_", "[_", "0_", "]_", "-_", "first", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "no", "qa_", "or_", "nrows_", "==_", "1_", ":_", "\\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_", "#", " ", "indent", "\\u", "next", " ", "tell", "s", " ", "us", " ", "whe", "ther", " ", "the", " ", "next", " ", "block", " ", "is", " ", "indented", ".", " ", "Assu", "ming", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "it", " ", "is", " ", "indented", " ", "by", " ", "4", " ", "space", "s", ",", " ", "then", " ", "we", " ", "shou", "ld", " ", "not", " ", "allow", " ", "4", "-", "space_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indent", "s", " ", "on", " ", "the", " ", "final", " ", "continuation", " ", "line", ".", " ", "In", " ", "turn", ",", " ", "some", " ", "other_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indent", "s", " ", "are", " ", "allow", "ed", " ", "to", " ", "have", " ", "an", " ", "extra", " ", "4", " ", "space", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "indent", "\\u", "next_", "=_", "logical", "\\u", "line_", "._", "endswith_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "=_", "depth_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "hang", "s_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ",_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "indent", "\\u", "char_", "!=_", "'\\\\", "t", "'_", "else_", "(_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "2_", "*_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reme", "mber", " ", "how", " ", "many", " ", "brackets", " ", "wer", "e", " ", "opene", "d", " ", "on", " ", "each", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "paren", "s_", "=_", "[_", "0_", "]_", "*_", "nrows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Relative", " ", "indent", "s", " ", "of", " ", "physical", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "rel", "\\u", "indent_", "=_", "[_", "0_", "]_", "*_", "nrows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "depth", ",", " ", "collect", " ", "a", " ", "list", " ", "of", " ", "opening", " ", "rows", "._", "\\u\\u\\uNL\\u\\u\\u_", "open", "\\u", "rows_", "=_", "[_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "depth", ",", " ", "memori", "ze", " ", "the", " ", "hang", "ing", " ", "indent", "ation", "._", "\\u\\u\\uNL\\u\\u\\u_", "hang", "s_", "=_", "[_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vis", "ual", " ", "indent", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "chan", "ces_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "indent_", "=_", "tokens_", "[_", "0_", "]_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent_", "=_", "[_", "last", "\\u", "indent_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "token", "\\u", "multiline", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "line_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "line", "\\u", "begins", "\\u", "with", "\\u", "multiline", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "token", "\\u", "type_", ",_", "text_", ",_", "start_", ",_", "end_", ",_", "line_", "in_", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newline_", "=_", "row_", "<_", "start_", "[_", "0_", "]_", "-_", "first", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "newline_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "start_", "[_", "0_", "]_", "-_", "first", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newline_", "=_", "(_", "not_", "last", "\\u", "token", "\\u", "multiline", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "type_", "not_", "in_", "(_", "tokenize_", "._", "NL", "_", ",_", "tokenize_", "._", "NEWLINE", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "line", "\\u", "begins", "\\u", "with", "\\u", "multiline", "_", "=_", "last", "\\u", "token", "\\u", "multiline", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "newline_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "beginn", "ing", " ", "of", " ", "a", " ", "continuation", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "indent_", "=_", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Record", " ", "the", " ", "initial", " ", "indent", "._", "\\u\\u\\uNL\\u\\u\\u_", "rel", "\\u", "indent_", "[_", "row_", "]_", "=_", "pep", "8_", "._", "expand", "\\u", "indent_", "(_", "line_", ")_", "-_", "indent", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Identif", "y", " ", "clos", "ing", " ", "bracket", "._", "\\u\\u\\uNL\\u\\u\\u_", "close", "\\u", "bracket_", "=_", "(_", "token", "\\u", "type_", "==_", "tokenize_", "._", "OP_", "and_", "text_", "in_", "']}", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Is", " ", "the", " ", "indent", " ", "relative", " ", "to", " ", "an", " ", "opening", " ", "bracket", " ", "line", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "open", "\\u", "row_", "in_", "reversed_", "(_", "open", "\\u", "rows_", "[_", "depth_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hang", "_", "=_", "rel", "\\u", "indent_", "[_", "row_", "]_", "-_", "rel", "\\u", "indent_", "[_", "open", "\\u", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hang", "ing", "\\u", "indent_", "=_", "hang", "_", "in_", "valid", "\\u", "hang", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hang", "ing", "\\u", "indent_", ":_", "\\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_", "hang", "s_", "[_", "depth_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hang", "ing", "\\u", "indent_", "=_", "(_", "hang", "_", "==_", "hang", "s_", "[_", "depth_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visu", "al", "\\u", "indent_", "=_", "(_", "not_", "close", "\\u", "bracket_", "and_", "hang", "_", ">_", "0_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "chan", "ces_", "._", "get_", "(_", "start_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "close", "\\u", "bracket_", "and_", "indent_", "[_", "depth_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Clos", "ing", " ", "bracket", " ", "for", " ", "visu", "al", " ", "indent", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "start_", "[_", "1_", "]_", "!=_", "indent_", "[_", "depth_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "(_", "start_", ",_", "'", "E1", "24", " ", "{", "0", "}'_", "._", "format_", "(_", "indent_", "[_", "depth_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "close", "\\u", "bracket_", "and_", "not_", "hang", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "indent_", "[_", "depth_", "]_", "and_", "start_", "[_", "1_", "]_", "<_", "indent_", "[_", "depth_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Vis", "ual", " ", "indent", " ", "is", " ", "broken", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "start_", ",_", "'", "E1", "2", "8", " ", "{", "0", "}'_", "._", "format_", "(_", "indent_", "[_", "depth_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "hang", "ing", "\\u", "indent_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "indent", "\\u", "next_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "rel", "\\u", "indent_", "[_", "row_", "]_", "==_", "2_", "*_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hang", "ing", " ", "indent", " ", "is", " ", "verifie", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "close", "\\u", "bracket_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "(_", "start_", ",_", "'", "E1", "23", " ", "{", "0", "}'_", "._", "format_", "(_", "indent", "\\u", "level_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "rel", "\\u", "indent_", "[_", "open", "\\u", "row_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hang", "s_", "[_", "depth_", "]_", "=_", "hang", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "visu", "al", "\\u", "indent_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Vis", "ual", " ", "indent", " ", "is", " ", "verifie", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent_", "[_", "depth_", "]_", "=_", "start_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "visu", "al", "\\u", "indent_", "in_", "(_", "text_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ignor", "e", " ", "token", " ", "line", "d", " ", "up", " ", "with", " ", "matchi", "ng", " ", "one", " ", "from", " ", "a", " ", "previ", "ous", " ", "line", "._", "\\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_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "one", "\\u", "indented", "_", "=_", "(_", "indent", "\\u", "level_", "+_", "rel", "\\u", "indent_", "[_", "open", "\\u", "row_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Indent", " ", "is", " ", "broken", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hang", "_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "error_", "=_", "(_", "'", "E1", "2", "2", "'_", ",_", "one", "\\u", "indented", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "indent_", "[_", "depth_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "error_", "=_", "(_", "'", "E1", "2", "7", "'_", ",_", "indent_", "[_", "depth_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hang", "_", ">_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "error_", "=_", "(_", "'", "E1", "2", "6", "'_", ",_", "one", "\\u", "indented", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "hang", "s_", "[_", "depth_", "]_", "=_", "hang", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "(_", "'", "E1", "21", "'_", ",_", "one", "\\u", "indented", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "(_", "start_", ",_", "'{", "0", "}", " ", "{", "1", "}'_", "._", "format_", "(_", "*_", "error_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Look", " ", "for", " ", "visu", "al", " ", "indent", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "paren", "s_", "[_", "row_", "]_", "and_", "token", "\\u", "type_", "not_", "in_", "(_", "tokenize_", "._", "NL", "_", ",_", "tokenize_", "._", "COMMENT_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "not_", "indent_", "[_", "depth_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent_", "[_", "depth_", "]_", "=_", "start_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent", "\\u", "chan", "ces_", "[_", "start_", "[_", "1_", "]_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Deal", " ", "with", " ", "implicit", " ", "string", " ", "concate", "nati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "token", "\\u", "type_", "in_", "(_", "tokenize_", "._", "STRING_", ",_", "tokenize_", "._", "COMMENT_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "in_", "(_", "'", "u", "'_", ",_", "'", "ur", "'_", ",_", "'", "b", "'_", ",_", "'", "br", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent", "\\u", "chan", "ces_", "[_", "start_", "[_", "1_", "]_", "]_", "=_", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Special", " ", "case", " ", "for", " ", "the", " ", "\"", "if", "\"", " ", "statem", "ent", " ", "bec", "aus", "e", " ", "len", "(\"", "if", " ", "(\"", ")", " ", "is", " ", "equal", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "4._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "indent", "\\u", "chan", "ces_", "and_", "not_", "row_", "and_", "not_", "depth_", "and_", "text_", "==_", "'", "if", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent", "\\u", "chan", "ces_", "[_", "end_", "[_", "1_", "]_", "+_", "1_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "text_", "==_", "':'_", "and_", "line_", "[_", "end_", "[_", "1_", "]_", ":_", "]_", "._", "isspace", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "open", "\\u", "rows_", "[_", "depth_", "]_", "._", "append_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Keep", " ", "track", " ", "of", " ", "bracket", " ", "depth", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "type_", "==_", "tokenize_", "._", "OP_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text_", "in_", "'(", "[{", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "depth_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent_", "._", "append_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hang", "s_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "open", "\\u", "rows_", ")_", "==_", "depth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "open", "\\u", "rows_", "._", "append_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "open", "\\u", "rows_", "[_", "depth_", "]_", "._", "append_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paren", "s_", "[_", "row_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "text_", "in_", "')]", "}'_", "and_", "depth_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Parent", " ", "indent", "s", " ", "shou", "ld", " ", "not", " ", "be", " ", "more", " ", "than", " ", "this", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prev", "\\u", "indent_", "=_", "indent_", "._", "pop_", "(_", ")_", "or_", "last", "\\u", "indent_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hang", "s_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "range_", "(_", "depth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "indent_", "[_", "d_", "]_", ">_", "prev", "\\u", "indent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "indent_", "[_", "d_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ind_", "in_", "list_", "(_", "indent", "\\u", "chan", "ces_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "ind_", ">=_", "prev", "\\u", "indent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "del_", "indent", "\\u", "chan", "ces_", "[_", "ind_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "open", "\\u", "rows_", "[_", "depth_", "+_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "depth_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "depth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "indent", "\\u", "chan", "ces_", "[_", "indent_", "[_", "depth_", "]_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "idx_", "in_", "range_", "(_", "row_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "paren", "s_", "[_", "idx_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "paren", "s_", "[_", "idx_", "]_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "indent_", ")_", "==_", "depth_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "[_", "1_", "]_", "not_", "in_", "indent", "\\u", "chan", "ces_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "for", " ", "purpose", "s", " ", "of", " ", "speed", "ing", " ", "up", " ", "E1", "21", " ", "(", "Git", "Hub", " ", "#", "90", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "last", "\\u", "line_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "','_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", "ow", " ", "to", " ", "line", " ", "up", " ", "token", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent", "\\u", "chan", "ces_", "[_", "start_", "[_", "1_", "]_", "]_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "token", "\\u", "multiline", "_", "=_", "(_", "start_", "[_", "0_", "]_", "!=_", "end_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "token", "\\u", "multiline", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rel", "\\u", "indent_", "[_", "end_", "[_", "0_", "]_", "-_", "first", "\\u", "row_", "]_", "=_", "rel", "\\u", "indent_", "[_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "line_", "=_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "next_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "last", "\\u", "line", "\\u", "begins", "\\u", "with", "\\u", "multiline", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "pep", "8_", "._", "expand", "\\u", "indent_", "(_", "line_", ")_", "==_", "indent", "\\u", "level_", "+_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "(_", "start_", "[_", "0_", "]_", ",_", "indent_", "[_", "0_", "]_", "+_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "(_", "pos_", ",_", "'", "E1", "25", " ", "{", "0", "}'_", "._", "format_", "(_", "indent", "\\u", "level_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "2_", "*_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "invalid", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Fix", "er", " ", "method", "s", " ", "are", " ", "prefixed", " ", "\"", "fix", "\\u\"", ".", " ", "The", " ", "\\u", "fix", "\\u", "source", "()", " ", "method", " ", "look", "s", " ", "for", " ", "these", "\\", "10", ";", " ", " ", " ", " ", "automati", "call", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "fixer", " ", "method", " ", "can", " ", "take", " ", "eit", "her", " ", "one", " ", "or", " ", "two", " ", "argu", "ment", "s", " ", "(", "in", " ", "addition", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "self", ").", " ", "The", " ", "first", " ", "argu", "ment", " ", "is", " ", "\"", "result", "\",", " ", "whi", "ch", " ", "is", " ", "the", " ", "error", " ", "informati", "on", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "pep", "8", ".", " ", "The", " ", "second", " ", "argu", "ment", ",", " ", "\"", "logical", "\",", " ", "is", " ", "require", "d", " ", "only", " ", "for", " ", "logical", "-", "line", "\\", "10", ";", " ", " ", " ", " ", "fixes", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "fixer", " ", "method", " ", "can", " ", "return", " ", "the", " ", "list", " ", "of", " ", "modifi", "ed", " ", "lines", " ", "or", " ", "Non", "e", ".", " ", "An", " ", "empty", "\\", "10", ";", " ", " ", " ", " ", "list", " ", "wou", "ld", " ", "mean", " ", "tha", "t", " ", "no", " ", "change", "s", " ", "wer", "e", " ", "made", ".", " ", "Non", "e", " ", "wou", "ld", " ", "mean", " ", "tha", "t", " ", "only", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "line", " ", "reporte", "d", " ", "in", " ", "the", " ", "pep", "8", " ", "error", " ", "was", " ", "modifi", "ed", ".", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "modifi", "ed", " ", "line", "\\", "10", ";", " ", " ", " ", " ", "numbers", " ", "tha", "t", " ", "are", " ", "return", "ed", " ", "are", " ", "indexe", "d", " ", "at", " ", "1", ".", " ", "Thi", "s", " ", "typical", "ly", " ", "wou", "ld", " ", "correspond", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "line", " ", "number", " ", "reporte", "d", " ", "in", " ", "the", " ", "pep", "8", " ", "error", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "[", "fixed", " ", "method", " ", "list", "]", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e1", "21", ",", "e1", "2", "2", ",", "e1", "23", ",", "e1", "24", ",", "e1", "25", ",", "e1", "2", "6", ",", "e1", "2", "7", ",", "e1", "2", "8", ",", "e1", "2", "9", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "01", ",", "e2", "02", ",", "e2", "03", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "11", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "21", ",", "e2", "2", "2", ",", "e2", "23", ",", "e2", "24", ",", "e2", "25", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "3", "1", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "5", "1", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "6", "1", ",", "e2", "6", "2", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e2", "7", "1", ",", "e2", "7", "2", ",", "e2", "7", "3", ",", "e2", "7", "4", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e3", "01", ",", "e3", "02", ",", "e3", "03", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e4", "01", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e5", "02", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e7", "01", ",", "e7", "02", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "e7", "11", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "w2", "9", "1", "\\", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "contents_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "filename_", "=_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "contents_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "=_", "readline", "s", "\\u", "from", "\\u", "file_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sio_", "=_", "io_", "._", "String", "IO_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "=_", "sio_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "options_", "=_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent", "\\u", "word_", "=_", "\\u", "get", "\\u", "indent", "word_", "(_", "''_", "._", "join_", "(_", "self_", "._", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", ")_", "if_", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", "is_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Many", " ", "fixer", "s", " ", "are", " ", "the", " ", "same", " ", "even", " ", "tho", "ugh", " ", "pep", "8", " ", "categoriz", "es", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "different", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "21_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "22_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "23_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "24_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "26_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "27_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "28_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e1", "29_", "=_", "self_", "._", "\\u", "fix", "\\u", "rein", "dent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "02_", "=_", "self_", "._", "fix", "\\u", "e2", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "03_", "=_", "self_", "._", "fix", "\\u", "e2", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "11_", "=_", "self_", "._", "fix", "\\u", "e2", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "21_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "22_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "23_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "26_", "=_", "self_", "._", "fix", "\\u", "e2", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "27_", "=_", "self_", "._", "fix", "\\u", "e2", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "28_", "=_", "self_", "._", "fix", "\\u", "e2", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "41_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "42_", "=_", "self_", "._", "fix", "\\u", "e2", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "61_", "=_", "self_", "._", "fix", "\\u", "e2", "62_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "72_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "73_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e2", "74_", "=_", "self_", "._", "fix", "\\u", "e2", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e3", "09_", "=_", "self_", "._", "fix", "\\u", "e3", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e5", "01_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fix", "\\u", "long", "\\u", "line", "\\u", "logical", "ly_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "and_", "(_", "options_", "._", "aggre", "ssi", "ve_", ">=_", "2_", "or_", "options_", "._", "experimental_", ")_", "else_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fix", "\\u", "long", "\\u", "line", "\\u", "physical", "ly_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "e7", "03_", "=_", "self_", "._", "fix", "\\u", "e7", "02_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "ws", "\\u", "comma", "\\u", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fix", "\\u", "source_", "(_", "self_", ",_", "results_", ")_", ":_", "\\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 ", " _", "(_", "logical", "\\u", "start_", ",_", "logical", "\\u", "end_", ")_", "=_", "\\u", "find", "\\u", "logical", "_", "(_", "self_", "._", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logical", "\\u", "support_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "Error_", ")_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logical", "\\u", "support_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "complete", "d\\u", "lines_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "result_", "in_", "sorted_", "(_", "results_", ",_", "key_", "=_", "\\u", "priorit", "y", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "result_", "[_", "'", "line", "'_", "]_", "in_", "complete", "d\\u", "lines_", ":_", "\\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_", "fixed", "\\u", "method", "name_", "=_", "'", "fix", "\\u'_", "+_", "result_", "[_", "'", "id", "'_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "fixed", "\\u", "method", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fix_", "=_", "getattr_", "(_", "self_", ",_", "fixed", "\\u", "method", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "original", "\\u", "line_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "logical", "\\u", "fix_", "=_", "len_", "(_", "inspect_", "._", "getargs", "pec_", "(_", "fix_", ")_", "._", "args_", ")_", ">_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "logical", "\\u", "fix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logical", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "logical", "\\u", "support_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logical", "_", "=_", "\\u", "get", "\\u", "logical", "_", "(_", "self_", "._", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "start_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "logical", "_", "and_", "set_", "(_", "range_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "_", "[_", "0_", "]_", "[_", "0_", "]_", "+_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "_", "[_", "1_", "]_", "[_", "0_", "]_", "+_", "1_", ")_", ")_", "._", "intersection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "d\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "modifi", "ed", "\\u", "lines_", "=_", "fix_", "(_", "result_", ",_", "logical", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "modifi", "ed", "\\u", "lines_", "=_", "fix_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "modifi", "ed", "\\u", "lines_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Force", " ", "logical", " ", "fixes", " ", "to", " ", "report", " ", "what", " ", "the", "y", " ", "modifi", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "assert_", "not_", "is", "\\u", "logical", "\\u", "fix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "==_", "original", "\\u", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "modifi", "ed", "\\u", "lines_", "=_", "[_", "]_", "\\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_", "modifi", "ed", "\\u", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "complete", "d\\u", "lines_", "._", "update_", "(_", "modifi", "ed", "\\u", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "modifi", "ed", "\\u", "lines_", "==_", "[_", "]_", ":_", "#", " ", "Emp", "ty", " ", "list", " ", "means", " ", "no", " ", "fix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "options_", "._", "verbose_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'---", ">", " ", " ", "Not", " ", "fix", "ing", " ", "{", "f", "}", " ", "on", " ", "line", " ", "{", "l", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "result_", "[_", "'", "id", "'_", "]_", ",_", "l_", "=_", "result_", "[_", "'", "line", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "We", " ", "assume", " ", "one", "-", "line", " ", "fix", " ", "whe", "n", " ", "Non", "e", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "complete", "d\\u", "lines_", "._", "add_", "(_", "result_", "[_", "'", "line", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "options_", "._", "verbose_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "->", " ", " ", "'{", "0", "}'", " ", "is", " ", "not", " ", "defin", "ed", ".\"_", "._", "format_", "(_", "fixed", "\\u", "method", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "info_", "=_", "result_", "[_", "'", "info", "'_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'---", ">", " ", " ", "{", "0", "}:", "{", "1", "}:", "{", "2", "}:", "{", "3", "}'_", "._", "format_", "(_", "self_", "._", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "[_", "'", "line", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "[_", "'", "column", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "info_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "version", " ", "of", " ", "the", " ", "source", " ", "code", " ", "with", " ", "PE", "P", " ", "8", " ", "violations", " ", "fixed", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pep", "8", "\\u", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ignore", "'_", ":_", "self_", "._", "options_", "._", "ignore_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "select", "'_", ":_", "self_", "._", "options_", "._", "select_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "line", "\\u", "length", "'_", ":_", "self_", "._", "options_", "._", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "\\u", "execute", "\\u", "pep", "8_", "(_", "pep", "8", "\\u", "options_", ",_", "self_", "._", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "progress_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "r_", "[_", "'", "id", "'_", "]_", "not_", "in_", "progress_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "progress_", "[_", "r_", "[_", "'", "id", "'_", "]_", "]_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "progress_", "[_", "r_", "[_", "'", "id", "'_", "]_", "]_", "._", "add_", "(_", "r_", "[_", "'", "line", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'---", ">", " ", " ", "{", "n", "}", " ", "issue", "(", "s", ")", " ", "to", " ", "fix", " ", "{", "progress", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "n_", "=_", "len_", "(_", "results_", ")_", ",_", "progress_", "=_", "progress_", ")_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "options_", "._", "line", "\\u", "range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", ",_", "end_", "=_", "self_", "._", "options_", "._", "line", "\\u", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "[_", "r_", "for_", "r_", "in_", "results_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "start_", "<=_", "r_", "[_", "'", "line", "'_", "]_", "<=_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "fix", "\\u", "source_", "(_", "filter", "\\u", "results_", "(_", "source_", "=_", "''_", "._", "join_", "(_", "self_", "._", "source_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "results_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "self_", "._", "options_", "._", "aggre", "ssi", "ve_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "options_", "._", "line", "\\u", "range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "number", " ", "of", " ", "lines", " ", "has", " ", "change", "d", " ", "then", " ", "change", " ", "line", "\\u", "range", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "sum_", "(_", "sline", "_", "._", "count_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "sline", "_", "in_", "self_", "._", "source_", "[_", "start_", "-_", "1_", ":_", "end_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "._", "line", "\\u", "range_", "[_", "1_", "]_", "=_", "start_", "+_", "count_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "self_", "._", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fix", "\\u", "rein", "dent_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "a", " ", "bad", "ly", " ", "indented", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "don", "e", " ", "by", " ", "addin", "g", " ", "or", " ", "remo", "ving", " ", "from", " ", "its", " ", "initial", " ", "indent", " ", "only", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "indent", "\\u", "spaces_", "=_", "int_", "(_", "result_", "[_", "'", "info", "'_", "]_", "._", "split_", "(_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "'", " ", "'_", "*_", "num", "\\u", "indent", "\\u", "spaces_", "+_", "target_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e1", "25_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "indent", "ation", " ", "undi", "stin", "gui", "sh", " ", "from", " ", "the", " ", "next", " ", "logical", " ", "line", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "indent", "\\u", "spaces_", "=_", "int_", "(_", "result_", "[_", "'", "info", "'_", "]_", "._", "split_", "(_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "space", "s", "\\u", "to", "\\u", "add_", "=_", "num", "\\u", "indent", "\\u", "spaces_", "-_", "len_", "(_", "\\u", "get", "\\u", "indentation_", "(_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent_", "=_", "len_", "(_", "\\u", "get", "\\u", "indentation_", "(_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "len_", "(_", "\\u", "get", "\\u", "indentation_", "(_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", ")_", ")_", ">=_", "indent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "(_", "'", " ", "'_", "*_", "space", "s", "\\u", "to", "\\u", "add_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "lines_", "._", "append_", "(_", "1_", "+_", "line", "\\u", "index_", ")_", "#", " ", "Line", " ", "indexe", "d", " ", "at", " ", "1._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "modifi", "ed", "\\u", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "01_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "extra", "neous", " ", "whitespace", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Av", "oid", " ", "pep", "8", " ", "bug", " ", "(", "https", "://", "git", "hub", ".", "com", "/", "jc", "roc", "hol", "l", "/", "pep", "8", "/", "issue", "s", "/", "268", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "offset_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "probab", "ly", "\\u", "part", "\\u", "of", "\\u", "multiline", "_", "(_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed_", "=_", "fix", "\\u", "whitespace_", "(_", "target_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replacement_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "24_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "extra", "neous", " ", "whitespace", " ", "aro", "und", " ", "opera", "tor", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed_", "=_", "target_", "[_", ":_", "offset_", "]_", "+_", "target_", "[_", "offset_", ":_", "]_", "._", "replace_", "(_", "'\\\\", "t", "'_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "25_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "missi", "ng", " ", "whitespace", " ", "aro", "und", " ", "opera", "tor", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed_", "=_", "target_", "[_", ":_", "offset_", "]_", "+_", "'", " ", "'_", "+_", "target_", "[_", "offset_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "proceed", " ", "if", " ", "non", "-", "whitespace", " ", "character", "s", " ", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "make", " ", "sure", " ", "we", " ", "don", "'", "t", " ", "break", " ", "the", " ", "indent", "ation", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "fixed_", "._", "replace_", "(_", "'", " ", "'_", ",_", "''_", ")_", "==_", "target_", "._", "replace_", "(_", "'", " ", "'_", ",_", "''_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "get", "\\u", "indentation_", "(_", "fixed_", ")_", "==_", "\\u", "get", "\\u", "indentation_", "(_", "target_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "fixed_", "\\u\\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_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "e2", "31_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "missi", "ng", " ", "whitespace", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Optimize", " ", "for", " ", "comma", " ", "case", ".", " ", "Thi", "s", " ", "will", " ", "fix", " ", "all", " ", "commas", " ", "in", " ", "the", " ", "full", " ", "source_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "in", " ", "one", " ", "pass", ".", " ", "Don", "'", "t", " ", "do", " ", "this", " ", "more", " ", "than", " ", "onc", "e", ".", " ", "If", " ", "it", " ", "fail", "s", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "time", ",", " ", "there", " ", "is", " ", "no", " ", "point", " ", "in", " ", "try", "ing", " ", "again", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "','_", "in_", "result_", "[_", "'", "info", "'_", "]_", "and_", "not_", "self_", "._", "\\u", "ws", "\\u", "comma", "\\u", "done_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "ws", "\\u", "comma", "\\u", "done_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "original_", "=_", "''_", "._", "join_", "(_", "self_", "._", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "refactor", "_", "(_", "original_", ",_", "[_", "'", "ws", "\\u", "comma", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "original_", "._", "strip_", "(_", ")_", "!=_", "new_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "=_", "[_", "new_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "range_", "(_", "1_", ",_", "1_", "+_", "len_", "(_", "original_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed_", "=_", "target_", "[_", ":_", "offset_", "]_", "+_", "'", " ", "'_", "+_", "target_", "[_", "offset_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "51_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "whitespace", " ", "aro", "und", " ", "parameter", " ", "'=", "'", " ", "sign", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "necessar", "y", " ", "sinc", "e", " ", "pep", "8", " ", "somet", "imes", " ", "report", "s", " ", "column", "s", " ", "tha", "t", " ", "go", "es_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "past", " ", "the", " ", "end", " ", "of", " ", "the", " ", "physical", " ", "line", ".", " ", "Thi", "s", " ", "happ", "ens", " ", "in", " ", "case", "s", " ", "like", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "foo", "(", "bar", "\\\\", "n", "=", "Non", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "min_", "(_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "target_", ")_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "target_", "[_", "c_", "]_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "target_", "[_", ":_", "c_", "]_", "._", "rstrip_", "(_", ")_", "+_", "target_", "[_", "c_", ":_", "]_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "coul", "d", " ", "be", " ", "an", " ", "escaped", " ", "newline_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "foo", "(", "a", "=\\\\", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fixed_", "._", "endswith_", "(_", "(_", "'=", "\\\\\\\\\\\\", "n", "'_", ",_", "'=", "\\\\\\\\\\\\", "r", "\\\\", "n", "'_", ",_", "'=", "\\\\\\\\\\\\", "r", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "fixed_", "._", "rstrip_", "(_", "'\\\\", "n", "\\\\", "r", " ", "\\\\", "t", "\\\\\\\\'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "+_", "1_", "]_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "+_", "1_", "]_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line", "\\u", "index_", "+_", "1_", ",_", "line", "\\u", "index_", "+_", "2_", "]_", "#", " ", "Line", " ", "indexe", "d", " ", "at", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "62_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "spaci", "ng", " ", "after", " ", "comment", " ", "hash", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "target_", "[_", ":_", "offset_", "]_", "._", "rstrip_", "(_", "'", " ", "\\\\", "t", "#'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comment_", "=_", "target_", "[_", "offset_", ":_", "]_", "._", "lstrip_", "(_", "'", " ", "\\\\", "t", "#'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed_", "=_", "code_", "+_", "(_", "'", " ", " ", "#", " ", "'_", "+_", "comment_", "if_", "comment_", "._", "strip_", "(_", ")_", "else_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "71_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "extra", "neous", " ", "whitespace", " ", "aro", "und", " ", "keywords", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "probab", "ly", "\\u", "part", "\\u", "of", "\\u", "multiline", "_", "(_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed_", "=_", "fix", "\\u", "whitespace_", "(_", "target_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replacement_", "=_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "fixed_", "==_", "target_", ":_", "\\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 ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "e3", "01_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "missi", "ng", " ", "blank", " ", "line", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cr_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "cr_", "+_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e3", "02_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "missi", "ng", " ", "2", " ", "blank", " ", "lines", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "linenum_", "=_", "2_", "-_", "int_", "(_", "result_", "[_", "'", "info", "'_", "]_", "._", "split_", "(_", ")_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cr_", "=_", "'\\\\", "n", "'_", "*_", "add", "\\u", "linenum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "cr_", "+_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e3", "03_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "extra", " ", "blank", " ", "lines", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "\\u", "linenum_", "=_", "int_", "(_", "result_", "[_", "'", "info", "'_", "]_", "._", "split_", "(_", "'('_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "')'_", ")_", "[_", "0_", "]_", ")_", "-_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "\\u", "linenum_", "=_", "max_", "(_", "1_", ",_", "delete", "\\u", "linenum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "need", " ", "to", " ", "count", " ", "bec", "aus", "e", " ", "pep", "8", " ", "report", "s", " ", "an", " ", "offset", " ", "line", " ", "number", " ", "if", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "comment", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "cnt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cnt_", "<_", "delete", "\\u", "linenum_", "and_", "line_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "source_", "[_", "line_", "]_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "lines_", "._", "append_", "(_", "1_", "+_", "line_", ")_", "#", " ", "Line", " ", "indexe", "d", " ", "at", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "modifi", "ed", "\\u", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e3", "04_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "blank", " ", "line", " ", "follow", "ing", " ", "function", " ", "decorat", "or", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "source_", "[_", "line_", "]_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "e4", "01_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Put", " ", "import", "s", " ", "on", " ", "separate", " ", "lines", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "target_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'", "import", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "indentation_", "=_", "re_", "._", "split_", "(_", "pattern_", "=_", "r", "'\\\\", "bi", "mpor", "t", "\\\\", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "=_", "target_", ",_", "maxsp", "lit_", "=_", "1_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed_", "=_", "(_", "target_", "[_", ":_", "offset_", "]_", "._", "rstrip_", "(_", "'\\\\", "t", " ", ",'_", ")_", "+_", "'\\\\", "n", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "indentation_", "+_", "'", "import", " ", "'_", "+_", "target_", "[_", "offset_", ":_", "]_", "._", "lstrip_", "(_", "'\\\\", "t", " ", ",'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "long", "\\u", "line", "\\u", "logical", "ly_", "(_", "self_", ",_", "result_", ",_", "logical", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tr", "y", " ", "to", " ", "make", " ", "lines", " ", "fit", " ", "within", " ", "--", "max", "-", "line", "-", "length", " ", "character", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "logical", "_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "logical", "_", "[_", "2_", "]_", ")_", "==_", "1_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "fix", "\\u", "long", "\\u", "line", "\\u", "physical", "ly_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start", "\\u", "line", "\\u", "index_", "=_", "logical", "_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "line", "\\u", "index_", "=_", "logical", "_", "[_", "1_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logical", "\\u", "lines_", "=_", "logical", "_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "source_", ",_", "start", "\\u", "line", "\\u", "index_", "-_", "1_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "line_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "source_", ",_", "end", "\\u", "line", "\\u", "index_", "+_", "1_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "single", "\\u", "line_", "=_", "join", "\\u", "logical", "\\u", "line_", "(_", "''_", "._", "join_", "(_", "logical", "\\u", "lines_", ")_", ")_", "\\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 ", " _", "fixed_", "=_", "self_", "._", "fix", "\\u", "long", "\\u", "line_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "=_", "single", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "previ", "ous", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "line_", "=_", "next", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "original_", "=_", "''_", "._", "join_", "(_", "logical", "\\u", "lines_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "fix", "\\u", "long", "\\u", "line", "\\u", "physical", "ly_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line", "\\u", "index_", "in_", "range_", "(_", "start", "\\u", "line", "\\u", "index_", ",_", "end", "\\u", "line", "\\u", "index_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "source_", "[_", "start", "\\u", "line", "\\u", "index_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "range_", "(_", "start", "\\u", "line", "\\u", "index_", "+_", "1_", ",_", "end", "\\u", "line", "\\u", "index_", "+_", "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 ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "long", "\\u", "line", "\\u", "physical", "ly_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tr", "y", " ", "to", " ", "make", " ", "lines", " ", "fit", " ", "within", " ", "--", "max", "-", "line", "-", "length", " ", "character", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "source_", ",_", "line", "\\u", "index_", "-_", "1_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "line_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "source_", ",_", "line", "\\u", "index_", "+_", "1_", ",_", "default_", "=_", "''_", ")_", "\\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 ", " _", "fixed_", "=_", "self_", "._", "fix", "\\u", "long", "\\u", "line_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "=_", "target_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "previ", "ous", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "line_", "=_", "next", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "original_", "=_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line", "\\u", "index_", "+_", "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 ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "long", "\\u", "line_", "(_", "self_", ",_", "target_", ",_", "previ", "ous", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "line_", ",_", "original_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cache", "\\u", "entry_", "=_", "(_", "target_", ",_", "previ", "ous", "\\u", "line_", ",_", "next", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cache", "\\u", "entry_", "in_", "self_", "._", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "target_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wra", "p", " ", "commente", "d", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "shorten", "\\u", "comment_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "target_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", "=_", "self_", "._", "options_", "._", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "comment_", "=_", "not_", "next", "\\u", "line_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed_", "=_", "get", "\\u", "fixed", "\\u", "long", "\\u", "line_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "=_", "target_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "previ", "ous", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "original_", "=_", "original_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "word_", "=_", "self_", "._", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", "=_", "self_", "._", "options_", "._", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "self_", "._", "options_", "._", "aggre", "ssi", "ve_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experimental_", "=_", "self_", "._", "options_", "._", "experimental_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbose_", "=_", "self_", "._", "options_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fixed_", "and_", "not_", "code", "\\u", "alm", "ost", "\\u", "equal_", "(_", "original_", ",_", "fixed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fixed_", "\\u\\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", "line", "\\u", "ignore", "\\u", "cache_", "._", "add_", "(_", "cache", "\\u", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "e5", "02_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "extra", "neous", " ", "escape", " ", "of", " ", "newline", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "target_", "._", "rstrip_", "(_", "'\\\\", "n", "\\\\", "r", " ", "\\\\", "t", "\\\\\\\\'_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e7", "01_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Put", " ", "colon", "-", "separate", "d", " ", "compo", "und", " ", "statem", "ent", " ", "on", " ", "separate", " ", "lines", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "result_", "[_", "'", "column", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Av", "oid", " ", "pep", "8", " ", "bug", " ", "(", "https", "://", "git", "hub", ".", "com", "/", "jc", "roc", "hol", "l", "/", "pep", "8", "/", "issue", "s", "/", "268", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "line", "\\u", "index_", ">_", "0_", "and_", "'\\\\\\\\'_", "in_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed", "\\u", "source_", "=_", "(_", "target_", "[_", ":_", "c_", "]_", "+_", "'\\\\", "n", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "get", "\\u", "indentation_", "(_", "target_", ")_", "+_", "self_", "._", "indent", "\\u", "word_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "[_", "c_", ":_", "]_", "._", "lstrip_", "(_", "'\\\\", "n", "\\\\", "r", " ", "\\\\", "t", "\\\\\\\\'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "fixed", "\\u", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "result_", "[_", "'", "line", "'_", "]_", ",_", "result_", "[_", "'", "line", "'_", "]_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e7", "02_", "(_", "self_", ",_", "result_", ",_", "logical", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Put", " ", "semico", "lon", "-", "separate", "d", " ", "compo", "und", " ", "statem", "ent", " ", "on", " ", "separate", " ", "lines", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "logical", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logical", "\\u", "lines_", "=_", "logical", "_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "target_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "'\\\\\\\\'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Normalize", " ", "'", "1", ";", " ", "\\\\\\\\\\\\", "n2", "'", " ", "int", "o", " ", "'", "1", ";", " ", "2", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "target_", "._", "rstrip_", "(_", "'\\\\", "n", " ", "\\\\", "r", "\\\\", "t", "\\\\\\\\'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "+_", "1_", "]_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "+_", "1_", "]_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line", "\\u", "index_", "+_", "1_", ",_", "line", "\\u", "index_", "+_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "target_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "';'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "target_", "._", "rstrip_", "(_", "'\\\\", "n", " ", "\\\\", "r", "\\\\", "t", ";'_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line", "\\u", "index_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first_", "=_", "target_", "[_", ":_", "offset_", "]_", "._", "rstrip_", "(_", "';'_", ")_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second_", "=_", "(_", "\\u", "get", "\\u", "indentation_", "(_", "logical", "\\u", "lines_", "[_", "0_", "]_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "[_", "offset_", ":_", "]_", "._", "lstrip_", "(_", "';'_", ")_", "._", "lstrip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "first_", "+_", "'\\\\", "n", "'_", "+_", "second_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line", "\\u", "index_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e7", "11_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "compa", "ris", "on", " ", "with", " ", "Non", "e", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "right", "\\u", "offset_", "=_", "offset_", "+_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "right", "\\u", "offset_", ">=_", "len_", "(_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "left_", "=_", "target_", "[_", ":_", "offset_", "]_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "center_", "=_", "target_", "[_", "offset_", ":_", "right", "\\u", "offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right_", "=_", "target_", "[_", "right", "\\u", "offset_", ":_", "]_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "right_", "._", "startswith_", "(_", "'", "Non", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "center_", "._", "strip_", "(_", ")_", "==_", "'=='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "center_", "=_", "'", "is", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "center_", "._", "strip_", "(_", ")_", "==_", "'!='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "center_", "=_", "'", "is", " ", "not", "'_", "\\u\\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_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "'", " ", "'_", "._", "join_", "(_", "[_", "left_", ",_", "new", "\\u", "center_", ",_", "right_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e7", "12_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "compa", "ris", "on", " ", "with", " ", "boolean", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "index_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Handle", " ", "very", " ", "easy", " ", "\"", "not", "\"", " ", "special", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "r", "'", "^", "\\\\", "s", "*", "if", " ", "\\\\", "w", "+", " ", "==", " ", "Fal", "se", ":$", "'_", ",_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "re_", "._", "sub_", "(_", "r", "'", "if", " ", "(\\\\", "w", "+)", " ", "==", " ", "Fal", "se", ":'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'", "if", " ", "not", " ", "\\\\", "1", ":'_", ",_", "target_", ",_", "count_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "._", "match_", "(_", "r", "'", "^", "\\\\", "s", "*", "if", " ", "\\\\", "w", "+", " ", "!=", " ", "Tru", "e", ":$", "'_", ",_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "re_", "._", "sub_", "(_", "r", "'", "if", " ", "(\\\\", "w", "+)", " ", "!=", " ", "Tru", "e", ":'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'", "if", " ", "not", " ", "\\\\", "1", ":'_", ",_", "target_", ",_", "count_", "=_", "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 ", " _", "right", "\\u", "offset_", "=_", "offset_", "+_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "right", "\\u", "offset_", ">=_", "len_", "(_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "left_", "=_", "target_", "[_", ":_", "offset_", "]_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "center_", "=_", "target_", "[_", "offset_", ":_", "right", "\\u", "offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right_", "=_", "target_", "[_", "right", "\\u", "offset_", ":_", "]_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Handle", " ", "simple", " ", "case", "s", " ", "only", "._", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "right_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "center_", "._", "strip_", "(_", ")_", "==_", "'=='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "re_", "._", "match_", "(_", "r", "'\\\\", "b", "Tru", "e", "\\\\", "b", "'_", ",_", "right_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "new", "\\u", "right_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\", "b", "Tru", "e", "\\\\", "b", " ", "*'_", ",_", "''_", ",_", "right_", ",_", "count_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "center_", "._", "strip_", "(_", ")_", "==_", "'!='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "re_", "._", "match_", "(_", "r", "'\\\\", "b", "Fal", "se", "\\\\", "b", "'_", ",_", "right_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "new", "\\u", "right_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\", "b", "Fal", "se", "\\\\", "b", " ", "*'_", ",_", "''_", ",_", "right_", ",_", "count_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "new", "\\u", "right_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "new", "\\u", "right_", "[_", "0_", "]_", "._", "isal", "num_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "right_", "=_", "'", " ", "'_", "+_", "new", "\\u", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "source_", "[_", "line", "\\u", "index_", "]_", "=_", "left_", "+_", "new", "\\u", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fix", "PE", "P", "8_", "(_", "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_", "fix", "\\u", "w2", "91_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "trail", "ing", " ", "whitespace", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "line_", "=_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "[_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "]_", "=_", "fixed", "\\u", "line_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "fixed", "\\u", "long", "\\u", "line_", "(_", "target_", ",_", "previ", "ous", "\\u", "line_", ",_", "original_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "word_", "=_", "'", " ", " ", " ", " ", "'_", ",_", "max", "\\u", "line", "\\u", "length_", "=_", "79_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "False_", ",_", "experimental_", "=_", "False_", ",_", "verbose_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Break", " ", "up", " ", "long", " ", "line", " ", "and", " ", "return", " ", "result", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Do", " ", "this", " ", "by", " ", "generat", "ing", " ", "multiple", " ", "reformat", "ted", " ", "candidate", "s", " ", "and", " ", "then", "\\", "10", ";", " ", " ", " ", " ", "ranking", " ", "the", " ", "candidate", "s", " ", "to", " ", "heuristic", "ally", " ", "select", " ", "the", " ", "best", " ", "option", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent_", "=_", "\\u", "get", "\\u", "indentation_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "target_", "[_", "len_", "(_", "indent_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "source_", "._", "lstrip_", "(_", ")_", "==_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "partial", " ", "multiline", "._", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", "=_", "list_", "(_", "generat", "e\\u", "tokens_", "(_", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "candidates_", "=_", "shorten", "\\u", "line_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", ",_", "source_", ",_", "indent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "aggre", "ssi", "ve_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experimental_", "=_", "experimental_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "previ", "ous", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", " ", "sort", " ", "alphabetic", "ally", " ", "as", " ", "a", " ", "tie", " ", "break", "er", " ", "(", "for", " ", "determini", "sm", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "candidates_", "=_", "sorted_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "set_", "(_", "candidates_", ")_", "._", "union_", "(_", "[_", "target_", ",_", "original_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "lambda_", "x_", ":_", "line", "\\u", "shorten", "ing", "\\u", "rank_", "(_", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", ">=_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "(_", "'-'_", "*_", "79_", "+_", "'\\\\", "n", "'_", ")_", "._", "join_", "(_", "[_", "''_", "]_", "+_", "candidates_", "+_", "[_", "''_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "codecs_", "._", "getw", "riter", "_", "(_", "'", "utf", "-", "8", "'_", ")_", "(_", "sys_", "._", "stderr_", "._", "buffer_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "sys_", "._", "stderr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "buffer", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "sys_", "._", "stderr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "candidates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "candidates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "join", "\\u", "logical", "\\u", "line_", "(_", "logical", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "single", " ", "line", " ", "based", " ", "on", " ", "logical", " ", "line", " ", "input", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indentation_", "=_", "\\u", "get", "\\u", "indentation_", "(_", "logical", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "indentation_", "+_", "unto", "ken", "ize", "\\u", "with", "out", "\\u", "newlines_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "generat", "e\\u", "tokens_", "(_", "logical", "\\u", "line_", "._", "lstrip_", "(_", ")_", ")_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unto", "ken", "ize", "\\u", "with", "out", "\\u", "newlines_", "(_", "tokens_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "source", " ", "code", " ", "based", " ", "on", " ", "token", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "row_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "column_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token", "\\u", "string_", "=_", "t_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "start", "\\u", "row_", ",_", "start", "\\u", "column_", ")_", "=_", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "end", "\\u", "row_", ",_", "end", "\\u", "column_", ")_", "=_", "t_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "start", "\\u", "row_", ">_", "last", "\\u", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "column_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "start", "\\u", "column_", ">_", "last", "\\u", "column_", "or_", "token", "\\u", "string_", "==_", "'\\\\", "n", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "text_", "._", "endswith_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "'", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "string_", "!=_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "token", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "row_", "=_", "end", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "column_", "=_", "end", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "find", "\\u", "logical", "_", "(_", "source", "\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "a", " ", "variab", "le", " ", "whi", "ch", " ", "is", " ", "the", " ", "index", " ", "of", " ", "all", " ", "the", " ", "starts", " ", "of", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logical", "\\u", "start_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logical", "\\u", "end_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "newline_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paren", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "generat", "e\\u", "tokens_", "(_", "''_", "._", "join_", "(_", "source", "\\u", "lines_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "t_", "[_", "0_", "]_", "in_", "[_", "tokenize_", "._", "COMMENT_", ",_", "tokenize_", "._", "DED", "ENT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tokenize_", "._", "INDENT", "_", ",_", "tokenize_", "._", "NL", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tokenize_", "._", "END", "MARKER", "_", "]_", ":_", "\\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_", "not_", "paren", "s_", "and_", "t_", "[_", "0_", "]_", "in_", "[_", "tokenize_", "._", "NEWLINE", "_", ",_", "tokenize_", "._", "SEMI", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "newline_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logical", "\\u", "end_", "._", "append_", "(_", "(_", "t_", "[_", "3_", "]_", "[_", "0_", "]_", "-_", "1_", ",_", "t_", "[_", "2_", "]_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "last", "\\u", "newline_", "and_", "not_", "paren", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logical", "\\u", "start_", "._", "append_", "(_", "(_", "t_", "[_", "2_", "]_", "[_", "0_", "]_", "-_", "1_", ",_", "t_", "[_", "2_", "]_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "newline_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "t_", "[_", "0_", "]_", "==_", "tokenize_", "._", "OP_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "t_", "[_", "1_", "]_", "in_", "'(", "[{", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paren", "s_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "t_", "[_", "1_", "]_", "in_", "'}", "])'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paren", "s_", "-=_", "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_", "return_", "(_", "logical", "\\u", "start_", ",_", "logical", "\\u", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "logical", "_", "(_", "source", "\\u", "lines_", ",_", "result_", ",_", "logical", "\\u", "start_", ",_", "logical", "\\u", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "logical", " ", "line", " ", "correspond", "ing", " ", "to", " ", "the", " ", "result", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Assume", "s", " ", "input", " ", "is", " ", "alr", "ead", "y", " ", "E", "702", "-", "clean", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "result_", "[_", "'", "line", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col_", "=_", "result_", "[_", "'", "column", "'_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "le_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "logical", "\\u", "start_", ")_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "logical", "\\u", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "logical", "\\u", "end_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x_", "[_", "0_", "]_", ">_", "row_", "or_", "(_", "x_", "[_", "0_", "]_", "==_", "row_", "and_", "x_", "[_", "1_", "]_", ">_", "col_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "le_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls_", "=_", "logical", "\\u", "start_", "[_", "i_", "]_", "\\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_", "if_", "ls_", "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_", "original_", "=_", "source", "\\u", "lines_", "[_", "ls_", "[_", "0_", "]_", ":_", "le_", "[_", "0_", "]_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ls_", ",_", "le_", ",_", "original_", "\\u\\u\\uNEWLINE\\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", "item_", "(_", "items_", ",_", "index_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "0_", "<=_", "index_", "<_", "len_", "(_", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "items_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rein", "dent_", "(_", "source_", ",_", "indent", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Rein", "dent", " ", "all", " ", "lines", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rein", "dent", "er_", "=_", "Rein", "dent", "er_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rein", "dent", "er_", "._", "run_", "(_", "indent", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "code", "\\u", "alm", "ost", "\\u", "equal_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "code", " ", "is", " ", "similar", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ignor", "e", " ", "whitespace", " ", "whe", "n", " ", "compa", "ring", " ", "specific", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "\\u", "a_", "=_", "split", "\\u", "and", "\\u", "strip", "\\u", "non", "\\u", "empty", "\\u", "lines_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "\\u", "b_", "=_", "split", "\\u", "and", "\\u", "strip", "\\u", "non", "\\u", "empty", "\\u", "lines_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "split", "\\u", "a_", ")_", "!=_", "len_", "(_", "split", "\\u", "b_", ")_", ":_", "\\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_", "for_", "index_", "in_", "range_", "(_", "len_", "(_", "split", "\\u", "a_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "''_", "._", "join_", "(_", "split", "\\u", "a_", "[_", "index_", "]_", "._", "split_", "(_", ")_", ")_", "!=_", "''_", "._", "join_", "(_", "split", "\\u", "b_", "[_", "index_", "]_", "._", "split_", "(_", ")_", ")_", ":_", "\\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_", "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_", "split", "\\u", "and", "\\u", "strip", "\\u", "non", "\\u", "empty", "\\u", "lines_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "lines", " ", "split", " ", "by", " ", "newline", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ignor", "e", " ", "empty", " ", "lines", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line_", "._", "strip_", "(_", ")_", "for_", "line_", "in_", "text_", "._", "splitlines_", "(_", ")_", "if_", "line_", "._", "strip_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "e2", "65_", "(_", "source_", ",_", "aggre", "ssi", "ve_", "=_", "False_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "unu", "sed", "-", "argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Format", " ", "block", " ", "comment", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'#'_", "not_", "in_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Optim", "izatio", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ignore", "d\\u", "line", "\\u", "numbers_", "=_", "multiline", "\\u", "string", "\\u", "lines_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "docstrings", "_", "=_", "True_", ")_", "|_", "set_", "(_", "commente", "d\\u", "out", "\\u", "code", "\\u", "lines_", "(_", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sio_", "=_", "io_", "._", "String", "IO_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "index_", ",_", "line_", ")_", "in_", "enumerate_", "(_", "sio_", "._", "readlines_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "\\u", "number_", "=_", "index_", "+_", "1_", "#", " ", "process", "ing", ".", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "line", "\\u", "number_", "not_", "in_", "ignore", "d\\u", "line", "\\u", "numbers_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indentation_", "=_", "\\u", "get", "\\u", "indentation_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "line_", "._", "lstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Normalize", " ", "beginn", "ing", " ", "if", " ", "not", " ", "a", " ", "she", "bang", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "line_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Leav", "e", " ", "multiple", " ", "space", "s", " ", "like", " ", "'#", " ", " ", " ", " ", "'", " ", "alo", "ne", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "line_", "._", "count_", "(_", "'#'_", ")_", ">_", "1_", "or_", "line_", "[_", "1_", "]_", "._", "isal", "num_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Leav", "e", " ", "sty", "listi", "c", " ", "outline", "d", " ", "blocks", " ", "alo", "ne", "._", "\\u\\u\\uNL\\u\\u\\u_", "and_", "not_", "line_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "'#'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line_", "=_", "'#", " ", "'_", "+_", "line_", "._", "lstrip_", "(_", "'#", " ", "\\\\", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed", "\\u", "lines_", "._", "append_", "(_", "indentation_", "+_", "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 ", " _", "fixed", "\\u", "lines_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "fixed", "\\u", "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_", "def_", "refactor", "_", "(_", "source_", ",_", "fixer", "\\u", "names_", ",_", "ignore_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "refactor", "ed", " ", "code", " ", "usi", "ng", " ", "lib", "2t", "o3", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ski", "p", " ", "if", " ", "ignore", " ", "string", " ", "is", " ", "produce", "d", " ", "in", " ", "the", " ", "refactor", "ed", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "source_", "#", " ", "process", "ing", ".", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "code", "\\u", "to", "\\u", "2t", "o3", "_", "(_", "select_", ",_", "ignore_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixes", "_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "code_", ",_", "fix_", "in_", "CODE", "\\u", "TO", "\\u", "2", "TO", "3_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "code", "\\u", "match_", "(_", "code_", ",_", "select_", "=_", "select_", ",_", "ignore_", "=_", "ignore_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixes", "_", "|=_", "set_", "(_", "fix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "fixes", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "2t", "o3", "_", "(_", "source_", ",_", "aggre", "ssi", "ve_", "=_", "True_", ",_", "select_", "=_", "None_", ",_", "ignore_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "vari", "ous", " ", "depre", "cated", " ", "code", " ", "(", "via", " ", "lib", "2t", "o3", ").\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "aggre", "ssi", "ve_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "select_", "=_", "select_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ignore_", "=_", "ignore_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "refactor", "_", "(_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "code", "\\u", "to", "\\u", "2t", "o3", "_", "(_", "select_", "=_", "select_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ignore_", "=_", "ignore_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "w", "602", "_", "(_", "source_", ",_", "aggre", "ssi", "ve_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "depre", "cated", " ", "form", " ", "of", " ", "rais", "ing", " ", "exception", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "aggre", "ssi", "ve_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "refactor", "_", "(_", "source_", ",_", "[_", "'", "raise", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ignore_", "=_", "'", "with", "\\u", "traceback", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "\\u", "newline_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "type", " ", "of", " ", "newline", " ", "used", " ", "in", " ", "source", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Inp", "ut", " ", "is", " ", "a", " ", "list", " ", "of", " ", "lines", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "isinstance_", "(_", "source_", ",_", "unicode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "counter_", "=_", "collections_", "._", "defaultdict_", "(_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "endswith_", "(_", "CRL", "F_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counter_", "[_", "CRL", "F_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "endswith_", "(_", "CR", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counter_", "[_", "CR", "_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "endswith_", "(_", "LF", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counter_", "[_", "LF", "_", "]_", "+=_", "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_", "return_", "(_", "sorted_", "(_", "counter_", ",_", "key_", "=_", "counter_", "._", "get_", ",_", "reverse_", "=_", "True_", ")_", "or_", "[_", "LF", "_", "]_", ")_", "[_", "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_", "\\u", "get", "\\u", "indent", "word_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "indent", "ation", " ", "type", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent", "\\u", "word_", "=_", "'", " ", " ", " ", " ", "'_", "#", " ", "Default", " ", "in", " ", "case", " ", "source", " ", "has", " ", "no", " ", "indentation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "generat", "e\\u", "tokens_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "t_", "[_", "0_", "]_", "==_", "token_", "._", "INDENT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent", "\\u", "word_", "=_", "t_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "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_", "indent", "\\u", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "indentation_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "lead", "ing", " ", "whitespace", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "non", "\\u", "whitespace", "\\u", "index_", "=_", "len_", "(_", "line_", ")_", "-_", "len_", "(_", "line_", "._", "lstrip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "line_", "[_", ":_", "non", "\\u", "whitespace", "\\u", "index_", "]_", "\\u\\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_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "diff", "\\u", "text_", "(_", "old_", ",_", "new_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "text", " ", "of", " ", "unifie", "d", " ", "diff", " ", "bet", "ween", " ", "old", " ", "and", " ", "new", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newline_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "difflib", "_", "._", "unifie", "d\\u", "diff_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "old_", ",_", "new_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "original", "/'_", "+_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fixed", "/'_", "+_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "linet", "erm", "_", "=_", "newline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Work", " ", "aro", "und", " ", "missi", "ng", " ", "newline", " ", "(", "http", "://", "bug", "s", ".", "python", ".", "org", "/", "issue", "214", "2", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text_", "and_", "not_", "line_", "._", "endswith_", "(_", "newline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "newline_", "+_", "r", "'\\\\", " ", "No", " ", "newline", " ", "at", " ", "end", " ", "of", " ", "file", "'_", "+_", "newline_", "\\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_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "priorit", "y", "\\u", "key_", "(_", "pep", "8", "\\u", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Key", " ", "for", " ", "sorting", " ", "PE", "P", "8", " ", "results", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Global", " ", "fixes", " ", "shou", "ld", " ", "be", " ", "don", "e", " ", "first", ".", " ", "Thi", "s", " ", "is", " ", "importa", "nt", " ", "for", " ", "thing", "s", " ", "like", "\\", "10", ";", " ", " ", " ", " ", "indent", "ation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priority_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", " ", "multiline", " ", "colon", "-", "based", " ", "bef", "ore", " ", "semico", "lon", " ", "based", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "e7", "01", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Break", " ", "multiline", " ", "statem", "ents", " ", "ear", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "e7", "02", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thin", "gs", " ", "tha", "t", " ", "make", " ", "lines", " ", "long", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "e2", "25", "'_", ",_", "'", "e2", "3", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "extra", "neous", " ", "whitespace", " ", "bef", "ore", " ", "break", "ing", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "e2", "01", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Short", "en", " ", "whitespace", " ", "in", " ", "comment", " ", "bef", "ore", " ", "reso", "rti", "ng", " ", "to", " ", "wrapp", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "e2", "6", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "middle", "\\u", "index_", "=_", "10000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lowe", "st", "\\u", "priority_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "need", " ", "to", " ", "shorten", " ", "lines", " ", "last", " ", "sinc", "e", " ", "the", " ", "logical", " ", "fixer", " ", "can", " ", "get", " ", "in", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "loop", ",", " ", "whi", "ch", " ", "caus", "es", " ", "us", " ", "to", " ", "exit", " ", "ear", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "'", "e5", "01", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "pep", "8", "\\u", "result_", "[_", "'", "id", "'_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "priority_", "._", "index_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "middle", "\\u", "index_", "+_", "lowe", "st", "\\u", "priority_", "._", "index_", "(_", "key_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "middle", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "shorten", "\\u", "line_", "(_", "tokens_", ",_", "source_", ",_", "indentation_", ",_", "indent", "\\u", "word_", ",_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "False_", ",_", "experimental_", "=_", "False_", ",_", "previ", "ous", "\\u", "line_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Separate", " ", "line", " ", "at", " ", "OPERATOR", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Multipl", "e", " ", "candidate", "s", " ", "will", " ", "be", " ", "yield", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "candidate_", "in_", "\\u", "shorten", "\\u", "line_", "(_", "tokens_", "=_", "tokens_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indentation_", "=_", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "word_", "=_", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "aggre", "ssi", "ve_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "line_", "=_", "previ", "ous", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "candidate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "aggre", "ssi", "ve_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key", "\\u", "token", "\\u", "strings_", "in_", "SHORT", "EN", "\\u", "OPERATOR", "\\u", "GROUPS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shorten", "ed_", "=_", "\\u", "shorten", "\\u", "line", "\\u", "at", "\\u", "tokens_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", "=_", "tokens_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indentation_", "=_", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "word_", "=_", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "token", "\\u", "strings_", "=_", "key", "\\u", "token", "\\u", "strings_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "aggre", "ssi", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "shorten", "ed_", "is_", "not_", "None_", "and_", "shorten", "ed_", "!=_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "shorten", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "experimental_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "shorten", "ed_", "in_", "\\u", "shorten", "\\u", "line", "\\u", "at", "\\u", "token", "s", "\\u", "new_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", "=_", "tokens_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indentation_", "=_", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", "=_", "max", "\\u", "line", "\\u", "length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "shorten", "ed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "shorten", "\\u", "line_", "(_", "tokens_", ",_", "source_", ",_", "indentation_", ",_", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "False_", ",_", "previ", "ous", "\\u", "line_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Separate", " ", "line", " ", "at", " ", "OPERATOR", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "input", " ", "is", " ", "expected", " ", "to", " ", "be", " ", "free", " ", "of", " ", "newline", "s", " ", "except", " ", "for", " ", "insi", "de", " ", "multiline", "\\", "10", ";", " ", " ", " ", " ", "string", "s", " ", "and", " ", "at", " ", "the", " ", "end", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Multipl", "e", " ", "candidate", "s", " ", "will", " ", "be", " ", "yield", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "token", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "offset_", ")_", "in_", "token", "\\u", "offsets_", "(_", "tokens_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "type_", "==_", "tokenize_", "._", "COMMENT_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "is", "\\u", "probab", "ly", "\\u", "part", "\\u", "of", "\\u", "multiline", "_", "(_", "previ", "ous", "\\u", "line_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "is", "\\u", "probab", "ly", "\\u", "part", "\\u", "of", "\\u", "multiline", "_", "(_", "source_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "source_", "[_", "start", "\\u", "offset_", "+_", "1_", ":_", "]_", "._", "strip_", "(_", ")_", "._", "lower_", "(_", ")_", "._", "startswith_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "no", "qa", "'_", ",_", "'", "pragma", ":'_", ",_", "'", "pylint", ":'_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Move", " ", "inline", " ", "comment", "s", " ", "to", " ", "previ", "ous", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first_", "=_", "source_", "[_", ":_", "start", "\\u", "offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second_", "=_", "source_", "[_", "start", "\\u", "offset_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "(_", "indentation_", "+_", "second_", "._", "strip_", "(_", ")_", "+_", "'\\\\", "n", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "indentation_", "+_", "first_", "._", "strip_", "(_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "type_", "==_", "token_", "._", "OP_", "and_", "token", "\\u", "string_", "!=_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "break", " ", "on", " ", "'=", "'", " ", "after", " ", "keyw", "ord", " ", "as", " ", "this", " ", "viola", "tes", " ", "PE", "P", " ", "8._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "token", "\\u", "type_", "!=_", "token_", "._", "INDENT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "first_", "=_", "source_", "[_", ":_", "end", "\\u", "offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "second", "\\u", "indent_", "=_", "indentation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "first_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "'('_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "second", "\\u", "indent_", "+=_", "indent", "\\u", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'('_", "in_", "first_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "second", "\\u", "indent_", "+=_", "'", " ", "'_", "*_", "(_", "1_", "+_", "first_", "._", "find_", "(_", "'('_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "second", "\\u", "indent_", "+=_", "indent", "\\u", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "second_", "=_", "(_", "second", "\\u", "indent_", "+_", "source_", "[_", "end", "\\u", "offset_", ":_", "]_", "._", "lstrip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "second_", "._", "strip_", "(_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "second_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\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_", "#", " ", "Do", " ", "not", " ", "begin", " ", "a", " ", "line", " ", "with", " ", "a", " ", "comma_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "second_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "','_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "end", " ", "a", " ", "line", " ", "with", " ", "a", " ", "dot_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "first_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "'.'_", ")_", ":_", "\\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_", "token", "\\u", "string_", "in_", "'+", "-*", "/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "first_", "+_", "'", " ", "\\\\\\\\'_", "+_", "'\\\\", "n", "'_", "+_", "second_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "first_", "+_", "'\\\\", "n", "'_", "+_", "second_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "fix", " ", "if", " ", "synta", "x", " ", "is", " ", "oka", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "check", "\\u", "syntax_", "(_", "normali", "ze", "\\u", "multiline", "_", "(_", "fixed_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "aggre", "ssi", "ve_", "else_", "fixed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "indentation_", "+_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "The", " ", "refl", "owe", "d", " ", "lines", " ", "of", " ", "atom", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "part", " ", "of", " ", "the", " ", "line", " ", "is", " ", "represent", "ed", " ", "as", " ", "an", " ", "\"", "atom", ".\"", " ", "The", "y", " ", "can", " ", "be", " ", "moved", "\\", "10", ";", " ", " ", " ", " ", "aro", "und", " ", "whe", "n", " ", "need", " ", "be", " ", "to", " ", "get", " ", "the", " ", "optim", "al", " ", "format", "ting", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Priva", "te", " ", "Classes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "\\u", "Indent_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Represent", " ", "an", " ", "indent", "ation", " ", "in", " ", "the", " ", "atom", " ", "stream", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "indent", "\\u", "amt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "indent", "\\u", "amt_", "=_", "indent", "\\u", "amt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", " ", "'_", "*_", "self_", "._", "\\u", "indent", "\\u", "amt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "indent", "\\u", "amt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Space_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Represent", " ", "a", " ", "space", " ", "in", " ", "the", " ", "atom", " ", "stream", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "emit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Line", "Break", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Represent", " ", "a", " ", "line", " ", "break", " ", "in", " ", "the", " ", "atom", " ", "stream", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "emit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Public", " ", "Methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Priva", "te", " ", "Methods_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "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", "init\\u\\u_", "(_", "self_", ",_", "max", "\\u", "line", "\\u", "length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "max", "\\u", "line", "\\u", "length_", "=_", "max", "\\u", "line", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "bracket", "\\u", "depth_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "prev", "\\u", "item_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "self_", ",_", "obj_", ",_", "indent", "\\u", "amt_", ",_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "obj_", ",_", "Atom_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "add", "\\u", "item_", "(_", "obj_", ",_", "indent", "\\u", "amt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "add", "\\u", "container_", "(_", "obj_", ",_", "indent", "\\u", "amt_", ",_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "comment_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Space_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Space_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "indent_", "(_", "self_", ",_", "indent", "\\u", "amt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Indent_", "(_", "indent", "\\u", "amt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "line", "\\u", "break_", "(_", "self_", ",_", "indent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Line", "Break", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "indent_", "(_", "len_", "(_", "indent_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "line", "\\u", "break", "\\u", "at_", "(_", "self_", ",_", "index_", ",_", "indent", "\\u", "amt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "insert_", "(_", "index_", ",_", "self_", "._", "\\u", "Line", "Break", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "._", "insert_", "(_", "index_", "+_", "1_", ",_", "self_", "._", "\\u", "Indent_", "(_", "indent", "\\u", "amt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "space", "\\u", "if", "\\u", "needed_", "(_", "self_", ",_", "curr", "\\u", "text_", ",_", "equal_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "\\u", "lines_", "or_", "isinstance_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "lines_", "[_", "-_", "1_", "]_", ",_", "(_", "self_", "._", "\\u", "Line", "Break", "_", ",_", "self_", "._", "\\u", "Indent_", ",_", "self_", "._", "\\u", "Space_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prev", "\\u", "text_", "=_", "unicode_", "(_", "self_", "._", "\\u", "prev", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "prev", "\\u", "text_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", ")_", "if_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "else_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "previ", "ous", " ", "item", " ", "was", " ", "a", " ", "keyw", "ord", " ", "or", " ", "identifi", "er", " ", "and", " ", "the", " ", "current_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "item", " ", "isn", "'", "t", " ", "an", " ", "opera", "tor", " ", "tha", "t", " ", "doe", "sn", "'", "t", " ", "require", " ", "a", " ", "space", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "self_", "._", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "keyword_", "or_", "self_", "._", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "string_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "name_", "or_", "self_", "._", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "number_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "curr", "\\u", "text_", "[_", "0_", "]_", "not_", "in_", "'(", "[{", ".,", ":", "}]", ")'_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "curr", "\\u", "text_", "[_", "0_", "]_", "==_", "'='_", "and_", "equal_", ")_", ")_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "place", " ", "space", "s", " ", "aro", "und", " ", "a", " ", "'.'", ",", " ", "unl", "ess", " ", "it", "'", "s", " ", "in", " ", "an", " ", "'", "import", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "statem", "ent", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "prev", "\\u", "prev", "\\u", "text_", "!=_", "'", "from", "'_", "and_", "prev", "\\u", "text_", "[_", "-_", "1_", "]_", "!=_", "'.'_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "\\u", "text_", "!=_", "'", "import", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "place", " ", "a", " ", "space", " ", "bef", "ore", " ", "a", " ", "colon", "._", "\\u\\u\\uNL\\u\\u\\u_", "curr", "\\u", "text_", "[_", "0_", "]_", "!=_", "':'_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "split", " ", "up", " ", "ending", " ", "brackets", " ", "by", " ", "space", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "prev", "\\u", "text_", "[_", "-_", "1_", "]_", "in_", "'}", "])'_", "and_", "curr", "\\u", "text_", "[_", "0_", "]_", "not_", "in_", "'.", ",}", "])'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "a", " ", "space", " ", "after", " ", "a", " ", "colon", " ", "or", " ", "comma", "._", "\\u\\u\\uNL\\u\\u\\u_", "prev", "\\u", "text_", "[_", "-_", "1_", "]_", "in_", "':", ",'_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "space", " ", "aro", "und", " ", "'=", "'", " ", "if", " ", "ask", "ed", " ", "to", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "equal_", "and_", "prev", "\\u", "text_", "==_", "'='_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "space", "s", " ", "aro", "und", " ", "non", "-", "una", "ry", " ", "arithmetic", " ", "opera", "tors", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "prev", "\\u", "text_", "not_", "in_", "'+", "-'_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "name_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "number_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "string_", ")_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "prev", "\\u", "text_", "in_", "(_", "'+'_", ",_", "'-'_", ",_", "'%'_", ",_", "'*'_", ",_", "'/'_", ",_", "'//'_", ",_", "'**", "'_", ")_", ")_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Space_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "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_", "previ", "ous", "\\u", "item_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "previ", "ous", " ", "non", "-", "whitespace", " ", "item", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "prev", "\\u", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "self_", ",_", "item", "\\u", "extent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "current", "\\u", "size_", "(_", ")_", "+_", "item", "\\u", "extent_", "<=_", "self_", "._", "\\u", "max", "\\u", "line", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "current", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "The", " ", "size", " ", "of", " ", "the", " ", "current", " ", "line", " ", "minu", "s", " ", "the", " ", "indent", "ation", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "reversed_", "(_", "self_", "._", "\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "+=_", "item_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "self_", "._", "\\u", "Line", "Break", "_", ")_", ":_", "\\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_", "return_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "line", "\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "\\u", "lines_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "self_", "._", "\\u", "lines_", "[_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "\\u", "Line", "Break", "_", ",_", "self_", "._", "\\u", "Indent_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "\\u", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "item_", ",_", "self_", "._", "\\u", "Line", "Break", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string_", "=_", "string_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "string_", "+=_", "item_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "string_", "._", "rstrip_", "(_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "item_", "(_", "self_", ",_", "item_", ",_", "indent", "\\u", "amt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "an", " ", "item", " ", "to", " ", "the", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ref", "low", " ", "the", " ", "line", " ", "to", " ", "get", " ", "the", " ", "best", " ", "format", "ting", " ", "after", " ", "the", " ", "item", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "inserted", ".", " ", "The", " ", "bracket", " ", "depth", " ", "indicat", "es", " ", "if", " ", "the", " ", "item", " ", "is", " ", "bei", "ng", "\\", "10", ";", " ", " ", " ", " ", "inserted", " ", "insi", "de", " ", "of", " ", "a", " ", "container", " ", "or", " ", "not", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "prev", "\\u", "item_", "and_", "self_", "._", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "string_", "and_", "item_", "._", "is", "\\u", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Place", " ", "consec", "uti", "ve", " ", "string", " ", "literal", "s", " ", "on", " ", "separate", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Line", "Break", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Indent_", "(_", "indent", "\\u", "amt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "text_", "=_", "unicode_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "lines_", "and_", "self_", "._", "\\u", "bracket", "\\u", "depth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "the", " ", "item", " ", "int", "o", " ", "a", " ", "container", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "prevent", "\\u", "default", "\\u", "initializer", "\\u", "splitting", "_", "(_", "item_", ",_", "indent", "\\u", "amt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "item", "\\u", "text_", "in_", "'.", ",)", "]}", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "split", "\\u", "after", "\\u", "delimiter_", "(_", "item_", ",_", "indent", "\\u", "amt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "\\u", "lines_", "and_", "not_", "self_", "._", "line", "\\u", "empty_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "the", " ", "item", " ", "outsi", "de", " ", "of", " ", "a", " ", "container", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "len_", "(_", "item", "\\u", "text_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "enforce", "\\u", "space_", "(_", "item_", ")_", "\\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_", "#", " ", "Line", " ", "break", " ", "for", " ", "the", " ", "new", " ", "item", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Line", "Break", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Indent_", "(_", "indent", "\\u", "amt_", ")_", ")_", "\\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", "lines_", "._", "append_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "prev", "\\u", "item_", ",_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "=_", "item_", ",_", "self_", "._", "\\u", "prev", "\\u", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "item", "\\u", "text_", "in_", "'(", "[{", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "bracket", "\\u", "depth_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "item", "\\u", "text_", "in_", "'}", "])'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "bracket", "\\u", "depth_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "\\u", "bracket", "\\u", "depth_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "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", "add", "\\u", "container_", "(_", "self_", ",_", "container_", ",_", "indent", "\\u", "amt_", ",_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "actual", "\\u", "indent_", "=_", "indent", "\\u", "amt_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "self_", "._", "\\u", "prev", "\\u", "item_", ")_", "!=_", "'='_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "line", "\\u", "empty_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "container_", "._", "size_", "+_", "self_", "._", "\\u", "bracket", "\\u", "depth_", "+_", "2_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "unicode_", "(_", "container_", ")_", "[_", "0_", "]_", "==_", "'('_", "and_", "self_", "._", "\\u", "prev", "\\u", "item_", "._", "is", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "split", " ", "bef", "ore", " ", "the", " ", "opening", " ", "bracket", " ", "of", " ", "a", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "indent_", "=_", "indent", "\\u", "amt_", "+_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "self_", "._", "\\u", "prev", "\\u", "item_", ")_", "not_", "in_", "'(", "[{", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "container", " ", "doe", "sn", "'", "t", " ", "fit", " ", "on", " ", "the", " ", "current", " ", "line", " ", "and", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "current", " ", "line", " ", "isn", "'", "t", " ", "empty", ",", " ", "place", " ", "the", " ", "container", " ", "on", " ", "the", " ", "next_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Line", "Break", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Indent_", "(_", "indent", "\\u", "amt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "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 ", " _", "actual", "\\u", "indent_", "=_", "self_", "._", "current", "\\u", "size_", "(_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "container_", ",_", "(_", "List", "Compr", "eh", "ensi", "on_", ",_", "If", "Expression_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "actual", "\\u", "indent_", "=_", "indent", "\\u", "amt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Increase", " ", "the", " ", "continue", "d", " ", "indent", "ation", " ", "only", " ", "if", " ", "recurs", "ing", " ", "on", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "container", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "container_", "._", "refl", "ow_", "(_", "self_", ",_", "'", " ", "'_", "*_", "actual", "\\u", "indent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "prevent", "\\u", "default", "\\u", "initializer", "\\u", "splitting", "_", "(_", "self_", ",_", "item_", ",_", "indent", "\\u", "amt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prev", "ent", " ", "splitting", " ", "bet", "ween", " ", "a", " ", "default", " ", "initializer", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "there", " ", "is", " ", "a", " ", "default", " ", "initializer", ",", " ", "it", "'", "s", " ", "best", " ", "to", " ", "keep", " ", "it", " ", "all", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "same", " ", "line", ".", " ", "It", "'", "s", " ", "nice", "r", " ", "and", " ", "more", " ", "reada", "ble", ",", " ", "even", " ", "if", " ", "it", " ", "go", "es", "\\", "10", ";", " ", " ", " ", " ", "over", " ", "the", " ", "maxim", "um", " ", "allow", "able", " ", "line", " ", "length", ".", " ", "Thi", "s", " ", "go", "es", " ", "back", " ", "along", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "current", " ", "line", " ", "to", " ", "dete", "rmin", "e", " ", "if", " ", "we", " ", "have", " ", "a", " ", "default", " ", "initializer", ",", " ", "and", ",", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "so", ",", " ", "to", " ", "remove", " ", "extra", "neous", " ", "whitespace", "s", " ", "and", " ", "add", " ", "a", " ", "line", "\\", "10", ";", " ", " ", " ", " ", "break", "/", "indent", " ", "bef", "ore", " ", "it", " ", "if", " ", "need", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "unicode_", "(_", "item_", ")_", "==_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "assign", "ment", " ", "in", " ", "the", " ", "initializer", ".", " ", "Ju", "st", " ", "remove", " ", "space", "s", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "delete", "\\u", "whitespace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "\\u", "prev", "\\u", "item_", "or_", "not_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "self_", "._", "\\u", "prev", "\\u", "item_", ")_", "!=_", "'='_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "delete", "\\u", "whitespace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "prev", "\\u", "index_", "=_", "self_", "._", "\\u", "lines_", "._", "index_", "(_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "self_", "._", "\\u", "lines_", "[_", "prev", "\\u", "prev", "\\u", "index_", "-_", "1_", "]_", ",_", "self_", "._", "\\u", "Indent_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "item_", "._", "size_", "+_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "default", " ", "initializer", " ", "is", " ", "alr", "ead", "y", " ", "the", " ", "only", " ", "item", " ", "on", " ", "this", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "insert", " ", "a", " ", "newline", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Replace", " ", "the", " ", "space", " ", "with", " ", "a", " ", "newline", "/", "indent", " ", "combo", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "self_", "._", "\\u", "lines_", "[_", "prev", "\\u", "prev", "\\u", "index_", "-_", "1_", "]_", ",_", "self_", "._", "\\u", "Space_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "\\u", "lines_", "[_", "prev", "\\u", "prev", "\\u", "index_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "add", "\\u", "line", "\\u", "break", "\\u", "at_", "(_", "self_", "._", "\\u", "lines_", "._", "index_", "(_", "self_", "._", "\\u", "prev", "\\u", "prev", "\\u", "item_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "amt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "split", "\\u", "after", "\\u", "delimiter_", "(_", "self_", ",_", "item_", ",_", "indent", "\\u", "amt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Split", " ", "the", " ", "line", " ", "only", " ", "after", " ", "a", " ", "delimiter", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "delete", "\\u", "whitespace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "item_", "._", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "space_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "reversed_", "(_", "self_", "._", "\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "space_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "not_", "isinstance_", "(_", "item_", ",_", "Atom_", ")_", "or_", "not_", "item_", "._", "is", "\\u", "colon", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "space_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "self_", "._", "\\u", "Space_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "space_", "=_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "(_", "self_", "._", "\\u", "Line", "Break", "_", ",_", "self_", "._", "\\u", "Indent_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "last", "\\u", "space_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "add", "\\u", "line", "\\u", "break", "\\u", "at_", "(_", "self_", "._", "\\u", "lines_", "._", "index_", "(_", "last", "\\u", "space_", ")_", ",_", "indent", "\\u", "amt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "enforce", "\\u", "space_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Enf", "orce", " ", "a", " ", "space", " ", "in", " ", "cert", "ain", " ", "situation", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "There", " ", "are", " ", "case", "s", " ", "where", " ", "we", " ", "will", " ", "want", " ", "a", " ", "space", " ", "where", " ", "normal", "ly", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "wou", "ld", "n", "'", "t", " ", "put", " ", "one", ".", " ", "Thi", "s", " ", "just", " ", "enforce", "s", " ", "the", " ", "addition", " ", "of", " ", "a", " ", "space", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "self_", "._", "\\u", "lines_", "[_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "\\u", "Space_", ",_", "self_", "._", "\\u", "Line", "Break", "_", ",_", "self_", "._", "\\u", "Indent_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "prev", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "text_", "=_", "unicode_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "text_", "=_", "unicode_", "(_", "self_", "._", "\\u", "prev", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prefe", "r", " ", "a", " ", "space", " ", "aro", "und", " ", "a", " ", "'.'", " ", "in", " ", "an", " ", "import", " ", "statem", "ent", ",", " ", "and", " ", "bet", "ween", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "import", "'", " ", "and", " ", "'(", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "item", "\\u", "text_", "==_", "'.'_", "and_", "prev", "\\u", "text_", "==_", "'", "from", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "item", "\\u", "text_", "==_", "'", "import", "'_", "and_", "prev", "\\u", "text_", "==_", "'.'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "item", "\\u", "text_", "==_", "'('_", "and_", "prev", "\\u", "text_", "==_", "'", "import", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "lines_", "._", "append_", "(_", "self_", "._", "\\u", "Space_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref", "ormat", "ted", "Lines_", "(_", "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", "delete", "\\u", "whitespace_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Delete", " ", "all", " ", "whitespace", " ", "from", " ", "the", " ", "end", " ", "of", " ", "the", " ", "line", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "isinstance_", "(_", "self_", "._", "\\u", "lines_", "[_", "-_", "1_", "]_", ",_", "(_", "self_", "._", "\\u", "Space_", ",_", "self_", "._", "\\u", "Line", "Break", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "Indent_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "\\u", "lines_", "[_", "-_", "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_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "The", " ", "smallest", " ", "unb", "reak", "able", " ", "unit", " ", "tha", "t", " ", "can", " ", "be", " ", "refl", "owe", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "atom_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "atom_", "=_", "atom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "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_", "self_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refl", "ow_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "refl", "owe", "d\\u", "lines_", ",_", "continue", "d\\u", "indent_", ",_", "extent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "list", "\\u", "comp", "\\u", "or", "\\u", "if", "\\u", "expr_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "is", "\\u", "dot_", "=_", "False_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "type_", "==_", "tokenize_", "._", "COMMENT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refl", "owe", "d\\u", "lines_", "._", "add", "\\u", "comment_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total", "\\u", "size_", "=_", "extent_", "if_", "extent_", "else_", "self_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "string_", "not_", "in_", "',", ":(", "[{}]", ")'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Some", " ", "atom", "s", " ", "will", " ", "need", " ", "an", " ", "extra", " ", "1", "-", "sized", " ", "space", " ", "token", " ", "after", " ", "them", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total", "\\u", "size_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prev", "\\u", "item_", "=_", "refl", "owe", "d\\u", "lines_", "._", "previ", "ous", "\\u", "item_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "is", "\\u", "list", "\\u", "comp", "\\u", "or", "\\u", "if", "\\u", "expr_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "refl", "owe", "d\\u", "lines_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "total", "\\u", "size_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "(_", "next", "\\u", "is", "\\u", "dot_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "refl", "owe", "d\\u", "lines_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "self_", "._", "size_", "+_", "1_", ")_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "refl", "owe", "d\\u", "lines_", "._", "line", "\\u", "empty_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "is", "\\u", "colon", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "(_", "prev", "\\u", "item_", "and_", "prev", "\\u", "item_", "._", "is", "\\u", "name_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "self_", ")_", "==_", "'('_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Start", " ", "a", " ", "new", " ", "line", " ", "if", " ", "there", " ", "is", " ", "alr", "ead", "y", " ", "somet", "hing", " ", "on", " ", "the", " ", "line", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "addin", "g", " ", "this", " ", "atom", " ", "wou", "ld", " ", "make", " ", "it", " ", "go", " ", "over", " ", "the", " ", "max", " ", "line", " ", "length", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refl", "owe", "d\\u", "lines_", "._", "add", "\\u", "line", "\\u", "break_", "(_", "continue", "d\\u", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refl", "owe", "d\\u", "lines_", "._", "add", "\\u", "space", "\\u", "if", "\\u", "needed_", "(_", "unicode_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "refl", "owe", "d\\u", "lines_", "._", "add_", "(_", "self_", ",_", "len_", "(_", "continue", "d\\u", "indent_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "repr\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "keyword_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "keyword_", "._", "isk", "ey", "word_", "(_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "type_", "==_", "tokenize_", "._", "STRING_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "type_", "==_", "tokenize_", "._", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "number_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "type_", "==_", "tokenize_", "._", "NUMBER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "comma_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "string_", "==_", "','_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "colon", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "string_", "==_", "':'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Atom_", "(_", "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_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "self_", "._", "\\u", "atom_", "._", "token", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "all", " ", "container", " ", "types", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "items_", "=_", "items_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "was", "\\u", "keyword_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "._", "is", "\\u", "comma_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string_", "+=_", "',", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "item_", "._", "is", "\\u", "colon", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string_", "+=_", "':", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item", "\\u", "string_", "=_", "unicode_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "last", "\\u", "was", "\\u", "keyword_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "not_", "string_", "._", "endswith_", "(_", "tuple_", "(_", "'(", "[{", ",.", ":", "}]", ")", " ", "'_", ")_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "item", "\\u", "string_", "._", "startswith_", "(_", "tuple_", "(_", "'(", "[{", ",.", ":", "}]", ")'_", ")_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "string_", "+=_", "'", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "string_", "+=_", "item", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "was", "\\u", "keyword_", "=_", "item_", "._", "is", "\\u", "keyword_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "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 ", " _", "for_", "element_", "in_", "self_", "._", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "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", "getitem\\u\\u_", "(_", "self_", ",_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "items_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refl", "ow_", "(_", "self_", ",_", "refl", "owe", "d\\u", "lines_", ",_", "continue", "d\\u", "indent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "was", "\\u", "container_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "index_", ",_", "item_", ")_", "in_", "enumerate_", "(_", "self_", "._", "\\u", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "item_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "\\u", "items_", ",_", "index_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "Atom_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "list", "\\u", "comp", "\\u", "or", "\\u", "if", "\\u", "expr_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "self_", ",_", "(_", "List", "Compr", "eh", "ensi", "on_", ",_", "If", "Expression_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "refl", "ow_", "(_", "refl", "owe", "d\\u", "lines_", ",_", "continue", "d\\u", "indent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "get", "\\u", "extent_", "(_", "index_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "list", "\\u", "comp", "\\u", "or", "\\u", "if", "\\u", "expr_", "=_", "is", "\\u", "list", "\\u", "comp", "\\u", "or", "\\u", "if", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "is", "\\u", "dot_", "=_", "(_", "next", "\\u", "item_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "next", "\\u", "item_", ")_", "==_", "'.'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "last", "\\u", "was", "\\u", "container_", "and_", "item_", "._", "is", "\\u", "comma_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "refl", "owe", "d\\u", "lines_", "._", "add", "\\u", "line", "\\u", "break_", "(_", "continue", "d\\u", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "was", "\\u", "container_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "isin", "stance", "(", "item", ",", " ", "Containe", "r", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refl", "owe", "d\\u", "lines_", "._", "add_", "(_", "item_", ",_", "len_", "(_", "continue", "d\\u", "indent_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "was", "\\u", "container_", "=_", "not_", "isinstance_", "(_", "item_", ",_", "(_", "List", "Compr", "eh", "ensi", "on_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "If", "Expression_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "and_", "index_", "==_", "0_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prefe", "r", " ", "to", " ", "keep", " ", "empty", " ", "container", "s", " ", "tog", "ether", " ", "inst", "ead", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "separa", "ting", " ", "them", "._", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "item_", ")_", "==_", "self_", "._", "open", "\\u", "bracket_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "not_", "next", "\\u", "item_", "or_", "unicode_", "(_", "next", "\\u", "item_", ")_", "!=_", "self_", "._", "close", "\\u", "bracket_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "len_", "(_", "self_", "._", "\\u", "items_", ")_", "!=_", "3_", "or_", "not_", "isinstance_", "(_", "next", "\\u", "item_", ",_", "Atom_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refl", "owe", "d\\u", "lines_", "._", "add", "\\u", "line", "\\u", "break_", "(_", "continue", "d\\u", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "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 ", " _", "next", "\\u", "next", "\\u", "item_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "\\u", "items_", ",_", "index_", "+_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "item_", ")_", "not_", "in_", "[_", "'.'_", ",_", "'%'_", ",_", "'", "in", "'_", "]_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "item_", "and_", "not_", "isinstance_", "(_", "next", "\\u", "item_", ",_", "Container_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "next", "\\u", "item_", ")_", "!=_", "':'_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "next", "\\u", "item_", "and_", "(_", "not_", "isinstance_", "(_", "next", "\\u", "next", "\\u", "item_", ",_", "Atom_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "next", "\\u", "item_", ")_", "==_", "'", "not", "'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "refl", "owe", "d\\u", "lines_", "._", "line", "\\u", "empty_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "refl", "owe", "d\\u", "lines_", "._", "fits", "\\u", "on", "\\u", "current", "\\u", "line_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "get", "\\u", "extent_", "(_", "index_", "+_", "1_", ")_", "+_", "2_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "refl", "owe", "d\\u", "lines_", "._", "add", "\\u", "line", "\\u", "break_", "(_", "continue", "d\\u", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "extent_", "(_", "self_", ",_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "The", " ", "extent", " ", "of", " ", "the", " ", "full", " ", "element", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "E", ".", "g", ".,", " ", "the", " ", "length", " ", "of", " ", "a", " ", "function", " ", "call", " ", "or", " ", "keyw", "ord", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extent_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "item_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "\\u", "items_", ",_", "index_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "see", "n", "\\u", "dot_", "=_", "prev", "\\u", "item_", "and_", "unicode_", "(_", "prev", "\\u", "item_", ")_", "==_", "'.'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index_", "<_", "len_", "(_", "self_", "._", "\\u", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "get", "\\u", "item_", "(_", "self_", "._", "\\u", "items_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "(_", "List", "Compr", "eh", "ensi", "on_", ",_", "If", "Expression_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prev", "\\u", "item_", "and_", "prev", "\\u", "item_", "._", "is", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "see", "n", "\\u", "dot_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "extent_", "+=_", "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 ", " ", " _", "extent_", "+=_", "item_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prev", "\\u", "item_", "=_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "unicode_", "(_", "item_", ")_", "not_", "in_", "[_", "'.'_", ",_", "'='_", ",_", "':'_", ",_", "'", "not", "'_", "]_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "item_", "._", "is", "\\u", "name_", "and_", "not_", "item_", "._", "is", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "unicode_", "(_", "item_", ")_", "==_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "see", "n", "\\u", "dot_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "extent_", "+=_", "item_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "item_", "=_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "extent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "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_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "self_", "._", "\\u\\u", "repr\\u\\u_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "keyword_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "comma_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "colon", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "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_", "open", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Container_", "(_", "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_", "close", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Tuple_", "(_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "high", "-", "level", " ", "represent", "ation", " ", "of", " ", "a", " ", "tuple", ".\"\"\"_", "\\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_", "Tuple_", "(_", "Container_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "open", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'('_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tuple_", "(_", "Container_", ")_", ":_", "\\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_", "close", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\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_", "class_", "List_", "(_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "high", "-", "level", " ", "represent", "ation", " ", "of", " ", "a", " ", "list", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "List_", "(_", "Container_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "open", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'['_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List_", "(_", "Container_", ")_", ":_", "\\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_", "close", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\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_", "class_", "Dict", "Or", "Set_", "(_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "high", "-", "level", " ", "represent", "ation", " ", "of", " ", "a", " ", "dictionar", "y", " ", "or", " ", "set", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Dict", "Or", "Set_", "(_", "Container_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "open", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'{'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "Or", "Set_", "(_", "Container_", ")_", ":_", "\\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_", "close", "\\u", "bracket_", "(_", "self_", ")_", ":_", "\\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_", "class_", "List", "Compr", "eh", "ensi", "on_", "(_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "high", "-", "level", " ", "represent", "ation", " ", "of", " ", "a", " ", "list", " ", "compre", "hens", "ion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "List", "Compr", "eh", "ensi", "on_", "(_", "Container_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "item_", ",_", "If", "Expression_", ")_", ":_", "\\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_", "length_", "+=_", "item_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "If", "Expression_", "(_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "high", "-", "level", " ", "represent", "ation", " ", "of", " ", "an", " ", "if", "-", "express", "ion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\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", "container_", "(_", "tokens_", ",_", "index_", ",_", "for", "\\u", "or", "\\u", "if_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "a", " ", "high", "-", "level", " ", "container", ",", " ", "suc", "h", " ", "as", " ", "a", " ", "list", ",", " ", "tuple", ",", " ", "etc", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Stor", "e", " ", "the", " ", "opening", " ", "bracket", "._", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "[_", "Atom_", "(_", "Token_", "(_", "*_", "tokens_", "[_", "index_", "]_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "tokens_", "=_", "len_", "(_", "tokens_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index_", "<_", "num", "\\u", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tok_", "=_", "Token_", "(_", "*_", "tokens_", "[_", "index_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tok_", "._", "token", "\\u", "string_", "in_", "',", ")]", "}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "check", " ", "if", " ", "we", "'", "re", " ", "at", " ", "the", " ", "end", " ", "of", " ", "a", " ", "list", " ", "compre", "hens", "ion", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", "-", "express", "ion", ".", " ", "Don", "'", "t", " ", "add", " ", "the", " ", "ending", " ", "token", " ", "as", " ", "part", " ", "of", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compre", "hens", "ion", " ", "or", " ", "if", "-", "express", "ion", ",", " ", "bec", "aus", "e", " ", "the", "y", " ", "are", "n", "'", "t", " ", "part", " ", "of", " ", "tho", "se_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "construct", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "for", "\\u", "or", "\\u", "if_", "==_", "'", "for", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "List", "Compr", "eh", "ensi", "on_", "(_", "items_", ")_", ",_", "index_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "for", "\\u", "or", "\\u", "if_", "==_", "'", "if", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "If", "Expression_", "(_", "items_", ")_", ",_", "index_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ve", " ", "reache", "d", " ", "the", " ", "end", " ", "of", " ", "a", " ", "container", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "._", "append_", "(_", "Atom_", "(_", "tok_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", ",", " ", "then", " ", "we", " ", "are", " ", "at", " ", "the", " ", "end", " ", "of", " ", "a", " ", "container", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tok_", "._", "token", "\\u", "string_", "==_", "')'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "end", " ", "of", " ", "a", " ", "tuple", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "Tuple_", "(_", "items_", ")_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tok_", "._", "token", "\\u", "string_", "==_", "']'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "end", " ", "of", " ", "a", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "List_", "(_", "items_", ")_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tok_", "._", "token", "\\u", "string_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "end", " ", "of", " ", "a", " ", "dictionar", "y", " ", "or", " ", "set", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "Dict", "Or", "Set_", "(_", "items_", ")_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tok_", "._", "token", "\\u", "string_", "in_", "'(", "[{", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "sub", "-", "container", " ", "is", " ", "bei", "ng", " ", "defin", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "container_", ",_", "index_", ")_", "=_", "\\u", "parse", "\\u", "container_", "(_", "tokens_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "append_", "(_", "container_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tok_", "._", "token", "\\u", "string_", "==_", "'", "for", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "container_", ",_", "index_", ")_", "=_", "\\u", "parse", "\\u", "container_", "(_", "tokens_", ",_", "index_", ",_", "'", "for", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "append_", "(_", "container_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tok_", "._", "token", "\\u", "string_", "==_", "'", "if", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "container_", ",_", "index_", ")_", "=_", "\\u", "parse", "\\u", "container_", "(_", "tokens_", ",_", "index_", ",_", "'", "if", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "._", "append_", "(_", "container_", ")_", "\\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 ", " _", "items_", "._", "append_", "(_", "Atom_", "(_", "tok_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "tokens_", "(_", "tokens_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "the", " ", "token", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "convert", "s", " ", "the", " ", "token", "s", " ", "int", "o", " ", "a", " ", "form", " ", "where", " ", "we", " ", "can", " ", "manipulate", " ", "them", "\\", "10", ";", " ", " ", " ", " ", "more", " ", "easi", "ly", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "\\u", "tokens_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "tokens_", "=_", "len_", "(_", "tokens_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index_", "<_", "num", "\\u", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tok_", "=_", "Token_", "(_", "*_", "tokens_", "[_", "index_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "tok_", "._", "token", "\\u", "type_", "!=_", "token_", "._", "INDENT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tok_", "._", "token", "\\u", "type_", "==_", "tokenize_", "._", "NEWLINE", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "There", "'", "s", " ", "only", " ", "one", " ", "newline", " ", "and", " ", "it", "'", "s", " ", "at", " ", "the", " ", "end", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tok_", "._", "token", "\\u", "string_", "in_", "'(", "[{", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "container_", ",_", "index_", ")_", "=_", "\\u", "parse", "\\u", "container_", "(_", "tokens_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "container_", ":_", "\\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_", "parsed", "\\u", "tokens_", "._", "append_", "(_", "container_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parsed", "\\u", "tokens_", "._", "append_", "(_", "Atom_", "(_", "tok_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "parsed", "\\u", "tokens_", "\\u\\u\\uNEWLINE\\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", "refl", "ow", "\\u", "lines_", "(_", "parsed", "\\u", "tokens_", ",_", "indentation_", ",_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ref", "low", " ", "the", " ", "lines", " ", "so", " ", "tha", "t", " ", "it", " ", "look", "s", " ", "nice", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "unicode_", "(_", "parsed", "\\u", "tokens_", "[_", "0_", "]_", ")_", "==_", "'", "def", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "function", " ", "definit", "ion", " ", "gets", " ", "indented", " ", "a", " ", "bit", " ", "more", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue", "d\\u", "indent_", "=_", "indentation_", "+_", "'", " ", "'_", "*_", "2_", "*_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue", "d\\u", "indent_", "=_", "indentation_", "+_", "'", " ", "'_", "*_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", "=_", "not_", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "=_", "Ref", "ormat", "ted", "Lines_", "(_", "max", "\\u", "line", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "._", "add", "\\u", "indent_", "(_", "len_", "(_", "indentation_", "._", "lstrip_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "splitting", " ", "after", " ", "the", " ", "opening", " ", "bracket", " ", "will", " ", "caus", "e", " ", "the", " ", "first", " ", "element_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "aligned", " ", "weird", "ly", ",", " ", "don", "'", "t", " ", "try", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first", "\\u", "token_", "=_", "get", "\\u", "item_", "(_", "parsed", "\\u", "tokens_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second", "\\u", "token_", "=_", "get", "\\u", "item_", "(_", "parsed", "\\u", "tokens_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "token_", "and_", "second", "\\u", "token_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "unicode_", "(_", "second", "\\u", "token_", ")_", "[_", "0_", "]_", "==_", "'('_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "indentation_", ")_", "+_", "len_", "(_", "first", "\\u", "token_", ")_", "+_", "1_", "==_", "len_", "(_", "continue", "d\\u", "indent_", ")_", "\\u\\u\\uNL\\u\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item_", "in_", "parsed", "\\u", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "._", "add", "\\u", "space", "\\u", "if", "\\u", "needed_", "(_", "unicode_", "(_", "item_", ")_", ",_", "equal_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "continue", "d\\u", "indent_", "=_", "continue", "d\\u", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", "and_", "isinstance_", "(_", "item_", ",_", "Container_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue", "d\\u", "indent_", "=_", "'", " ", "'_", "*_", "(_", "lines_", "._", "current", "\\u", "size_", "(_", ")_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item_", "._", "refl", "ow_", "(_", "lines_", ",_", "continue", "d\\u", "indent_", ",_", "break", "\\u", "after", "\\u", "open", "\\u", "bracket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue", "d\\u", "indent_", "=_", "save", "\\u", "continue", "d\\u", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "lines_", "._", "emit_", "(_", ")_", "\\u\\u\\uNEWLINE\\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", "shorten", "\\u", "line", "\\u", "at", "\\u", "token", "s", "\\u", "new_", "(_", "tokens_", ",_", "source_", ",_", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Short", "en", " ", "the", " ", "line", " ", "tak", "ing", " ", "its", " ", "length", " ", "int", "o", " ", "account", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "input", " ", "is", " ", "expected", " ", "to", " ", "be", " ", "free", " ", "of", " ", "newline", "s", " ", "except", " ", "for", " ", "insi", "de", "\\", "10", ";", " ", " ", " ", " ", "multiline", " ", "string", "s", " ", "and", " ", "at", " ", "the", " ", "end", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Yi", "eld", " ", "the", " ", "original", " ", "source", " ", "so", " ", "to", " ", "see", " ", "if", " ", "it", "'", "s", " ", "a", " ", "bett", "er", " ", "choice", " ", "than", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shorten", "ed", " ", "candidate", " ", "lines", " ", "we", " ", "generat", "e", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "indentation_", "+_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parsed", "\\u", "tokens_", "=_", "\\u", "parse", "\\u", "tokens_", "(_", "tokens_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "parsed", "\\u", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Perform", " ", "two", " ", "refl", "ow", "s", ".", " ", "The", " ", "first", " ", "one", " ", "starts", " ", "on", " ", "the", " ", "same", " ", "line", " ", "as", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prefix", ".", " ", "The", " ", "second", " ", "starts", " ", "on", " ", "the", " ", "line", " ", "after", " ", "the", " ", "prefix", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "\\u", "refl", "ow", "\\u", "lines_", "(_", "parsed", "\\u", "tokens_", ",_", "indentation_", ",_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fixed_", "and_", "check", "\\u", "syntax_", "(_", "normali", "ze", "\\u", "multiline", "_", "(_", "fixed_", "._", "lstrip_", "(_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed_", "=_", "\\u", "refl", "ow", "\\u", "lines_", "(_", "parsed", "\\u", "tokens_", ",_", "indentation_", ",_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "on", "\\u", "prefix", "\\u", "line_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fixed_", "and_", "check", "\\u", "syntax_", "(_", "normali", "ze", "\\u", "multiline", "_", "(_", "fixed_", "._", "lstrip_", "(_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "shorten", "\\u", "line", "\\u", "at", "\\u", "tokens_", "(_", "tokens_", ",_", "source_", ",_", "indentation_", ",_", "indent", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "token", "\\u", "strings_", ",_", "aggre", "ssi", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Separate", " ", "line", " ", "by", " ", "break", "ing", " ", "at", " ", "token", "s", " ", "in", " ", "key", "\\u", "token", "\\u", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "input", " ", "is", " ", "expected", " ", "to", " ", "be", " ", "free", " ", "of", " ", "newline", "s", " ", "except", " ", "for", " ", "insi", "de", "\\", "10", ";", " ", " ", " ", " ", "multiline", " ", "string", "s", " ", "and", " ", "at", " ", "the", " ", "end", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "index_", ",_", "\\u", "t_", ")_", "in_", "enumerate_", "(_", "token", "\\u", "offsets_", "(_", "tokens_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "token", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "offset_", ")_", "=_", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "token", "\\u", "type_", "!=_", "token_", "._", "INDENT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "string_", "in_", "key", "\\u", "token", "\\u", "strings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "not", " ", "break", " ", "in", " ", "container", "s", " ", "with", " ", "zero", " ", "or", " ", "one", " ", "items", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unwa", "nte", "d\\u", "next", "\\u", "token_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'('_", ":_", "')'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'['_", ":_", "']'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'{'_", ":_", "'}'_", "}_", "._", "get_", "(_", "token", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "unwa", "nte", "d\\u", "next", "\\u", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "item_", "(_", "tokens_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "+_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "[_", "None_", ",_", "None_", "]_", ")_", "[_", "1_", "]_", "==_", "unwa", "nte", "d\\u", "next", "\\u", "token_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "item_", "(_", "tokens_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "+_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "[_", "None_", ",_", "None_", "]_", ")_", "[_", "1_", "]_", "==_", "unwa", "nte", "d\\u", "next", "\\u", "token_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "index_", ">_", "2_", "and_", "token", "\\u", "string_", "==_", "'('_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", "[_", "index_", "-_", "1_", "]_", "[_", "1_", "]_", "in_", "',", "(%", "['_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "split", " ", "after", " ", "a", " ", "tuple", " ", "start", ",", " ", "or", " ", "bef", "ore", " ", "a", " ", "tuple", " ", "start", " ", "if_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "tuple", " ", "is", " ", "in", " ", "a", " ", "list", "._", "\\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_", "if_", "end", "\\u", "offset_", "<_", "len_", "(_", "source_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "split", " ", "right", " ", "bef", "ore", " ", "newline", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offsets_", "._", "append_", "(_", "end", "\\u", "offset_", ")_", "\\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_", "#", " ", "Break", " ", "at", " ", "adjacent", " ", "string", "s", ".", " ", "The", "se", " ", "wer", "e", " ", "probab", "ly", " ", "mean", "t", " ", "to", " ", "be", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "separate", " ", "lines", " ", "in", " ", "the", " ", "first", " ", "place", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "previ", "ous", "\\u", "token_", "=_", "get", "\\u", "item_", "(_", "tokens_", ",_", "index_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "type_", "==_", "tokenize_", "._", "STRING_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "token_", "and_", "previ", "ous", "\\u", "token_", "[_", "0_", "]_", "==_", "tokenize_", "._", "STRING_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offsets_", "._", "append_", "(_", "start", "\\u", "offset_", ")_", "\\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_", "current", "\\u", "indent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "split", "\\u", "at", "\\u", "offsets_", "(_", "source_", ",_", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "+=_", "'\\\\", "n", "'_", "+_", "current", "\\u", "indent_", "+_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "symbol_", "in_", "'(", "[{", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "endswith_", "(_", "symbol_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "indent_", "+=_", "indent", "\\u", "word_", "\\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_", "#", " ", "Fi", "rst", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed_", "=_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "current", "\\u", "indent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "indent_", "=_", "indent", "\\u", "word_", "\\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_", "fixed_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "check", "\\u", "syntax_", "(_", "normali", "ze", "\\u", "multiline", "_", "(_", "fixed_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "aggre", "ssi", "ve_", ">_", "1_", "else_", "fixed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "indentation_", "+_", "fixed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "token", "\\u", "offsets_", "(_", "tokens_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Yi", "eld", " ", "token", "s", " ", "and", " ", "offset", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previ", "ous", "\\u", "end", "\\u", "row_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previ", "ous", "\\u", "end", "\\u", "column_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token", "\\u", "type_", "=_", "t_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "\\u", "string_", "=_", "t_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "start", "\\u", "row_", ",_", "start", "\\u", "column_", ")_", "=_", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "end", "\\u", "row_", ",_", "end", "\\u", "column_", ")_", "=_", "t_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Account", " ", "for", " ", "the", " ", "whitespace", " ", "bet", "ween", " ", "token", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "offset_", "+=_", "start", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "previ", "ous", "\\u", "end", "\\u", "row_", "==_", "start", "\\u", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end", "\\u", "offset_", "-=_", "previ", "ous", "\\u", "end", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Record", " ", "the", " ", "start", " ", "offset", " ", "of", " ", "the", " ", "token", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start", "\\u", "offset_", "=_", "end", "\\u", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Account", " ", "for", " ", "the", " ", "length", " ", "of", " ", "the", " ", "token", " ", "its", "elf", "._", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "offset_", "+=_", "len_", "(_", "token", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "(_", "token", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "end", "\\u", "row_", "=_", "end", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previ", "ous", "\\u", "end", "\\u", "column_", "=_", "end", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "normali", "ze", "\\u", "multiline", "_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Normalize", " ", "multiline", "-", "relate", "d", " ", "code", " ", "tha", "t", " ", "will", " ", "caus", "e", " ", "synta", "x", " ", "error", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "for", " ", "purpose", "s", " ", "of", " ", "checking", " ", "synta", "x", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "._", "startswith_", "(_", "'", "def", " ", "'_", ")_", "and_", "line_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "':'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "line_", "+_", "'", " ", "pass", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'", "return", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "def", " ", "\\u(", "):", " ", "'_", "+_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'@'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "line_", "+_", "'", "def", " ", "\\u(", "):", " ", "pass", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'", "class", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "line_", "+_", "'", " ", "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 ", " _", "return_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "whitespace_", "(_", "line_", ",_", "offset_", ",_", "replacement_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Replace", " ", "whitespace", " ", "at", " ", "offset", " ", "and", " ", "return", " ", "fixed", " ", "line", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Replace", " ", "escaped", " ", "newline", "s", " ", "too", "_", "\\u\\u\\uNL\\u\\u\\u_", "left_", "=_", "line_", "[_", ":_", "offset_", "]_", "._", "rstrip_", "(_", "'\\\\", "n", "\\\\", "r", " ", "\\\\", "t", "\\\\\\\\'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right_", "=_", "line_", "[_", "offset_", ":_", "]_", "._", "lstrip_", "(_", "'\\\\", "n", "\\\\", "r", " ", "\\\\", "t", "\\\\\\\\'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "right_", "._", "startswith_", "(_", "'#'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "return_", "left_", "+_", "replacement_", "+_", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "execute", "\\u", "pep", "8_", "(_", "pep", "8", "\\u", "options_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "pep", "8", " ", "via", " ", "python", " ", "method", " ", "calls", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Qui", "et", "Report_", "(_", "pep", "8_", "._", "Base", "Report_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Version", " ", "of", " ", "checke", "r", " ", "tha", "t", " ", "doe", "s", " ", "not", " ", "print", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Qui", "et", "Report_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "full", "\\u", "error", "\\u", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "error_", "(_", "self_", ",_", "line", "\\u", "number_", ",_", "offset_", ",_", "text_", ",_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Collect", " ", "error", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "=_", "super_", "(_", "Qui", "et", "Report_", ",_", "self_", ")_", "._", "error_", "(_", "line", "\\u", "number_", ",_", "offset_", ",_", "text_", ",_", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "full", "\\u", "error", "\\u", "results_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "id", "'_", ":_", "code_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", "'_", ":_", "line", "\\u", "number_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "column", "'_", ":_", "offset_", "+_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "info", "'_", ":_", "text_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "full", "\\u", "error", "\\u", "results_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "error", " ", "results", " ", "in", " ", "deta", "il", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Result", "s", " ", "are", " ", "in", " ", "the", " ", "form", " ", "of", " ", "a", " ", "list", " ", "of", " ", "dictionar", "ies", ".", " ", "Ea", "ch", "\\", "10", ";", " ", " ", " ", " ", "dictionar", "y", " ", "contain", "s", " ", "'", "id", "',", " ", "'", "line", "',", " ", "'", "column", "',", " ", "and", " ", "'", "info", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "full", "\\u", "error", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "checker_", "=_", "pep", "8_", "._", "Checker_", "(_", "''_", ",_", "lines_", "=_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reporter_", "=_", "Qui", "et", "Report_", ",_", "**_", "pep", "8", "\\u", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checker_", "._", "check", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "checker_", "._", "report_", "._", "full", "\\u", "error", "\\u", "results_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "remove", "\\u", "lead", "ing", "\\u", "and", "\\u", "normalize_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "line_", "._", "lstrip_", "(_", ")_", "._", "rstrip_", "(_", "CR", "_", "+_", "LF", "_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Rein", "dent", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Rein", "dent", "s", " ", "bad", "ly", "-", "indented", " ", "code", " ", "to", " ", "uniform", "ly", " ", "use", " ", "four", "-", "space", " ", "indent", "ation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Release", "d", " ", "to", " ", "the", " ", "public", " ", "domain", ",", " ", "by", " ", "Tim", " ", "Peter", "s", ",", " ", "03", " ", "Oct", "obe", "r", " ", "2000", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Rein", "dent", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "input", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sio_", "=_", "io_", "._", "String", "IO_", "(_", "input", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "\\u", "lines_", "=_", "sio_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "string", "\\u", "content", "\\u", "line", "\\u", "numbers_", "=_", "multiline", "\\u", "string", "\\u", "lines_", "(_", "input", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "File", " ", "lines", ",", " ", "rstr", "ipp", "ed", " ", "&", " ", "tab", "-", "expand", "ed", ".", " ", "Du", "mm", "y", " ", "at", " ", "start", " ", "is", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "we", " ", "can", " ", "use", " ", "tokenize", "'", "s", " ", "1", "-", "based", " ", "line", " ", "numbering", " ", "easi", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "a", " ", "line", " ", "is", " ", "all", "-", "blank", " ", "iff", " ", "it", " ", "is", " ", "a", " ", "newline", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "index_", ",_", "line_", "in_", "enumerate_", "(_", "source", "\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "\\u", "number_", "=_", "index_", "+_", "1_", "#", " ", "process", "ing", ".", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "not", " ", "modif", "y", " ", "if", " ", "insi", "de", " ", "a", " ", "multiline", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "line", "\\u", "number_", "in_", "self_", "._", "string", "\\u", "content", "\\u", "line", "\\u", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lines_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", "ly", " ", "expand", " ", "lead", "ing", " ", "tabs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lines_", "._", "append_", "(_", "\\u", "get", "\\u", "indentation_", "(_", "line_", ")_", "._", "expand", "tabs_", "(_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "remove", "\\u", "lead", "ing", "\\u", "and", "\\u", "normalize_", "(_", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "lines_", "._", "insert_", "(_", "0_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "index_", "=_", "1_", "#", " ", "index", " ", "int", "o", " ", "self", ".", "lines", " ", "of", " ", "next", " ", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "text_", "=_", "input", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rein", "dent", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "indent", "\\u", "size_", "=_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "indent", "ation", " ", "and", " ", "return", " ", "modifi", "ed", " ", "line", " ", "numbers", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Line", " ", "numbers", " ", "are", " ", "indexe", "d", " ", "at", " ", "1", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "indent", "\\u", "size_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "input", "\\u", "text_", "\\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 ", " _", "stats_", "=_", "\\u", "rein", "dent", "\\u", "stats_", "(_", "tokenize_", "._", "generat", "e\\u", "tokens_", "(_", "self_", "._", "getl", "ine_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "input", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "trail", "ing", " ", "empty", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lines_", "=_", "self_", "._", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "lines_", "and_", "lines_", "[_", "-_", "1_", "]_", "==_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Senti", "nel", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stats_", "._", "append_", "(_", "(_", "len_", "(_", "lines_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Map", " ", "count", " ", "of", " ", "lead", "ing", " ", "space", "s", " ", "to", " ", "#", " ", "we", " ", "want", "._", "\\u\\u\\uNL\\u\\u\\u_", "have", "2w", "ant_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Program", " ", "after", " ", "transformation", "._", "\\u\\u\\uNL\\u\\u\\u_", "after_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Copy", " ", "over", " ", "initial", " ", "empty", " ", "lines", " ", "--", " ", "there", "'", "s", " ", "not", "hing", " ", "to", " ", "do", " ", "until_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "see", " ", "a", " ", "line", " ", "with", " ", "*", "somet", "hing", "*", " ", "on", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "stats_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "after_", "._", "extend_", "(_", "lines_", "[_", "1_", ":_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "stats_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "stmt_", ",_", "this", "level_", "=_", "stats_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "stmt_", "=_", "stats_", "[_", "i_", "+_", "1_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "have_", "=_", "\\u", "lead", "ing", "\\u", "space", "\\u", "count_", "(_", "lines_", "[_", "this", "stmt_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "want_", "=_", "this", "level_", "*_", "indent", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "want_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "comment", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "have_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "An", " ", "indented", " ", "comment", " ", "line", ".", " ", "If", " ", "we", " ", "saw", " ", "the", " ", "same_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indent", "ation", " ", "bef", "ore", ",", " ", "reus", "e", " ", "what", " ", "it", " ", "most", " ", "recent", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mapp", "ed", " ", "to", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "want_", "=_", "have", "2w", "ant_", "._", "get_", "(_", "have_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "want_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "n", " ", "it", " ", "probab", "ly", " ", "belo", "ngs", " ", "to", " ", "the", " ", "next", " ", "real", " ", "stmt", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "j_", "in_", "range_", "(_", "i_", "+_", "1_", ",_", "len_", "(_", "stats_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "jl", "ine_", ",_", "jl", "evel_", "=_", "stats_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "jl", "evel_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "have_", "==_", "\\u", "lead", "ing", "\\u", "space", "\\u", "count_", "(_", "lines_", "[_", "jl", "ine_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "want_", "=_", "jl", "evel_", "*_", "indent", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "want_", "<_", "0_", ":_", "#", " ", "Ma", "yb", "e", " ", "it", "'", "s", " ", "a", " ", "hang", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "comment", " ", "like", " ", "this", " ", "one", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "whi", "ch", " ", "case", " ", "we", " ", "shou", "ld", " ", "shift", " ", "it", " ", "like", " ", "its", " ", "base_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "line", " ", "got", " ", "shifted", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "j_", "in_", "range_", "(_", "i_", "-_", "1_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "jl", "ine_", ",_", "jl", "evel_", "=_", "stats_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "jl", "evel_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "want_", "=_", "(_", "have_", "+_", "\\u", "lead", "ing", "\\u", "space", "\\u", "count_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "after_", "[_", "jl", "ine_", "-_", "1_", "]_", ")_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "lead", "ing", "\\u", "space", "\\u", "count_", "(_", "lines_", "[_", "jl", "ine_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "want_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Stil", "l", " ", "no", " ", "luck", " ", "--", " ", "lea", "ve", " ", "it", " ", "alo", "ne", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "want_", "=_", "have_", "\\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 ", " ", "_", "want_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "want_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "have", "2w", "ant_", "[_", "have_", "]_", "=_", "want_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "want_", "-_", "have_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "diff_", "==_", "0_", "or_", "have_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "after_", "._", "extend_", "(_", "lines_", "[_", "this", "stmt_", ":_", "next", "stmt_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "index_", ",_", "line_", "in_", "enumerate_", "(_", "lines_", "[_", "this", "stmt_", ":_", "next", "stmt_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line", "\\u", "number_", "=_", "index_", "+_", "this", "stmt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line", "\\u", "number_", "in_", "self_", "._", "string", "\\u", "content", "\\u", "line", "\\u", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "after_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diff_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "line_", "==_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "after_", "._", "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 ", " ", " _", "after_", "._", "append_", "(_", "'", " ", "'_", "*_", "diff_", "+_", "line_", ")_", "\\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 ", " ", " _", "remove_", "=_", "min_", "(_", "\\u", "lead", "ing", "\\u", "space", "\\u", "count_", "(_", "line_", ")_", ",_", "-_", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "after_", "._", "append_", "(_", "line_", "[_", "remove_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "after_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rein", "dent", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "getl", "ine_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Line", "-", "getter", " ", "for", " ", "tokenize", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "index_", ">=_", "len_", "(_", "self_", "._", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\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 ", " _", "line_", "=_", "self_", "._", "lines_", "[_", "self_", "._", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "rein", "dent", "\\u", "stats_", "(_", "tokens_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "list", " ", "of", " ", "(", "linen", "o", ",", " ", "indent", "level", ")", " ", "pair", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "One", " ", "for", " ", "each", " ", "stmt", " ", "and", " ", "comment", " ", "line", ".", " ", "indent", "level", " ", "is", " ", "-1", " ", "for", " ", "comment", " ", "lines", ",", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "signal", " ", "tha", "t", " ", "tokenize", " ", "doe", "sn", "'", "t", " ", "know", " ", "what", " ", "to", " ", "do", " ", "abo", "ut", " ", "them", ";", " ", "inde", "ed", ",", " ", "the", "y", "'", "re", "\\", "10", ";", " ", " ", " ", " ", "our", " ", "head", "ache", "!", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "find", "\\u", "stmt_", "=_", "1_", "#", " ", "Ne", "xt", " ", "token", " ", "begins", " ", "a", " ", "fresh", " ", "stmt", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "=_", "0_", "#", " ", "Curr", "ent", " ", "indent", " ", "level", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stats_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token", "\\u", "type_", "=_", "t_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sline", "_", "=_", "t_", "[_", "2_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "t_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "type_", "==_", "tokenize_", "._", "NEWLINE", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "program", " ", "statem", "ent", ",", " ", "or", " ", "END", "MARKER", ",", " ", "will", " ", "eventual", "ly", " ", "follow", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "after", " ", "some", " ", "(", "possib", "ly", " ", "empty", ")", " ", "run", " ", "of", " ", "token", "s", " ", "of", " ", "the", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "NL", " ", "|", " ", "COMMENT", ")*", " ", "(", "INDENT", " ", "|", " ", "DED", "ENT", "+)?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "find", "\\u", "stmt_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "type_", "==_", "tokenize_", "._", "INDENT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "find", "\\u", "stmt_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "type_", "==_", "tokenize_", "._", "DED", "ENT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "find", "\\u", "stmt_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "type_", "==_", "tokenize_", "._", "COMMENT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "find", "\\u", "stmt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stats_", "._", "append_", "(_", "(_", "sline", "_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bu", "t", " ", "we", "'", "re", " ", "still", " ", "look", "ing", " ", "for", " ", "a", " ", "new", " ", "stmt", ",", " ", "so", " ", "leave_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", "\\u", "stmt", " ", "alo", "ne", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "type_", "==_", "tokenize_", "._", "NL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "find", "\\u", "stmt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "first", " ", "\"", "real", " ", "token", "\"", " ", "follow", "ing", " ", "a", " ", "NEWLINE", ",", " ", "so", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "must", " ", "be", " ", "the", " ", "first", " ", "token", " ", "of", " ", "the", " ", "next", " ", "program", " ", "statem", "ent", ",", " ", "or", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "END", "MARKER", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "find", "\\u", "stmt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", ":_", "#", " ", "Not", " ", "end", "marker", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stats_", "._", "append_", "(_", "(_", "sline", "_", ",_", "level_", ")_", ")_", "\\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_", "stats_", "\\u\\u\\uNEWLINE\\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", "lead", "ing", "\\u", "space", "\\u", "count_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "number", " ", "of", " ", "lead", "ing", " ", "space", "s", " ", "in", " ", "line", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<_", "len_", "(_", "line_", ")_", "and_", "line_", "[_", "i_", "]_", "==_", "'", " ", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refactor", "\\u", "with", "\\u", "2t", "o3", "_", "(_", "source", "\\u", "text_", ",_", "fixer", "\\u", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Us", "e", " ", "lib", "2t", "o3", " ", "to", " ", "refactor", " ", "the", " ", "source", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "refactor", "ed", " ", "source", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lib", "2t", "o3", "_", "._", "refactor", "_", "import_", "Ref", "actor", "ing", "Tool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixer", "s_", "=_", "[_", "'", "lib", "2t", "o3", ".", "fixes", ".", "fix", "\\u'_", "+_", "name_", "for_", "name_", "in_", "fixer", "\\u", "names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tool_", "=_", "Ref", "actor", "ing", "Tool_", "(_", "fixer", "\\u", "names_", "=_", "fixer", "s_", ",_", "explicit", "_", "=_", "fixer", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lib", "2t", "o3", "_", "._", "pge", "n2_", "import_", "tokenize_", "as_", "lib", "2t", "o3", "\\u", "tokenize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unicode_", "(_", "tool_", "._", "refactor", "\\u", "string_", "(_", "source", "\\u", "text_", ",_", "name_", "=_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "lib", "2t", "o3", "\\u", "tokenize_", "._", "Token", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "source", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "syntax_", "(_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "synta", "x", " ", "is", " ", "oka", "y", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "compile_", "(_", "code_", ",_", "'<", "string", ">'_", ",_", "'", "exec", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "Type", "Error_", ",_", "Unic", "ode", "Decode", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "filter", "\\u", "results_", "(_", "source_", ",_", "results_", ",_", "aggre", "ssi", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Filter", " ", "out", " ", "spu", "rio", "us", " ", "report", "s", " ", "from", " ", "pep", "8", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "aggre", "ssi", "ve", " ", "is", " ", "Tru", "e", ",", " ", "we", " ", "allow", " ", "possib", "ly", " ", "unsafe", " ", "fixes", " ", "(", "E", "711", ",", " ", "E", "712", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "non", "\\u", "docstr", "ing", "\\u", "string", "\\u", "line", "\\u", "numbers_", "=_", "multiline", "\\u", "string", "\\u", "lines_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "source_", ",_", "include", "\\u", "docstrings", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "string", "\\u", "line", "\\u", "numbers_", "=_", "multiline", "\\u", "string", "\\u", "lines_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "source_", ",_", "include", "\\u", "docstrings", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "commente", "d\\u", "out", "\\u", "code", "\\u", "line", "\\u", "numbers_", "=_", "commente", "d\\u", "out", "\\u", "code", "\\u", "lines_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "r_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "issue", "\\u", "id_", "=_", "r_", "[_", "'", "id", "'_", "]_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r_", "[_", "'", "line", "'_", "]_", "in_", "non", "\\u", "docstr", "ing", "\\u", "string", "\\u", "line", "\\u", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "id_", "._", "startswith_", "(_", "(_", "'", "e1", "'_", ",_", "'", "e5", "01", "'_", ",_", "'", "w", "191", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "[_", "'", "line", "'_", "]_", "in_", "all", "\\u", "string", "\\u", "line", "\\u", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "id_", "in_", "[_", "'", "e5", "01", "'_", "]_", ":_", "\\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_", "#", " ", "We", " ", "must", " ", "offset", " ", "by", " ", "1", " ", "for", " ", "lines", " ", "tha", "t", " ", "contain", " ", "the", " ", "trail", "ing", " ", "content", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "multiline", " ", "string", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "aggre", "ssi", "ve_", "and_", "(_", "r_", "[_", "'", "line", "'_", "]_", "+_", "1_", ")_", "in_", "all", "\\u", "string", "\\u", "line", "\\u", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "not", " ", "modif", "y", " ", "multiline", " ", "string", "s", " ", "in", " ", "non", "-", "aggre", "ssi", "ve", " ", "mode", ".", " ", "Remove_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "trail", "ing", " ", "whitespace", " ", "coul", "d", " ", "break", " ", "docte", "sts", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "id_", "._", "startswith_", "(_", "(_", "'", "w2", "9", "'_", ",_", "'", "w3", "9", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "aggre", "ssi", "ve_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "id_", "._", "startswith_", "(_", "(_", "'", "e7", "11", "'_", ",_", "'", "w", "6", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "aggre", "ssi", "ve_", "<=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "id_", "._", "startswith_", "(_", "(_", "'", "e7", "1", "2", "'_", ",_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "[_", "'", "line", "'_", "]_", "in_", "commente", "d\\u", "out", "\\u", "code", "\\u", "line", "\\u", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue", "\\u", "id_", "._", "startswith_", "(_", "(_", "'", "e2", "6", "'_", ",_", "'", "e5", "01", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "multiline", "\\u", "string", "\\u", "lines_", "(_", "source_", ",_", "include", "\\u", "docstrings", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "line", " ", "numbers", " ", "tha", "t", " ", "are", " ", "within", " ", "multiline", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "line", " ", "numbers", " ", "are", " ", "indexe", "d", " ", "at", " ", "1", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Docs", "tring", "s", " ", "are", " ", "ignore", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "numbers_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previ", "ous", "\\u", "token", "\\u", "type_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "generat", "e\\u", "tokens_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token", "\\u", "type_", "=_", "t_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "row_", "=_", "t_", "[_", "2_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "row_", "=_", "t_", "[_", "3_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "type_", "==_", "tokenize_", "._", "STRING_", "and_", "start", "\\u", "row_", "!=_", "end", "\\u", "row_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "docstrings", "_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "token", "\\u", "type_", "!=_", "tokenize_", "._", "INDENT", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "increment", " ", "by", " ", "one", " ", "sinc", "e", " ", "we", " ", "want", " ", "the", " ", "content", "s", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line", "\\u", "numbers_", "|=_", "set_", "(_", "range_", "(_", "1_", "+_", "start", "\\u", "row_", ",_", "1_", "+_", "end", "\\u", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "previ", "ous", "\\u", "token", "\\u", "type_", "=_", "token", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "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_", "return_", "line", "\\u", "numbers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "commente", "d\\u", "out", "\\u", "code", "\\u", "lines_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "line", " ", "numbers", " ", "of", " ", "comment", "s", " ", "tha", "t", " ", "are", " ", "like", "ly", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Comme", "nte", "d", "-", "out", " ", "code", " ", "is", " ", "bad", " ", "practic", "e", ",", " ", "but", " ", "modif", "ying", " ", "it", " ", "just", " ", "adds", " ", "even", " ", "more", "\\", "10", ";", " ", " ", " ", " ", "clu", "tter", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "numbers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "generat", "e\\u", "tokens_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token", "\\u", "type_", "=_", "t_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "\\u", "string_", "=_", "t_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "row_", "=_", "t_", "[_", "2_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "t_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ignor", "e", " ", "inline", " ", "comment", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "line_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", ":_", "\\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_", "token", "\\u", "type_", "==_", "tokenize_", "._", "COMMENT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "strip", "ped", "\\u", "line_", "=_", "token", "\\u", "string_", "._", "lstrip_", "(_", "'#'_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "'_", "in_", "strip", "ped", "\\u", "line_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "'#'_", "not_", "in_", "strip", "ped", "\\u", "line_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "check", "\\u", "syntax_", "(_", "strip", "ped", "\\u", "line_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line", "\\u", "numbers_", "._", "append_", "(_", "start", "\\u", "row_", ")_", "\\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_", "(_", "Syntax", "Error_", ",_", "tokenize_", "._", "Token", "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_", "return_", "line", "\\u", "numbers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shorten", "\\u", "comment_", "(_", "line_", ",_", "max", "\\u", "line", "\\u", "length_", ",_", "last", "\\u", "comment_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "trimmed", " ", "or", " ", "split", " ", "long", " ", "comment", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "there", " ", "are", " ", "no", " ", "comment", "s", " ", "immediate", "ly", " ", "follow", "ing", " ", "it", ",", " ", "do", " ", "a", " ", "text", " ", "wrap", ".", "\\", "10", ";", " ", " ", " ", " ", "Do", "ing", " ", "this", " ", "wrapp", "ing", " ", "on", " ", "all", " ", "comment", "s", " ", "in", " ", "genera", "l", " ", "wou", "ld", " ", "lead", " ", "to", " ", "ja", "gged", "\\", "10", ";", " ", " ", " ", " ", "comment", " ", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "line_", ")_", ">_", "max", "\\u", "line", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "line_", "._", "rstrip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "PE", "P", " ", "8", " ", "recommend", "s", " ", "7", "2", " ", "character", "s", " ", "for", " ", "comment", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "indentation_", "=_", "\\u", "get", "\\u", "indentation_", "(_", "line_", ")_", "+_", "'#", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "line", "\\u", "length_", "=_", "min_", "(_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "indentation_", ")_", "+_", "72_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MIN", "\\u", "CHARACTER", "\\u", "REPEAT", "_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "line_", ")_", "-_", "len_", "(_", "line_", "._", "rstrip_", "(_", "line_", "[_", "-_", "1_", "]_", ")_", ")_", ">=_", "MIN", "\\u", "CHARACTER", "\\u", "REPEAT", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "line_", "[_", "-_", "1_", "]_", "._", "isal", "num_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Trim", " ", "comment", "s", " ", "tha", "t", " ", "end", " ", "with", " ", "thing", "s", " ", "like", " ", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "line_", "[_", ":_", "max", "\\u", "line", "\\u", "length_", "]_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "last", "\\u", "comment_", "and_", "re_", "._", "match_", "(_", "r", "'\\\\", "s", "*#", "+\\\\", "s", "*\\\\", "w", "+'_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "textwrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "\\u", "lines_", "=_", "textwrap_", "._", "wrap_", "(_", "line_", "._", "lstrip_", "(_", "'", " ", "\\\\", "t", "#'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "initial", "\\u", "indent_", "=_", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subsequen", "t", "\\u", "indent_", "=_", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "max", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "long", "\\u", "words_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "break", "\\u", "on", "\\u", "hyphen", "s_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "split", "\\u", "lines_", ")_", "+_", "'\\\\", "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 ", " _", "return_", "line_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "normali", "ze", "\\u", "line", "\\u", "ending", "s_", "(_", "lines_", ",_", "newline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "fixed", " ", "line", " ", "ending", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "lines", " ", "will", " ", "be", " ", "modifi", "ed", " ", "to", " ", "use", " ", "the", " ", "most", " ", "common", " ", "line", " ", "ending", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "line_", "._", "rstrip_", "(_", "'\\\\", "n", "\\\\", "r", "'_", ")_", "+_", "newline_", "for_", "line_", "in_", "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_", "def_", "mutual", "\\u", "startswith_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "b_", "._", "startswith_", "(_", "a_", ")_", "or_", "a_", "._", "startswith_", "(_", "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_", "def_", "code", "\\u", "match_", "(_", "code_", ",_", "select_", ",_", "ignore_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "isinstance_", "(_", "ignore_", ",_", "unicode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ignore", "d\\u", "code_", "in_", "[_", "c_", "._", "strip_", "(_", ")_", "for_", "c_", "in_", "ignore_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mutual", "\\u", "startswith_", "(_", "code_", "._", "lower_", "(_", ")_", ",_", "ignore", "d\\u", "code_", "._", "lower_", "(_", ")_", ")_", ":_", "\\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_", "if_", "select_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "isinstance_", "(_", "select_", ",_", "unicode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "selecte", "d\\u", "code_", "in_", "[_", "c_", "._", "strip_", "(_", ")_", "for_", "c_", "in_", "select_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mutual", "\\u", "startswith_", "(_", "code_", "._", "lower_", "(_", ")_", ",_", "selecte", "d\\u", "code_", "._", "lower_", "(_", ")_", ")_", ":_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "code_", "(_", "source_", ",_", "options_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "fixed", " ", "source", " ", "code", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "=_", "parse", "\\u", "args_", "(_", "[_", "''_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "source_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "source_", "._", "decode_", "(_", "locale_", "._", "getpr", "efer", "rede", "nco", "ding_", "(_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sio_", "=_", "io_", "._", "String", "IO_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "fix", "\\u", "lines_", "(_", "sio_", "._", "readlines_", "(_", ")_", ",_", "options_", "=_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "lines_", "(_", "source", "\\u", "lines_", ",_", "options_", ",_", "filename_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "fixed", " ", "source", " ", "code", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Transform", " ", "every", "thing", " ", "to", " ", "line", " ", "feed", ".", " ", "The", "n", " ", "change", " ", "them", " ", "back", " ", "to", " ", "original_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bef", "ore", " ", "return", "ing", " ", "fixed", " ", "source", " ", "code", "._", "\\u\\u\\uNL\\u\\u\\u_", "original", "\\u", "newline_", "=_", "find", "\\u", "newline_", "(_", "source", "\\u", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "source_", "=_", "''_", "._", "join_", "(_", "normali", "ze", "\\u", "line", "\\u", "ending", "s_", "(_", "source", "\\u", "lines_", ",_", "'\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Keep", " ", "a", " ", "histo", "ry", " ", "to", " ", "break", " ", "out", " ", "of", " ", "cycle", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "hashes_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "line", "\\u", "range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed", "\\u", "source_", "=_", "appl", "y", "\\u", "local", "\\u", "fixes", "_", "(_", "tmp", "\\u", "source_", ",_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Apply", " ", "global", " ", "fixes", " ", "only", " ", "onc", "e", " ", "(", "for", " ", "efficien", "cy", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed", "\\u", "source_", "=_", "appl", "y", "\\u", "global", "\\u", "fixes", "_", "(_", "tmp", "\\u", "source_", ",_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "passes_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "hash_", "(_", "fixed", "\\u", "source_", ")_", "not_", "in_", "previ", "ous", "\\u", "hashes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "pep", "8", "\\u", "passes_", ">=_", "0_", "and_", "passes_", ">_", "options_", "._", "pep", "8", "\\u", "passes_", ":_", "\\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_", "passes_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "hashes_", "._", "add_", "(_", "hash_", "(_", "fixed", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "source_", "=_", "copy_", "._", "copy_", "(_", "fixed", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fix_", "=_", "Fix", "PE", "P", "8_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "contents_", "=_", "tmp", "\\u", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", "=_", "long", "\\u", "line", "\\u", "ignore", "\\u", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "source_", "=_", "fix_", "._", "fix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sio_", "=_", "io_", "._", "String", "IO_", "(_", "fixed", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "normali", "ze", "\\u", "line", "\\u", "ending", "s_", "(_", "sio_", "._", "readlines_", "(_", ")_", ",_", "original", "\\u", "newline_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "file_", "(_", "filename_", ",_", "options_", "=_", "None_", ",_", "output_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "=_", "parse", "\\u", "args_", "(_", "[_", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "original", "\\u", "source_", "=_", "readline", "s", "\\u", "from", "\\u", "file_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "source_", "=_", "original", "\\u", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "in", "\\u", "place_", "or_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encoding_", "=_", "detect", "\\u", "encoding_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "codecs_", "._", "getw", "riter", "_", "(_", "encoding_", ")_", "(_", "output_", "._", "buffer_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "output_", ",_", "'", "buffer", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "Line", "Endi", "ng", "Wrapper_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed", "\\u", "source_", "=_", "fix", "\\u", "lines_", "(_", "fixed", "\\u", "source_", ",_", "options_", ",_", "filename_", "=_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new_", "=_", "io_", "._", "String", "IO_", "(_", "fixed", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "new_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "get", "\\u", "diff", "\\u", "text_", "(_", "original", "\\u", "source_", ",_", "new_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "._", "write_", "(_", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "._", "flush_", "(_", ")_", "\\u\\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_", "diff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "in", "\\u", "place_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "open", "\\u", "with", "\\u", "encoding_", "(_", "filename_", ",_", "encoding_", "=_", "encoding_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "write_", "(_", "fixed", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "._", "write_", "(_", "fixed", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "._", "flush_", "(_", ")_", "\\u\\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_", "fixed", "\\u", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "global", "\\u", "fixes", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Yi", "eld", " ", "multiple", " ", "(", "code", ",", " ", "function", ")", " ", "tuple", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "function_", "in_", "globals_", "(_", ")_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "inspect_", "._", "isf", "unction_", "(_", "function_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arguments_", "=_", "inspect_", "._", "getargs", "pec_", "(_", "function_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arguments_", "[_", ":_", "1_", "]_", "!=_", "[_", "'", "source", "'_", "]_", ":_", "\\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_", "code_", "=_", "extract", "\\u", "code", "\\u", "from", "\\u", "function_", "(_", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "code_", ",_", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "global", "\\u", "fixes", "_", "(_", "source_", ",_", "options_", ",_", "where_", "=_", "'", "global", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Run", " ", "global", " ", "fixes", " ", "on", " ", "source", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", "se", " ", "are", " ", "fixes", " ", "tha", "t", " ", "only", " ", "need", " ", "be", " ", "don", "e", " ", "onc", "e", " ", "(", "unli", "ke", " ", "tho", "se", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "Fix", "PE", "P", "8", ",", " ", "whi", "ch", " ", "are", " ", "dependent", " ", "on", " ", "pep", "8", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "code", "\\u", "match_", "(_", "'", "E1", "01", "'_", ",_", "select_", "=_", "options_", "._", "select_", ",_", "ignore_", "=_", "options_", "._", "ignore_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "rein", "dent_", "(_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "\\u", "size_", "=_", "options_", "._", "indent", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "(_", "code_", ",_", "function_", ")_", "in_", "global", "\\u", "fixes", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "code", "\\u", "match_", "(_", "code_", ",_", "select_", "=_", "options_", "._", "select_", ",_", "ignore_", "=_", "options_", "._", "ignore_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'---", ">", " ", " ", "Apply", "ing", " ", "{", "0", "}", " ", "fix", " ", "for", " ", "{", "1", "}'_", "._", "format_", "(_", "where_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "._", "upper_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source_", "=_", "function_", "(_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "options_", "._", "aggre", "ssi", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source_", "=_", "fix", "\\u", "2t", "o3", "_", "(_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "aggre", "ssi", "ve_", "=_", "options_", "._", "aggre", "ssi", "ve_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "select_", "=_", "options_", "._", "select_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ignore_", "=_", "options_", "._", "ignore_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "source_", "\\u\\u\\uNEWLINE\\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", "local", "\\u", "fixes", "_", "(_", "source_", ",_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ana", "nolo", "gus", " ", "to", " ", "appl", "y", "\\u", "global", "\\u", "fixes", ",", " ", "but", " ", "runs", " ", "only", " ", "tho", "se", " ", "whi", "ch", " ", "make", "s", " ", "sense", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "the", " ", "give", "n", " ", "line", "\\u", "range", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Do", " ", "as", " ", "muc", "h", " ", "as", " ", "we", " ", "can", " ", "with", "out", " ", "break", "ing", " ", "code", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find", "\\u", "ge_", "(_", "a_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "left", "most", " ", "item", " ", "great", "er", " ", "than", " ", "or", " ", "equal", " ", "to", " ", "x", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "bisect_", "._", "bisect", "\\u", "left_", "(_", "a_", ",_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "!=_", "len_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", ",_", "a_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "len_", "(_", "a_", ")_", "-_", "1_", ",_", "a_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "\\u", "le_", "(_", "a_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "right", "most", " ", "value", " ", "less", " ", "than", " ", "or", " ", "equal", " ", "to", " ", "x", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "bisect_", "._", "bisect", "\\u", "right_", "(_", "a_", ",_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "i_", "-_", "1_", ",_", "a_", "[_", "i_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_", ",_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "local", "\\u", "fix_", "(_", "source_", ",_", "start", "\\u", "log_", ",_", "end", "\\u", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "lines_", ",_", "end", "\\u", "lines_", ",_", "indent", "s_", ",_", "last", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "appl", "y", "\\u", "global", "\\u", "fixes", " ", "to", " ", "the", " ", "source", " ", "bet", "ween", " ", "start", "\\u", "log", " ", "and", " ", "end", "\\u", "log", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "subs", "ource", " ", "must", " ", "be", " ", "the", " ", "correct", " ", "synta", "x", " ", "of", " ", "a", " ", "complete", " ", "python", " ", "program", "\\", "10", ";", " ", " ", " ", " ", "(", "but", " ", "all", " ", "lines", " ", "may", " ", "share", " ", "an", " ", "indent", "ation", ").", " ", "The", " ", "subs", "ource", "'", "s", " ", "shared", " ", "indent", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "remove", "d", ",", " ", "fixes", " ", "are", " ", "applied", " ", "and", " ", "the", " ", "indent", " ", "prepend", "ed", " ", "back", ".", " ", "Tak", "ing", "\\", "10", ";", " ", " ", " ", " ", "care", " ", "to", " ", "not", " ", "rein", "dent", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "last", "\\u", "line", " ", "is", " ", "the", " ", "strict", " ", "cut", " ", "off", " ", "(", "options", ".", "line", "\\u", "range", "[", "1", "])", ",", " ", "so", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "lines", " ", "after", " ", "last", "\\u", "line", " ", "are", " ", "not", " ", "modifi", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "end", "\\u", "log_", "<_", "start", "\\u", "log_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind_", "=_", "indent", "s_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indent_", "=_", "\\u", "get", "\\u", "indentation_", "(_", "source_", "[_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sl_", "=_", "slice_", "(_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", ",_", "end", "\\u", "lines_", "[_", "end", "\\u", "log_", "]_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "subs", "ource_", "=_", "source_", "[_", "sl_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "indent", " ", "from", " ", "subs", "ource", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ind_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line", "\\u", "no_", "in_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", ":_", "end", "\\u", "log_", "+_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "line", "\\u", "no_", "-_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subs", "ource_", "[_", "pos_", "]_", "=_", "subs", "ource_", "[_", "pos_", "]_", "[_", "ind_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", " ", "indent", "ation", " ", "of", " ", "subs", "ource", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fixed", "\\u", "subs", "ource_", "=_", "appl", "y", "\\u", "global", "\\u", "fixes", "_", "(_", "''_", "._", "join_", "(_", "subs", "ource_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "where_", "=_", "'", "local", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "subs", "ource_", "=_", "fixed", "\\u", "subs", "ource_", "._", "splitlines_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "back", " ", "indent", " ", "for", " ", "non", " ", "multi", "-", "line", " ", "string", "s", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "ms", "l_", "=_", "multiline", "\\u", "string", "\\u", "lines_", "(_", "''_", "._", "join_", "(_", "fixed", "\\u", "subs", "ource_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "docstrings", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "line_", "in_", "enumerate_", "(_", "fixed", "\\u", "subs", "ource_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "i_", "+_", "1_", "in_", "ms", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixed", "\\u", "subs", "ource_", "[_", "i_", "]_", "=_", "indent_", "+_", "line_", "if_", "line_", "!=_", "'\\\\", "n", "'_", "else_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "make", " ", "a", " ", "special", " ", "case", " ", "to", " ", "look", " ", "at", " ", "the", " ", "final", " ", "line", ",", " ", "if", " ", "it", "'", "s", " ", "a", " ", "multiline", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", "and", "*", " ", "the", " ", "cut", " ", "off", " ", "is", " ", "some", "where", " ", "insi", "de", " ", "it", ",", " ", "we", " ", "take", " ", "the", " ", "fixed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subse", "t", " ", "up", " ", "unti", "l", " ", "last", "\\u", "line", ",", " ", "this", " ", "assume", "s", " ", "tha", "t", " ", "the", " ", "number", " ", "of", " ", "lines_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "s", " ", "not", " ", "change", " ", "in", " ", "this", " ", "multiline", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "change", "d\\u", "lines_", "=_", "len_", "(_", "fixed", "\\u", "subs", "ource_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "start", "\\u", "lines_", "[_", "end", "\\u", "log_", "]_", "!=_", "end", "\\u", "lines_", "[_", "end", "\\u", "log_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "end", "\\u", "lines_", "[_", "end", "\\u", "log_", "]_", ">_", "last", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "after", "\\u", "end_", "=_", "end", "\\u", "lines_", "[_", "end", "\\u", "log_", "]_", "-_", "last", "\\u", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixed", "\\u", "subs", "ource_", "=_", "(_", "fixed", "\\u", "subs", "ource_", "[_", ":_", "-_", "after", "\\u", "end_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "[_", "sl_", "]_", "[_", "-_", "after", "\\u", "end_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change", "d\\u", "lines_", "-=_", "after", "\\u", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "line", "\\u", "range_", "[_", "1_", "]_", "=_", "(_", "options_", "._", "line", "\\u", "range_", "[_", "0_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "change", "d\\u", "lines_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "source_", "[_", ":_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "fixed", "\\u", "subs", "ource_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "[_", "end", "\\u", "lines_", "[_", "end", "\\u", "log_", "]_", "+_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "continue", "d\\u", "stmt_", "(_", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "continue", "d\\u", "stmts_", "=_", "frozenset_", "(_", "[_", "'", "else", "'_", ",_", "'", "eli", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "final", "ly", "'_", ",_", "'", "except", "'_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "re_", "._", "split_", "(_", "'[", " ", ":]", "'_", ",_", "line_", "._", "strip_", "(_", ")_", ",_", "1_", ")_", "[_", "0_", "]_", "in_", "continue", "d\\u", "stmts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "options_", "._", "line", "\\u", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", ",_", "end_", "=_", "options_", "._", "line", "\\u", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "line_", "=_", "end_", "#", " ", "We", " ", "shou", "ld", "n", "'", "t", " ", "modif", "y", " ", "lines", " ", "after", " ", "this", " ", "cut", "-", "off", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "_", "=_", "\\u", "find", "\\u", "logical", "_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "logical", "_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ju", "st", " ", "blank", " ", "lines", ",", " ", "this", " ", "shou", "ld", " ", "impl", "y", " ", "tha", "t", " ", "it", " ", "will", " ", "bec", "ome", " ", "'\\\\", "n", "'", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "appl", "y", "\\u", "global", "\\u", "fixes", "_", "(_", "source_", ",_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start", "\\u", "lines_", ",_", "indent", "s_", "=_", "zip_", "(_", "*_", "logical", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "lines_", ",_", "\\u_", "=_", "zip_", "(_", "*_", "logical", "_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "source_", "._", "splitlines_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "log_", ",_", "start_", "=_", "find", "\\u", "ge_", "(_", "start", "\\u", "lines_", ",_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "log_", ",_", "end_", "=_", "find", "\\u", "le_", "(_", "start", "\\u", "lines_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Look", " ", "beh", "ind", " ", "one", " ", "line", ",", " ", "if", " ", "it", "'", "s", " ", "indented", " ", "less", " ", "than", " ", "current", " ", "indent_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "we", " ", "can", " ", "move", " ", "to", " ", "this", " ", "previ", "ous", " ", "line", " ", "know", "ing", " ", "tha", "t", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indent", "ation", " ", "level", " ", "will", " ", "not", " ", "be", " ", "change", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "start", "\\u", "log_", ">_", "0_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "indent", "s_", "[_", "start", "\\u", "log_", "-_", "1_", "]_", "<_", "indent", "s_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "not_", "is", "\\u", "continue", "d\\u", "stmt_", "(_", "source_", "[_", "start", "\\u", "log_", "-_", "1_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "log_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "start_", "<_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "continue", "d\\u", "stmt_", "(_", "source_", "[_", "start_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "log_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind_", "=_", "indent", "s_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "itertools_", "._", "take", "while_", "(_", "lambda_", "t_", ":_", "t_", "[_", "1_", "]_", "[_", "1_", "]_", ">=_", "ind_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enumerate_", "(_", "logical", "_", "[_", "0_", "]_", "[_", "start", "\\u", "log_", ":_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n", "\\u", "log_", ",_", "n_", "=_", "start", "\\u", "log_", "+_", "t_", "[_", "0_", "]_", ",_", "t_", "[_", "1_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "start", " ", "share", "s", " ", "indent", " ", "up", " ", "to", " ", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n_", "<=_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "local", "\\u", "fix_", "(_", "source_", ",_", "start", "\\u", "log_", ",_", "n", "\\u", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "lines_", ",_", "end", "\\u", "lines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "s_", ",_", "last", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "log_", "=_", "n", "\\u", "log_", "if_", "n_", "==_", "end_", "else_", "n", "\\u", "log_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Look", " ", "at", " ", "the", " ", "line", " ", "after", " ", "end", " ", "and", " ", "see", " ", "if", " ", "allow", "s", " ", "us", " ", "to", " ", "rein", "dent", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "after", "\\u", "end", "\\u", "log_", ",_", "after", "\\u", "end_", "=_", "find", "\\u", "ge_", "(_", "start", "\\u", "lines_", ",_", "end_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "indent", "s_", "[_", "after", "\\u", "end", "\\u", "log_", "]_", ">_", "indent", "s_", "[_", "start", "\\u", "log_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "log_", ",_", "start_", "=_", "find", "\\u", "ge_", "(_", "start", "\\u", "lines_", ",_", "start_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "indent", "s_", "[_", "after", "\\u", "end", "\\u", "log_", "]_", "==_", "indent", "s_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "is", "\\u", "continue", "d\\u", "stmt_", "(_", "source_", "[_", "after", "\\u", "end_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "find", " ", "n", ",", " ", "the", " ", "beginn", "ing", " ", "of", " ", "the", " ", "last", " ", "continue", "d", " ", "statement_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "fix", " ", "to", " ", "previ", "ous", " ", "block", " ", "if", " ", "there", " ", "is", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "only", "\\u", "block_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", ",_", "n", "\\u", "ind_", "in_", "logical", "_", "[_", "0_", "]_", "[_", "start", "\\u", "log_", ":_", "end", "\\u", "log_", "+_", "1_", "]_", "[_", ":_", ":_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "n", "\\u", "ind_", "==_", "ind_", "and_", "not_", "is", "\\u", "continue", "d\\u", "stmt_", "(_", "source_", "[_", "n_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "n", "\\u", "log_", "=_", "start", "\\u", "lines_", "._", "index_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "local", "\\u", "fix_", "(_", "source_", ",_", "start", "\\u", "log_", ",_", "n", "\\u", "log_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "lines_", ",_", "end", "\\u", "lines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "s_", ",_", "last", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "log_", "=_", "n", "\\u", "log_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start", "\\u", "lines_", "[_", "start", "\\u", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "only", "\\u", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "only", "\\u", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "end", "\\u", "log_", ",_", "end_", "=_", "find", "\\u", "le_", "(_", "start", "\\u", "lines_", ",_", "end_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source_", "=_", "local", "\\u", "fix_", "(_", "source_", ",_", "start", "\\u", "log_", ",_", "end", "\\u", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "lines_", ",_", "end", "\\u", "lines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indent", "s_", ",_", "last", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extract", "\\u", "code", "\\u", "from", "\\u", "function_", "(_", "function_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "code", " ", "handle", "d", " ", "by", " ", "function", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "function_", "._", "\\u\\u", "name\\u\\u_", "._", "startswith_", "(_", "'", "fix", "\\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_", "code_", "=_", "re_", "._", "sub_", "(_", "'", "^", "fix", "\\u'_", ",_", "''_", ",_", "function_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "code_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int_", "(_", "code_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "parser_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "command", "-", "line", " ", "parser", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "import", " ", "local", "ly", " ", "to", " ", "be", " ", "frie", "ndl", "y", " ", "to", " ", "tho", "se", " ", "who", " ", "use", " ", "autop", "ep", "8", " ", "as", " ", "a", " ", "library_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "are", " ", "support", "ing", " ", "Pyth", "on", " ", "2.6", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "docstr", "ing", "\\u", "summary_", "(_", "\\u\\u", "doc\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prog_", "=_", "'", "autop", "ep", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "version", "'_", ",_", "action_", "=_", "'", "version", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'%", "(", "prog", ")", "s", " ", "'_", "+_", "\\u\\u", "version\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "v", "'_", ",_", "'--", "verbo", "se", "'_", ",_", "action_", "=_", "'", "count", "'_", ",_", "dest_", "=_", "'", "verbo", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "print", " ", "verbo", "se", " ", "message", "s", ";", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "multiple", " ", "-", "v", " ", "result", " ", "in", " ", "more", " ", "verbo", "se", " ", "message", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "d", "'_", ",_", "'--", "diff", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "dest_", "=_", "'", "diff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "print", " ", "the", " ", "diff", " ", "for", " ", "the", " ", "fixed", " ", "source", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "i", "'_", ",_", "'--", "in", "-", "place", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "make", " ", "change", "s", " ", "to", " ", "files", " ", "in", " ", "place", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "r", "'_", ",_", "'--", "recurs", "ive", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "run", " ", "recurs", "ively", " ", "over", " ", "director", "ies", ";", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "must", " ", "be", " ", "used", " ", "with", " ", "--", "in", "-", "place", " ", "or", " ", "--", "diff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "j", "'_", ",_", "'--", "jobs", "'_", ",_", "type_", "=_", "int_", ",_", "metavar_", "=_", "'", "n", "'_", ",_", "default_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "number", " ", "of", " ", "parall", "el", " ", "jobs", ";", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "match", " ", "CPU", " ", "count", " ", "if", " ", "value", " ", "is", " ", "less", " ", "than", " ", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "p", "'_", ",_", "'--", "pep", "8", "-", "pass", "es", "'_", ",_", "metavar_", "=_", "'", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "-_", "1_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "maxim", "um", " ", "number", " ", "of", " ", "addition", "al", " ", "pep", "8", " ", "pass", "es", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "default", ":", " ", "infini", "te", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "a", "'_", ",_", "'--", "aggre", "ssi", "ve", "'_", ",_", "action_", "=_", "'", "count", "'_", ",_", "default_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "enable", " ", "non", "-", "whitespace", " ", "change", "s", ";", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "multiple", " ", "-", "a", " ", "result", " ", "in", " ", "more", " ", "aggre", "ssi", "ve", " ", "change", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "experimental", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "enable", " ", "experimental", " ", "fixes", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "exclu", "de", "'_", ",_", "metavar_", "=_", "'", "glob", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "exclu", "de", " ", "file", "/", "director", "y", " ", "names", " ", "tha", "t", " ", "match", " ", "these", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comma", "-", "separate", "d", " ", "glob", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "list", "-", "fixes", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "list", " ", "codes", " ", "for", " ", "fixes", ";", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", " ", "by", " ", "--", "ignore", " ", "and", " ", "--", "select", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "ignore", "'_", ",_", "metavar_", "=_", "'", "error", "s", "'_", ",_", "default_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "do", " ", "not", " ", "fix", " ", "these", " ", "error", "s", "/", "warn", "ings", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "default", ":", " ", "{", "0", "})'_", "._", "format_", "(_", "DEF", "AUL", "T", "\\u", "IGNORE", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "select", "'_", ",_", "metavar_", "=_", "'", "error", "s", "'_", ",_", "default_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "fix", " ", "only", " ", "these", " ", "error", "s", "/", "warn", "ings", " ", "(", "e", ".", "g", ".", " ", "E4", ",", "W", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "max", "-", "line", "-", "length", "'_", ",_", "metavar_", "=_", "'", "n", "'_", ",_", "default_", "=_", "79_", ",_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "set", " ", "maxim", "um", " ", "allow", "ed", " ", "line", " ", "length", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "default", ":", " ", "%", "(", "default", ")", "s", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "range", "'_", ",_", "metavar_", "=_", "'", "line", "'_", ",_", "dest_", "=_", "'", "line", "\\u", "range", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "None_", ",_", "type_", "=_", "int_", ",_", "nargs_", "=_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "only", " ", "fix", " ", "error", "s", " ", "found", " ", "within", " ", "this", " ", "inclu", "sive", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "range", " ", "of", " ", "line", " ", "numbers", " ", "(", "e", ".", "g", ".", " ", "1", " ", "9", "9", ");", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", " ", "numbers", " ", "are", " ", "indexe", "d", " ", "at", " ", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "indent", "-", "size", "'_", ",_", "default_", "=_", "DEF", "AUL", "T", "\\u", "INDENT", "\\u", "SIZE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "=_", "int_", ",_", "metavar_", "=_", "'", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "number", " ", "of", " ", "space", "s", " ", "per", " ", "indent", " ", "level", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "default", " ", "%", "(", "default", ")", "s", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "files", "'_", ",_", "nargs_", "=_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "files", " ", "to", " ", "format", " ", "or", " ", "'-'", " ", "for", " ", "standard", " ", "in", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "(_", "arguments_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "command", "-", "line", " ", "options", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "create", "\\u", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "args_", "._", "files_", "and_", "not_", "args_", "._", "list", "\\u", "fixes", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'", "incorrect", " ", "number", " ", "of", " ", "argu", "ment", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "._", "files_", "=_", "[_", "decode", "\\u", "filename_", "(_", "name_", ")_", "for_", "name_", "in_", "args_", "._", "files_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'-'_", "in_", "args_", "._", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", "._", "files_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'", "cann", "ot", " ", "mix", " ", "std", "in", " ", "and", " ", "regular", " ", "files", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "diff", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "standard", " ", "input", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "in", "\\u", "place_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "in", "-", "place", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "standard", " ", "input", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "recursive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "recurs", "ive", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "standard", " ", "input", "'_", ")_", "\\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_", "(_", "args_", "._", "files_", ")_", ">_", "1_", "and_", "not_", "(_", "args_", "._", "in", "\\u", "place_", "or_", "args_", "._", "diff_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'", "autop", "ep", "8", " ", "only", " ", "take", "s", " ", "one", " ", "filename", " ", "as", " ", "argu", "ment", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unl", "ess", " ", "the", " ", "\"--", "in", "-", "place", "\"", " ", "or", " ", "\"--", "diff", "\"", " ", "args", " ", "are", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "used", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "recursive_", "and_", "not_", "(_", "args_", "._", "in", "\\u", "place_", "or_", "args_", "._", "diff_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "recurs", "ive", " ", "must", " ", "be", " ", "used", " ", "with", " ", "--", "in", "-", "place", " ", "or", " ", "--", "diff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "exclude_", "and_", "not_", "args_", "._", "recursive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "exclu", "de", " ", "is", " ", "only", " ", "rele", "van", "t", " ", "whe", "n", " ", "used", " ", "with", " ", "--", "recurs", "ive", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "in", "\\u", "place_", "and_", "args_", "._", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "in", "-", "place", " ", "and", " ", "--", "diff", " ", "are", " ", "mutual", "ly", " ", "exclu", "sive", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "max", "\\u", "line", "\\u", "length_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'--", "max", "-", "line", "-", "length", " ", "must", " ", "be", " ", "great", "er", " ", "than", " ", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "select_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "select_", "=_", "args_", "._", "select_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "ignore_", "=_", "args_", "._", "ignore_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "args_", "._", "select_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "args_", "._", "aggre", "ssi", "ve_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "every", "thing", " ", "by", " ", "default", " ", "if", " ", "aggre", "ssi", "ve", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "select_", "=_", "[_", "'", "E", "'_", ",_", "'", "W", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "ignore_", "=_", "DEF", "AUL", "T", "\\u", "IGNORE", "_", "._", "split_", "(_", "','_", ")_", "\\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_", "args_", "._", "exclude_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "exclude_", "=_", "args_", "._", "exclude_", "._", "split_", "(_", "','_", ")_", "\\u\\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_", "._", "exclude_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "jobs_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "not", " ", "import", " ", "multipro", "cess", "ing", " ", "global", "ly", " ", "in", " ", "case", " ", "it", " ", "is", " ", "not", " ", "supported_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "the", " ", "platform", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "multiprocessing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "jobs_", "=_", "multiprocessing_", "._", "cpu", "\\u", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "jobs_", ">_", "1_", "and_", "not_", "args_", "._", "in", "\\u", "place_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "'", "parall", "el", " ", "jobs", " ", "require", "s", " ", "--", "in", "-", "place", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "\\u", "filename_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Unic", "ode", " ", "filename", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "filename_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "filename_", "._", "decode_", "(_", "sys_", "._", "getfile", "system", "encoding_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "support", "ed", "\\u", "fixes", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Yi", "eld", " ", "pep", "8", " ", "error", " ", "codes", " ", "tha", "t", " ", "autop", "ep", "8", " ", "fixes", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "item", " ", "we", " ", "yield", " ", "is", " ", "a", " ", "tuple", " ", "of", " ", "the", " ", "code", " ", "followe", "d", " ", "by", " ", "its", "\\", "10", ";", " ", " ", " ", " ", "description", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "(_", "'", "E1", "01", "'_", ",_", "docstr", "ing", "\\u", "summary_", "(_", "rein", "dent_", "._", "\\u\\u", "doc\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "=_", "Fix", "PE", "P", "8_", "(_", "filename_", "=_", "None_", ",_", "options_", "=_", "None_", ",_", "contents_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "attribute_", "in_", "dir_", "(_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "=_", "re_", "._", "match_", "(_", "'", "fix", "\\u(", "[", "ew", "][", "0", "-", "9", "][", "0", "-", "9", "][", "0", "-", "9", "])'_", ",_", "attribute_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "._", "group_", "(_", "1_", ")_", "._", "upper_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "sub_", "(_", "r", "'\\\\", "s", "+'_", ",_", "'", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstr", "ing", "\\u", "summary_", "(_", "getattr_", "(_", "instance_", ",_", "attribute_", ")_", "._", "\\u\\u", "doc\\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_", "for_", "(_", "code_", ",_", "function_", ")_", "in_", "sorted_", "(_", "global", "\\u", "fixes", "_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "code_", "._", "upper_", "(_", ")_", "+_", "(_", "4_", "-_", "len_", "(_", "code_", ")_", ")_", "*_", "'", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "sub_", "(_", "r", "'\\\\", "s", "+'_", ",_", "'", " ", "'_", ",_", "docstr", "ing", "\\u", "summary_", "(_", "function_", "._", "\\u\\u", "doc\\u\\u_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "code_", "in_", "sorted_", "(_", "CODE", "\\u", "TO", "\\u", "2", "TO", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "(_", "code_", "._", "upper_", "(_", ")_", "+_", "(_", "4_", "-_", "len_", "(_", "code_", ")_", ")_", "*_", "'", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "sub_", "(_", "r", "'\\\\", "s", "+'_", ",_", "'", " ", "'_", ",_", "docstr", "ing", "\\u", "summary_", "(_", "fix", "\\u", "2t", "o3", "_", "._", "\\u\\u", "doc\\u\\u_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "docstr", "ing", "\\u", "summary_", "(_", "docstring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "summar", "y", " ", "of", " ", "docstr", "ing", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "docstring_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "[_", "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_", "line", "\\u", "shorten", "ing", "\\u", "rank_", "(_", "candidate_", ",_", "indent", "\\u", "word_", ",_", "max", "\\u", "line", "\\u", "length_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "rank", " ", "of", " ", "candidate", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "for", " ", "sorting", " ", "candidate", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "candidate_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rank_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "candidate_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "lines_", "[_", "0_", "]_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "[_", "0_", "]_", "._", "rstrip_", "(_", ")_", "[_", "-_", "1_", "]_", "not_", "in_", "'(", "[{", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "opening", "_", ",_", "closing_", ")_", "in_", "(_", "'()'_", ",_", "'[]'_", ",_", "'{}'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "pen", "alize", " ", "empty", " ", "container", "s", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "split", " ", "up", ".", " ", "Thin", "gs", " ", "like_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "\"", "foo", "(\\\\", "n", " ", " ", " ", " ", ")\"", " ", "are", "n", "'", "t", " ", "partic", "ular", "ly", " ", "good", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opening", "\\u", "loc_", "=_", "lines_", "[_", "0_", "]_", "._", "find_", "(_", "opening", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clos", "ing", "\\u", "loc_", "=_", "lines_", "[_", "0_", "]_", "._", "find_", "(_", "closing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "opening", "\\u", "loc_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "clos", "ing", "\\u", "loc_", "<_", "0_", "or_", "clos", "ing", "\\u", "loc_", "!=_", "opening", "\\u", "loc_", "+_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "offset_", "=_", "max_", "(_", "offset_", ",_", "1_", "+_", "opening", "\\u", "loc_", ")_", "\\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_", "current", "\\u", "longest_", "=_", "max_", "(_", "offset_", "+_", "len_", "(_", "x_", "._", "strip_", "(_", ")_", ")_", "for_", "x_", "in_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rank_", "+=_", "4_", "*_", "max_", "(_", "0_", ",_", "current", "\\u", "longest_", "-_", "max", "\\u", "line", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rank_", "+=_", "len_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Too", " ", "muc", "h", " ", "variatio", "n", " ", "in", " ", "line", " ", "length", " ", "is", " ", "ug", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "rank_", "+=_", "2_", "*_", "standard", "\\u", "deviation", "_", "(_", "len_", "(_", "line_", ")_", "for_", "line_", "in_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bad", "\\u", "star", "ing", "\\u", "symbol_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'('_", ":_", "')'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'['_", ":_", "']'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'{'_", ":_", "'}'_", "}_", "._", "get_", "(_", "lines_", "[_", "0_", "]_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "lines_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bad", "\\u", "star", "ing", "\\u", "symbol_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "[_", "1_", "]_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "bad", "\\u", "star", "ing", "\\u", "symbol_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "20_", "\\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_", "lineno_", ",_", "current", "\\u", "line_", "in_", "enumerate_", "(_", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "line_", "=_", "current", "\\u", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "current", "\\u", "line_", "._", "startswith_", "(_", "'#'_", ")_", ":_", "\\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_", "for_", "bad", "\\u", "start_", "in_", "[_", "'.'_", ",_", "'%'_", ",_", "'+'_", ",_", "'-'_", ",_", "'/'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "current", "\\u", "line_", "._", "startswith_", "(_", "bad", "\\u", "start_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "not", " ", "tolera", "te", " ", "opera", "tors", " ", "on", " ", "thei", "r", " ", "own", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "line_", "==_", "bad", "\\u", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "1000_", "\\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_", "current", "\\u", "line_", "._", "endswith_", "(_", "(_", "'('_", ",_", "'['_", ",_", "'{'_", ",_", "'.'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Av", "oid", " ", "lone", "ly", " ", "opening", ".", " ", "The", "y", " ", "result", " ", "in", " ", "long", "er", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "current", "\\u", "line_", ")_", "<=_", "len_", "(_", "indent", "\\u", "word_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Av", "oid", " ", "the", " ", "ug", "lines", "s", " ", "of", " ", "\",", " ", "(\\\\", "n", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "line_", "._", "endswith_", "(_", "'('_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "line_", "[_", ":_", "-_", "1_", "]_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "','_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", " ", "avoid", " ", "the", " ", "ug", "lines", "s", " ", "of", " ", "\"", "foo", ".\\\\", "nba", "r", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "line_", "._", "endswith_", "(_", "'.'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "has", "\\u", "arithmetic", "\\u", "operator_", "(_", "current", "\\u", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "100_", "\\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_", "current", "\\u", "line_", "._", "endswith_", "(_", "(_", "'%'_", ",_", "'('_", ",_", "'['_", ",_", "'{'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "-=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "break", " ", "list", " ", "compre", "hens", "ion", "s", " ", "at", " ", "the", " ", "\"", "for", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "line_", "._", "startswith_", "(_", "'", "for", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "-=_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "line_", "._", "endswith_", "(_", "'\\\\\\\\'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "line", " ", "ends", " ", "in", " ", "\\\\", "-", "newline", ",", " ", "it", " ", "may", " ", "be", " ", "part", " ", "of", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "multiline", " ", "string", ".", " ", "In", " ", "tha", "t", " ", "case", ",", " ", "we", " ", "wou", "ld", " ", "like", " ", "to", " ", "know", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "how", " ", "long", " ", "tha", "t", " ", "line", " ", "is", " ", "with", "out", " ", "the", " ", "\\\\", "-", "newline", ".", " ", "If", " ", "it", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "long", "er", " ", "than", " ", "the", " ", "maxim", "um", ",", " ", "or", " ", "has", " ", "comment", "s", ",", " ", "then", " ", "we", " ", "assume", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "the", " ", "\\\\", "-", "newline", " ", "is", " ", "an", " ", "oka", "y", " ", "candidate", " ", "and", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pen", "alize", " ", "it", " ", "a", " ", "bit", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total", "\\u", "len_", "=_", "len_", "(_", "current", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lineno_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "lineno_", "<_", "len_", "(_", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total", "\\u", "len_", "+=_", "len_", "(_", "lines_", "[_", "lineno_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lines_", "[_", "lineno_", "]_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'#'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "total", "\\u", "len_", "=_", "max", "\\u", "line", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "lines_", "[_", "lineno_", "]_", "._", "endswith_", "(_", "'\\\\\\\\'_", ")_", ":_", "\\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_", "lineno_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "total", "\\u", "len_", "<_", "max", "\\u", "line", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prefe", "r", " ", "break", "ing", " ", "at", " ", "commas", " ", "rat", "her", " ", "than", " ", "colon", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "','_", "in_", "current", "\\u", "line_", "and_", "current", "\\u", "line_", "._", "endswith_", "(_", "':'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rank_", "+=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rank_", "+=_", "10_", "*_", "count", "\\u", "unb", "alance", "d\\u", "brackets", "_", "(_", "current", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "max_", "(_", "0_", ",_", "rank_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "standard", "\\u", "deviation", "_", "(_", "numbers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "standard", " ", "dev", "ation", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numbers_", "=_", "list_", "(_", "numbers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "numbers_", ":_", "\\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_", "mean_", "=_", "sum_", "(_", "numbers_", ")_", "/_", "len_", "(_", "numbers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "sum_", "(_", "(_", "n_", "-_", "mean_", ")_", "**_", "2_", "for_", "n_", "in_", "numbers_", ")_", "/_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "numbers_", ")_", ")_", "**_", ".5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "arithmetic", "\\u", "operator_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "line", " ", "contain", "s", " ", "any", " ", "arithmetic", " ", "opera", "tors", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "operator_", "in_", "pep", "8_", "._", "ARI", "TH", "MET", "IC", "\\u", "OP_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "operator_", "in_", "line_", ":_", "\\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]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "count", "\\u", "unb", "alance", "d\\u", "brackets", "_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "number", " ", "of", " ", "unmatched", " ", "open", "/", "close", " ", "brackets", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "opening", "_", ",_", "closing_", "in_", "[_", "'()'_", ",_", "'[]'_", ",_", "'{}'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "+=_", "abs_", "(_", "line_", "._", "count_", "(_", "opening", "_", ")_", "-_", "line_", "._", "count_", "(_", "closing_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "split", "\\u", "at", "\\u", "offsets_", "(_", "line_", ",_", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Split", " ", "line", " ", "at", " ", "offset", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "list", " ", "of", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "current", "\\u", "offset_", "in_", "sorted_", "(_", "offsets_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "current", "\\u", "offset_", "<_", "len_", "(_", "line_", ")_", "and_", "previ", "ous", "\\u", "offset_", "!=_", "current", "\\u", "offset_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "line_", "[_", "previ", "ous", "\\u", "offset_", ":_", "current", "\\u", "offset_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "previ", "ous", "\\u", "offset_", "=_", "current", "\\u", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "append_", "(_", "line_", "[_", "current", "\\u", "offset_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Line", "Endi", "ng", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "Replace", " ", "line", " ", "ending", "s", " ", "to", " ", "work", " ", "with", " ", "sys", ".", "stdout", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "see", "ms", " ", "tha", "t", " ", "sys", ".", "stdout", " ", "expect", "s", " ", "only", " ", "'\\\\", "n", "'", " ", "as", " ", "the", " ", "line", " ", "ending", ",", " ", "no", " ", "matte", "r", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "platform", ".", " ", "Ot", "her", "wis", "e", ",", " ", "we", " ", "get", " ", "repeated", " ", "line", " ", "ending", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Line", "Endi", "ng", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "output_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "output_", "=_", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Line", "Endi", "ng", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "output_", "._", "write_", "(_", "s_", "._", "replace_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ",_", "'\\\\", "n", "'_", ")_", "._", "replace_", "(_", "'\\\\", "r", "'_", ",_", "'\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Line", "Endi", "ng", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flush_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "output_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "file_", "(_", "filename_", ",_", "exclude_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "file", " ", "is", " ", "oka", "y", " ", "for", " ", "modif", "ying", "/", "recurs", "ing", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base", "\\u", "name_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "base", "\\u", "name_", "._", "startswith_", "(_", "'.'_", ")_", ":_", "\\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_", "for_", "pattern_", "in_", "exclude_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fnmatch_", "._", "fnmatch_", "(_", "base", "\\u", "name_", ",_", "pattern_", ")_", ":_", "\\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_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "filename_", ")_", "and_", "not_", "is", "\\u", "python", "\\u", "file_", "(_", "filename_", ")_", ":_", "\\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_", "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_", "find", "\\u", "files_", "(_", "filenames_", ",_", "recursive_", ",_", "exclude_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Yi", "eld", " ", "filename", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "filenames_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "recursive_", "and_", "os_", "._", "path_", "._", "isdir_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "root_", ",_", "directories_", ",_", "children_", "in_", "os_", "._", "walk_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filenames_", "+=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "f_", ")_", "for_", "f_", "in_", "children_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "match", "\\u", "file_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "f_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exclude_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directories_", "[_", ":_", "]_", "=_", "[_", "d_", "for_", "d_", "in_", "directories_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "match", "\\u", "file_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "d_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exclude_", ")_", "]_", "\\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 ", " _", "yield_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fix", "\\u", "file_", "(_", "parameters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Help", "er", " ", "function", " ", "for", " ", "option", "ally", " ", "runn", "ing", " ", "fix", "\\u", "file", "()", " ", "in", " ", "parall", "el", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parameters_", "[_", "1_", "]_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'[", "file", ":", "{", "0", "}]'_", "._", "format_", "(_", "parameters_", "[_", "0_", "]_", ")_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\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 ", " _", "fix", "\\u", "file_", "(_", "*_", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "unicode_", "(_", "error_", ")_", ",_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "multiple", "\\u", "files_", "(_", "filenames_", ",_", "options_", ",_", "output_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fix", " ", "list", " ", "of", " ", "files", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optio", "nal", "ly", " ", "fix", " ", "files", " ", "recurs", "ively", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filenames_", "=_", "find", "\\u", "files_", "(_", "filenames_", ",_", "options_", "._", "recursive_", ",_", "options_", "._", "exclude_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "jobs_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "multiprocessing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pool_", "=_", "multiprocessing_", "._", "Pool_", "(_", "options_", "._", "jobs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pool_", "._", "map_", "(_", "\\u", "fix", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "name_", ",_", "options_", ")_", "for_", "name_", "in_", "filenames_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "fix", "\\u", "file_", "(_", "(_", "name_", ",_", "options_", ",_", "output_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "python", "\\u", "file_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "filename", " ", "is", " ", "Pyth", "on", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filename_", "._", "endswith_", "(_", "'.", "py", "'_", ")_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open", "\\u", "with", "\\u", "encoding_", "(_", "filename_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first", "\\u", "line_", "=_", "f_", "._", "readlines_", "(_", "1_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "Index", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "PYTHON", "\\u", "SHE", "BAN", "G", "\\u", "REGEX_", "._", "match_", "(_", "first", "\\u", "line_", ")_", ":_", "\\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_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "probab", "ly", "\\u", "part", "\\u", "of", "\\u", "multiline", "_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "line", " ", "is", " ", "like", "ly", " ", "part", " ", "of", " ", "a", " ", "multiline", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "multiline", " ", "string", "s", " ", "are", " ", "involved", ",", " ", "pep", "8", " ", "report", "s", " ", "the", " ", "error", " ", "as", " ", "bei", "ng", "\\", "10", ";", " ", " ", " ", " ", "at", " ", "the", " ", "start", " ", "of", " ", "the", " ", "multiline", " ", "string", ",", " ", "whi", "ch", " ", "doe", "sn", "'", "t", " ", "work", " ", "for", " ", "us", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "\"\"", "'_", "in_", "line_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\"'''", "\"_", "in_", "line_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "._", "rstrip_", "(_", ")_", "._", "endswith_", "(_", "'\\\\\\\\'_", ")_", "\\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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tool", " ", "main", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Exi", "t", " ", "on", " ", "broken", " ", "pipe", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signal_", "._", "signal_", "(_", "signal_", "._", "SIG", "PIPE_", ",_", "signal_", "._", "SIG", "\\u", "DF", "L_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "SIG", "PIPE", " ", "is", " ", "not", " ", "avail", "able", " ", "on", " ", "Window", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "parse", "\\u", "args_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "args_", "._", "list", "\\u", "fixes", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "code_", ",_", "description_", "in_", "sorted_", "(_", "support", "ed", "\\u", "fixes", "_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'{", "code", "}", " ", "-", " ", "{", "description", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "code_", ",_", "description_", "=_", "description_", ")_", ")_", "\\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_", "if_", "args_", "._", "files_", "==_", "[_", "'-'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "args_", "._", "in", "\\u", "place_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Line", "Endi", "ng", "Wrapper", " ", "is", " ", "unne", "cess", "ary", " ", "here", " ", "due", " ", "to", " ", "the", " ", "symmetry", " ", "between_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "standard", " ", "in", " ", "and", " ", "standard", " ", "out", "._", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "fix", "\\u", "code_", "(_", "sys_", "._", "stdin_", "._", "read_", "(_", ")_", ",_", "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 ", " _", "if_", "args_", "._", "in", "\\u", "place_", "or_", "args_", "._", "diff_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "files_", "=_", "list_", "(_", "set_", "(_", "args_", "._", "files_", ")_", ")_", "\\u\\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_", "(_", "args_", "._", "files_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "args_", "._", "recursive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fix", "\\u", "multiple", "\\u", "files_", "(_", "args_", "._", "files_", ",_", "args_", ",_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Cache", "d", "Tokenizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "one", "-", "element", " ", "cache", " ", "aro", "und", " ", "tokenize", ".", "generat", "e\\u", "token", "s", "()", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Origina", "l", " ", "code", " ", "writt", "en", " ", "by", " ", "Ne", "d", " ", "Bat", "che", "lder", ",", " ", "in", " ", "covera", "ge", ".", "py", ".", "\\", "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_", "[SEP]_", "class_", "Cache", "d", "Tokenizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "text_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "tokens_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cache", "d", "Tokenizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "tokens_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "stand", "-", "in", " ", "for", " ", "tokenize", ".", "generat", "e\\u", "token", "s", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text_", "!=_", "self_", "._", "last", "\\u", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "string", "\\u", "io_", "=_", "io_", "._", "String", "IO_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "tokens_", "=_", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tokenize_", "._", "generat", "e\\u", "tokens_", "(_", "string", "\\u", "io_", "._", "readline_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "text_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_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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 ]
`__init__` method calls overridden method
ganeti/ganeti/lib/masterd/iallocator.py
[ { "content": "class IARequestBase(outils.ValidatedSlots):\n \"\"\"A generic IAllocator request object.\n\n \"\"\"\n __metaclass__ = _AutoReqParam\n\n MODE = NotImplemented\n REQ_PARAMS = []\n REQ_RESULT = NotImplemented\n\n\n\n\n", "metadata": "root.IARequestBase", "header": "['module', '___EOS___']", "index": 86 }, { "content": " def __init__(self, **kwargs):\n \"\"\"Constructor for IARequestBase.\n\n The constructor takes only keyword arguments and will set\n attributes on this object based on the passed arguments. As such,\n it means that you should not pass arguments which are not in the\n REQ_PARAMS attribute for this class.\n\n \"\"\"\n outils.ValidatedSlots.__init__(self, **kwargs)\n\n self.Validate()", "metadata": "root.IARequestBase.__init__", "header": "['class', 'IARequestBase', '(', 'outils', '.', 'ValidatedSlots', ')', ':', '___EOS___']", "index": 96 }, { "content": " def Validate(self):\n \"\"\"Validates all parameters of the request.\n\n\n This method returns L{None} if the validation succeeds, or raises\n an exception otherwise.\n\n @rtype: NoneType\n @return: L{None}, if the validation succeeds\n\n @raise Exception: validation fails\n\n \"\"\"\n assert self.MODE in constants.VALID_IALLOCATOR_MODES\n\n for (param, validator) in self.REQ_PARAMS:\n if not hasattr(self, param):\n raise errors.OpPrereqError(\"Request is missing '%s' parameter\" % param,\n errors.ECODE_INVAL)\n\n value = getattr(self, param)\n if not validator(value):\n raise errors.OpPrereqError((\"Request parameter '%s' has invalid\"\n \" type %s/value %s\") %\n (param, type(value), value),\n errors.ECODE_INVAL)", "metadata": "root.IARequestBase.Validate", "header": "['class', 'IARequestBase', '(', 'outils', '.', 'ValidatedSlots', ')', ':', '___EOS___']", "index": 109 }, { "content": " def GetRequest(self, cfg):\n \"\"\"Gets the request data dict.\n\n @param cfg: The configuration instance\n\n \"\"\"\n raise NotImplementedError", "metadata": "root.IARequestBase.GetRequest", "header": "['class', 'IARequestBase', '(', 'outils', '.', 'ValidatedSlots', ')', ':', '___EOS___']", "index": 136 }, { "content": " def GetExtraParams(self): # pylint: disable=R0201\n \"\"\"Gets extra parameters to the IAllocator call.\n\n \"\"\"\n return {}", "metadata": "root.IARequestBase.GetExtraParams", "header": "['class', 'IARequestBase', '(', 'outils', '.', 'ValidatedSlots', ')', ':', '___EOS___']", "index": 144 }, { "content": " def ValidateResult(self, ia, result):\n \"\"\"Validates the result of an request.\n\n @param ia: The IAllocator instance\n @param result: The IAllocator run result\n @raises ResultValidationError: If validation fails\n\n \"\"\"\n if ia.success and not self.REQ_RESULT(result):\n raise errors.ResultValidationError(\"iallocator returned invalid result,\"\n \" expected %s, got %s\" %\n (self.REQ_RESULT, result))", "metadata": "root.IARequestBase.ValidateResult", "header": "['class', 'IARequestBase', '(', 'outils', '.', 'ValidatedSlots', ')', ':', '___EOS___']", "index": 150 }, { "content": "class IAReqInstanceAlloc(IARequestBase):\n \"\"\"An instance allocation request.\n\n \"\"\"\n # pylint: disable=E1101\n MODE = constants.IALLOCATOR_MODE_ALLOC\n REQ_PARAMS = [\n _INST_NAME,\n (\"memory\", ht.TNonNegativeInt),\n (\"spindle_use\", ht.TNonNegativeInt),\n (\"disks\", ht.TListOf(ht.TDict)),\n (\"disk_template\", ht.TString),\n (\"group_name\", ht.TMaybe(ht.TNonEmptyString)),\n (\"os\", ht.TString),\n (\"tags\", _STRING_LIST),\n (\"nics\", ht.TListOf(ht.TDict)),\n (\"vcpus\", ht.TInt),\n (\"hypervisor\", ht.TString),\n (\"node_whitelist\", ht.TMaybeListOf(ht.TNonEmptyString)),\n ]\n REQ_RESULT = ht.TList\n\n\n", "metadata": "root.IAReqInstanceAlloc", "header": "['module', '___EOS___']", "index": 164 }, { "content": " def RequiredNodes(self):\n \"\"\"Calculates the required nodes based on the disk_template.\n\n \"\"\"\n if self.disk_template in constants.DTS_INT_MIRROR:\n return 2\n else:\n return 1", "metadata": "root.IAReqInstanceAlloc.RequiredNodes", "header": "['class', 'IAReqInstanceAlloc', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 186 }, { "content": " def GetRequest(self, cfg):\n \"\"\"Requests a new instance.\n\n The checks for the completeness of the opcode must have already been\n done.\n\n \"\"\"\n for d in self.disks:\n d[constants.IDISK_TYPE] = self.disk_template\n disk_space = gmi.ComputeDiskSize(self.disks)\n\n return {\n \"name\": self.name,\n \"disk_template\": self.disk_template,\n \"group_name\": self.group_name,\n \"tags\": self.tags,\n \"os\": self.os,\n \"vcpus\": self.vcpus,\n \"memory\": self.memory,\n \"spindle_use\": self.spindle_use,\n \"disks\": self.disks,\n \"disk_space_total\": disk_space,\n \"nics\": self.nics,\n \"required_nodes\": self.RequiredNodes(),\n \"hypervisor\": self.hypervisor,\n }", "metadata": "root.IAReqInstanceAlloc.GetRequest", "header": "['class', 'IAReqInstanceAlloc', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 195 }, { "content": " def ValidateResult(self, ia, result):\n \"\"\"Validates an single instance allocation request.\n\n \"\"\"\n IARequestBase.ValidateResult(self, ia, result)\n\n if ia.success and len(result) != self.RequiredNodes():\n raise errors.ResultValidationError(\"iallocator returned invalid number\"\n \" of nodes (%s), required %s\" %\n (len(result), self.RequiredNodes()))", "metadata": "root.IAReqInstanceAlloc.ValidateResult", "header": "['class', 'IAReqInstanceAlloc', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 222 }, { "content": "class IAReqInstanceAllocateSecondary(IARequestBase):\n \"\"\"Request to find a secondary node for plain to DRBD conversion.\n\n \"\"\"\n # pylint: disable=E1101\n MODE = constants.IALLOCATOR_MODE_ALLOCATE_SECONDARY\n REQ_PARAMS = [\n _INST_NAME,\n ]\n REQ_RESULT = ht.TString\n", "metadata": "root.IAReqInstanceAllocateSecondary", "header": "['module', '___EOS___']", "index": 234 }, { "content": " def GetRequest(self, cfg):\n return {\n \"name\": self.name\n }", "metadata": "root.IAReqInstanceAllocateSecondary.GetRequest", "header": "['class', 'IAReqInstanceAllocateSecondary', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 245 }, { "content": "class IAReqMultiInstanceAlloc(IARequestBase):\n \"\"\"An multi instance allocation request.\n\n \"\"\"\n # pylint: disable=E1101\n MODE = constants.IALLOCATOR_MODE_MULTI_ALLOC\n REQ_PARAMS = [\n (\"instances\", ht.TListOf(ht.TInstanceOf(IAReqInstanceAlloc))),\n ]\n _MASUCCESS = \\\n ht.TListOf(ht.TAnd(ht.TIsLength(2),\n ht.TItems([ht.TNonEmptyString,\n ht.TListOf(ht.TNonEmptyString),\n ])))\n _MAFAILED = ht.TListOf(ht.TNonEmptyString)\n REQ_RESULT = ht.TAnd(ht.TList, ht.TIsLength(2),\n ht.TItems([_MASUCCESS, _MAFAILED]))\n", "metadata": "root.IAReqMultiInstanceAlloc", "header": "['module', '___EOS___']", "index": 251 }, { "content": " def GetRequest(self, cfg):\n return {\n \"instances\": [iareq.GetRequest(cfg) for iareq in self.instances],\n }", "metadata": "root.IAReqMultiInstanceAlloc.GetRequest", "header": "['class', 'IAReqMultiInstanceAlloc', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 269 }, { "content": "class IAReqRelocate(IARequestBase):\n \"\"\"A relocation request.\n\n \"\"\"\n # pylint: disable=E1101\n MODE = constants.IALLOCATOR_MODE_RELOC\n REQ_PARAMS = [\n _INST_UUID,\n (\"relocate_from_node_uuids\", _STRING_LIST),\n ]\n REQ_RESULT = ht.TList\n\n\n", "metadata": "root.IAReqRelocate", "header": "['module', '___EOS___']", "index": 275 }, { "content": " def GetRequest(self, cfg):\n \"\"\"Request an relocation of an instance\n\n The checks for the completeness of the opcode must have already been\n done.\n\n \"\"\"\n instance = cfg.GetInstanceInfo(self.inst_uuid)\n disks = cfg.GetInstanceDisks(self.inst_uuid)\n if instance is None:\n raise errors.ProgrammerError(\"Unknown instance '%s' passed to\"\n \" IAllocator\" % self.inst_uuid)\n\n if not utils.AllDiskOfType(disks, constants.DTS_MIRRORED):\n raise errors.OpPrereqError(\"Can't relocate non-mirrored instances\",\n errors.ECODE_INVAL)\n\n secondary_nodes = cfg.GetInstanceSecondaryNodes(instance.uuid)\n if (utils.AnyDiskOfType(disks, constants.DTS_INT_MIRROR) and\n len(secondary_nodes) != 1):\n raise errors.OpPrereqError(\"Instance has not exactly one secondary node\",\n errors.ECODE_STATE)\n\n disk_sizes = [{constants.IDISK_SIZE: disk.size,\n constants.IDISK_TYPE: disk.dev_type} for disk in disks]\n disk_space = gmi.ComputeDiskSize(disk_sizes)\n\n return {\n \"name\": instance.name,\n \"disk_space_total\": disk_space,\n \"required_nodes\": 1,\n \"relocate_from\": cfg.GetNodeNames(self.relocate_from_node_uuids),\n }", "metadata": "root.IAReqRelocate.GetRequest", "header": "['class', 'IAReqRelocate', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 287 }, { "content": " def ValidateResult(self, ia, result):\n \"\"\"Validates the result of an relocation request.\n\n \"\"\"\n IARequestBase.ValidateResult(self, ia, result)\n\n node2group = dict((name, ndata[\"group\"])\n for (name, ndata) in ia.in_data[\"nodes\"].items())\n\n fn = compat.partial(self._NodesToGroups, node2group,\n ia.in_data[\"nodegroups\"])\n\n instance = ia.cfg.GetInstanceInfo(self.inst_uuid)\n request_groups = fn(ia.cfg.GetNodeNames(self.relocate_from_node_uuids) +\n ia.cfg.GetNodeNames([instance.primary_node]))\n result_groups = fn(result + ia.cfg.GetNodeNames([instance.primary_node]))\n\n if ia.success and not set(result_groups).issubset(request_groups):\n raise errors.ResultValidationError(\"Groups of nodes returned by\"\n \" iallocator (%s) differ from original\"\n \" groups (%s)\" %\n (utils.CommaJoin(result_groups),\n utils.CommaJoin(request_groups)))", "metadata": "root.IAReqRelocate.ValidateResult", "header": "['class', 'IAReqRelocate', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 321 }, { "content": " @staticmethod\n def _NodesToGroups(node2group, groups, nodes):\n \"\"\"Returns a list of unique group names for a list of nodes.\n\n @type node2group: dict\n @param node2group: Map from node name to group UUID\n @type groups: dict\n @param groups: Group information\n @type nodes: list\n @param nodes: Node names\n\n \"\"\"\n result = set()\n\n for node in nodes:\n try:\n group_uuid = node2group[node]\n except KeyError:\n # Ignore unknown node\n pass\n else:\n try:\n group = groups[group_uuid]\n except KeyError:\n # Can't find group, let's use UUID\n group_name = group_uuid\n else:\n group_name = group[\"name\"]\n\n result.add(group_name)\n\n return sorted(result)", "metadata": "root.IAReqRelocate._NodesToGroups", "header": "['class', 'IAReqRelocate', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 345 }, { "content": "class IAReqNodeEvac(IARequestBase):\n \"\"\"A node evacuation request.\n\n \"\"\"\n # pylint: disable=E1101\n MODE = constants.IALLOCATOR_MODE_NODE_EVAC\n REQ_PARAMS = [\n (\"instances\", _STRING_LIST),\n (\"evac_mode\", ht.TEvacMode),\n (\"ignore_soft_errors\", ht.TMaybe(ht.TBool)),\n ]\n REQ_RESULT = _NEVAC_RESULT\n\n", "metadata": "root.IAReqNodeEvac", "header": "['module', '___EOS___']", "index": 379 }, { "content": " def GetRequest(self, cfg):\n \"\"\"Get data for node-evacuate requests.\n\n \"\"\"\n return {\n \"instances\": self.instances,\n \"evac_mode\": self.evac_mode,\n }", "metadata": "root.IAReqNodeEvac.GetRequest", "header": "['class', 'IAReqNodeEvac', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 392 }, { "content": " def GetExtraParams(self):\n \"\"\"Get extra iallocator command line options for\n node-evacuate requests.\n\n \"\"\"\n if self.ignore_soft_errors:\n return {\"ignore-soft-errors\": None}\n else:\n return {}", "metadata": "root.IAReqNodeEvac.GetExtraParams", "header": "['class', 'IAReqNodeEvac', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 401 }, { "content": "class IAReqGroupChange(IARequestBase):\n \"\"\"A group change request.\n\n \"\"\"\n # pylint: disable=E1101\n MODE = constants.IALLOCATOR_MODE_CHG_GROUP\n REQ_PARAMS = [\n (\"instances\", _STRING_LIST),\n (\"target_groups\", _STRING_LIST),\n ]\n REQ_RESULT = _NEVAC_RESULT\n", "metadata": "root.IAReqGroupChange", "header": "['module', '___EOS___']", "index": 412 }, { "content": " def GetRequest(self, cfg):\n \"\"\"Get data for node-evacuate requests.\n\n \"\"\"\n return {\n \"instances\": self.instances,\n \"target_groups\": self.target_groups,\n }", "metadata": "root.IAReqGroupChange.GetRequest", "header": "['class', 'IAReqGroupChange', '(', 'IARequestBase', ')', ':', '___EOS___']", "index": 424 } ]
[]
[]
0
false
[ "[CLS]_", "`_", "\\u\\u", "init\\u\\u_", "`_", "method_", "calls_", "overrid", "den_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IA", "Request", "Base_", "(_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "gener", "ic", " ", "IA", "lloc", "ator", " ", "request", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "metaclass\\u\\u_", "=_", "\\u", "Auto", "Re", "q", "Param_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "IA", "Request", "Base_", "(_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Constructor", " ", "for", " ", "IA", "Request", "Base", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "construct", "or", " ", "take", "s", " ", "only", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "and", " ", "will", " ", "set", "\\", "10", ";", " ", " ", " ", " ", "attribute", "s", " ", "on", " ", "this", " ", "object", " ", "based", " ", "on", " ", "the", " ", "pass", "ed", " ", "argu", "ment", "s", ".", " ", "As", " ", "suc", "h", ",", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "means", " ", "tha", "t", " ", "you", " ", "shou", "ld", " ", "not", " ", "pass", " ", "argu", "ment", "s", " ", "whi", "ch", " ", "are", " ", "not", " ", "in", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "REQ", "\\u", "PARAM", "S", " ", "attribute", " ", "for", " ", "this", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Validate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Request", "Base_", "(_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Validate", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", "s", " ", "all", " ", "parameter", "s", " ", "of", " ", "the", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "return", "s", " ", "L", "{", "Non", "e", "}", " ", "if", " ", "the", " ", "validation", " ", "succeeds", ",", " ", "or", " ", "raise", "s", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "exception", " ", "other", "wis", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "Non", "e", "Type", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "L", "{", "Non", "e", "},", " ", "if", " ", "the", " ", "validation", " ", "succeeds", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", " ", "Except", "ion", ":", " ", "validation", " ", "fail", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "MODE_", "in_", "constants_", "._", "VALID", "\\u", "IAL", "LOC", "ATOR", "\\u", "MODES_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "param_", ",_", "validator_", ")_", "in_", "self_", "._", "REQ", "\\u", "PARAMS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "self_", ",_", "param_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Op", "Pre", "req", "Error_", "(_", "\"", "Request", " ", "is", " ", "missi", "ng", " ", "'%", "s", "'", " ", "parameter", "\"_", "%_", "param_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "ECO", "DE", "\\u", "INV", "AL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "value_", "=_", "getattr_", "(_", "self_", ",_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "validator_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Op", "Pre", "req", "Error_", "(_", "(_", "\"", "Request", " ", "parameter", " ", "'%", "s", "'", " ", "has", " ", "invalid", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "type", " ", "%", "s", "/", "value", " ", "%", "s", "\"_", ")_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "param_", ",_", "type_", "(_", "value_", ")_", ",_", "value_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "ECO", "DE", "\\u", "INV", "AL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Request", "Base_", "(_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", ")_", ":_", "\\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", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "the", " ", "request", " ", "data", " ", "dict", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "cfg", ":", " ", "The", " ", "configura", "tion", " ", "instance", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Request", "Base_", "(_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Extra", "Params_", "(_", "self_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "R0", "201_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "extra", " ", "parameter", "s", " ", "to", " ", "the", " ", "IA", "lloc", "ator", " ", "call", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Request", "Base_", "(_", "out", "ils_", "._", "Validate", "d", "Slot", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Validate", "Result_", "(_", "self_", ",_", "ia_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", "s", " ", "the", " ", "result", " ", "of", " ", "an", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "ia", ":", " ", "The", " ", "IA", "lloc", "ator", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "result", ":", " ", "The", " ", "IA", "lloc", "ator", " ", "run", " ", "result", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", "s", " ", "Result", "Validat", "ion", "Error", ":", " ", "If", " ", "validation", " ", "fail", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ia_", "._", "success_", "and_", "not_", "self_", "._", "REQ", "\\u", "RESULT_", "(_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Result", "Validat", "ion", "Error_", "(_", "\"", "ial", "locator", " ", "return", "ed", " ", "invalid", " ", "result", ",\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "expected", " ", "%", "s", ",", " ", "got", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "REQ", "\\u", "RESULT_", ",_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IA", "Re", "q", "Insta", "nce", "Alloc", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "An", " ", "instance", " ", "allocat", "ion", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "constants_", "._", "IAL", "LOC", "ATOR", "\\u", "MODE", "\\u", "ALLOC", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "INST", "\\u", "NAME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "memory", "\"_", ",_", "ht_", "._", "TN", "on", "Nega", "tiv", "e", "Int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "spind", "le", "\\u", "use", "\"_", ",_", "ht_", "._", "TN", "on", "Nega", "tiv", "e", "Int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "disks", "\"_", ",_", "ht_", "._", "TL", "ist", "Of_", "(_", "ht_", "._", "TD", "ict_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "disk", "\\u", "template", "\"_", ",_", "ht_", "._", "TS", "tring_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "group", "\\u", "name", "\"_", ",_", "ht_", "._", "TM", "ay", "be_", "(_", "ht_", "._", "TN", "on", "Emp", "ty", "String_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "os", "\"_", ",_", "ht_", "._", "TS", "tring_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "tags", "\"_", ",_", "\\u", "STRING", "\\u", "LIST_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "nic", "s", "\"_", ",_", "ht_", "._", "TL", "ist", "Of_", "(_", "ht_", "._", "TD", "ict_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "vcpu", "s", "\"_", ",_", "ht_", "._", "TI", "nt_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "hypervisor", "\"_", ",_", "ht_", "._", "TS", "tring_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "node", "\\u", "whitelist", "\"_", ",_", "ht_", "._", "TM", "ay", "be", "List", "Of_", "(_", "ht_", "._", "TN", "on", "Emp", "ty", "String_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "ht_", "._", "TL", "ist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "IA", "Re", "q", "Insta", "nce", "Alloc", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Requ", "ired", "Nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Calculat", "es", " ", "the", " ", "require", "d", " ", "nodes", " ", "based", " ", "on", " ", "the", " ", "disk", "\\u", "template", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "disk", "\\u", "template_", "in_", "constants_", "._", "DT", "S", "\\u", "INT", "\\u", "MIR", "ROR", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Insta", "nce", "Alloc", "_", "(_", "IA", "Request", "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_", "Get", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Request", "s", " ", "a", " ", "new", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "checks", " ", "for", " ", "the", " ", "complete", "ness", " ", "of", " ", "the", " ", "opcode", " ", "must", " ", "have", " ", "alr", "ead", "y", " ", "bee", "n", "\\", "10", ";", " ", " ", " ", " ", "don", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "self_", "._", "disks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "[_", "constants_", "._", "IDI", "SK", "\\u", "TYPE_", "]_", "=_", "self_", "._", "disk", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "disk", "\\u", "space_", "=_", "gm", "i_", "._", "Compute", "Disk", "Size_", "(_", "self_", "._", "disks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "disk", "\\u", "template", "\"_", ":_", "self_", "._", "disk", "\\u", "template_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "group", "\\u", "name", "\"_", ":_", "self_", "._", "group", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tags", "\"_", ":_", "self_", "._", "tags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "os", "\"_", ":_", "self_", "._", "os_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vcpu", "s", "\"_", ":_", "self_", "._", "vcpu", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "memory", "\"_", ":_", "self_", "._", "memory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "spind", "le", "\\u", "use", "\"_", ":_", "self_", "._", "spind", "le", "\\u", "use_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "disks", "\"_", ":_", "self_", "._", "disks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "disk", "\\u", "space", "\\u", "total", "\"_", ":_", "disk", "\\u", "space_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nic", "s", "\"_", ":_", "self_", "._", "nics_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "require", "d\\u", "nodes", "\"_", ":_", "self_", "._", "Requ", "ired", "Nodes_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hypervisor", "\"_", ":_", "self_", "._", "hypervisor", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Insta", "nce", "Alloc", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Validate", "Result_", "(_", "self_", ",_", "ia_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", "s", " ", "an", " ", "single", " ", "instance", " ", "allocat", "ion", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IA", "Request", "Base_", "._", "Validate", "Result_", "(_", "self_", ",_", "ia_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ia_", "._", "success_", "and_", "len_", "(_", "result_", ")_", "!=_", "self_", "._", "Requ", "ired", "Nodes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Result", "Validat", "ion", "Error_", "(_", "\"", "ial", "locator", " ", "return", "ed", " ", "invalid", " ", "number", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "of", " ", "nodes", " ", "(%", "s", "),", " ", "require", "d", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "len_", "(_", "result_", ")_", ",_", "self_", "._", "Requ", "ired", "Nodes_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "IA", "Re", "q", "Insta", "nce", "Allocate", "Second", "ary_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Request", " ", "to", " ", "find", " ", "a", " ", "second", "ary", " ", "node", " ", "for", " ", "plain", " ", "to", " ", "DR", "BD", " ", "conve", "rsi", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "constants_", "._", "IAL", "LOC", "ATOR", "\\u", "MODE", "\\u", "ALLOC", "ATE", "\\u", "SECOND", "ARY", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "INST", "\\u", "NAME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "ht_", "._", "TS", "tring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Insta", "nce", "Allocate", "Second", "ary_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Get", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "self_", "._", "name_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "IA", "Re", "q", "Multi", "Insta", "nce", "Alloc", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "An", " ", "multi", " ", "instance", " ", "allocat", "ion", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "constants_", "._", "IAL", "LOC", "ATOR", "\\u", "MODE", "\\u", "MULTI", "\\u", "ALLOC", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "instance", "s", "\"_", ",_", "ht_", "._", "TL", "ist", "Of_", "(_", "ht_", "._", "TI", "nstance", "Of_", "(_", "IA", "Re", "q", "Insta", "nce", "Alloc", "_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "MAS", "UC", "CES", "S_", "=_", "ht_", "._", "TL", "ist", "Of_", "(_", "ht_", "._", "TA", "nd_", "(_", "ht_", "._", "TI", "s", "Length_", "(_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ht_", "._", "TI", "tems_", "(_", "[_", "ht_", "._", "TN", "on", "Emp", "ty", "String_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ht_", "._", "TL", "ist", "Of_", "(_", "ht_", "._", "TN", "on", "Emp", "ty", "String_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "MA", "FAILED_", "=_", "ht_", "._", "TL", "ist", "Of_", "(_", "ht_", "._", "TN", "on", "Emp", "ty", "String_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "ht_", "._", "TA", "nd_", "(_", "ht_", "._", "TL", "ist_", ",_", "ht_", "._", "TI", "s", "Length_", "(_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ht_", "._", "TI", "tems_", "(_", "[_", "\\u", "MAS", "UC", "CES", "S_", ",_", "\\u", "MA", "FAILED_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Multi", "Insta", "nce", "Alloc", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Get", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "instance", "s", "\"_", ":_", "[_", "iar", "eq_", "._", "Get", "Request_", "(_", "cfg_", ")_", "for_", "iar", "eq_", "in_", "self_", "._", "instances_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IA", "Re", "q", "Relo", "cate", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "relocat", "ion", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "constants_", "._", "IAL", "LOC", "ATOR", "\\u", "MODE", "\\u", "REL", "OC", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "INST", "\\u", "UUID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "relocat", "e\\u", "from", "\\u", "node", "\\u", "uuids", "\"_", ",_", "\\u", "STRING", "\\u", "LIST_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "ht_", "._", "TL", "ist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "IA", "Re", "q", "Relo", "cate", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Get", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Request", " ", "an", " ", "relocat", "ion", " ", "of", " ", "an", " ", "instance", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "checks", " ", "for", " ", "the", " ", "complete", "ness", " ", "of", " ", "the", " ", "opcode", " ", "must", " ", "have", " ", "alr", "ead", "y", " ", "bee", "n", "\\", "10", ";", " ", " ", " ", " ", "don", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "=_", "cfg_", "._", "Get", "Insta", "nce", "Info_", "(_", "self_", "._", "inst", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disks_", "=_", "cfg_", "._", "Get", "Insta", "nce", "Disk", "s_", "(_", "self_", "._", "inst", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "instance_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Programm", "er", "Error_", "(_", "\"", "Un", "know", "n", " ", "instance", " ", "'%", "s", "'", " ", "pass", "ed", " ", "to", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "IA", "lloc", "ator", "\"_", "%_", "self_", "._", "inst", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "utils_", "._", "All", "Disk", "Of", "Type_", "(_", "disks_", ",_", "constants_", "._", "DT", "S", "\\u", "MIR", "ROR", "ED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Op", "Pre", "req", "Error_", "(_", "\"", "Can", "'", "t", " ", "relocat", "e", " ", "non", "-", "mirrore", "d", " ", "instance", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "ECO", "DE", "\\u", "INV", "AL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "second", "ary", "\\u", "nodes_", "=_", "cfg_", "._", "Get", "Insta", "nce", "Second", "ary", "Nodes_", "(_", "instance_", "._", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "utils_", "._", "Any", "Disk", "Of", "Type_", "(_", "disks_", ",_", "constants_", "._", "DT", "S", "\\u", "INT", "\\u", "MIR", "ROR", "_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "second", "ary", "\\u", "nodes_", ")_", "!=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Op", "Pre", "req", "Error_", "(_", "\"", "Insta", "nce", " ", "has", " ", "not", " ", "exact", "ly", " ", "one", " ", "second", "ary", " ", "node", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "ECO", "DE", "\\u", "STATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "disk", "\\u", "sizes_", "=_", "[_", "{_", "constants_", "._", "IDI", "SK", "\\u", "SIZE_", ":_", "disk_", "._", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IDI", "SK", "\\u", "TYPE_", ":_", "disk_", "._", "dev", "\\u", "type_", "}_", "for_", "disk_", "in_", "disks_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disk", "\\u", "space_", "=_", "gm", "i_", "._", "Compute", "Disk", "Size_", "(_", "disk", "\\u", "sizes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "instance_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "disk", "\\u", "space", "\\u", "total", "\"_", ":_", "disk", "\\u", "space_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "require", "d\\u", "nodes", "\"_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "relocat", "e\\u", "from", "\"_", ":_", "cfg_", "._", "Get", "Node", "Names_", "(_", "self_", "._", "relocat", "e\\u", "from", "\\u", "node", "\\u", "uuids_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Relo", "cate", "_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Validate", "Result_", "(_", "self_", ",_", "ia_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", "s", " ", "the", " ", "result", " ", "of", " ", "an", " ", "relocat", "ion", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IA", "Request", "Base_", "._", "Validate", "Result_", "(_", "self_", ",_", "ia_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "2g", "roup_", "=_", "dict_", "(_", "(_", "name_", ",_", "ndata", "_", "[_", "\"", "group", "\"_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "name_", ",_", "ndata", "_", ")_", "in_", "ia_", "._", "in", "\\u", "data_", "[_", "\"", "nodes", "\"_", "]_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fn_", "=_", "compat_", "._", "partial_", "(_", "self_", "._", "\\u", "Node", "s", "To", "Groups_", ",_", "node", "2g", "roup_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ia_", "._", "in", "\\u", "data_", "[_", "\"", "node", "group", "s", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "=_", "ia_", "._", "cfg_", "._", "Get", "Insta", "nce", "Info_", "(_", "self_", "._", "inst", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "groups_", "=_", "fn_", "(_", "ia_", "._", "cfg_", "._", "Get", "Node", "Names_", "(_", "self_", "._", "relocat", "e\\u", "from", "\\u", "node", "\\u", "uuids_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "ia_", "._", "cfg_", "._", "Get", "Node", "Names_", "(_", "[_", "instance_", "._", "primary", "\\u", "node_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "groups_", "=_", "fn_", "(_", "result_", "+_", "ia_", "._", "cfg_", "._", "Get", "Node", "Names_", "(_", "[_", "instance_", "._", "primary", "\\u", "node_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ia_", "._", "success_", "and_", "not_", "set_", "(_", "result", "\\u", "groups_", ")_", "._", "issubset_", "(_", "request", "\\u", "groups_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "._", "Result", "Validat", "ion", "Error_", "(_", "\"", "Group", "s", " ", "of", " ", "nodes", " ", "return", "ed", " ", "by", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "ial", "locator", " ", "(%", "s", ")", " ", "differ", " ", "from", " ", "original", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "group", "s", " ", "(%", "s", ")\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "utils_", "._", "Comm", "a", "Join_", "(_", "result", "\\u", "groups_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "utils_", "._", "Comm", "a", "Join_", "(_", "request", "\\u", "groups_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Relo", "cate", "_", "(_", "IA", "Request", "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_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "Node", "s", "To", "Groups_", "(_", "node", "2g", "roup_", ",_", "groups_", ",_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "unique", " ", "group", " ", "names", " ", "for", " ", "a", " ", "list", " ", "of", " ", "nodes", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "node", "2g", "roup", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "node", "2g", "roup", ":", " ", "Map", " ", "from", " ", "node", " ", "name", " ", "to", " ", "group", " ", "UU", "ID", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "group", "s", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "group", "s", ":", " ", "Group", " ", "informati", "on", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "nodes", ":", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "nodes", ":", " ", "Node", " ", "names", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "uuid_", "=_", "node", "2g", "roup_", "[_", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ignor", "e", " ", "unknown", " ", "node_", "\\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_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group_", "=_", "groups_", "[_", "group", "\\u", "uuid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "find", " ", "group", ",", " ", "let", "'", "s", " ", "use", " ", "UUID_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "name_", "=_", "group", "\\u", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "name_", "=_", "group_", "[_", "\"", "name", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "._", "add_", "(_", "group", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sorted_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "IA", "Re", "q", "Node", "Eva", "c_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "node", " ", "eva", "cuat", "ion", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "constants_", "._", "IAL", "LOC", "ATOR", "\\u", "MODE", "\\u", "NODE", "\\u", "EV", "AC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "instance", "s", "\"_", ",_", "\\u", "STRING", "\\u", "LIST_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "eva", "c\\u", "mode", "\"_", ",_", "ht_", "._", "TE", "vac", "Mode_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "ignore", "\\u", "soft", "\\u", "error", "s", "\"_", ",_", "ht_", "._", "TM", "ay", "be_", "(_", "ht_", "._", "TB", "ool_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "\\u", "NE", "VA", "C", "\\u", "RESULT_", "\\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_", "IA", "Re", "q", "Node", "Eva", "c_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Get", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "data", " ", "for", " ", "node", "-", "eva", "cuat", "e", " ", "request", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "instance", "s", "\"_", ":_", "self_", "._", "instances_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "eva", "c\\u", "mode", "\"_", ":_", "self_", "._", "eva", "c\\u", "mode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Node", "Eva", "c_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Extra", "Params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "extra", " ", "ial", "locator", " ", "command", " ", "line", " ", "options", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "node", "-", "eva", "cuat", "e", " ", "request", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "ignore", "\\u", "soft", "\\u", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "ignore", "-", "soft", "-", "error", "s", "\"_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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_", "class_", "IA", "Re", "q", "Group", "Change_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "group", " ", "change", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "MODE_", "=_", "constants_", "._", "IAL", "LOC", "ATOR", "\\u", "MODE", "\\u", "CH", "G", "\\u", "GROUP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "PARAMS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "instance", "s", "\"_", ",_", "\\u", "STRING", "\\u", "LIST_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "target", "\\u", "group", "s", "\"_", ",_", "\\u", "STRING", "\\u", "LIST_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REQ", "\\u", "RESULT_", "=_", "\\u", "NE", "VA", "C", "\\u", "RESULT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "IA", "Re", "q", "Group", "Change_", "(_", "IA", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Get", "Request_", "(_", "self_", ",_", "cfg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "data", " ", "for", " ", "node", "-", "eva", "cuat", "e", " ", "request", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "instance", "s", "\"_", ":_", "self_", "._", "instances_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "target", "\\u", "group", "s", "\"_", ":_", "self_", "._", "target", "\\u", "groups_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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ova/nova/tests/unit/virt/xenapi/test_volumeops.py
[ { "content": "# Copyright (c) 2012 Citrix Systems, Inc.\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\nimport mock\n\nfrom nova import exception\nfrom nova import test\nfrom nova.tests.unit.virt.xenapi import stubs\nfrom nova.virt.xenapi import vm_utils\nfrom nova.virt.xenapi import volume_utils\nfrom nova.virt.xenapi import volumeops\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VolumeOpsTestBase(stubs.XenAPITestBaseNoDB):\n", "metadata": "root.VolumeOpsTestBase", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def setUp(self):\n super(VolumeOpsTestBase, self).setUp()\n self._setup_mock_volumeops()", "metadata": "root.VolumeOpsTestBase.setUp", "header": "['class', 'VolumeOpsTestBase', '(', 'stubs', '.', 'XenAPITestBaseNoDB', ')', ':', '___EOS___']", "index": 25 }, { "content": " def _setup_mock_volumeops(self):\n self.session = stubs.FakeSessionForVolumeTests('fake_uri')\n self.ops = volumeops.VolumeOps(self.session)", "metadata": "root.VolumeOpsTestBase._setup_mock_volumeops", "header": "['class', 'VolumeOpsTestBase', '(', 'stubs', '.', 'XenAPITestBaseNoDB', ')', ':', '___EOS___']", "index": 29 }, { "content": "class VolumeDetachTestCase(VolumeOpsTestBase):\n\n\n\n\n\n\n\n\n\n", "metadata": "root.VolumeDetachTestCase", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def test_detach_volume_call(self):\n registered_calls = []\n\n def regcall(label):\n def side_effect(*args, **kwargs):\n registered_calls.append(label)\n return side_effect\n\n ops = volumeops.VolumeOps('session')\n self.mox.StubOutWithMock(volumeops.vm_utils, 'lookup')\n self.mox.StubOutWithMock(volumeops.volume_utils, 'find_vbd_by_number')\n self.mox.StubOutWithMock(volumeops.vm_utils, 'is_vm_shutdown')\n self.mox.StubOutWithMock(volumeops.vm_utils, 'unplug_vbd')\n self.mox.StubOutWithMock(volumeops.vm_utils, 'destroy_vbd')\n self.mox.StubOutWithMock(volumeops.volume_utils, 'get_device_number')\n self.mox.StubOutWithMock(volumeops.volume_utils, 'find_sr_from_vbd')\n self.mox.StubOutWithMock(volumeops.volume_utils, 'purge_sr')\n\n volumeops.vm_utils.lookup('session', 'instance_1').AndReturn(\n 'vmref')\n\n volumeops.volume_utils.get_device_number('mountpoint').AndReturn(\n 'devnumber')\n\n volumeops.volume_utils.find_vbd_by_number(\n 'session', 'vmref', 'devnumber').AndReturn('vbdref')\n\n volumeops.vm_utils.is_vm_shutdown('session', 'vmref').AndReturn(\n False)\n\n volumeops.vm_utils.unplug_vbd('session', 'vbdref', 'vmref')\n\n volumeops.vm_utils.destroy_vbd('session', 'vbdref').WithSideEffects(\n regcall('destroy_vbd'))\n\n volumeops.volume_utils.find_sr_from_vbd(\n 'session', 'vbdref').WithSideEffects(\n regcall('find_sr_from_vbd')).AndReturn('srref')\n\n volumeops.volume_utils.purge_sr('session', 'srref')\n\n self.mox.ReplayAll()\n\n ops.detach_volume(\n dict(driver_volume_type='iscsi', data='conn_data'),\n 'instance_1', 'mountpoint')\n\n self.assertEqual(\n ['find_sr_from_vbd', 'destroy_vbd'], registered_calls)", "metadata": "root.VolumeDetachTestCase.test_detach_volume_call", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 35 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_detach_vbds_and_srs\")\n @mock.patch.object(volume_utils, \"find_vbd_by_number\")\n @mock.patch.object(vm_utils, \"vm_ref_or_raise\")\n def test_detach_volume(self, mock_vm, mock_vbd, mock_detach):\n mock_vm.return_value = \"vm_ref\"\n mock_vbd.return_value = \"vbd_ref\"\n\n self.ops.detach_volume({}, \"name\", \"/dev/xvdd\")\n\n mock_vm.assert_called_once_with(self.session, \"name\")\n mock_vbd.assert_called_once_with(self.session, \"vm_ref\", 3)\n mock_detach.assert_called_once_with(\"vm_ref\", [\"vbd_ref\"])", "metadata": "root.VolumeDetachTestCase.test_detach_volume", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 85 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_detach_vbds_and_srs\")\n @mock.patch.object(volume_utils, \"find_vbd_by_number\")\n @mock.patch.object(vm_utils, \"vm_ref_or_raise\")\n def test_detach_volume_skips_error_skip_attach(self, mock_vm, mock_vbd,\n mock_detach):\n mock_vm.return_value = \"vm_ref\"\n mock_vbd.return_value = None\n\n self.ops.detach_volume({}, \"name\", \"/dev/xvdd\")\n\n self.assertFalse(mock_detach.called)", "metadata": "root.VolumeDetachTestCase.test_detach_volume_skips_error_skip_attach", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 98 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_detach_vbds_and_srs\")\n @mock.patch.object(volume_utils, \"find_vbd_by_number\")\n @mock.patch.object(vm_utils, \"vm_ref_or_raise\")\n def test_detach_volume_raises(self, mock_vm, mock_vbd,\n mock_detach):\n mock_vm.return_value = \"vm_ref\"\n mock_vbd.side_effect = test.TestingException\n\n self.assertRaises(test.TestingException,\n self.ops.detach_volume, {}, \"name\", \"/dev/xvdd\")\n self.assertFalse(mock_detach.called)", "metadata": "root.VolumeDetachTestCase.test_detach_volume_raises", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 110 }, { "content": " @mock.patch.object(volume_utils, \"purge_sr\")\n @mock.patch.object(vm_utils, \"destroy_vbd\")\n @mock.patch.object(volume_utils, \"find_sr_from_vbd\")\n @mock.patch.object(vm_utils, \"unplug_vbd\")\n @mock.patch.object(vm_utils, \"is_vm_shutdown\")\n def test_detach_vbds_and_srs_not_shutdown(self, mock_shutdown, mock_unplug,\n mock_find_sr, mock_destroy, mock_purge):\n mock_shutdown.return_value = False\n mock_find_sr.return_value = \"sr_ref\"\n\n self.ops._detach_vbds_and_srs(\"vm_ref\", [\"vbd_ref\"])\n\n mock_shutdown.assert_called_once_with(self.session, \"vm_ref\")\n mock_find_sr.assert_called_once_with(self.session, \"vbd_ref\")\n mock_unplug.assert_called_once_with(self.session, \"vbd_ref\", \"vm_ref\")\n mock_destroy.assert_called_once_with(self.session, \"vbd_ref\")\n mock_purge.assert_called_once_with(self.session, \"sr_ref\")", "metadata": "root.VolumeDetachTestCase.test_detach_vbds_and_srs_not_shutdown", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 122 }, { "content": " @mock.patch.object(volume_utils, \"purge_sr\")\n @mock.patch.object(vm_utils, \"destroy_vbd\")\n @mock.patch.object(volume_utils, \"find_sr_from_vbd\")\n @mock.patch.object(vm_utils, \"unplug_vbd\")\n @mock.patch.object(vm_utils, \"is_vm_shutdown\")\n def test_detach_vbds_and_srs_is_shutdown(self, mock_shutdown, mock_unplug,\n mock_find_sr, mock_destroy, mock_purge):\n mock_shutdown.return_value = True\n mock_find_sr.return_value = \"sr_ref\"\n\n self.ops._detach_vbds_and_srs(\"vm_ref\", [\"vbd_ref_1\", \"vbd_ref_2\"])\n\n expected = [mock.call(self.session, \"vbd_ref_1\"),\n mock.call(self.session, \"vbd_ref_2\")]\n self.assertEqual(expected, mock_destroy.call_args_list)\n mock_purge.assert_called_with(self.session, \"sr_ref\")\n self.assertFalse(mock_unplug.called)", "metadata": "root.VolumeDetachTestCase.test_detach_vbds_and_srs_is_shutdown", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 140 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_detach_vbds_and_srs\")\n @mock.patch.object(volumeops.VolumeOps, \"_get_all_volume_vbd_refs\")\n def test_detach_all_no_volumes(self, mock_get_all, mock_detach):\n mock_get_all.return_value = []\n\n self.ops.detach_all(\"vm_ref\")\n\n mock_get_all.assert_called_once_with(\"vm_ref\")\n self.assertFalse(mock_detach.called)", "metadata": "root.VolumeDetachTestCase.test_detach_all_no_volumes", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 158 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_detach_vbds_and_srs\")\n @mock.patch.object(volumeops.VolumeOps, \"_get_all_volume_vbd_refs\")\n def test_detach_all_volumes(self, mock_get_all, mock_detach):\n mock_get_all.return_value = [\"1\"]\n\n self.ops.detach_all(\"vm_ref\")\n\n mock_get_all.assert_called_once_with(\"vm_ref\")\n mock_detach.assert_called_once_with(\"vm_ref\", [\"1\"])", "metadata": "root.VolumeDetachTestCase.test_detach_all_volumes", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 168 }, { "content": " def test_get_all_volume_vbd_refs_no_vbds(self):\n with mock.patch.object(self.session.VM, \"get_VBDs\") as mock_get:\n with mock.patch.object(self.session.VBD,\n \"get_other_config\") as mock_conf:\n mock_get.return_value = []\n\n result = self.ops._get_all_volume_vbd_refs(\"vm_ref\")\n\n self.assertEqual([], list(result))\n mock_get.assert_called_once_with(\"vm_ref\")\n self.assertFalse(mock_conf.called)", "metadata": "root.VolumeDetachTestCase.test_get_all_volume_vbd_refs_no_vbds", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 178 }, { "content": " def test_get_all_volume_vbd_refs_no_volumes(self):\n with mock.patch.object(self.session.VM, \"get_VBDs\") as mock_get:\n with mock.patch.object(self.session.VBD,\n \"get_other_config\") as mock_conf:\n mock_get.return_value = [\"1\"]\n mock_conf.return_value = {}\n\n result = self.ops._get_all_volume_vbd_refs(\"vm_ref\")\n\n self.assertEqual([], list(result))\n mock_get.assert_called_once_with(\"vm_ref\")\n mock_conf.assert_called_once_with(\"1\")", "metadata": "root.VolumeDetachTestCase.test_get_all_volume_vbd_refs_no_volumes", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 190 }, { "content": " def test_get_all_volume_vbd_refs_with_volumes(self):\n with mock.patch.object(self.session.VM, \"get_VBDs\") as mock_get:\n with mock.patch.object(self.session.VBD,\n \"get_other_config\") as mock_conf:\n mock_get.return_value = [\"1\", \"2\"]\n mock_conf.return_value = {\"osvol\": True}\n\n result = self.ops._get_all_volume_vbd_refs(\"vm_ref\")\n\n self.assertEqual([\"1\", \"2\"], list(result))\n mock_get.assert_called_once_with(\"vm_ref\")", "metadata": "root.VolumeDetachTestCase.test_get_all_volume_vbd_refs_with_volumes", "header": "['class', 'VolumeDetachTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 203 }, { "content": "class AttachVolumeTestCase(VolumeOpsTestBase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.AttachVolumeTestCase", "header": "['module', '___EOS___']", "index": 216 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_attach_volume\")\n @mock.patch.object(vm_utils, \"vm_ref_or_raise\")\n def test_attach_volume_default_hotplug(self, mock_get_vm, mock_attach):\n mock_get_vm.return_value = \"vm_ref\"\n\n self.ops.attach_volume({}, \"instance_name\", \"/dev/xvda\")\n\n mock_attach.assert_called_once_with({}, \"vm_ref\", \"instance_name\", 0,\n True)", "metadata": "root.AttachVolumeTestCase.test_attach_volume_default_hotplug", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 217 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_attach_volume\")\n @mock.patch.object(vm_utils, \"vm_ref_or_raise\")\n def test_attach_volume_hotplug(self, mock_get_vm, mock_attach):\n mock_get_vm.return_value = \"vm_ref\"\n\n self.ops.attach_volume({}, \"instance_name\", \"/dev/xvda\", False)\n\n mock_attach.assert_called_once_with({}, \"vm_ref\", \"instance_name\", 0,\n False)", "metadata": "root.AttachVolumeTestCase.test_attach_volume_hotplug", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 227 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_attach_volume\")\n def test_attach_volume_default_hotplug_connect_volume(self, mock_attach):\n self.ops.connect_volume({})\n mock_attach.assert_called_once_with({})", "metadata": "root.AttachVolumeTestCase.test_attach_volume_default_hotplug_connect_volume", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 237 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_check_is_supported_driver_type\")\n @mock.patch.object(volumeops.VolumeOps, \"_connect_to_volume_provider\")\n @mock.patch.object(volumeops.VolumeOps, \"_connect_hypervisor_to_volume\")\n @mock.patch.object(volumeops.VolumeOps, \"_attach_volume_to_vm\")\n def test_attach_volume_with_defaults(self, mock_attach, mock_hypervisor,\n mock_provider, mock_driver):\n connection_info = {\"data\": {}}\n with mock.patch.object(self.session.VDI, \"get_uuid\") as mock_vdi:\n mock_provider.return_value = (\"sr_ref\", \"sr_uuid\")\n mock_vdi.return_value = \"vdi_uuid\"\n\n result = self.ops._attach_volume(connection_info)\n\n self.assertEqual(result, (\"sr_uuid\", \"vdi_uuid\"))\n\n mock_driver.assert_called_once_with(connection_info)\n mock_provider.assert_called_once_with({}, None)\n mock_hypervisor.assert_called_once_with(\"sr_ref\", {})\n self.assertFalse(mock_attach.called)", "metadata": "root.AttachVolumeTestCase.test_attach_volume_with_defaults", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 242 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_check_is_supported_driver_type\")\n @mock.patch.object(volumeops.VolumeOps, \"_connect_to_volume_provider\")\n @mock.patch.object(volumeops.VolumeOps, \"_connect_hypervisor_to_volume\")\n @mock.patch.object(volumeops.VolumeOps, \"_attach_volume_to_vm\")\n def test_attach_volume_with_hot_attach(self, mock_attach, mock_hypervisor,\n mock_provider, mock_driver):\n connection_info = {\"data\": {}}\n with mock.patch.object(self.session.VDI, \"get_uuid\") as mock_vdi:\n mock_provider.return_value = (\"sr_ref\", \"sr_uuid\")\n mock_hypervisor.return_value = \"vdi_ref\"\n mock_vdi.return_value = \"vdi_uuid\"\n\n result = self.ops._attach_volume(connection_info, \"vm_ref\",\n \"name\", 2, True)\n\n self.assertEqual(result, (\"sr_uuid\", \"vdi_uuid\"))\n\n mock_driver.assert_called_once_with(connection_info)\n mock_provider.assert_called_once_with({}, \"name\")\n mock_hypervisor.assert_called_once_with(\"sr_ref\", {})\n mock_attach.assert_called_once_with(\"vdi_ref\", \"vm_ref\", \"name\", 2,\n True)", "metadata": "root.AttachVolumeTestCase.test_attach_volume_with_hot_attach", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 262 }, { "content": " @mock.patch.object(volume_utils, \"forget_sr\")\n @mock.patch.object(volumeops.VolumeOps, \"_check_is_supported_driver_type\")\n @mock.patch.object(volumeops.VolumeOps, \"_connect_to_volume_provider\")\n @mock.patch.object(volumeops.VolumeOps, \"_connect_hypervisor_to_volume\")\n @mock.patch.object(volumeops.VolumeOps, \"_attach_volume_to_vm\")\n def test_attach_volume_cleanup(self, mock_attach, mock_hypervisor,\n mock_provider, mock_driver, mock_forget):\n connection_info = {\"data\": {}}\n mock_provider.return_value = (\"sr_ref\", \"sr_uuid\")\n mock_hypervisor.side_effect = test.TestingException\n\n self.assertRaises(test.TestingException,\n self.ops._attach_volume, connection_info)\n\n mock_driver.assert_called_once_with(connection_info)\n mock_provider.assert_called_once_with({}, None)\n mock_hypervisor.assert_called_once_with(\"sr_ref\", {})\n mock_forget.assert_called_once_with(self.session, \"sr_ref\")\n self.assertFalse(mock_attach.called)", "metadata": "root.AttachVolumeTestCase.test_attach_volume_cleanup", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 285 }, { "content": " def test_check_is_supported_driver_type_pass_iscsi(self):\n conn_info = {\"driver_volume_type\": \"iscsi\"}\n self.ops._check_is_supported_driver_type(conn_info)", "metadata": "root.AttachVolumeTestCase.test_check_is_supported_driver_type_pass_iscsi", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 305 }, { "content": " def test_check_is_supported_driver_type_pass_xensm(self):\n conn_info = {\"driver_volume_type\": \"xensm\"}\n self.ops._check_is_supported_driver_type(conn_info)", "metadata": "root.AttachVolumeTestCase.test_check_is_supported_driver_type_pass_xensm", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 309 }, { "content": " def test_check_is_supported_driver_type_pass_bad(self):\n conn_info = {\"driver_volume_type\": \"bad\"}\n self.assertRaises(exception.VolumeDriverNotFound,\n self.ops._check_is_supported_driver_type, conn_info)", "metadata": "root.AttachVolumeTestCase.test_check_is_supported_driver_type_pass_bad", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 313 }, { "content": " @mock.patch.object(volume_utils, \"introduce_sr\")\n @mock.patch.object(volume_utils, \"find_sr_by_uuid\")\n @mock.patch.object(volume_utils, \"parse_sr_info\")\n def test_connect_to_volume_provider_new_sr(self, mock_parse, mock_find_sr,\n mock_introduce_sr):\n mock_parse.return_value = (\"uuid\", \"label\", \"params\")\n mock_find_sr.return_value = None\n mock_introduce_sr.return_value = \"sr_ref\"\n\n ref, uuid = self.ops._connect_to_volume_provider({}, \"name\")\n\n self.assertEqual(\"sr_ref\", ref)\n self.assertEqual(\"uuid\", uuid)\n mock_parse.assert_called_once_with({}, \"Disk-for:name\")\n mock_find_sr.assert_called_once_with(self.session, \"uuid\")\n mock_introduce_sr.assert_called_once_with(self.session, \"uuid\",\n \"label\", \"params\")", "metadata": "root.AttachVolumeTestCase.test_connect_to_volume_provider_new_sr", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 318 }, { "content": " @mock.patch.object(volume_utils, \"introduce_sr\")\n @mock.patch.object(volume_utils, \"find_sr_by_uuid\")\n @mock.patch.object(volume_utils, \"parse_sr_info\")\n def test_connect_to_volume_provider_old_sr(self, mock_parse, mock_find_sr,\n mock_introduce_sr):\n mock_parse.return_value = (\"uuid\", \"label\", \"params\")\n mock_find_sr.return_value = \"sr_ref\"\n\n ref, uuid = self.ops._connect_to_volume_provider({}, \"name\")\n\n self.assertEqual(\"sr_ref\", ref)\n self.assertEqual(\"uuid\", uuid)\n mock_parse.assert_called_once_with({}, \"Disk-for:name\")\n mock_find_sr.assert_called_once_with(self.session, \"uuid\")\n self.assertFalse(mock_introduce_sr.called)", "metadata": "root.AttachVolumeTestCase.test_connect_to_volume_provider_old_sr", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 336 }, { "content": " @mock.patch.object(volume_utils, \"introduce_vdi\")\n def test_connect_hypervisor_to_volume_regular(self, mock_intro):\n mock_intro.return_value = \"vdi\"\n\n result = self.ops._connect_hypervisor_to_volume(\"sr\", {})\n\n self.assertEqual(\"vdi\", result)\n mock_intro.assert_called_once_with(self.session, \"sr\")", "metadata": "root.AttachVolumeTestCase.test_connect_hypervisor_to_volume_regular", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 352 }, { "content": " @mock.patch.object(volume_utils, \"introduce_vdi\")\n def test_connect_hypervisor_to_volume_vdi(self, mock_intro):\n mock_intro.return_value = \"vdi\"\n\n conn = {\"vdi_uuid\": \"id\"}\n result = self.ops._connect_hypervisor_to_volume(\"sr\", conn)\n\n self.assertEqual(\"vdi\", result)\n mock_intro.assert_called_once_with(self.session, \"sr\",\n vdi_uuid=\"id\")", "metadata": "root.AttachVolumeTestCase.test_connect_hypervisor_to_volume_vdi", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 361 }, { "content": " @mock.patch.object(volume_utils, \"introduce_vdi\")\n def test_connect_hypervisor_to_volume_lun(self, mock_intro):\n mock_intro.return_value = \"vdi\"\n\n conn = {\"target_lun\": \"lun\"}\n result = self.ops._connect_hypervisor_to_volume(\"sr\", conn)\n\n self.assertEqual(\"vdi\", result)\n mock_intro.assert_called_once_with(self.session, \"sr\",\n target_lun=\"lun\")", "metadata": "root.AttachVolumeTestCase.test_connect_hypervisor_to_volume_lun", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 372 }, { "content": " @mock.patch.object(volume_utils, \"introduce_vdi\")\n @mock.patch.object(volumeops.LOG, 'debug')\n def test_connect_hypervisor_to_volume_mask_password(self, mock_debug,\n mock_intro):\n # Tests that the connection_data is scrubbed before logging.\n data = {'auth_password': 'verybadpass'}\n self.ops._connect_hypervisor_to_volume(\"sr\", data)\n self.assertTrue(mock_debug.called, 'LOG.debug was not called')\n password_logged = False\n for call in mock_debug.call_args_list:\n # The call object is a tuple of (args, kwargs)\n if 'verybadpass' in call[0]:\n password_logged = True\n break\n self.assertFalse(password_logged, 'connection_data was not scrubbed')", "metadata": "root.AttachVolumeTestCase.test_connect_hypervisor_to_volume_mask_password", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 383 }, { "content": " @mock.patch.object(vm_utils, \"is_vm_shutdown\")\n @mock.patch.object(vm_utils, \"create_vbd\")\n def test_attach_volume_to_vm_plug(self, mock_vbd, mock_shutdown):\n mock_vbd.return_value = \"vbd\"\n mock_shutdown.return_value = False\n\n with mock.patch.object(self.session.VBD, \"plug\") as mock_plug:\n self.ops._attach_volume_to_vm(\"vdi\", \"vm\", \"name\", 2, True)\n mock_plug.assert_called_once_with(\"vbd\", \"vm\")\n\n mock_vbd.assert_called_once_with(self.session, \"vm\", \"vdi\", 2,\n bootable=False, osvol=True)\n mock_shutdown.assert_called_once_with(self.session, \"vm\")", "metadata": "root.AttachVolumeTestCase.test_attach_volume_to_vm_plug", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 399 }, { "content": " @mock.patch.object(vm_utils, \"is_vm_shutdown\")\n @mock.patch.object(vm_utils, \"create_vbd\")\n def test_attach_volume_to_vm_no_plug(self, mock_vbd, mock_shutdown):\n mock_vbd.return_value = \"vbd\"\n mock_shutdown.return_value = True\n\n with mock.patch.object(self.session.VBD, \"plug\") as mock_plug:\n self.ops._attach_volume_to_vm(\"vdi\", \"vm\", \"name\", 2, True)\n self.assertFalse(mock_plug.called)\n\n mock_vbd.assert_called_once_with(self.session, \"vm\", \"vdi\", 2,\n bootable=False, osvol=True)\n mock_shutdown.assert_called_once_with(self.session, \"vm\")", "metadata": "root.AttachVolumeTestCase.test_attach_volume_to_vm_no_plug", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 413 }, { "content": " @mock.patch.object(vm_utils, \"is_vm_shutdown\")\n @mock.patch.object(vm_utils, \"create_vbd\")\n def test_attach_volume_to_vm_no_hotplug(self, mock_vbd, mock_shutdown):\n mock_vbd.return_value = \"vbd\"\n\n with mock.patch.object(self.session.VBD, \"plug\") as mock_plug:\n self.ops._attach_volume_to_vm(\"vdi\", \"vm\", \"name\", 2, False)\n self.assertFalse(mock_plug.called)\n\n mock_vbd.assert_called_once_with(self.session, \"vm\", \"vdi\", 2,\n bootable=False, osvol=True)\n self.assertFalse(mock_shutdown.called)", "metadata": "root.AttachVolumeTestCase.test_attach_volume_to_vm_no_hotplug", "header": "['class', 'AttachVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 427 }, { "content": "class FindBadVolumeTestCase(VolumeOpsTestBase):\n\n\n", "metadata": "root.FindBadVolumeTestCase", "header": "['module', '___EOS___']", "index": 441 }, { "content": " @mock.patch.object(volumeops.VolumeOps, \"_get_all_volume_vbd_refs\")\n def test_find_bad_volumes_no_vbds(self, mock_get_all):\n mock_get_all.return_value = []\n\n result = self.ops.find_bad_volumes(\"vm_ref\")\n\n mock_get_all.assert_called_once_with(\"vm_ref\")\n self.assertEqual([], result)", "metadata": "root.FindBadVolumeTestCase.test_find_bad_volumes_no_vbds", "header": "['class', 'FindBadVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 442 }, { "content": " @mock.patch.object(volume_utils, \"find_sr_from_vbd\")\n @mock.patch.object(volumeops.VolumeOps, \"_get_all_volume_vbd_refs\")\n def test_find_bad_volumes_no_bad_vbds(self, mock_get_all, mock_find_sr):\n mock_get_all.return_value = [\"1\", \"2\"]\n mock_find_sr.return_value = \"sr_ref\"\n\n with mock.patch.object(self.session.SR, \"scan\") as mock_scan:\n result = self.ops.find_bad_volumes(\"vm_ref\")\n\n mock_get_all.assert_called_once_with(\"vm_ref\")\n expected_find = [mock.call(self.session, \"1\"),\n mock.call(self.session, \"2\")]\n self.assertEqual(expected_find, mock_find_sr.call_args_list)\n expected_scan = [mock.call(\"sr_ref\"), mock.call(\"sr_ref\")]\n self.assertEqual(expected_scan, mock_scan.call_args_list)\n self.assertEqual([], result)", "metadata": "root.FindBadVolumeTestCase.test_find_bad_volumes_no_bad_vbds", "header": "['class', 'FindBadVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 451 }, { "content": " @mock.patch.object(volume_utils, \"find_sr_from_vbd\")\n @mock.patch.object(volumeops.VolumeOps, \"_get_all_volume_vbd_refs\")\n def test_find_bad_volumes_bad_vbds(self, mock_get_all, mock_find_sr):\n mock_get_all.return_value = [\"vbd_ref\"]\n mock_find_sr.return_value = \"sr_ref\"\n\n class FakeException(Exception):\n details = ['SR_BACKEND_FAILURE_40', \"\", \"\", \"\"]\n\n session = mock.Mock()\n session.XenAPI.Failure = FakeException\n self.ops._session = session\n\n with mock.patch.object(session.SR, \"scan\") as mock_scan:\n with mock.patch.object(session.VBD,\n \"get_device\") as mock_get:\n mock_scan.side_effect = FakeException\n mock_get.return_value = \"xvdb\"\n\n result = self.ops.find_bad_volumes(\"vm_ref\")\n\n mock_get_all.assert_called_once_with(\"vm_ref\")\n mock_scan.assert_called_once_with(\"sr_ref\")\n mock_get.assert_called_once_with(\"vbd_ref\")\n self.assertEqual([\"/dev/xvdb\"], result)", "metadata": "root.FindBadVolumeTestCase.test_find_bad_volumes_bad_vbds", "header": "['class', 'FindBadVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 468 }, { "content": " @mock.patch.object(volume_utils, \"find_sr_from_vbd\")\n @mock.patch.object(volumeops.VolumeOps, \"_get_all_volume_vbd_refs\")\n def test_find_bad_volumes_raises(self, mock_get_all, mock_find_sr):\n mock_get_all.return_value = [\"vbd_ref\"]\n mock_find_sr.return_value = \"sr_ref\"\n\n class FakeException(Exception):\n details = ['foo', \"\", \"\", \"\"]\n\n session = mock.Mock()\n session.XenAPI.Failure = FakeException\n self.ops._session = session\n\n with mock.patch.object(session.SR, \"scan\") as mock_scan:\n with mock.patch.object(session.VBD,\n \"get_device\") as mock_get:\n mock_scan.side_effect = FakeException\n mock_get.return_value = \"xvdb\"\n\n self.assertRaises(FakeException,\n self.ops.find_bad_volumes, \"vm_ref\")\n mock_scan.assert_called_once_with(\"sr_ref\")", "metadata": "root.FindBadVolumeTestCase.test_find_bad_volumes_raises", "header": "['class', 'FindBadVolumeTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 494 }, { "content": "class CleanupFromVDIsTestCase(VolumeOpsTestBase):\n\n\n", "metadata": "root.CleanupFromVDIsTestCase", "header": "['module', '___EOS___']", "index": 518 }, { "content": " def _check_find_purge_calls(self, find_sr_from_vdi, purge_sr, vdi_refs,\n sr_refs):\n find_sr_calls = [mock.call(self.ops._session, vdi_ref) for vdi_ref\n in vdi_refs]\n find_sr_from_vdi.assert_has_calls(find_sr_calls)\n purge_sr_calls = [mock.call(self.ops._session, sr_ref) for sr_ref\n in sr_refs]\n purge_sr.assert_has_calls(purge_sr_calls)", "metadata": "root.CleanupFromVDIsTestCase._check_find_purge_calls", "header": "['class', 'CleanupFromVDIsTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 519 }, { "content": " @mock.patch.object(volume_utils, 'find_sr_from_vdi')\n @mock.patch.object(volume_utils, 'purge_sr')\n def test_safe_cleanup_from_vdis(self, purge_sr, find_sr_from_vdi):\n vdi_refs = ['vdi_ref1', 'vdi_ref2']\n sr_refs = ['sr_ref1', 'sr_ref2']\n find_sr_from_vdi.side_effect = sr_refs\n self.ops.safe_cleanup_from_vdis(vdi_refs)\n\n self._check_find_purge_calls(find_sr_from_vdi, purge_sr, vdi_refs,\n sr_refs)", "metadata": "root.CleanupFromVDIsTestCase.test_safe_cleanup_from_vdis", "header": "['class', 'CleanupFromVDIsTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 528 }, { "content": " @mock.patch.object(volume_utils, 'find_sr_from_vdi',\n side_effect=[exception.StorageError(reason=''), 'sr_ref2'])\n @mock.patch.object(volume_utils, 'purge_sr')\n def test_safe_cleanup_from_vdis_handles_find_sr_exception(self, purge_sr,\n find_sr_from_vdi):\n vdi_refs = ['vdi_ref1', 'vdi_ref2']\n sr_refs = ['sr_ref2']\n find_sr_from_vdi.side_effect = [exception.StorageError(reason=''),\n sr_refs[0]]\n self.ops.safe_cleanup_from_vdis(vdi_refs)\n\n self._check_find_purge_calls(find_sr_from_vdi, purge_sr, vdi_refs,\n sr_refs)", "metadata": "root.CleanupFromVDIsTestCase.test_safe_cleanup_from_vdis_handles_find_sr_exception", "header": "['class', 'CleanupFromVDIsTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 539 }, { "content": " @mock.patch.object(volume_utils, 'find_sr_from_vdi')\n @mock.patch.object(volume_utils, 'purge_sr')\n def test_safe_cleanup_from_vdis_handles_purge_sr_exception(self, purge_sr,\n find_sr_from_vdi):\n vdi_refs = ['vdi_ref1', 'vdi_ref2']\n sr_refs = ['sr_ref1', 'sr_ref2']\n find_sr_from_vdi.side_effect = sr_refs\n purge_sr.side_effects = [test.TestingException, None]\n self.ops.safe_cleanup_from_vdis(vdi_refs)\n\n self._check_find_purge_calls(find_sr_from_vdi, purge_sr, vdi_refs,\n sr_refs)", "metadata": "root.CleanupFromVDIsTestCase.test_safe_cleanup_from_vdis_handles_purge_sr_exception", "header": "['class', 'CleanupFromVDIsTestCase', '(', 'VolumeOpsTestBase', ')', ':', '___EOS___']", "index": 553 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", " ", "Cit", "rix", " ", "System", "s", ",", " ", "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", "\");", " ", "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_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nova_", "import_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "import_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "tests_", "._", "unit_", "._", "virt_", "._", "xenapi", "_", "import_", "stubs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "virt_", "._", "xenapi", "_", "import_", "vm", "\\u", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "virt_", "._", "xenapi", "_", "import_", "volume", "\\u", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nova_", "._", "virt_", "._", "xenapi", "_", "import_", "volume", "ops_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Volume", "Op", "s", "Test", "Base_", "(_", "stubs_", "._", "Xen", "API", "Test", "Base", "No", "DB_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Op", "s", "Test", "Base_", "(_", "stubs_", "._", "Xen", "API", "Test", "Base", "No", "DB_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Volume", "Op", "s", "Test", "Base_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "setup", "\\u", "mock", "\\u", "volume", "ops_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Op", "s", "Test", "Base_", "(_", "stubs_", "._", "Xen", "API", "Test", "Base", "No", "DB_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "setup", "\\u", "mock", "\\u", "volume", "ops_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "session_", "=_", "stubs_", "._", "Fake", "Sess", "ion", "For", "Volume", "Tests_", "(_", "'", "fake", "\\u", "uri", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "=_", "volume", "ops_", "._", "Volume", "Ops_", "(_", "self_", "._", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "deta", "ch", "\\u", "volume", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "register", "ed", "\\u", "calls_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "reg", "call_", "(_", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "side", "\\u", "effect_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "register", "ed", "\\u", "calls_", "._", "append_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "side", "\\u", "effect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ops_", "=_", "volume", "ops_", "._", "Volume", "Ops_", "(_", "'", "session", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "vm", "\\u", "utils_", ",_", "'", "look", "up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "volume", "\\u", "utils_", ",_", "'", "find", "\\u", "vb", "d\\u", "by", "\\u", "number", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "vm", "\\u", "utils_", ",_", "'", "is", "\\u", "vm", "\\u", "shut", "down", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "vm", "\\u", "utils_", ",_", "'", "unpl", "ug", "\\u", "vb", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "vm", "\\u", "utils_", ",_", "'", "destroy", "\\u", "vb", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "volume", "\\u", "utils_", ",_", "'", "get", "\\u", "device", "\\u", "number", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "volume", "\\u", "utils_", ",_", "'", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "volume", "ops_", "._", "volume", "\\u", "utils_", ",_", "'", "pur", "ge", "\\u", "sr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "vm", "\\u", "utils_", "._", "lookup_", "(_", "'", "session", "'_", ",_", "'", "instance", "\\u", "1", "'_", ")_", "._", "And", "Return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vm", "ref", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "volume", "\\u", "utils_", "._", "get", "\\u", "device", "\\u", "number_", "(_", "'", "mountpoint", "'_", ")_", "._", "And", "Return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "devn", "umber", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "volume", "\\u", "utils_", "._", "find", "\\u", "vb", "d\\u", "by", "\\u", "number_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "session", "'_", ",_", "'", "vm", "ref", "'_", ",_", "'", "devn", "umber", "'_", ")_", "._", "And", "Return_", "(_", "'", "vb", "dre", "f", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "vm", "\\u", "utils_", "._", "is", "\\u", "vm", "\\u", "shutdown_", "(_", "'", "session", "'_", ",_", "'", "vm", "ref", "'_", ")_", "._", "And", "Return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "vm", "\\u", "utils_", "._", "unpl", "ug", "\\u", "vb", "d_", "(_", "'", "session", "'_", ",_", "'", "vb", "dre", "f", "'_", ",_", "'", "vm", "ref", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "vm", "\\u", "utils_", "._", "destroy", "\\u", "vb", "d_", "(_", "'", "session", "'_", ",_", "'", "vb", "dre", "f", "'_", ")_", "._", "With", "Side", "Effe", "cts_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "reg", "call_", "(_", "'", "destroy", "\\u", "vb", "d", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "volume", "\\u", "utils_", "._", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "session", "'_", ",_", "'", "vb", "dre", "f", "'_", ")_", "._", "With", "Side", "Effe", "cts_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "reg", "call_", "(_", "'", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "'_", ")_", ")_", "._", "And", "Return_", "(_", "'", "sr", "ref", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "ops_", "._", "volume", "\\u", "utils_", "._", "pur", "ge", "\\u", "sr_", "(_", "'", "session", "'_", ",_", "'", "sr", "ref", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ops_", "._", "deta", "ch", "\\u", "volume_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "dict_", "(_", "driver", "\\u", "volume", "\\u", "type_", "=_", "'", "iscsi", "'_", ",_", "data_", "=_", "'", "conn", "\\u", "data", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "instance", "\\u", "1", "'_", ",_", "'", "mountpoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "'_", ",_", "'", "destroy", "\\u", "vb", "d", "'_", "]_", ",_", "register", "ed", "\\u", "calls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "vb", "d\\u", "by", "\\u", "number", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "vm", "\\u", "ref", "\\u", "or", "\\u", "raise", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "volume_", "(_", "self_", ",_", "mock", "\\u", "vm_", ",_", "mock", "\\u", "vb", "d_", ",_", "mock", "\\u", "detach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "vm_", "._", "return", "\\u", "value_", "=_", "\"", "vm", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "return", "\\u", "value_", "=_", "\"", "vb", "d\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "deta", "ch", "\\u", "volume_", "(_", "{_", "}_", ",_", "\"", "name", "\"_", ",_", "\"/", "dev", "/", "xv", "dd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "vm_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\\u", "ref", "\"_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "detach_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ",_", "[_", "\"", "vb", "d\\u", "ref", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "vb", "d\\u", "by", "\\u", "number", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "vm", "\\u", "ref", "\\u", "or", "\\u", "raise", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "volume", "\\u", "skips", "\\u", "error", "\\u", "skip", "\\u", "attach_", "(_", "self_", ",_", "mock", "\\u", "vm_", ",_", "mock", "\\u", "vb", "d_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "detach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "vm_", "._", "return", "\\u", "value_", "=_", "\"", "vm", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "return", "\\u", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "deta", "ch", "\\u", "volume_", "(_", "{_", "}_", ",_", "\"", "name", "\"_", ",_", "\"/", "dev", "/", "xv", "dd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "detach_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "vb", "d\\u", "by", "\\u", "number", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "vm", "\\u", "ref", "\\u", "or", "\\u", "raise", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "volume", "\\u", "raises_", "(_", "self_", ",_", "mock", "\\u", "vm_", ",_", "mock", "\\u", "vb", "d_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "detach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "vm_", "._", "return", "\\u", "value_", "=_", "\"", "vm", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "side", "\\u", "effect_", "=_", "test_", "._", "Test", "ing", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "test_", "._", "Test", "ing", "Exception_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "deta", "ch", "\\u", "volume_", ",_", "{_", "}_", ",_", "\"", "name", "\"_", ",_", "\"/", "dev", "/", "xv", "dd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "detach_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "pur", "ge", "\\u", "sr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "destroy", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "unpl", "ug", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "is", "\\u", "vm", "\\u", "shut", "down", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\\u", "not", "\\u", "shutdown_", "(_", "self_", ",_", "mock", "\\u", "shutdown_", ",_", "mock", "\\u", "unpl", "ug_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", ",_", "mock", "\\u", "destroy_", ",_", "mock", "\\u", "purge_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "shutdown_", "._", "return", "\\u", "value_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "srs_", "(_", "\"", "vm", "\\u", "ref", "\"_", ",_", "[_", "\"", "vb", "d\\u", "ref", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "shutdown_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vb", "d\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "unpl", "ug_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vb", "d\\u", "ref", "\"_", ",_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "destroy_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vb", "d\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "purge_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "sr", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "pur", "ge", "\\u", "sr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "destroy", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "unpl", "ug", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "is", "\\u", "vm", "\\u", "shut", "down", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\\u", "is", "\\u", "shutdown_", "(_", "self_", ",_", "mock", "\\u", "shutdown_", ",_", "mock", "\\u", "unpl", "ug_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", ",_", "mock", "\\u", "destroy_", ",_", "mock", "\\u", "purge_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "shutdown_", "._", "return", "\\u", "value_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "srs_", "(_", "\"", "vm", "\\u", "ref", "\"_", ",_", "[_", "\"", "vb", "d\\u", "ref", "\\u", "1", "\"_", ",_", "\"", "vb", "d\\u", "ref", "\\u", "2", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "mock_", "._", "call_", "(_", "self_", "._", "session_", ",_", "\"", "vb", "d\\u", "ref", "\\u", "1", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "call_", "(_", "self_", "._", "session_", ",_", "\"", "vb", "d\\u", "ref", "\\u", "2", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "mock", "\\u", "destroy_", "._", "call", "\\u", "args", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "purge_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "sr", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "unpl", "ug_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "all", "\\u", "no", "\\u", "volumes_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "all_", ",_", "mock", "\\u", "detach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "all_", "._", "return", "\\u", "value_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "deta", "ch", "\\u", "all_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "get", "\\u", "all_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "detach_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "deta", "ch", "\\u", "vb", "ds", "\\u", "and", "\\u", "sr", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "deta", "ch", "\\u", "all", "\\u", "volumes_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "all_", ",_", "mock", "\\u", "detach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "all_", "._", "return", "\\u", "value_", "=_", "[_", "\"", "1", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "deta", "ch", "\\u", "all_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "get", "\\u", "all_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "detach_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ",_", "[_", "\"", "1", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\\u", "no", "\\u", "vb", "ds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VM_", ",_", "\"", "get", "\\u", "VB", "Ds", "\"_", ")_", "as_", "mock", "\\u", "get_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VB", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", "\\u", "other", "\\u", "config", "\"_", ")_", "as_", "mock", "\\u", "conf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get_", "._", "return", "\\u", "value_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "list_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "get_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "conf_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\\u", "no", "\\u", "volumes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VM_", ",_", "\"", "get", "\\u", "VB", "Ds", "\"_", ")_", "as_", "mock", "\\u", "get_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VB", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", "\\u", "other", "\\u", "config", "\"_", ")_", "as_", "mock", "\\u", "conf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get_", "._", "return", "\\u", "value_", "=_", "[_", "\"", "1", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "conf_", "._", "return", "\\u", "value_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "list_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "get_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "conf_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volume", "Detach", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\\u", "with", "\\u", "volumes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VM_", ",_", "\"", "get", "\\u", "VB", "Ds", "\"_", ")_", "as_", "mock", "\\u", "get_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VB", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", "\\u", "other", "\\u", "config", "\"_", ")_", "as_", "mock", "\\u", "conf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get_", "._", "return", "\\u", "value_", "=_", "[_", "\"", "1", "\"_", ",_", "\"", "2", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "conf_", "._", "return", "\\u", "value_", "=_", "{_", "\"", "os", "vol", "\"_", ":_", "True_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "\"", "1", "\"_", ",_", "\"", "2", "\"_", "]_", ",_", "list_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "get_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "attach", "\\u", "volume", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "vm", "\\u", "ref", "\\u", "or", "\\u", "raise", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "default", "\\u", "hot", "plug_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "vm_", ",_", "mock", "\\u", "attach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "vm_", "._", "return", "\\u", "value_", "=_", "\"", "vm", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "attach", "\\u", "volume_", "(_", "{_", "}_", ",_", "\"", "instance", "\\u", "name", "\"_", ",_", "\"/", "dev", "/", "xv", "da", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "attach_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "\"", "vm", "\\u", "ref", "\"_", ",_", "\"", "instance", "\\u", "name", "\"_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "attach", "\\u", "volume", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "vm", "\\u", "ref", "\\u", "or", "\\u", "raise", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "hot", "plug_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "vm_", ",_", "mock", "\\u", "attach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "vm_", "._", "return", "\\u", "value_", "=_", "\"", "vm", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "attach", "\\u", "volume_", "(_", "{_", "}_", ",_", "\"", "instance", "\\u", "name", "\"_", ",_", "\"/", "dev", "/", "xv", "da", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "attach_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "\"", "vm", "\\u", "ref", "\"_", ",_", "\"", "instance", "\\u", "name", "\"_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "attach", "\\u", "volume", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "default", "\\u", "hot", "plug", "\\u", "connect", "\\u", "volume_", "(_", "self_", ",_", "mock", "\\u", "attach_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ops_", "._", "connect", "\\u", "volume_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "attach_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provide", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "with", "\\u", "defaults_", "(_", "self_", ",_", "mock", "\\u", "attach_", ",_", "mock", "\\u", "hypervisor", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "provider_", ",_", "mock", "\\u", "driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connecti", "on", "\\u", "info_", "=_", "{_", "\"", "data", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VDI", "_", ",_", "\"", "get", "\\u", "uuid", "\"_", ")_", "as_", "mock", "\\u", "vdi", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "provider_", "._", "return", "\\u", "value_", "=_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "\"", "sr", "\\u", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "vdi", "_", "._", "return", "\\u", "value_", "=_", "\"", "vdi", "\\u", "uuid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "attach", "\\u", "volume_", "(_", "connecti", "on", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "(_", "\"", "sr", "\\u", "uuid", "\"_", ",_", "\"", "vdi", "\\u", "uuid", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mock", "\\u", "driver_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "connecti", "on", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "provider_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "hypervisor", "_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "attach_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provide", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "with", "\\u", "hot", "\\u", "attach_", "(_", "self_", ",_", "mock", "\\u", "attach_", ",_", "mock", "\\u", "hypervisor", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "provider_", ",_", "mock", "\\u", "driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connecti", "on", "\\u", "info_", "=_", "{_", "\"", "data", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VDI", "_", ",_", "\"", "get", "\\u", "uuid", "\"_", ")_", "as_", "mock", "\\u", "vdi", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "provider_", "._", "return", "\\u", "value_", "=_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "\"", "sr", "\\u", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "hypervisor", "_", "._", "return", "\\u", "value_", "=_", "\"", "vdi", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "vdi", "_", "._", "return", "\\u", "value_", "=_", "\"", "vdi", "\\u", "uuid", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "attach", "\\u", "volume_", "(_", "connecti", "on", "\\u", "info_", ",_", "\"", "vm", "\\u", "ref", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ",_", "2_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "(_", "\"", "sr", "\\u", "uuid", "\"_", ",_", "\"", "vdi", "\\u", "uuid", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mock", "\\u", "driver_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "connecti", "on", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "provider_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "\"", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "hypervisor", "_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "attach_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vdi", "\\u", "ref", "\"_", ",_", "\"", "vm", "\\u", "ref", "\"_", ",_", "\"", "name", "\"_", ",_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "forget", "\\u", "sr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provide", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "cleanup_", "(_", "self_", ",_", "mock", "\\u", "attach_", ",_", "mock", "\\u", "hypervisor", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "provider_", ",_", "mock", "\\u", "driver_", ",_", "mock", "\\u", "forget", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connecti", "on", "\\u", "info_", "=_", "{_", "\"", "data", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "provider_", "._", "return", "\\u", "value_", "=_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "\"", "sr", "\\u", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "hypervisor", "_", "._", "side", "\\u", "effect_", "=_", "test_", "._", "Test", "ing", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "test_", "._", "Test", "ing", "Exception_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "attach", "\\u", "volume_", ",_", "connecti", "on", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "driver_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "connecti", "on", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "provider_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "hypervisor", "_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "forget", "_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "sr", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "attach_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type", "\\u", "pass", "\\u", "iscsi", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn", "\\u", "info_", "=_", "{_", "\"", "driver", "\\u", "volume", "\\u", "type", "\"_", ":_", "\"", "iscsi", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type_", "(_", "conn", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type", "\\u", "pass", "\\u", "xen", "sm_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn", "\\u", "info_", "=_", "{_", "\"", "driver", "\\u", "volume", "\\u", "type", "\"_", ":_", "\"", "xen", "sm", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type_", "(_", "conn", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type", "\\u", "pass", "\\u", "bad_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn", "\\u", "info_", "=_", "{_", "\"", "driver", "\\u", "volume", "\\u", "type", "\"_", ":_", "\"", "bad", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Volume", "Drive", "r", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "check", "\\u", "is", "\\u", "support", "ed", "\\u", "driver", "\\u", "type_", ",_", "conn", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "introduce", "\\u", "sr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "by", "\\u", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "parse", "\\u", "sr", "\\u", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provide", "r", "\\u", "new", "\\u", "sr_", "(_", "self_", ",_", "mock", "\\u", "parse_", ",_", "mock", "\\u", "find", "\\u", "sr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "introduce", "\\u", "sr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "parse_", "._", "return", "\\u", "value_", "=_", "(_", "\"", "uuid", "\"_", ",_", "\"", "label", "\"_", ",_", "\"", "params", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "introduce", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ref_", ",_", "uuid_", "=_", "self_", "._", "ops_", "._", "\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provider_", "(_", "{_", "}_", ",_", "\"", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "uuid", "\"_", ",_", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "parse_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "\"", "Disk", "-", "for", ":", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "introduce", "\\u", "sr_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "uuid", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "label", "\"_", ",_", "\"", "params", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "introduce", "\\u", "sr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "by", "\\u", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "parse", "\\u", "sr", "\\u", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provide", "r", "\\u", "old", "\\u", "sr_", "(_", "self_", ",_", "mock", "\\u", "parse_", ",_", "mock", "\\u", "find", "\\u", "sr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "introduce", "\\u", "sr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "parse_", "._", "return", "\\u", "value_", "=_", "(_", "\"", "uuid", "\"_", ",_", "\"", "label", "\"_", ",_", "\"", "params", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ref_", ",_", "uuid_", "=_", "self_", "._", "ops_", "._", "\\u", "connect", "\\u", "to", "\\u", "volume", "\\u", "provider_", "(_", "{_", "}_", ",_", "\"", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "sr", "\\u", "ref", "\"_", ",_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "uuid", "\"_", ",_", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "parse_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "{_", "}_", ",_", "\"", "Disk", "-", "for", ":", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "introduce", "\\u", "sr_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "introduce", "\\u", "vdi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\\u", "regular", "_", "(_", "self_", ",_", "mock", "\\u", "intro_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "intro_", "._", "return", "\\u", "value_", "=_", "\"", "vdi", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume_", "(_", "\"", "sr", "\"_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "vdi", "\"_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "intro_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "sr", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "introduce", "\\u", "vdi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\\u", "vdi", "_", "(_", "self_", ",_", "mock", "\\u", "intro_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "intro_", "._", "return", "\\u", "value_", "=_", "\"", "vdi", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conn_", "=_", "{_", "\"", "vdi", "\\u", "uuid", "\"_", ":_", "\"", "id", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume_", "(_", "\"", "sr", "\"_", ",_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "vdi", "\"_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "intro_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "sr", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vdi", "\\u", "uuid_", "=_", "\"", "id", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "introduce", "\\u", "vdi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\\u", "lun_", "(_", "self_", ",_", "mock", "\\u", "intro_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "intro_", "._", "return", "\\u", "value_", "=_", "\"", "vdi", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conn_", "=_", "{_", "\"", "target", "\\u", "lun", "\"_", ":_", "\"", "lun", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume_", "(_", "\"", "sr", "\"_", ",_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "vdi", "\"_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "intro_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "sr", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "lun_", "=_", "\"", "lun", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "introduce", "\\u", "vdi", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "LOG_", ",_", "'", "debug", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume", "\\u", "mask", "\\u", "password_", "(_", "self_", ",_", "mock", "\\u", "debug_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "intro_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "connecti", "on", "\\u", "data", " ", "is", " ", "scrub", "bed", " ", "bef", "ore", " ", "logg", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "{_", "'", "auth", "\\u", "password", "'_", ":_", "'", "very", "bad", "pass", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "connect", "\\u", "hypervisor", "\\u", "to", "\\u", "volume_", "(_", "\"", "sr", "\"_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "mock", "\\u", "debug_", "._", "called_", ",_", "'", "LOG", ".", "debug", " ", "was", " ", "not", " ", "call", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password", "\\u", "logged", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "call_", "in_", "mock", "\\u", "debug_", "._", "call", "\\u", "args", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "call", " ", "object", " ", "is", " ", "a", " ", "tuple", " ", "of", " ", "(", "args", ",", " ", "kwarg", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "very", "bad", "pass", "'_", "in_", "call_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password", "\\u", "logged", "_", "=_", "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_", "self_", "._", "assert", "False_", "(_", "password", "\\u", "logged", "_", ",_", "'", "connecti", "on", "\\u", "data", " ", "was", " ", "not", " ", "scrub", "bed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "is", "\\u", "vm", "\\u", "shut", "down", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "create", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm", "\\u", "plug_", "(_", "self_", ",_", "mock", "\\u", "vb", "d_", ",_", "mock", "\\u", "shutdown_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "vb", "d_", "._", "return", "\\u", "value_", "=_", "\"", "vb", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "shutdown_", "._", "return", "\\u", "value_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VB", "D_", ",_", "\"", "plug", "\"_", ")_", "as_", "mock", "\\u", "plug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ops_", "._", "\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm_", "(_", "\"", "vdi", "\"_", ",_", "\"", "vm", "\"_", ",_", "\"", "name", "\"_", ",_", "2_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "plug_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vb", "d", "\"_", ",_", "\"", "vm", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\"_", ",_", "\"", "vdi", "\"_", ",_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "boot", "able_", "=_", "False_", ",_", "os", "vol_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "shutdown_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "is", "\\u", "vm", "\\u", "shut", "down", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "create", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm", "\\u", "no", "\\u", "plug_", "(_", "self_", ",_", "mock", "\\u", "vb", "d_", ",_", "mock", "\\u", "shutdown_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "vb", "d_", "._", "return", "\\u", "value_", "=_", "\"", "vb", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "shutdown_", "._", "return", "\\u", "value_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VB", "D_", ",_", "\"", "plug", "\"_", ")_", "as_", "mock", "\\u", "plug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ops_", "._", "\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm_", "(_", "\"", "vdi", "\"_", ",_", "\"", "vm", "\"_", ",_", "\"", "name", "\"_", ",_", "2_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "plug_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\"_", ",_", "\"", "vdi", "\"_", ",_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "boot", "able_", "=_", "False_", ",_", "os", "vol_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "shutdown_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attach", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "is", "\\u", "vm", "\\u", "shut", "down", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "vm", "\\u", "utils_", ",_", "\"", "create", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm", "\\u", "no", "\\u", "hot", "plug_", "(_", "self_", ",_", "mock", "\\u", "vb", "d_", ",_", "mock", "\\u", "shutdown_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "vb", "d_", "._", "return", "\\u", "value_", "=_", "\"", "vb", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "VB", "D_", ",_", "\"", "plug", "\"_", ")_", "as_", "mock", "\\u", "plug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ops_", "._", "\\u", "attach", "\\u", "volume", "\\u", "to", "\\u", "vm_", "(_", "\"", "vdi", "\"_", ",_", "\"", "vm", "\"_", ",_", "\"", "name", "\"_", ",_", "2_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "plug_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mock", "\\u", "vb", "d_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "self_", "._", "session_", ",_", "\"", "vm", "\"_", ",_", "\"", "vdi", "\"_", ",_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "boot", "able_", "=_", "False_", ",_", "os", "vol_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "mock", "\\u", "shutdown_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Fin", "d", "Ba", "d", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fin", "d", "Ba", "d", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "find", "\\u", "bad", "\\u", "volume", "s", "\\u", "no", "\\u", "vb", "ds_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "all_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "all_", "._", "return", "\\u", "value_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "find", "\\u", "bad", "\\u", "volumes_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "get", "\\u", "all_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fin", "d", "Ba", "d", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "find", "\\u", "bad", "\\u", "volume", "s", "\\u", "no", "\\u", "bad", "\\u", "vb", "ds_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "all_", ",_", "mock", "\\u", "find", "\\u", "sr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "all_", "._", "return", "\\u", "value_", "=_", "[_", "\"", "1", "\"_", ",_", "\"", "2", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "self_", "._", "session_", "._", "SR_", ",_", "\"", "scan", "\"_", ")_", "as_", "mock", "\\u", "scan_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "ops_", "._", "find", "\\u", "bad", "\\u", "volumes_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "get", "\\u", "all_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "find_", "=_", "[_", "mock_", "._", "call_", "(_", "self_", "._", "session_", ",_", "\"", "1", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "call_", "(_", "self_", "._", "session_", ",_", "\"", "2", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected", "\\u", "find_", ",_", "mock", "\\u", "find", "\\u", "sr_", "._", "call", "\\u", "args", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "scan_", "=_", "[_", "mock_", "._", "call_", "(_", "\"", "sr", "\\u", "ref", "\"_", ")_", ",_", "mock_", "._", "call_", "(_", "\"", "sr", "\\u", "ref", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected", "\\u", "scan_", ",_", "mock", "\\u", "scan_", "._", "call", "\\u", "args", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fin", "d", "Ba", "d", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "find", "\\u", "bad", "\\u", "volume", "s", "\\u", "bad", "\\u", "vb", "ds_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "all_", ",_", "mock", "\\u", "find", "\\u", "sr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "all_", "._", "return", "\\u", "value_", "=_", "[_", "\"", "vb", "d\\u", "ref", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Fake", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "=_", "[_", "'", "SR", "\\u", "BACK", "END", "\\u", "FAIL", "URE", "\\u", "40", "'_", ",_", "\"\"_", ",_", "\"\"_", ",_", "\"\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "session_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "Xen", "API_", "._", "Failure_", "=_", "Fake", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "session_", "=_", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "session_", "._", "SR_", ",_", "\"", "scan", "\"_", ")_", "as_", "mock", "\\u", "scan_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "session_", "._", "VB", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", "\\u", "device", "\"_", ")_", "as_", "mock", "\\u", "get_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "scan_", "._", "side", "\\u", "effect_", "=_", "Fake", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "get_", "._", "return", "\\u", "value_", "=_", "\"", "xv", "db", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "ops_", "._", "find", "\\u", "bad", "\\u", "volumes_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "get", "\\u", "all_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "scan_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "sr", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "get_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "vb", "d\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "\"/", "dev", "/", "xv", "db", "\"_", "]_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fin", "d", "Ba", "d", "Volume", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "\"", "find", "\\u", "sr", "\\u", "from", "\\u", "vb", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "ops_", "._", "Volume", "Ops_", ",_", "\"\\u", "get", "\\u", "all", "\\u", "volume", "\\u", "vb", "d\\u", "refs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "find", "\\u", "bad", "\\u", "volume", "s", "\\u", "raises_", "(_", "self_", ",_", "mock", "\\u", "get", "\\u", "all_", ",_", "mock", "\\u", "find", "\\u", "sr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "get", "\\u", "all_", "._", "return", "\\u", "value_", "=_", "[_", "\"", "vb", "d\\u", "ref", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "find", "\\u", "sr_", "._", "return", "\\u", "value_", "=_", "\"", "sr", "\\u", "ref", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Fake", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "=_", "[_", "'", "foo", "'_", ",_", "\"\"_", ",_", "\"\"_", ",_", "\"\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "session_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "Xen", "API_", "._", "Failure_", "=_", "Fake", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "\\u", "session_", "=_", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "session_", "._", "SR_", ",_", "\"", "scan", "\"_", ")_", "as_", "mock", "\\u", "scan_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "mock_", "._", "patch_", "._", "object_", "(_", "session_", "._", "VB", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", "\\u", "device", "\"_", ")_", "as_", "mock", "\\u", "get_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "scan_", "._", "side", "\\u", "effect_", "=_", "Fake", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "get_", "._", "return", "\\u", "value_", "=_", "\"", "xv", "db", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Fake", "Exception_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ops_", "._", "find", "\\u", "bad", "\\u", "volumes_", ",_", "\"", "vm", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "scan_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\"", "sr", "\\u", "ref", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Clean", "up", "Fro", "m", "VDI", "s", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Clean", "up", "Fro", "m", "VDI", "s", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "check", "\\u", "find", "\\u", "pur", "ge", "\\u", "calls_", "(_", "self_", ",_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ",_", "pur", "ge", "\\u", "sr_", ",_", "vdi", "\\u", "refs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sr", "\\u", "refs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "find", "\\u", "sr", "\\u", "calls_", "=_", "[_", "mock_", "._", "call_", "(_", "self_", "._", "ops_", "._", "\\u", "session_", ",_", "vdi", "\\u", "ref_", ")_", "for_", "vdi", "\\u", "ref_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "vdi", "\\u", "refs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", "._", "assert", "\\u", "has", "\\u", "calls_", "(_", "find", "\\u", "sr", "\\u", "calls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pur", "ge", "\\u", "sr", "\\u", "calls_", "=_", "[_", "mock_", "._", "call_", "(_", "self_", "._", "ops_", "._", "\\u", "session_", ",_", "sr", "\\u", "ref_", ")_", "for_", "sr", "\\u", "ref_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "sr", "\\u", "refs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pur", "ge", "\\u", "sr_", "._", "assert", "\\u", "has", "\\u", "calls_", "(_", "pur", "ge", "\\u", "sr", "\\u", "calls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clean", "up", "Fro", "m", "VDI", "s", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "'", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "'", "pur", "ge", "\\u", "sr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "safe", "\\u", "clean", "up", "\\u", "from", "\\u", "vdi", "s_", "(_", "self_", ",_", "pur", "ge", "\\u", "sr_", ",_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vdi", "\\u", "refs_", "=_", "[_", "'", "vdi", "\\u", "ref", "1", "'_", ",_", "'", "vdi", "\\u", "ref", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sr", "\\u", "refs_", "=_", "[_", "'", "sr", "\\u", "ref", "1", "'_", ",_", "'", "sr", "\\u", "ref", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", "._", "side", "\\u", "effect_", "=_", "sr", "\\u", "refs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "safe", "\\u", "clean", "up", "\\u", "from", "\\u", "vdi", "s_", "(_", "vdi", "\\u", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "find", "\\u", "pur", "ge", "\\u", "calls_", "(_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ",_", "pur", "ge", "\\u", "sr_", ",_", "vdi", "\\u", "refs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sr", "\\u", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clean", "up", "Fro", "m", "VDI", "s", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "'", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "side", "\\u", "effect_", "=_", "[_", "exception_", "._", "Stor", "age", "Error_", "(_", "reason_", "=_", "''_", ")_", ",_", "'", "sr", "\\u", "ref", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "'", "pur", "ge", "\\u", "sr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "safe", "\\u", "clean", "up", "\\u", "from", "\\u", "vdi", "s", "\\u", "handle", "s", "\\u", "find", "\\u", "sr", "\\u", "exception_", "(_", "self_", ",_", "pur", "ge", "\\u", "sr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vdi", "\\u", "refs_", "=_", "[_", "'", "vdi", "\\u", "ref", "1", "'_", ",_", "'", "vdi", "\\u", "ref", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sr", "\\u", "refs_", "=_", "[_", "'", "sr", "\\u", "ref", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", "._", "side", "\\u", "effect_", "=_", "[_", "exception_", "._", "Stor", "age", "Error_", "(_", "reason_", "=_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sr", "\\u", "refs_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "safe", "\\u", "clean", "up", "\\u", "from", "\\u", "vdi", "s_", "(_", "vdi", "\\u", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "find", "\\u", "pur", "ge", "\\u", "calls_", "(_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ",_", "pur", "ge", "\\u", "sr_", ",_", "vdi", "\\u", "refs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sr", "\\u", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Clean", "up", "Fro", "m", "VDI", "s", "Test", "Case_", "(_", "Volume", "Op", "s", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "'", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "._", "object_", "(_", "volume", "\\u", "utils_", ",_", "'", "pur", "ge", "\\u", "sr", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "safe", "\\u", "clean", "up", "\\u", "from", "\\u", "vdi", "s", "\\u", "handle", "s", "\\u", "pur", "ge", "\\u", "sr", "\\u", "exception_", "(_", "self_", ",_", "pur", "ge", "\\u", "sr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vdi", "\\u", "refs_", "=_", "[_", "'", "vdi", "\\u", "ref", "1", "'_", ",_", "'", "vdi", "\\u", "ref", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sr", "\\u", "refs_", "=_", "[_", "'", "sr", "\\u", "ref", "1", "'_", ",_", "'", "sr", "\\u", "ref", "2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", "._", "side", "\\u", "effect_", "=_", "sr", "\\u", "refs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pur", "ge", "\\u", "sr_", "._", "side", "\\u", "effects_", "=_", "[_", "test_", "._", "Test", "ing", "Exception_", ",_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ops_", "._", "safe", "\\u", "clean", "up", "\\u", "from", "\\u", "vdi", "s_", "(_", "vdi", "\\u", "refs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "find", "\\u", "pur", "ge", "\\u", "calls_", "(_", "find", "\\u", "sr", "\\u", "from", "\\u", "vdi", "_", ",_", "pur", "ge", "\\u", "sr_", ",_", "vdi", "\\u", "refs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sr", "\\u", "refs_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
arista-eosplus/pyeapi/pyeapi/api/abstract.py
[ { "content": "#\n# Copyright (c) 2014, Arista Networks, 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# Redistributions of source code must retain the above copyright notice,\n# this list of conditions and the following disclaimer.\n#\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#\n# Neither the name of Arista Networks 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 ARISTA NETWORKS\n# BE 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\n# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n\"\"\"Provides an abstract implementation for building API modules\n\nThis module provides a set of classes that are used to build API modules\nthat work with Node objects. Using this module will allow the API\nmodules to be automatically loaded using the Node.api method.\n\nThe classes in this module should not be instantiated directly but rather\nprovide parent class for API implementations. All API modules will\nultimately derive from BaseEntity which provides some common functions to\nmake building API modules easier.\n\"\"\"\nfrom collections import Callable, Mapping\n\nfrom pyeapi.eapilib import CommandError, ConnectionError\nfrom pyeapi.utils import make_iterable\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BaseEntity(object):\n \"\"\"Base class for all resources to derive from\n\n This BaseEntity class should not be directly instatiated. It is\n designed to be implemented by all resource classes to provide common\n methods.\n\n Attributes:\n node (Node): The node instance this resource will perform operations\n against for configuration\n config (Config): Returns an instance of Config with the nodes\n current running configuration\n error (CommandError): Holds the latest CommandError exception\n instance if raised\n\n Args:\n node (Node): An instance of Node\n \"\"\"\n\n\n\n\n\n", "metadata": "root.BaseEntity", "header": "['module', '___EOS___']", "index": 48 }, { "content": " def __init__(self, node):\n self.node = node", "metadata": "root.BaseEntity.__init__", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 66 }, { "content": " @property\n def config(self):\n return self.node.running_config", "metadata": "root.BaseEntity.config", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 69 }, { "content": " @property\n def error(self):\n return self.node.connection.error", "metadata": "root.BaseEntity.error", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 73 }, { "content": " def get_block(self, parent, config='running_config'):\n \"\"\" Scans the config and returns a block of code\n\n Args:\n parent (str): The parent string to search the config for and\n return the block\n config (str): A text config string to be searched. Default\n is to search the running-config of the Node.\n\n Returns:\n A string object that represents the block from the config. If\n the parent string is not found, then this method will\n return None.\n\n \"\"\"\n try:\n parent = r'^%s$' % parent\n return self.node.section(parent, config=config)\n except TypeError:\n return None", "metadata": "root.BaseEntity.get_block", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 77 }, { "content": " def configure(self, commands):\n \"\"\"Sends the commands list to the node in config mode\n\n This method performs configuration the node using the array of\n commands specified. This method wraps the configuration commands\n in a try/except block and stores any exceptions in the error\n property.\n\n Note:\n If the return from this method is False, use the error property\n to investigate the exception\n\n Args:\n commands (list): A list of commands to be sent to the node in\n config mode\n\n Returns:\n True if the commands are executed without exception otherwise\n False is returned\n \"\"\"\n try:\n self.node.config(commands)\n return True\n except (CommandError, ConnectionError):\n return False", "metadata": "root.BaseEntity.configure", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 98 }, { "content": " def command_builder(self, string, value=None, default=None, disable=None):\n \"\"\"Builds a command with keywords\n\n Notes:\n Negating a command string by overriding 'value' with None or an\n assigned value that evalutates to false has been deprecated.\n Please use 'disable' to negate a command.\n\n Parameters are evaluated in the order 'default', 'disable', 'value'\n\n Args:\n string (str): The command string\n value (str): The configuration setting to subsititue into the\n command string. If value is a boolean and True, just the\n command string is used\n default (bool): Specifies the command should use the default\n keyword argument. Default preempts disable and value.\n disable (bool): Specifies the command should use the no\n keyword argument. Disable preempts value.\n\n Returns:\n A command string that can be used to configure the node\n \"\"\"\n if default:\n return 'default %s' % string\n elif disable:\n return 'no %s' % string\n elif value is True:\n return string\n elif value:\n return '%s %s' % (string, value)\n else:\n return 'no %s' % string\n # -- above line to be deprecated and replaced with the error below\n # raise ValueError(\"abstract.command_builder: No value \"\n # \"received '%s'\" % value)", "metadata": "root.BaseEntity.command_builder", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 124 }, { "content": " def configure_interface(self, name, commands):\n \"\"\"Configures the specified interface with the commands\n\n Args:\n name (str): The interface name to configure\n commands: The commands to configure in the interface\n\n Returns:\n True if the commands completed successfully\n \"\"\"\n commands = make_iterable(commands)\n commands.insert(0, 'interface %s' % name)\n return self.configure(commands)", "metadata": "root.BaseEntity.configure_interface", "header": "['class', 'BaseEntity', '(', 'object', ')', ':', '___EOS___']", "index": 161 }, { "content": "class Entity(BaseEntity, Callable):\n \"\"\"Abstract class for building Entity resources\n\n The Entity class provides an abstract implementation that allows for\n building an API configuration resource. The Entity class should not\n be directly instantiated. It is used in instances where a single config\n entity is appropriate in the configuration.\n\n Examples of Entity candidates include global spanning tree\n \"\"\"\n", "metadata": "root.Entity", "header": "['module', '___EOS___']", "index": 176 }, { "content": " def __call__(self):\n return self.get()", "metadata": "root.Entity.__call__", "header": "['class', 'Entity', '(', 'BaseEntity', ',', 'Callable', ')', ':', '___EOS___']", "index": 186 }, { "content": " def get(self):\n raise NotImplementedError", "metadata": "root.Entity.get", "header": "['class', 'Entity', '(', 'BaseEntity', ',', 'Callable', ')', ':', '___EOS___']", "index": 189 }, { "content": "class EntityCollection(BaseEntity, Mapping):\n \"\"\"Abstract class for building EntityCollection resources\n\n The EntityCollection class provides an abstract implementat that allows\n for building API configuration resources with multiple resources. The\n EntityCollection class should not be directly instantiated.\n\n Examples of an EntityCollection candidate include VLANs and interfaces\n \"\"\"\n\n\n\n\n\n", "metadata": "root.EntityCollection", "header": "['module', '___EOS___']", "index": 193 }, { "content": " def __call__(self):\n return self.getall()", "metadata": "root.EntityCollection.__call__", "header": "['class', 'EntityCollection', '(', 'BaseEntity', ',', 'Mapping', ')', ':', '___EOS___']", "index": 203 }, { "content": " def __getitem__(self, value):\n return self.get(value)", "metadata": "root.EntityCollection.__getitem__", "header": "['class', 'EntityCollection', '(', 'BaseEntity', ',', 'Mapping', ')', ':', '___EOS___']", "index": 206 }, { "content": " def __len__(self):\n return len(self.getall())", "metadata": "root.EntityCollection.__len__", "header": "['class', 'EntityCollection', '(', 'BaseEntity', ',', 'Mapping', ')', ':', '___EOS___']", "index": 209 }, { "content": " def __iter__(self):\n return iter(self.getall())", "metadata": "root.EntityCollection.__iter__", "header": "['class', 'EntityCollection', '(', 'BaseEntity', ',', 'Mapping', ')', ':', '___EOS___']", "index": 212 }, { "content": " def getall(self):\n raise NotImplementedError", "metadata": "root.EntityCollection.getall", "header": "['class', 'EntityCollection', '(', 'BaseEntity', ',', 'Mapping', ')', ':', '___EOS___']", "index": 215 }, { "content": " def get(self, name, default=None):\n raise NotImplementedError", "metadata": "root.EntityCollection.get", "header": "['class', 'EntityCollection', '(', 'BaseEntity', ',', 'Mapping', ')', ':', '___EOS___']", "index": 218 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2014", ",", " ", "Ari", "sta", " ", "Network", "s", ",", " ", "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_", "#", " ", " ", " ", "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_", "#", " ", " ", " ", "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_", "#", " ", " ", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "Ari", "sta", " ", "Network", "s", " ", "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", " ", "ARI", "STA", " ", "NET", "WORKS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BE", " ", "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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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_", "\"\"\"", "Prov", "ides", " ", "an", " ", "abstract", " ", "implementation", " ", "for", " ", "buildi", "ng", " ", "API", " ", "module", "s", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "module", " ", "provide", "s", " ", "a", " ", "set", " ", "of", " ", "classe", "s", " ", "tha", "t", " ", "are", " ", "used", " ", "to", " ", "build", " ", "API", " ", "module", "s", "\\", "10", ";", "tha", "t", " ", "work", " ", "with", " ", "Node", " ", "object", "s", ".", " ", " ", "Us", "ing", " ", "this", " ", "module", " ", "will", " ", "allow", " ", "the", " ", "API", "\\", "10", ";", "module", "s", " ", "to", " ", "be", " ", "automati", "call", "y", " ", "load", "ed", " ", "usi", "ng", " ", "the", " ", "Node", ".", "api", " ", "method", ".", "\\", "10", ";", "\\", "10", ";", "The", " ", "classe", "s", " ", "in", " ", "this", " ", "module", " ", "shou", "ld", " ", "not", " ", "be", " ", "instantiate", "d", " ", "direct", "ly", " ", "but", " ", "rat", "her", "\\", "10", ";", "provide", " ", "parent", " ", "class", " ", "for", " ", "API", " ", "implementation", "s", ".", " ", " ", "All", " ", "API", " ", "module", "s", " ", "will", "\\", "10", ";", "ultima", "tel", "y", " ", "derive", " ", "from", " ", "Base", "Entit", "y", " ", "whi", "ch", " ", "provide", "s", " ", "some", " ", "common", " ", "function", "s", " ", "to", "\\", "10", ";", "make", " ", "buildi", "ng", " ", "API", " ", "module", "s", " ", "easi", "er", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Callable_", ",_", "Mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pye", "api_", "._", "eap", "ili", "b_", "import_", "Command", "Error_", ",_", "Connect", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pye", "api_", "._", "utils_", "import_", "make", "\\u", "iterable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Base", "Entity_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "all", " ", "resource", "s", " ", "to", " ", "derive", " ", "from", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "Base", "Entit", "y", " ", "class", " ", "shou", "ld", " ", "not", " ", "be", " ", "direct", "ly", " ", "insta", "tiat", "ed", ".", " ", " ", "It", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "design", "ed", " ", "to", " ", "be", " ", "implemented", " ", "by", " ", "all", " ", "resource", " ", "classe", "s", " ", "to", " ", "provide", " ", "common", "\\", "10", ";", " ", " ", " ", " ", "method", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "node", " ", "(", "Node", "):", " ", "The", " ", "node", " ", "instance", " ", "this", " ", "resource", " ", "will", " ", "perform", " ", "operati", "ons", "\\", "10", ";", " ", " ", " ", " ", "against", " ", "for", " ", "configura", "tion", "\\", "10", ";", " ", " ", " ", " ", "config", " ", "(", "Config", "):", " ", "Return", "s", " ", "an", " ", "instance", " ", "of", " ", "Config", " ", "with", " ", "the", " ", "nodes", "\\", "10", ";", " ", " ", " ", " ", "current", " ", "runn", "ing", " ", "configura", "tion", "\\", "10", ";", " ", " ", " ", " ", "error", " ", "(", "Command", "Error", "):", " ", "Hold", "s", " ", "the", " ", "late", "st", " ", "Command", "Error", " ", "exception", "\\", "10", ";", " ", " ", " ", " ", "instance", " ", "if", " ", "raise", "d", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "node", " ", "(", "Node", "):", " ", "An", " ", "instance", " ", "of", " ", "Node", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "node_", "=_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "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_", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "node_", "._", "runn", "ing", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "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_", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "node_", "._", "connection_", "._", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "block_", "(_", "self_", ",_", "parent_", ",_", "config_", "=_", "'", "runn", "ing", "\\u", "config", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Sca", "ns", " ", "the", " ", "config", " ", "and", " ", "return", "s", " ", "a", " ", "block", " ", "of", " ", "code", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "parent", " ", "(", "str", "):", " ", "The", " ", "parent", " ", "string", " ", "to", " ", "search", " ", "the", " ", "config", " ", "for", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "the", " ", "block", "\\", "10", ";", " ", " ", " ", " ", "config", " ", "(", "str", "):", " ", "A", " ", "text", " ", "config", " ", "string", " ", "to", " ", "be", " ", "searche", "d", ".", " ", "Default", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "to", " ", "search", " ", "the", " ", "runn", "ing", "-", "config", " ", "of", " ", "the", " ", "Node", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "string", " ", "object", " ", "tha", "t", " ", "represent", "s", " ", "the", " ", "block", " ", "from", " ", "the", " ", "config", ".", " ", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "parent", " ", "string", " ", "is", " ", "not", " ", "found", ",", " ", "then", " ", "this", " ", "method", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "Non", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parent_", "=_", "r", "'", "^", "%", "s", "$'_", "%_", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "node_", "._", "section_", "(_", "parent_", ",_", "config_", "=_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "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_", "configure_", "(_", "self_", ",_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "ds", " ", "the", " ", "command", "s", " ", "list", " ", "to", " ", "the", " ", "node", " ", "in", " ", "config", " ", "mode", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "perform", "s", " ", "configura", "tion", " ", "the", " ", "node", " ", "usi", "ng", " ", "the", " ", "array", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "command", "s", " ", "specified", ".", " ", " ", " ", "Thi", "s", " ", "method", " ", "wrap", "s", " ", "the", " ", "configura", "tion", " ", "command", "s", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "a", " ", "try", "/", "except", " ", "block", " ", "and", " ", "store", "s", " ", "any", " ", "exception", "s", " ", "in", " ", "the", " ", "error", "\\", "10", ";", " ", " ", " ", " ", "property", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "return", " ", "from", " ", "this", " ", "method", " ", "is", " ", "Fal", "se", ",", " ", "use", " ", "the", " ", "error", " ", "property", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "investigat", "e", " ", "the", " ", "exception", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "command", "s", " ", "(", "list", "):", " ", "A", " ", "list", " ", "of", " ", "command", "s", " ", "to", " ", "be", " ", "sent", " ", "to", " ", "the", " ", "node", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "config", " ", "mode", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", " ", "if", " ", "the", " ", "command", "s", " ", "are", " ", "executed", " ", "with", "out", " ", "exception", " ", "other", "wis", "e", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", " ", "is", " ", "return", "ed", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "node_", "._", "config_", "(_", "commands_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Command", "Error_", ",_", "Connect", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "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_", "command", "\\u", "builder_", "(_", "self_", ",_", "string_", ",_", "value_", "=_", "None_", ",_", "default_", "=_", "None_", ",_", "disable_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Build", "s", " ", "a", " ", "command", " ", "with", " ", "keywords", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "es", ":", "\\", "10", ";", " ", " ", " ", " ", "Nega", "ting", " ", "a", " ", "command", " ", "string", " ", "by", " ", "overrid", "ing", " ", "'", "value", "'", " ", "with", " ", "Non", "e", " ", "or", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "assign", "ed", " ", "value", " ", "tha", "t", " ", "eval", "utat", "es", " ", "to", " ", "fal", "se", " ", "has", " ", "bee", "n", " ", "depre", "cated", ".", "\\", "10", ";", " ", " ", " ", " ", "Ple", "ase", " ", "use", " ", "'", "disable", "'", " ", "to", " ", "negate", " ", "a", " ", "command", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", " ", "are", " ", "evaluate", "d", " ", "in", " ", "the", " ", "order", " ", "'", "default", "',", " ", "'", "disable", "',", " ", "'", "value", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "string", " ", "(", "str", "):", " ", "The", " ", "command", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "value", " ", "(", "str", "):", " ", "The", " ", "configura", "tion", " ", "setti", "ng", " ", "to", " ", "subs", "iti", "tu", "e", " ", "int", "o", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "command", " ", "string", ".", " ", "If", " ", "value", " ", "is", " ", "a", " ", "boolean", " ", "and", " ", "Tru", "e", ",", " ", "just", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "command", " ", "string", " ", "is", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "default", " ", "(", "bool", "):", " ", "Specifie", "s", " ", "the", " ", "command", " ", "shou", "ld", " ", "use", " ", "the", " ", "default", "\\", "10", ";", " ", " ", " ", " ", "keyw", "ord", " ", "argu", "ment", ".", " ", "Default", " ", "pree", "mpt", "s", " ", "disable", " ", "and", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "disable", " ", "(", "bool", "):", " ", "Specifie", "s", " ", "the", " ", "command", " ", "shou", "ld", " ", "use", " ", "the", " ", "no", "\\", "10", ";", " ", " ", " ", " ", "keyw", "ord", " ", "argu", "ment", ".", " ", "Disa", "ble", " ", "pree", "mpt", "s", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "command", " ", "string", " ", "tha", "t", " ", "can", " ", "be", " ", "used", " ", "to", " ", "configur", "e", " ", "the", " ", "node", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "default", " ", "%", "s", "'_", "%_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "disable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "no", " ", "%", "s", "'_", "%_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", " ", "%", "s", "'_", "%_", "(_", "string_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "no", " ", "%", "s", "'_", "%_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--", " ", "above", " ", "line", " ", "to", " ", "be", " ", "depre", "cated", " ", "and", " ", "replaced", " ", "with", " ", "the", " ", "error", " ", "below_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "raise", " ", "Value", "Error", "(\"", "abstract", ".", "command", "\\u", "builde", "r", ":", " ", "No", " ", "value", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", " ", "\"", "receive", "d", " ", "'%", "s", "'\"", " ", "%", " ", "value", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Entity_", "(_", "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_", "configur", "e\\u", "interface_", "(_", "self_", ",_", "name_", ",_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Configure", "s", " ", "the", " ", "specified", " ", "interface", " ", "with", " ", "the", " ", "command", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "(", "str", "):", " ", "The", " ", "interface", " ", "name", " ", "to", " ", "configur", "e", "\\", "10", ";", " ", " ", " ", " ", "command", "s", ":", " ", "The", " ", "command", "s", " ", "to", " ", "configur", "e", " ", "in", " ", "the", " ", "interface", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", " ", "if", " ", "the", " ", "command", "s", " ", "complete", "d", " ", "success", "full", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "commands_", "=_", "make", "\\u", "iterable_", "(_", "commands_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "commands_", "._", "insert_", "(_", "0_", ",_", "'", "interface", " ", "%", "s", "'_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "configure_", "(_", "commands_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Entity_", "(_", "Base", "Entity_", ",_", "Callable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Abstract", " ", "class", " ", "for", " ", "buildi", "ng", " ", "Entit", "y", " ", "resource", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "Entit", "y", " ", "class", " ", "provide", "s", " ", "an", " ", "abstract", " ", "implementation", " ", "tha", "t", " ", "allow", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "buildi", "ng", " ", "an", " ", "API", " ", "configura", "tion", " ", "resource", ".", " ", " ", "The", " ", "Entit", "y", " ", "class", " ", "shou", "ld", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "direct", "ly", " ", "instantiate", "d", ".", " ", " ", "It", " ", "is", " ", "used", " ", "in", " ", "instance", "s", " ", "where", " ", "a", " ", "single", " ", "config", "\\", "10", ";", " ", " ", " ", " ", "entity", " ", "is", " ", "appropr", "iate", " ", "in", " ", "the", " ", "configura", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", " ", "of", " ", "Entit", "y", " ", "candidate", "s", " ", "include", " ", "global", " ", "spanning", " ", "tree", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", "Base", "Entity_", ",_", "Callable_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", "Base", "Entity_", ",_", "Callable_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Abstract", " ", "class", " ", "for", " ", "buildi", "ng", " ", "Entit", "y", "Collecti", "on", " ", "resource", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "Entit", "y", "Collecti", "on", " ", "class", " ", "provide", "s", " ", "an", " ", "abstract", " ", "implement", "at", " ", "tha", "t", " ", "allow", "s", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "buildi", "ng", " ", "API", " ", "configura", "tion", " ", "resource", "s", " ", "with", " ", "multiple", " ", "resource", "s", ".", " ", " ", "The", "\\", "10", ";", " ", " ", " ", " ", "Entit", "y", "Collecti", "on", " ", "class", " ", "shou", "ld", " ", "not", " ", "be", " ", "direct", "ly", " ", "instantiate", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", " ", "of", " ", "an", " ", "Entit", "y", "Collecti", "on", " ", "candidate", " ", "include", " ", "VLAN", "s", " ", "and", " ", "interface", "s", "\\", "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_", "[SEP]_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "geta", "ll_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\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_", "._", "geta", "ll_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "iter_", "(_", "self_", "._", "geta", "ll_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "geta", "ll_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entit", "y", "Collection_", "(_", "Base", "Entity_", ",_", "Mapping_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "name_", ",_", "default_", "=_", "None_", ")_", ":_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
home-assistant/home-assistant/tests/components/alarm_control_panel/test_mqtt.py
[ { "content": "\"\"\"The tests the MQTT alarm control panel component.\"\"\"\nimport unittest\n\nfrom homeassistant.bootstrap import _setup_component\nfrom homeassistant.const import (\n STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,\n STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, STATE_UNKNOWN)\nfrom homeassistant.components import alarm_control_panel\n\nfrom tests.common import (\n mock_mqtt_component, fire_mqtt_message, get_test_home_assistant)\n\nCODE = 'HELLO_CODE'\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestAlarmControlPanelMQTT(unittest.TestCase):\n \"\"\"Test the manual alarm module.\"\"\"\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestAlarmControlPanelMQTT", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def setUp(self): # pylint: disable=invalid-name\n \"\"\"Setup things to be run when tests are started.\"\"\"\n self.hass = get_test_home_assistant()\n self.mock_publish = mock_mqtt_component(self.hass)", "metadata": "root.TestAlarmControlPanelMQTT.setUp", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 18 }, { "content": " def tearDown(self): # pylint: disable=invalid-name\n \"\"\"Stop down stuff we started.\"\"\"\n self.hass.stop()", "metadata": "root.TestAlarmControlPanelMQTT.tearDown", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def test_fail_setup_without_state_topic(self):\n \"\"\"Test for failing with no state topic.\"\"\"\n self.hass.config.components = ['mqtt']\n assert not _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'command_topic': 'alarm/command'\n }\n })", "metadata": "root.TestAlarmControlPanelMQTT.test_fail_setup_without_state_topic", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 27 }, { "content": " def test_fail_setup_without_command_topic(self):\n \"\"\"Test failing with no command topic.\"\"\"\n self.hass.config.components = ['mqtt']\n assert not _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'state_topic': 'alarm/state'\n }\n })", "metadata": "root.TestAlarmControlPanelMQTT.test_fail_setup_without_command_topic", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 37 }, { "content": " def test_update_state_via_state_topic(self):\n \"\"\"Test updating with via state topic.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n }\n })\n\n entity_id = 'alarm_control_panel.test'\n\n self.assertEqual(STATE_UNKNOWN,\n self.hass.states.get(entity_id).state)\n\n for state in (STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME,\n STATE_ALARM_ARMED_AWAY, STATE_ALARM_PENDING,\n STATE_ALARM_TRIGGERED):\n fire_mqtt_message(self.hass, 'alarm/state', state)\n self.hass.pool.block_till_done()\n self.assertEqual(state, self.hass.states.get(entity_id).state)", "metadata": "root.TestAlarmControlPanelMQTT.test_update_state_via_state_topic", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": " def test_ignore_update_state_if_unknown_via_state_topic(self):\n \"\"\"Test ignoring updates via state topic.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n }\n })\n\n entity_id = 'alarm_control_panel.test'\n\n self.assertEqual(STATE_UNKNOWN,\n self.hass.states.get(entity_id).state)\n\n fire_mqtt_message(self.hass, 'alarm/state', 'unsupported state')\n self.hass.pool.block_till_done()\n self.assertEqual(STATE_UNKNOWN, self.hass.states.get(entity_id).state)", "metadata": "root.TestAlarmControlPanelMQTT.test_ignore_update_state_if_unknown_via_state_topic", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 71 }, { "content": " def test_arm_home_publishes_mqtt(self):\n \"\"\"Test publishing of MQTT messages while armed.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n }\n })\n\n alarm_control_panel.alarm_arm_home(self.hass)\n self.hass.pool.block_till_done()\n self.assertEqual(('alarm/command', 'ARM_HOME', 0, False),\n self.mock_publish.mock_calls[-1][1])", "metadata": "root.TestAlarmControlPanelMQTT.test_arm_home_publishes_mqtt", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 92 }, { "content": " def test_arm_home_not_publishes_mqtt_with_invalid_code(self):\n \"\"\"Test not publishing of MQTT messages with invalid code.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n 'code': '1234'\n }\n })\n\n call_count = self.mock_publish.call_count\n alarm_control_panel.alarm_arm_home(self.hass, 'abcd')\n self.hass.pool.block_till_done()\n self.assertEqual(call_count, self.mock_publish.call_count)", "metadata": "root.TestAlarmControlPanelMQTT.test_arm_home_not_publishes_mqtt_with_invalid_code", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 109 }, { "content": " def test_arm_away_publishes_mqtt(self):\n \"\"\"Test publishing of MQTT messages while armed.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n }\n })\n\n alarm_control_panel.alarm_arm_away(self.hass)\n self.hass.pool.block_till_done()\n self.assertEqual(('alarm/command', 'ARM_AWAY', 0, False),\n self.mock_publish.mock_calls[-1][1])", "metadata": "root.TestAlarmControlPanelMQTT.test_arm_away_publishes_mqtt", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 127 }, { "content": " def test_arm_away_not_publishes_mqtt_with_invalid_code(self):\n \"\"\"Test not publishing of MQTT messages with invalid code.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n 'code': '1234'\n }\n })\n\n call_count = self.mock_publish.call_count\n alarm_control_panel.alarm_arm_away(self.hass, 'abcd')\n self.hass.pool.block_till_done()\n self.assertEqual(call_count, self.mock_publish.call_count)", "metadata": "root.TestAlarmControlPanelMQTT.test_arm_away_not_publishes_mqtt_with_invalid_code", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 144 }, { "content": " def test_disarm_publishes_mqtt(self):\n \"\"\"Test publishing of MQTT messages while disarmed.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n }\n })\n\n alarm_control_panel.alarm_disarm(self.hass)\n self.hass.pool.block_till_done()\n self.assertEqual(('alarm/command', 'DISARM', 0, False),\n self.mock_publish.mock_calls[-1][1])", "metadata": "root.TestAlarmControlPanelMQTT.test_disarm_publishes_mqtt", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 162 }, { "content": " def test_disarm_not_publishes_mqtt_with_invalid_code(self):\n \"\"\"Test not publishing of MQTT messages with invalid code.\"\"\"\n self.hass.config.components = ['mqtt']\n assert _setup_component(self.hass, alarm_control_panel.DOMAIN, {\n alarm_control_panel.DOMAIN: {\n 'platform': 'mqtt',\n 'name': 'test',\n 'state_topic': 'alarm/state',\n 'command_topic': 'alarm/command',\n 'code': '1234'\n }\n })\n\n call_count = self.mock_publish.call_count\n alarm_control_panel.alarm_disarm(self.hass, 'abcd')\n self.hass.pool.block_till_done()\n self.assertEqual(call_count, self.mock_publish.call_count)", "metadata": "root.TestAlarmControlPanelMQTT.test_disarm_not_publishes_mqtt_with_invalid_code", "header": "['class', 'TestAlarmControlPanelMQTT', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 179 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "The", " ", "tests", " ", "the", " ", "MQ", "TT", " ", "alarm", " ", "control", " ", "panel", " ", "component", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "homeassistant_", "._", "bootstrap_", "import_", "\\u", "setup", "\\u", "component_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "homeassistant_", "._", "const_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "STATE", "\\u", "ALARM", "\\u", "DIS", "ARM", "ED_", ",_", "STATE", "\\u", "ALARM", "\\u", "ARM", "ED", "\\u", "HOME_", ",_", "STATE", "\\u", "ALARM", "\\u", "ARM", "ED", "\\u", "AWA", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "STATE", "\\u", "ALARM", "\\u", "PENDING_", ",_", "STATE", "\\u", "ALARM", "\\u", "TRIGGER", "ED_", ",_", "STATE", "\\u", "UNKNOWN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "homeassistant_", "._", "components_", "import_", "alarm", "\\u", "control", "\\u", "panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tests_", "._", "common_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "mqtt", "\\u", "component_", ",_", "fire", "\\u", "mqtt", "\\u", "message_", ",_", "get", "\\u", "test\\u", "home", "\\u", "assistan", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CODE_", "=_", "'", "HELL", "O", "\\u", "CODE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "manu", "al", " ", "alarm", " ", "module", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "invalid", "-", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", "up", " ", "thing", "s", " ", "to", " ", "be", " ", "run", " ", "whe", "n", " ", "tests", " ", "are", " ", "start", "ed", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "=_", "get", "\\u", "test\\u", "home", "\\u", "assistan", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mock", "\\u", "publish_", "=_", "mock", "\\u", "mqtt", "\\u", "component_", "(_", "self_", "._", "hass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "invalid", "-", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sto", "p", " ", "down", " ", "stu", "ff", " ", "we", " ", "start", "ed", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fail", "\\u", "setup", "\\u", "with", "out", "\\u", "state", "\\u", "topic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "for", " ", "faili", "ng", " ", "with", " ", "no", " ", "state", " ", "topic", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fail", "\\u", "setup", "\\u", "with", "out", "\\u", "command", "\\u", "topic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "faili", "ng", " ", "with", " ", "no", " ", "command", " ", "topic", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "state", "\\u", "via", "\\u", "state", "\\u", "topic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "updat", "ing", " ", "with", " ", "via", " ", "state", " ", "topic", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "entity", "\\u", "id_", "=_", "'", "alarm", "\\u", "control", "\\u", "panel", ".", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "STATE", "\\u", "UNKNOWN_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "hass_", "._", "states_", "._", "get_", "(_", "entity", "\\u", "id_", ")_", "._", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "state_", "in_", "(_", "STATE", "\\u", "ALARM", "\\u", "DIS", "ARM", "ED_", ",_", "STATE", "\\u", "ALARM", "\\u", "ARM", "ED", "\\u", "HOME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "STATE", "\\u", "ALARM", "\\u", "ARM", "ED", "\\u", "AWA", "Y_", ",_", "STATE", "\\u", "ALARM", "\\u", "PENDING_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "STATE", "\\u", "ALARM", "\\u", "TRIGGER", "ED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fire", "\\u", "mqtt", "\\u", "message_", "(_", "self_", "._", "hass_", ",_", "'", "alarm", "/", "state", "'_", ",_", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "state_", ",_", "self_", "._", "hass_", "._", "states_", "._", "get_", "(_", "entity", "\\u", "id_", ")_", "._", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ignore", "\\u", "update", "\\u", "state", "\\u", "if", "\\u", "unknown", "\\u", "via", "\\u", "state", "\\u", "topic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "ign", "orin", "g", " ", "update", "s", " ", "via", " ", "state", " ", "topic", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "entity", "\\u", "id_", "=_", "'", "alarm", "\\u", "control", "\\u", "panel", ".", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "STATE", "\\u", "UNKNOWN_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "hass_", "._", "states_", "._", "get_", "(_", "entity", "\\u", "id_", ")_", "._", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fire", "\\u", "mqtt", "\\u", "message_", "(_", "self_", "._", "hass_", ",_", "'", "alarm", "/", "state", "'_", ",_", "'", "unsup", "porte", "d", " ", "state", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "STATE", "\\u", "UNKNOWN_", ",_", "self_", "._", "hass_", "._", "states_", "._", "get_", "(_", "entity", "\\u", "id_", ")_", "._", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "arm", "\\u", "home", "\\u", "publi", "she", "s", "\\u", "mqtt_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "publishing", " ", "of", " ", "MQ", "TT", " ", "message", "s", " ", "whi", "le", " ", "arme", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "alarm", "\\u", "arm", "\\u", "home_", "(_", "self_", "._", "hass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "'", "alarm", "/", "command", "'_", ",_", "'", "ARM", "\\u", "HOM", "E", "'_", ",_", "0_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mock", "\\u", "publish_", "._", "mock", "\\u", "calls_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "arm", "\\u", "home", "\\u", "not", "\\u", "publi", "she", "s", "\\u", "mqtt", "\\u", "with", "\\u", "invalid", "\\u", "code_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "not", " ", "publishing", " ", "of", " ", "MQ", "TT", " ", "message", "s", " ", "with", " ", "invalid", " ", "code", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "'_", ":_", "'", "1234", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "call", "\\u", "count_", "=_", "self_", "._", "mock", "\\u", "publish_", "._", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "alarm", "\\u", "arm", "\\u", "home_", "(_", "self_", "._", "hass_", ",_", "'", "abc", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "call", "\\u", "count_", ",_", "self_", "._", "mock", "\\u", "publish_", "._", "call", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "arm", "\\u", "awa", "y", "\\u", "publi", "she", "s", "\\u", "mqtt_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "publishing", " ", "of", " ", "MQ", "TT", " ", "message", "s", " ", "whi", "le", " ", "arme", "d", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "alarm", "\\u", "arm", "\\u", "away_", "(_", "self_", "._", "hass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "'", "alarm", "/", "command", "'_", ",_", "'", "ARM", "\\u", "AWA", "Y", "'_", ",_", "0_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mock", "\\u", "publish_", "._", "mock", "\\u", "calls_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "arm", "\\u", "awa", "y", "\\u", "not", "\\u", "publi", "she", "s", "\\u", "mqtt", "\\u", "with", "\\u", "invalid", "\\u", "code_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "not", " ", "publishing", " ", "of", " ", "MQ", "TT", " ", "message", "s", " ", "with", " ", "invalid", " ", "code", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "'_", ":_", "'", "1234", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "call", "\\u", "count_", "=_", "self_", "._", "mock", "\\u", "publish_", "._", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "alarm", "\\u", "arm", "\\u", "away_", "(_", "self_", "._", "hass_", ",_", "'", "abc", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "call", "\\u", "count_", ",_", "self_", "._", "mock", "\\u", "publish_", "._", "call", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "disa", "rm", "\\u", "publi", "she", "s", "\\u", "mqtt_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "publishing", " ", "of", " ", "MQ", "TT", " ", "message", "s", " ", "whi", "le", " ", "disa", "rmed", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "alarm", "\\u", "disa", "rm_", "(_", "self_", "._", "hass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "(_", "'", "alarm", "/", "command", "'_", ",_", "'", "DIS", "ARM", "'_", ",_", "0_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mock", "\\u", "publish_", "._", "mock", "\\u", "calls_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Alarm", "Control", "Pane", "l", "MQ", "TT_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "disa", "rm", "\\u", "not", "\\u", "publi", "she", "s", "\\u", "mqtt", "\\u", "with", "\\u", "invalid", "\\u", "code_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "not", " ", "publishing", " ", "of", " ", "MQ", "TT", " ", "message", "s", " ", "with", " ", "invalid", " ", "code", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "config_", "._", "components_", "=_", "[_", "'", "mqtt", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\\u", "setup", "\\u", "component_", "(_", "self_", "._", "hass_", ",_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "DOMAIN_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "platform", "'_", ":_", "'", "mqtt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", "\\u", "topic", "'_", ":_", "'", "alarm", "/", "command", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "'_", ":_", "'", "1234", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "call", "\\u", "count_", "=_", "self_", "._", "mock", "\\u", "publish_", "._", "call", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alarm", "\\u", "control", "\\u", "panel_", "._", "alarm", "\\u", "disa", "rm_", "(_", "self_", "._", "hass_", ",_", "'", "abc", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hass_", "._", "pool_", "._", "block", "\\u", "till", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "call", "\\u", "count_", ",_", "self_", "._", "mock", "\\u", "publish_", "._", "call", "\\u", "count_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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import
dclambert/pyensemble/ensemble.py
[ { "content": "# Author: David C. Lambert [dcl -at- panix -dot- com]\n# Copyright(c) 2013\n# License: Simple BSD\n\"\"\"\nThe :mod:`ensemble` module implements the ensemble selection\ntechnique of Caruana et al [1][2].\n\nCurrently supports f1, auc, rmse, accuracy and mean cross entropy scores\nfor hillclimbing. Based on numpy, scipy, sklearn and sqlite.\n\nWork in progress.\n\nReferences\n----------\n.. [1] Caruana, et al, \"Ensemble Selection from Libraries of Rich Models\",\n Proceedings of the 21st International Conference on Machine Learning\n (ICML `04).\n.. [2] Caruana, et al, \"Getting the Most Out of Ensemble Selection\",\n Proceedings of the 6th International Conference on Data Mining\n (ICDM `06).\n\"\"\"\nimport os\nimport sys\nimport sqlite3\nimport numpy as np\nfrom math import sqrt\nfrom cPickle import loads, dumps\nfrom collections import Counter\n\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom sklearn.utils import check_random_state\nfrom sklearn.metrics import f1_score, roc_auc_score\nfrom sklearn.metrics import mean_squared_error, accuracy_score\nfrom sklearn.cross_validation import StratifiedKFold\nfrom sklearn.preprocessing import LabelBinarizer\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _f1(y, y_bin, probs):\n \"\"\"return f1 score\"\"\"\n return f1_score(y, np.argmax(probs, axis=1))", "metadata": "root._f1", "header": "['module', '___EOS___']", "index": 37 }, { "content": "def _auc(y, y_bin, probs):\n \"\"\"return AUC score (for binary problems only)\"\"\"\n return roc_auc_score(y, probs[:, 1])", "metadata": "root._auc", "header": "['module', '___EOS___']", "index": 42 }, { "content": "def _rmse(y, y_bin, probs):\n \"\"\"return 1-rmse since we're maximizing the score for hillclimbing\"\"\"\n return 1.0 - sqrt(mean_squared_error(y_bin, probs))", "metadata": "root._rmse", "header": "['module', '___EOS___']", "index": 47 }, { "content": "def _accuracy(y, y_bin, probs):\n \"\"\"return accuracy score\"\"\"\n return accuracy_score(y, np.argmax(probs, axis=1))", "metadata": "root._accuracy", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def _mxentropy(y, y_bin, probs):\n \"\"\"return negative mean cross entropy since we're maximizing the score\n for hillclimbing\"\"\"\n\n # clip away from extremes to avoid under/overflows\n eps = 1.0e-7\n clipped = np.clip(probs, eps, 1.0 - eps)\n clipped /= clipped.sum(axis=1)[:, np.newaxis]\n\n return (y_bin * np.log(clipped)).sum() / y.shape[0]", "metadata": "root._mxentropy", "header": "['module', '___EOS___']", "index": 57 }, { "content": "def _bootstraps(n, rs):\n \"\"\"return bootstrap sample indices for given n\"\"\"\n bs_inds = rs.randint(n, size=(n))\n return bs_inds, np.setdiff1d(range(n), bs_inds)", "metadata": "root._bootstraps", "header": "['module', '___EOS___']", "index": 69 }, { "content": "class EnsembleSelectionClassifier(BaseEstimator, ClassifierMixin):\n \"\"\"Caruana-style ensemble selection [1][2]\n\n Parameters:\n -----------\n `db_file` : string\n Name of file for sqlite db backing store.\n\n `models` : list or None\n List of classifiers following sklearn fit/predict API, if None\n fitted models are loaded from the specified database.\n\n `n_best` : int (default: 5)\n Number of top models in initial ensemble.\n\n `n_folds` : int (default: 3)\n Number of internal cross-validation folds.\n\n `bag_fraction` : float (default: 0.25)\n Fraction of (post-pruning) models to randomly select for each bag.\n\n `prune_fraction` : float (default: 0.8)\n Fraction of worst models to prune before ensemble selection.\n\n `score_metric` : string (default: 'accuracy')\n Score metric to use when hillclimbing. Must be one of\n 'accuracy', 'xentropy', 'rmse', 'f1'.\n\n `epsilon` : float (default: 0.01)\n Minimum score improvement to add model to ensemble. Ignored\n if use_epsilon is False.\n\n `max_models` : int (default: 50)\n Maximum number of models to include in an ensemble.\n\n `verbose` : boolean (default: False)\n Turn on verbose messages.\n\n `use_bootstrap`: boolean (default: False)\n If True, use bootstrap sample of entire dataset for fitting, and\n oob samples for hillclimbing for each internal CV fold instead\n of StratifiedKFolds\n\n `use_epsilon` : boolean (default: False)\n If True, candidates models are added to ensembles until the value\n of the score_metric fails to improve by the value of the epsilon\n parameter. If False, models are added until the number of models\n in the cadidate ensemble reaches the value of the max_models\n parameter.\n\n `random_state` : int, RandomState instance or None (default=None)\n Control the pseudo random number generator used to select\n candidates for each bag.\n\n References\n ----------\n .. [1] Caruana, et al, \"Ensemble Selection from Libraries of Rich Models\",\n Proceedings of the 21st International Conference on Machine Learning\n (ICML `04).\n .. [2] Caruana, et al, \"Getting the Most Out of Ensemble Selection\",\n Proceedings of the 6th International Conference on Data Mining\n (ICDM `06).\n \"\"\"\n\n _metrics = {\n 'f1': _f1,\n 'auc': _auc,\n 'rmse': _rmse,\n 'accuracy': _accuracy,\n 'xentropy': _mxentropy,\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.EnsembleSelectionClassifier", "header": "['module', '___EOS___']", "index": 75 }, { "content": " def __init__(self, db_file=None,\n models=None, n_best=5, n_folds=3,\n n_bags=20, bag_fraction=0.25,\n prune_fraction=0.8,\n score_metric='accuracy',\n epsilon=0.01, max_models=50,\n use_epsilon=False, use_bootstrap=False,\n verbose=False, random_state=None):\n\n self.db_file = db_file\n self.models = models\n self.n_best = n_best\n self.n_bags = n_bags\n self.n_folds = n_folds\n self.bag_fraction = bag_fraction\n self.prune_fraction = prune_fraction\n self.score_metric = score_metric\n self.epsilon = epsilon\n self.max_models = max_models\n self.use_epsilon = use_epsilon\n self.use_bootstrap = use_bootstrap\n self.verbose = verbose\n self.random_state = random_state\n\n self._check_params()\n\n self._folds = None\n self._n_models = 0\n self._n_classes = 0\n self._metric = None\n self._ensemble = Counter()\n self._model_scores = []\n self._scored_models = []\n self._fitted_models = []\n\n self._init_db(models)", "metadata": "root.EnsembleSelectionClassifier.__init__", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 147 }, { "content": " def _check_params(self):\n \"\"\"Parameter sanity checks\"\"\"\n\n if (not self.db_file):\n msg = \"db_file parameter is required\"\n raise ValueError(msg)\n\n if (self.epsilon < 0.0):\n msg = \"epsilon must be >= 0.0\"\n raise ValueError(msg)\n\n metric_names = self._metrics.keys()\n if (self.score_metric not in metric_names):\n msg = \"score_metric not in %s\" % metric_names\n raise ValueError(msg)\n\n if (self.n_best < 1):\n msg = \"n_best must be >= 1\"\n raise ValueError(msg)\n\n if (self.max_models < self.n_best):\n msg = \"max_models must be >= n_best\"\n raise ValueError(msg)\n\n if (not self.use_bootstrap):\n if (self.n_folds < 2):\n msg = \"n_folds must be >= 2 for StratifiedKFolds\"\n raise ValueError(msg)\n else:\n if (self.n_folds < 1):\n msg = \"n_folds must be >= 1 with bootstrap\"\n raise ValueError(msg)", "metadata": "root.EnsembleSelectionClassifier._check_params", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 184 }, { "content": " def _init_db(self, models):\n \"\"\"Initialize database\"\"\"\n\n # db setup script\n _createTablesScript = \"\"\"\n create table models (\n model_idx integer UNIQUE NOT NULL,\n pickled_model blob NOT NULL\n );\n\n create table fitted_models (\n model_idx integer NOT NULL,\n fold_idx integer NOT NULL,\n pickled_model blob NOT NULL\n );\n\n create table model_scores (\n model_idx integer UNIQUE NOT NULL,\n score real NOT NULL,\n probs blob NOT NULL\n );\n\n create table ensemble (\n model_idx integer NOT NULL,\n weight integer NOT NULL\n );\n \"\"\"\n\n # barf if db file exists and we're making a new model\n if (models and os.path.exists(self.db_file)):\n raise ValueError(\"db_file '%s' already exists!\" % self.db_file)\n\n db_conn = sqlite3.connect(self.db_file)\n with db_conn:\n db_conn.execute(\"pragma journal_mode = off\")\n\n if (models):\n # build database\n with db_conn:\n db_conn.executescript(_createTablesScript)\n\n # populate model table\n insert_stmt = \"\"\"insert into models (model_idx, pickled_model)\n values (?, ?)\"\"\"\n with db_conn:\n vals = ((i, buffer(dumps(m))) for i, m in enumerate(models))\n db_conn.executemany(insert_stmt, vals)\n create_stmt = \"create index models_index on models (model_idx)\"\n db_conn.execute(create_stmt)\n\n self._n_models = len(models)\n\n else:\n curs = db_conn.cursor()\n curs.execute(\"select count(*) from models\")\n self._n_models = curs.fetchone()[0]\n\n curs.execute(\"select model_idx, weight from ensemble\")\n for k, v in curs.fetchall():\n self._ensemble[k] = v\n\n # clumsy hack to get n_classes\n curs.execute(\"select probs from model_scores limit 1\")\n r = curs.fetchone()\n probs = loads(str(r[0]))\n self._n_classes = probs.shape[1]\n\n db_conn.close()", "metadata": "root.EnsembleSelectionClassifier._init_db", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 217 }, { "content": " def fit(self, X, y):\n \"\"\"Perform model fitting and ensemble building\"\"\"\n\n self.fit_models(X, y)\n self.build_ensemble(X, y)\n return self", "metadata": "root.EnsembleSelectionClassifier.fit", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 286 }, { "content": " def fit_models(self, X, y):\n \"\"\"Perform internal cross-validation fit\"\"\"\n\n if (self.verbose):\n sys.stderr.write('\\nfitting models:\\n')\n\n if (self.use_bootstrap):\n n = X.shape[0]\n rs = check_random_state(self.random_state)\n self._folds = [_bootstraps(n, rs) for _ in xrange(self.n_folds)]\n else:\n self._folds = list(StratifiedKFold(y, n_folds=self.n_folds))\n\n select_stmt = \"select pickled_model from models where model_idx = ?\"\n insert_stmt = \"\"\"insert into fitted_models\n (model_idx, fold_idx, pickled_model)\n values (?,?,?)\"\"\"\n\n db_conn = sqlite3.connect(self.db_file)\n curs = db_conn.cursor()\n\n for model_idx in xrange(self._n_models):\n\n curs.execute(select_stmt, [model_idx])\n pickled_model = curs.fetchone()[0]\n model = loads(str(pickled_model))\n\n model_folds = []\n\n for fold_idx, fold in enumerate(self._folds):\n train_inds, _ = fold\n model.fit(X[train_inds], y[train_inds])\n\n pickled_model = buffer(dumps(model))\n model_folds.append((model_idx, fold_idx, pickled_model))\n\n with db_conn:\n db_conn.executemany(insert_stmt, model_folds)\n\n if (self.verbose):\n if ((model_idx + 1) % 50 == 0):\n sys.stderr.write('%d\\n' % (model_idx + 1))\n else:\n sys.stderr.write('.')\n\n if (self.verbose):\n sys.stderr.write('\\n')\n\n with db_conn:\n stmt = \"\"\"create index fitted_models_index\n on fitted_models (model_idx, fold_idx)\"\"\"\n\n db_conn.execute(stmt)\n\n db_conn.close()", "metadata": "root.EnsembleSelectionClassifier.fit_models", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 293 }, { "content": " def _score_models(self, db_conn, X, y, y_bin):\n \"\"\"Get cross-validated test scores for each model\"\"\"\n\n self._metric = self._metrics[self.score_metric]\n\n if (self.verbose):\n sys.stderr.write('\\nscoring models:\\n')\n\n insert_stmt = \"\"\"insert into model_scores (model_idx, score, probs)\n values (?,?,?)\"\"\"\n\n select_stmt = \"\"\"select pickled_model\n from fitted_models\n where model_idx = ? and fold_idx = ?\"\"\"\n\n # nuke existing scores\n with db_conn:\n stmt = \"\"\"drop index if exists model_scores_index;\n delete from model_scores;\"\"\"\n db_conn.executescript(stmt)\n\n curs = db_conn.cursor()\n\n # build probs array using the test sets for each internal CV fold\n for model_idx in xrange(self._n_models):\n probs = np.zeros((len(X), self._n_classes))\n\n for fold_idx, fold in enumerate(self._folds):\n _, test_inds = fold\n\n curs.execute(select_stmt, [model_idx, fold_idx])\n res = curs.fetchone()\n model = loads(str(res[0]))\n\n probs[test_inds] = model.predict_proba(X[test_inds])\n\n score = self._metric(y, y_bin, probs)\n\n # save score and probs array\n with db_conn:\n vals = (model_idx, score, buffer(dumps(probs)))\n db_conn.execute(insert_stmt, vals)\n\n if (self.verbose):\n if ((model_idx + 1) % 50 == 0):\n sys.stderr.write('%d\\n' % (model_idx + 1))\n else:\n sys.stderr.write('.')\n\n if (self.verbose):\n sys.stderr.write('\\n')\n\n with db_conn:\n stmt = \"\"\"create index model_scores_index\n on model_scores (model_idx)\"\"\"\n db_conn.execute(stmt)", "metadata": "root.EnsembleSelectionClassifier._score_models", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 349 }, { "content": " def _get_ensemble_score(self, db_conn, ensemble, y, y_bin):\n \"\"\"Get score for model ensemble\"\"\"\n\n n_models = float(sum(ensemble.values()))\n ensemble_probs = np.zeros((len(y), self._n_classes))\n\n curs = db_conn.cursor()\n select_stmt = \"\"\"select model_idx, probs\n from model_scores\n where model_idx in %s\"\"\"\n\n in_str = str(tuple(ensemble)).replace(',)', ')')\n curs.execute(select_stmt % in_str)\n\n for row in curs.fetchall():\n model_idx, probs = row\n probs = loads(str(probs))\n weight = ensemble[model_idx]\n ensemble_probs += probs * weight\n\n ensemble_probs /= n_models\n\n score = self._metric(y, y_bin, ensemble_probs)\n return score, ensemble_probs", "metadata": "root.EnsembleSelectionClassifier._get_ensemble_score", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 406 }, { "content": " def _score_with_model(self, db_conn, y, y_bin, probs, n_models, model_idx):\n \"\"\"compute ensemble score with specified model added\"\"\"\n\n curs = db_conn.cursor()\n select_stmt = \"\"\"select probs\n from model_scores\n where model_idx = %d\"\"\"\n\n curs.execute(select_stmt % model_idx)\n row = curs.fetchone()\n\n n_models = float(n_models)\n new_probs = loads(str(row[0]))\n new_probs = (probs*n_models + new_probs)/(n_models + 1.0)\n\n score = self._metric(y, y_bin, new_probs)\n return score, new_probs", "metadata": "root.EnsembleSelectionClassifier._score_with_model", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 431 }, { "content": " def _ensemble_from_candidates(self, db_conn, candidates, y, y_bin):\n \"\"\"Build an ensemble from a list of candidate models\"\"\"\n\n ensemble = Counter(candidates[:self.n_best])\n\n ens_score, ens_probs = self._get_ensemble_score(db_conn,\n ensemble,\n y, y_bin)\n\n ens_count = sum(ensemble.values())\n if (self.verbose):\n sys.stderr.write('%02d/%.3f ' % (ens_count, ens_score))\n\n cand_ensembles = []\n while(ens_count < self.max_models):\n # compute and collect scores after adding each candidate\n new_scores = []\n for new_model_idx in candidates:\n score, _ = self._score_with_model(db_conn, y, y_bin,\n ens_probs, ens_count,\n new_model_idx)\n\n new_scores.append({'score': score,\n 'new_model_idx': new_model_idx})\n\n new_scores.sort(key=lambda x: x['score'], reverse=True)\n\n last_ens_score = ens_score\n ens_score = new_scores[0]['score']\n\n if (self.use_epsilon):\n # if score improvement is less than epsilon,\n # don't add the new model and stop\n score_diff = ens_score - last_ens_score\n if (score_diff < self.epsilon):\n break\n\n new_model_idx = new_scores[0]['new_model_idx']\n ensemble.update({new_model_idx: 1})\n _, ens_probs = self._score_with_model(db_conn, y, y_bin,\n ens_probs, ens_count,\n new_model_idx)\n\n if (not self.use_epsilon):\n # store current ensemble to select best later\n ens_copy = Counter(ensemble)\n cand = {'ens': ens_copy, 'score': ens_score}\n cand_ensembles.append(cand)\n\n ens_count = sum(ensemble.values())\n if (self.verbose):\n if ((ens_count - self.n_best) % 8 == 0):\n sys.stderr.write(\"\\n \")\n msg = '%02d/%.3f ' % (ens_count, ens_score)\n sys.stderr.write(msg)\n\n if (self.verbose):\n sys.stderr.write('\\n')\n\n if (not self.use_epsilon and ens_count == self.max_models):\n cand_ensembles.sort(key=lambda x: x['score'], reverse=True)\n ensemble = cand_ensembles[0]['ens']\n\n return ensemble", "metadata": "root.EnsembleSelectionClassifier._ensemble_from_candidates", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 449 }, { "content": " def _get_best_model(self, curs):\n \"\"\"perform query for best scoring model\"\"\"\n\n select_stmt = \"\"\"select model_idx, pickled_model\n from models\n where model_idx =\n (select model_idx\n from model_scores\n order by score desc\n limit 1)\"\"\"\n curs.execute(select_stmt)\n row = curs.fetchone()\n\n return row[0], loads(str(row[1]))", "metadata": "root.EnsembleSelectionClassifier._get_best_model", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 514 }, { "content": " def best_model(self):\n \"\"\"Returns best model found after CV scoring\"\"\"\n\n db_conn = sqlite3.connect(self.db_file)\n _, model = self._get_best_model(db_conn.cursor())\n db_conn.close()\n return model", "metadata": "root.EnsembleSelectionClassifier.best_model", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 529 }, { "content": " def _print_best_results(self, curs, best_model_score):\n \"\"\"Show best model and score\"\"\"\n\n sys.stderr.write('Best model CV score: %.5f\\n' % best_model_score)\n\n _, best_model = self._get_best_model(curs)\n sys.stderr.write('Best model: %s\\n\\n' % repr(best_model))", "metadata": "root.EnsembleSelectionClassifier._print_best_results", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 537 }, { "content": " def build_ensemble(self, X, y, rescore=True):\n \"\"\"Generate bagged ensemble\"\"\"\n\n self._n_classes = len(np.unique(y))\n\n db_conn = sqlite3.connect(self.db_file)\n curs = db_conn.cursor()\n\n # binarize\n if (self._n_classes > 2):\n y_bin = LabelBinarizer().fit_transform(y)\n else:\n y_bin = np.column_stack((1-y, y))\n\n # get CV scores for fitted models\n if (rescore):\n self._score_models(db_conn, X, y, y_bin)\n\n # get number of best models to take\n n_models = int(self._n_models * (1.0 - self.prune_fraction))\n bag_size = int(self.bag_fraction * n_models)\n if (self.verbose):\n sys.stderr.write('%d models left after pruning\\n' % n_models)\n sys.stderr.write('leaving %d candidates per bag\\n\\n' % bag_size)\n\n # get indices and scores from DB\n select_stmt = \"\"\"select model_idx, score\n from model_scores\n order by score desc\n limit %d\"\"\"\n curs.execute(select_stmt % n_models)\n ranked_model_scores = [(r[0], r[1]) for r in curs.fetchall()]\n\n # print best performing model results\n best_model_score = ranked_model_scores[0][1]\n if (self.verbose):\n self._print_best_results(curs, best_model_score)\n sys.stderr.write(\"Ensemble scores for each bag (size/score):\\n\")\n\n ensembles = []\n\n # make bags and ensembles\n rs = check_random_state(self.random_state)\n for i in xrange(self.n_bags):\n # get bag_size elements at random\n cand_indices = rs.permutation(n_models)[:bag_size]\n\n # sort by rank\n candidates = [ranked_model_scores[ci][0] for ci in cand_indices]\n\n if (self.verbose):\n sys.stderr.write('Bag %02d): ' % (i+1))\n\n # build an ensemble with current candidates\n ensemble = self._ensemble_from_candidates(db_conn,\n candidates,\n y, y_bin)\n ensembles.append(ensemble)\n\n # combine ensembles from each bag\n for e in ensembles:\n self._ensemble += e\n\n # push to DB\n insert_stmt = \"insert into ensemble(model_idx, weight) values (?, ?)\"\n with db_conn:\n val_gen = ((mi, w) for mi, w in self._ensemble.most_common())\n db_conn.executemany(insert_stmt, val_gen)\n\n if (self.verbose):\n score, _ = self._get_ensemble_score(db_conn,\n self._ensemble,\n y, y_bin)\n\n fmt = \"\\nFinal ensemble (%d components) CV score: %.5f\\n\\n\"\n\n sys.stderr.write(fmt % (sum(self._ensemble.values()), score))\n\n db_conn.close()", "metadata": "root.EnsembleSelectionClassifier.build_ensemble", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 545 }, { "content": " def _model_predict_proba(self, X, model_idx=0):\n \"\"\"Get probability predictions for a model given its index\"\"\"\n\n db_conn = sqlite3.connect(self.db_file)\n curs = db_conn.cursor()\n select_stmt = \"\"\"select pickled_model\n from fitted_models\n where model_idx = ? and fold_idx = ?\"\"\"\n\n # average probs over each n_folds models\n probs = np.zeros((len(X), self._n_classes))\n for fold_idx in xrange(self.n_folds):\n curs.execute(select_stmt, [model_idx, fold_idx])\n\n res = curs.fetchone()\n model = loads(str(res[0]))\n\n probs += model.predict_proba(X)/float(self.n_folds)\n\n db_conn.close()\n\n return probs", "metadata": "root.EnsembleSelectionClassifier._model_predict_proba", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 625 }, { "content": " def best_model_predict_proba(self, X):\n \"\"\"Probability estimates for all classes (ordered by class label)\n using best model\"\"\"\n\n db_conn = sqlite3.connect(self.db_file)\n best_model_idx, _ = self._get_best_model(db_conn.cursor())\n db_conn.close()\n\n return self._model_predict_proba(X, best_model_idx)", "metadata": "root.EnsembleSelectionClassifier.best_model_predict_proba", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 648 }, { "content": " def best_model_predict(self, X):\n \"\"\"Predict class labels for samples in X using best model\"\"\"\n return np.argmax(self.best_model_predict_proba(X), axis=1)", "metadata": "root.EnsembleSelectionClassifier.best_model_predict", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 658 }, { "content": " def predict_proba(self, X):\n \"\"\"Probability estimates for all classes (ordered by class label)\"\"\"\n\n n_models = float(sum(self._ensemble.values()))\n\n probs = np.zeros((len(X), self._n_classes))\n\n for model_idx, weight in self._ensemble.items():\n probs += self._model_predict_proba(X, model_idx) * weight/n_models\n\n return probs", "metadata": "root.EnsembleSelectionClassifier.predict_proba", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 662 }, { "content": " def predict(self, X):\n \"\"\"Predict class labels for samples in X.\"\"\"\n return np.argmax(self.predict_proba(X), axis=1)", "metadata": "root.EnsembleSelectionClassifier.predict", "header": "['class', 'EnsembleSelectionClassifier', '(', 'BaseEstimator', ',', 'ClassifierMixin', ')', ':', '___EOS___']", "index": 674 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Author", ":", " ", "Dav", "id", " ", "C", ".", " ", "Lam", "bert", " ", "[", "dcl", " ", "-", "at", "-", " ", "pani", "x", " ", "-", "dot", "-", " ", "com", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", "(", "c", ")", " ", "2013_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "Simple", " ", "BS", "D_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "The", " ", ":", "mod", ":`", "ensembl", "e", "`", " ", "module", " ", "implement", "s", " ", "the", " ", "ensembl", "e", " ", "selection", "\\", "10", ";", "technique", " ", "of", " ", "Car", "uan", "a", " ", "et", " ", "al", " ", "[", "1", "][", "2", "].", "\\", "10", ";", "\\", "10", ";", "Curr", "ent", "ly", " ", "support", "s", " ", "f1", ",", " ", "auc", ",", " ", "rmse", ",", " ", "accu", "rac", "y", " ", "and", " ", "mean", " ", "cross", " ", "entr", "opy", " ", "score", "s", "\\", "10", ";", "for", " ", "hill", "clim", "bing", ".", " ", " ", "Base", "d", " ", "on", " ", "nump", "y", ",", " ", "sci", "py", ",", " ", "skl", "earn", " ", "and", " ", "sql", "ite", ".", "\\", "10", ";", "\\", "10", ";", "Work", " ", "in", " ", "progress", ".", "\\", "10", ";", "\\", "10", ";", "Reference", "s", "\\", "10", ";", "----------", "\\", "10", ";", "..", " ", "[", "1", "]", " ", "Car", "uan", "a", ",", " ", "et", " ", "al", ",", " ", "\"", "Ensemble", " ", "Selecti", "on", " ", "from", " ", "Libr", "aries", " ", "of", " ", "Rich", " ", "Model", "s", "\",", "\\", "10", ";", " ", " ", " ", "Proce", "eding", "s", " ", "of", " ", "the", " ", "21", "st", " ", "Intern", "ation", "al", " ", "Conference", " ", "on", " ", "Machine", " ", "Learn", "ing", "\\", "10", ";", " ", " ", " ", "(", "ICM", "L", " ", "`", "04", ").", "\\", "10", ";", "..", " ", "[", "2", "]", " ", "Car", "uan", "a", ",", " ", "et", " ", "al", ",", " ", "\"", "Get", "ting", " ", "the", " ", "Mos", "t", " ", "Out", " ", "of", " ", "Ensemble", " ", "Selecti", "on", "\",", "\\", "10", ";", " ", " ", " ", "Proce", "eding", "s", " ", "of", " ", "the", " ", "6", "th", " ", "Intern", "ation", "al", " ", "Conference", " ", "on", " ", "Data", " ", "Mini", "ng", "\\", "10", ";", " ", " ", " ", "(", "IC", "DM", " ", "`", "0", "6", ").", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sqlite3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "sqrt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "Pickle_", "import_", "loads_", ",_", "dumps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sklearn_", "._", "base_", "import_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "utils_", "import_", "check", "\\u", "random", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "metrics_", "import_", "f1", "\\u", "score_", ",_", "roc", "\\u", "auc", "\\u", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "metrics_", "import_", "mean", "\\u", "square", "d\\u", "error_", ",_", "accu", "rac", "y", "\\u", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "cross", "\\u", "validation_", "import_", "Strat", "ified", "KF", "old_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "preprocessing_", "import_", "Label", "Bin", "ari", "zer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "\\u", "f1_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "f1", " ", "score", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "f1", "\\u", "score_", "(_", "y_", ",_", "np_", "._", "argmax_", "(_", "probs_", ",_", "axis_", "=_", "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_", "\\u", "auc_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "AUC", " ", "score", " ", "(", "for", " ", "binar", "y", " ", "problem", "s", " ", "only", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "roc", "\\u", "auc", "\\u", "score_", "(_", "y_", ",_", "probs_", "[_", ":_", ",_", "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_", "\\u", "rmse", "_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "1", "-", "rmse", " ", "sinc", "e", " ", "we", "'", "re", " ", "maxim", "izi", "ng", " ", "the", " ", "score", " ", "for", " ", "hill", "clim", "bing", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1.0_", "-_", "sqrt_", "(_", "mean", "\\u", "square", "d\\u", "error_", "(_", "y", "\\u", "bin_", ",_", "probs_", ")_", ")_", "\\u\\u\\uNEWLINE\\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", "accuracy_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "accu", "rac", "y", " ", "score", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "accu", "rac", "y", "\\u", "score_", "(_", "y_", ",_", "np_", "._", "argmax_", "(_", "probs_", ",_", "axis_", "=_", "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_", "\\u", "mx", "entropy_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "negati", "ve", " ", "mean", " ", "cross", " ", "entr", "opy", " ", "sinc", "e", " ", "we", "'", "re", " ", "maxim", "izi", "ng", " ", "the", " ", "score", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "hill", "clim", "bing", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "clip", " ", "awa", "y", " ", "from", " ", "extreme", "s", " ", "to", " ", "avoid", " ", "under", "/", "overflow", "s_", "\\u\\u\\uNL\\u\\u\\u_", "eps_", "=_", "1.0e-", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clipped", "_", "=_", "np_", "._", "clip_", "(_", "probs_", ",_", "eps_", ",_", "1.0_", "-_", "eps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clipped", "_", "/=_", "clipped", "_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", "[_", ":_", ",_", "np_", "._", "newaxis_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "y", "\\u", "bin_", "*_", "np_", "._", "log_", "(_", "clipped", "_", ")_", ")_", "._", "sum_", "(_", ")_", "/_", "y_", "._", "shape_", "[_", "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_", "\\u", "boots", "trap", "s_", "(_", "n_", ",_", "rs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "boots", "trap", " ", "sample", " ", "indice", "s", " ", "for", " ", "give", "n", " ", "n", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bs", "\\u", "inds_", "=_", "rs_", "._", "randint_", "(_", "n_", ",_", "size_", "=_", "(_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bs", "\\u", "inds_", ",_", "np_", "._", "setd", "iff", "1d_", "(_", "range_", "(_", "n_", ")_", ",_", "bs", "\\u", "inds_", ")_", "\\u\\u\\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_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Car", "uan", "a", "-", "style", " ", "ensembl", "e", " ", "selection", " ", "[", "1", "][", "2", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-----------", "\\", "10", ";", " ", " ", " ", " ", "`", "db", "\\u", "file", "`", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Name", " ", "of", " ", "file", " ", "for", " ", "sql", "ite", " ", "db", " ", "backing", " ", "store", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "model", "s", "`", " ", ":", " ", "list", " ", "or", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "List", " ", "of", " ", "classif", "iers", " ", "follow", "ing", " ", "skl", "earn", " ", "fit", "/", "predi", "ct", " ", "API", ",", " ", "if", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "fitted", " ", "model", "s", " ", "are", " ", "load", "ed", " ", "from", " ", "the", " ", "specified", " ", "databa", "se", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "n", "\\u", "best", "`", " ", ":", " ", "int", " ", "(", "default", ":", " ", "5", ")", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "top", " ", "model", "s", " ", "in", " ", "initial", " ", "ensembl", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "n", "\\u", "fold", "s", "`", " ", ":", " ", "int", " ", "(", "default", ":", " ", "3", ")", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "internal", " ", "cross", "-", "validation", " ", "fold", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "bag", "\\u", "fract", "ion", "`", " ", ":", " ", "float", " ", "(", "default", ":", " ", "0.25", ")", "\\", "10", ";", " ", " ", " ", " ", "Frac", "tion", " ", "of", " ", "(", "post", "-", "prun", "ing", ")", " ", "model", "s", " ", "to", " ", "random", "ly", " ", "select", " ", "for", " ", "each", " ", "bag", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "prune", "\\u", "fract", "ion", "`", " ", ":", " ", "float", " ", "(", "default", ":", " ", "0.", "8", ")", "\\", "10", ";", " ", " ", " ", " ", "Frac", "tion", " ", "of", " ", "worst", " ", "model", "s", " ", "to", " ", "prune", " ", "bef", "ore", " ", "ensembl", "e", " ", "selection", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "score", "\\u", "metric", "`", " ", ":", " ", "string", " ", "(", "default", ":", " ", "'", "accu", "rac", "y", "')", "\\", "10", ";", " ", " ", " ", " ", "Score", " ", "metric", " ", "to", " ", "use", " ", "whe", "n", " ", "hill", "clim", "bing", ".", " ", " ", "Mus", "t", " ", "be", " ", "one", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "'", "accu", "rac", "y", "',", " ", "'", "xen", "trop", "y", "',", " ", "'", "rmse", "',", " ", "'", "f1", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "eps", "ilon", "`", " ", ":", " ", "float", " ", "(", "default", ":", " ", "0.01", ")", "\\", "10", ";", " ", " ", " ", " ", "Mini", "mum", " ", "score", " ", "improvement", " ", "to", " ", "add", " ", "model", " ", "to", " ", "ensembl", "e", ".", " ", " ", "Ignor", "ed", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "use", "\\u", "eps", "ilon", " ", "is", " ", "Fal", "se", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "max", "\\u", "model", "s", "`", " ", ":", " ", "int", " ", "(", "default", ":", " ", "50", ")", "\\", "10", ";", " ", " ", " ", " ", "Maxim", "um", " ", "number", " ", "of", " ", "model", "s", " ", "to", " ", "include", " ", "in", " ", "an", " ", "ensembl", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "verbo", "se", "`", " ", ":", " ", "boolean", " ", "(", "default", ":", " ", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "Turn", " ", "on", " ", "verbo", "se", " ", "message", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "use", "\\u", "boots", "trap", "`", ":", " ", "boolean", " ", "(", "default", ":", " ", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "Tru", "e", ",", " ", "use", " ", "boots", "trap", " ", "sample", " ", "of", " ", "entire", " ", "dataset", " ", "for", " ", "fitting", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "oob", " ", "samples", " ", "for", " ", "hill", "clim", "bing", " ", "for", " ", "each", " ", "internal", " ", "CV", " ", "fold", " ", "inst", "ead", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "Strat", "ified", "KF", "olds", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "use", "\\u", "eps", "ilon", "`", " ", ":", " ", "boolean", " ", "(", "default", ":", " ", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "Tru", "e", ",", " ", "candidate", "s", " ", "model", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "ensembl", "es", " ", "unti", "l", " ", "the", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "score", "\\u", "metric", " ", "fail", "s", " ", "to", " ", "improve", " ", "by", " ", "the", " ", "value", " ", "of", " ", "the", " ", "eps", "ilon", "\\", "10", ";", " ", " ", " ", " ", "parameter", ".", " ", " ", "If", " ", "Fal", "se", ",", " ", "model", "s", " ", "are", " ", "adde", "d", " ", "unti", "l", " ", "the", " ", "number", " ", "of", " ", "model", "s", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "cad", "idat", "e", " ", "ensembl", "e", " ", "reache", "s", " ", "the", " ", "value", " ", "of", " ", "the", " ", "max", "\\u", "model", "s", "\\", "10", ";", " ", " ", " ", " ", "parameter", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "random", "\\u", "state", "`", " ", " ", ":", " ", "int", ",", " ", "Random", "State", " ", "instance", " ", "or", " ", "Non", "e", " ", "(", "default", "=", "Non", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "Control", " ", "the", " ", "pseudo", " ", "random", " ", "number", " ", "generat", "or", " ", "used", " ", "to", " ", "select", "\\", "10", ";", " ", " ", " ", " ", "candidate", "s", " ", "for", " ", "each", " ", "bag", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Reference", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "[", "1", "]", " ", "Car", "uan", "a", ",", " ", "et", " ", "al", ",", " ", "\"", "Ensemble", " ", "Selecti", "on", " ", "from", " ", "Libr", "aries", " ", "of", " ", "Rich", " ", "Model", "s", "\",", "\\", "10", ";", " ", " ", " ", "Proce", "eding", "s", " ", "of", " ", "the", " ", "21", "st", " ", "Intern", "ation", "al", " ", "Conference", " ", "on", " ", "Machine", " ", "Learn", "ing", "\\", "10", ";", " ", " ", " ", "(", "ICM", "L", " ", "`", "04", ").", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "[", "2", "]", " ", "Car", "uan", "a", ",", " ", "et", " ", "al", ",", " ", "\"", "Get", "ting", " ", "the", " ", "Mos", "t", " ", "Out", " ", "of", " ", "Ensemble", " ", "Selecti", "on", "\",", "\\", "10", ";", " ", " ", " ", "Proce", "eding", "s", " ", "of", " ", "the", " ", "6", "th", " ", "Intern", "ation", "al", " ", "Conference", " ", "on", " ", "Data", " ", "Mini", "ng", "\\", "10", ";", " ", " ", " ", "(", "IC", "DM", " ", "`", "0", "6", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "metrics_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "f1", "'_", ":_", "\\u", "f1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auc", "'_", ":_", "\\u", "auc_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rmse", "'_", ":_", "\\u", "rmse", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "accu", "rac", "y", "'_", ":_", "\\u", "accuracy_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xen", "trop", "y", "'_", ":_", "\\u", "mx", "entropy_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "db", "\\u", "file_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "models_", "=_", "None_", ",_", "n", "\\u", "best_", "=_", "5_", ",_", "n", "\\u", "folds_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "bag", "s_", "=_", "20_", ",_", "bag", "\\u", "fraction_", "=_", "0.25_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prune", "\\u", "fraction_", "=_", "0.8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "metric_", "=_", "'", "accu", "rac", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "epsilon_", "=_", "0.01_", ",_", "max", "\\u", "models_", "=_", "50_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "epsilon_", "=_", "False_", ",_", "use", "\\u", "bootstrap_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbose_", "=_", "False_", ",_", "random", "\\u", "state_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db", "\\u", "file_", "=_", "db", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "models_", "=_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "best_", "=_", "n", "\\u", "best_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "bag", "s_", "=_", "n", "\\u", "bag", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "folds_", "=_", "n", "\\u", "folds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bag", "\\u", "fraction_", "=_", "bag", "\\u", "fraction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prune", "\\u", "fraction_", "=_", "prune", "\\u", "fraction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "score", "\\u", "metric_", "=_", "score", "\\u", "metric_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "epsilon_", "=_", "epsilon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "models_", "=_", "max", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "use", "\\u", "epsilon_", "=_", "use", "\\u", "epsilon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "use", "\\u", "bootstrap_", "=_", "use", "\\u", "bootstrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "verbose_", "=_", "verbose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "random", "\\u", "state_", "=_", "random", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "params_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "folds_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "n", "\\u", "models_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "n", "\\u", "classes_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "metric_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ensemble_", "=_", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "model", "\\u", "scores_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "scored", "\\u", "models_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "fitted", "\\u", "models_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "init", "\\u", "db_", "(_", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Parameter", " ", "sanity", " ", "checks", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "db", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "db", "\\u", "file", " ", "parameter", " ", "is", " ", "require", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "epsilon_", "<_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "eps", "ilon", " ", "must", " ", "be", " ", ">=", " ", "0.", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "metric", "\\u", "names_", "=_", "self_", "._", "\\u", "metrics_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "score", "\\u", "metric_", "not_", "in_", "metric", "\\u", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "score", "\\u", "metric", " ", "not", " ", "in", " ", "%", "s", "\"_", "%_", "metric", "\\u", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "n", "\\u", "best_", "<_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "n", "\\u", "best", " ", "must", " ", "be", " ", ">=", " ", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "max", "\\u", "models_", "<_", "self_", "._", "n", "\\u", "best_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "max", "\\u", "model", "s", " ", "must", " ", "be", " ", ">=", " ", "n", "\\u", "best", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "use", "\\u", "bootstrap_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "n", "\\u", "folds_", "<_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "n", "\\u", "fold", "s", " ", "must", " ", "be", " ", ">=", " ", "2", " ", "for", " ", "Strat", "ified", "KF", "olds", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "n", "\\u", "folds_", "<_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "n", "\\u", "fold", "s", " ", "must", " ", "be", " ", ">=", " ", "1", " ", "with", " ", "boots", "trap", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\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", "init", "\\u", "db_", "(_", "self_", ",_", "models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "e", " ", "databa", "se", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "db", " ", "setup", " ", "script_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "create", "Table", "s", "Script_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "create", " ", "table", " ", "model", "s", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "model", "\\u", "idx", " ", " ", "integ", "er", " ", "UNI", "QUE", " ", "NOT", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", "pickled", "\\u", "model", " ", " ", "blob", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "create", " ", "table", " ", "fitted", "\\u", "model", "s", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "model", "\\u", "idx", " ", " ", "integ", "er", " ", "NOT", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", "fold", "\\u", "idx", " ", " ", " ", "integ", "er", " ", "NOT", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", "pickled", "\\u", "model", " ", " ", "blob", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "create", " ", "table", " ", "model", "\\u", "score", "s", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "model", "\\u", "idx", " ", " ", "integ", "er", " ", "UNI", "QUE", " ", "NOT", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", "score", " ", " ", "real", " ", "NOT", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", "probs", " ", " ", "blob", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "create", " ", "table", " ", "ensembl", "e", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "model", "\\u", "idx", " ", " ", "integ", "er", " ", "NOT", " ", "NULL", ",", "\\", "10", ";", " ", " ", " ", " ", "weight", " ", " ", " ", " ", " ", "integ", "er", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", ");", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bar", "f", " ", "if", " ", "db", " ", "file", " ", "exist", "s", " ", "and", " ", "we", "'", "re", " ", "mak", "ing", " ", "a", " ", "new", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "models_", "and_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "db", "\\u", "file_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "db", "\\u", "file", " ", "'%", "s", "'", " ", "alr", "ead", "y", " ", "exist", "s", "!\"_", "%_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db", "\\u", "conn_", "=_", "sqlite3_", "._", "connect_", "(_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "conn_", "._", "execute_", "(_", "\"", "pragma", " ", "journal", "\\u", "mode", " ", "=", " ", "off", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "build", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "conn_", "._", "execute", "script_", "(_", "\\u", "create", "Table", "s", "Script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "populate", " ", "model", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "insert", "\\u", "stmt_", "=_", "\"\"\"", "insert", " ", "int", "o", " ", "model", "s", " ", "(", "model", "\\u", "idx", ",", " ", "pickled", "\\u", "model", ")", "\\", "10", ";", " ", " ", " ", "values", " ", "(?", ",", " ", "?)", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vals_", "=_", "(_", "(_", "i_", ",_", "buffer_", "(_", "dumps_", "(_", "m_", ")_", ")_", ")_", "for_", "i_", ",_", "m_", "in_", "enumerate_", "(_", "models_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "executemany", "_", "(_", "insert", "\\u", "stmt_", ",_", "vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "stmt_", "=_", "\"", "create", " ", "index", " ", "model", "s", "\\u", "index", " ", "on", " ", "model", "s", " ", "(", "model", "\\u", "idx", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "execute_", "(_", "create", "\\u", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "n", "\\u", "models_", "=_", "len_", "(_", "models_", ")_", "\\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 ", " _", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "._", "execute_", "(_", "\"", "select", " ", "count", "(*", ")", " ", "from", " ", "model", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "n", "\\u", "models_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "curs_", "._", "execute_", "(_", "\"", "select", " ", "model", "\\u", "idx", ",", " ", "weight", " ", "from", " ", "ensembl", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "curs_", "._", "fetchall_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "ensemble_", "[_", "k_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "clu", "ms", "y", " ", "hack", " ", "to", " ", "get", " ", "n", "\\u", "classes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "curs_", "._", "execute_", "(_", "\"", "select", " ", "probs", " ", "from", " ", "model", "\\u", "score", "s", " ", "limit", " ", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "probs_", "=_", "loads_", "(_", "str_", "(_", "r_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "n", "\\u", "classes_", "=_", "probs_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db", "\\u", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fit_", "(_", "self_", ",_", "X_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Perform", " ", "model", " ", "fitting", " ", "and", " ", "ensembl", "e", " ", "buildi", "ng", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "fit", "\\u", "models_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "build", "\\u", "ensemble_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fit", "\\u", "models_", "(_", "self_", ",_", "X_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Perform", " ", "internal", " ", "cross", "-", "validation", " ", "fit", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'\\\\", "nfi", "tting", " ", "model", "s", ":\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "use", "\\u", "bootstrap_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "X_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rs_", "=_", "check", "\\u", "random", "\\u", "state_", "(_", "self_", "._", "random", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "folds_", "=_", "[_", "\\u", "boots", "trap", "s_", "(_", "n_", ",_", "rs_", ")_", "for_", "\\u_", "in_", "xrange_", "(_", "self_", "._", "n", "\\u", "folds_", ")_", "]_", "\\u\\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", "folds_", "=_", "list_", "(_", "Strat", "ified", "KF", "old_", "(_", "y_", ",_", "n", "\\u", "folds_", "=_", "self_", "._", "n", "\\u", "folds_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"", "select", " ", "pickled", "\\u", "model", " ", "from", " ", "model", "s", " ", "where", " ", "model", "\\u", "idx", " ", "=", " ", "?\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "insert", "\\u", "stmt_", "=_", "\"\"\"", "insert", " ", "int", "o", " ", "fitted", "\\u", "model", "s", "\\", "10", ";", " ", " ", " ", "(", "model", "\\u", "idx", ",", " ", "fold", "\\u", "idx", ",", " ", "pickled", "\\u", "model", ")", "\\", "10", ";", " ", " ", " ", "values", " ", "(?,?", ",", "?)", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "conn_", "=_", "sqlite3_", "._", "connect_", "(_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "model", "\\u", "idx_", "in_", "xrange_", "(_", "self_", "._", "\\u", "n", "\\u", "models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", ",_", "[_", "model", "\\u", "idx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pickled", "\\u", "model_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "loads_", "(_", "str_", "(_", "pickled", "\\u", "model_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "folds_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fold", "\\u", "idx_", ",_", "fold_", "in_", "enumerate_", "(_", "self_", "._", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "inds_", ",_", "\\u_", "=_", "fold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "fit_", "(_", "X_", "[_", "train", "\\u", "inds_", "]_", ",_", "y_", "[_", "train", "\\u", "inds_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pickled", "\\u", "model_", "=_", "buffer_", "(_", "dumps_", "(_", "model_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "folds_", "._", "append_", "(_", "(_", "model", "\\u", "idx_", ",_", "fold", "\\u", "idx_", ",_", "pickled", "\\u", "model_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "conn_", "._", "executemany", "_", "(_", "insert", "\\u", "stmt_", ",_", "model", "\\u", "folds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "(_", "model", "\\u", "idx_", "+_", "1_", ")_", "%_", "50_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "'%", "d", "\\\\", "n", "'_", "%_", "(_", "model", "\\u", "idx_", "+_", "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 ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stmt_", "=_", "\"\"\"", "create", " ", "index", " ", "fitted", "\\u", "model", "s", "\\u", "index", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "fitted", "\\u", "model", "s", " ", "(", "model", "\\u", "idx", ",", " ", "fold", "\\u", "idx", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "conn_", "._", "execute_", "(_", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db", "\\u", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "score", "\\u", "models_", "(_", "self_", ",_", "db", "\\u", "conn_", ",_", "X_", ",_", "y_", ",_", "y", "\\u", "bin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "cross", "-", "validat", "ed", " ", "test", " ", "score", "s", " ", "for", " ", "each", " ", "model", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "metric_", "=_", "self_", "._", "\\u", "metrics_", "[_", "self_", "._", "score", "\\u", "metric_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'\\\\", "nsc", "orin", "g", " ", "model", "s", ":\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "insert", "\\u", "stmt_", "=_", "\"\"\"", "insert", " ", "int", "o", " ", "model", "\\u", "score", "s", " ", "(", "model", "\\u", "idx", ",", " ", "score", ",", " ", "probs", ")", "\\", "10", ";", " ", " ", " ", "values", " ", "(?,?", ",", "?)", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"\"\"", "select", " ", "pickled", "\\u", "model", "\\", "10", ";", " ", " ", " ", "from", " ", "fitted", "\\u", "model", "s", "\\", "10", ";", " ", " ", " ", "where", " ", "model", "\\u", "idx", " ", "=", " ", "?", " ", "and", " ", "fold", "\\u", "idx", " ", "=", " ", "?\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nuk", "e", " ", "exist", "ing", " ", "scores_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stmt_", "=_", "\"\"\"", "drop", " ", "index", " ", "if", " ", "exist", "s", " ", "model", "\\u", "score", "s", "\\u", "index", ";", "\\", "10", ";", " ", " ", " ", " ", "delete", " ", "from", " ", "model", "\\u", "score", "s", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "execute", "script_", "(_", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "probs", " ", "array", " ", "usi", "ng", " ", "the", " ", "test", " ", "sets", " ", "for", " ", "each", " ", "internal", " ", "CV", " ", "fold_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "model", "\\u", "idx_", "in_", "xrange_", "(_", "self_", "._", "\\u", "n", "\\u", "models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "probs_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "X_", ")_", ",_", "self_", "._", "\\u", "n", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fold", "\\u", "idx_", ",_", "fold_", "in_", "enumerate_", "(_", "self_", "._", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u_", ",_", "test\\u", "inds_", "=_", "fold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", ",_", "[_", "model", "\\u", "idx_", ",_", "fold", "\\u", "idx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "loads_", "(_", "str_", "(_", "res_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "probs_", "[_", "test\\u", "inds_", "]_", "=_", "model_", "._", "predi", "ct", "\\u", "proba_", "(_", "X_", "[_", "test\\u", "inds_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "score_", "=_", "self_", "._", "\\u", "metric_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "score", " ", "and", " ", "probs", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vals_", "=_", "(_", "model", "\\u", "idx_", ",_", "score_", ",_", "buffer_", "(_", "dumps_", "(_", "probs_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "execute_", "(_", "insert", "\\u", "stmt_", ",_", "vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "(_", "model", "\\u", "idx_", "+_", "1_", ")_", "%_", "50_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "'%", "d", "\\\\", "n", "'_", "%_", "(_", "model", "\\u", "idx_", "+_", "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 ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stmt_", "=_", "\"\"\"", "create", " ", "index", " ", "model", "\\u", "score", "s", "\\u", "index", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "model", "\\u", "score", "s", " ", "(", "model", "\\u", "idx", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "execute_", "(_", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\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", "ensembl", "e\\u", "score_", "(_", "self_", ",_", "db", "\\u", "conn_", ",_", "ensemble_", ",_", "y_", ",_", "y", "\\u", "bin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "score", " ", "for", " ", "model", " ", "ensembl", "e", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "models_", "=_", "float_", "(_", "sum_", "(_", "ensemble_", "._", "values_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "e\\u", "probs_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "y_", ")_", ",_", "self_", "._", "\\u", "n", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"\"\"", "select", " ", "model", "\\u", "idx", ",", " ", "probs", "\\", "10", ";", " ", " ", " ", "from", " ", "model", "\\u", "score", "s", "\\", "10", ";", " ", " ", " ", "where", " ", "model", "\\u", "idx", " ", "in", " ", "%", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in", "\\u", "str_", "=_", "str_", "(_", "tuple_", "(_", "ensemble_", ")_", ")_", "._", "replace_", "(_", "',", ")'_", ",_", "')'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", "%_", "in", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "curs_", "._", "fetchall_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "\\u", "idx_", ",_", "probs_", "=_", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "probs_", "=_", "loads_", "(_", "str_", "(_", "probs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "weight_", "=_", "ensemble_", "[_", "model", "\\u", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "e\\u", "probs_", "+=_", "probs_", "*_", "weight_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ensembl", "e\\u", "probs_", "/=_", "n", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "score_", "=_", "self_", "._", "\\u", "metric_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "ensembl", "e\\u", "probs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "score_", ",_", "ensembl", "e\\u", "probs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "score", "\\u", "with", "\\u", "model_", "(_", "self_", ",_", "db", "\\u", "conn_", ",_", "y_", ",_", "y", "\\u", "bin_", ",_", "probs_", ",_", "n", "\\u", "models_", ",_", "model", "\\u", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "compute", " ", "ensembl", "e", " ", "score", " ", "with", " ", "specified", " ", "model", " ", "adde", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"\"\"", "select", " ", "probs", "\\", "10", ";", " ", " ", " ", "from", " ", "model", "\\u", "score", "s", "\\", "10", ";", " ", " ", " ", "where", " ", "model", "\\u", "idx", " ", "=", " ", "%", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", "%_", "model", "\\u", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "models_", "=_", "float_", "(_", "n", "\\u", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "probs_", "=_", "loads_", "(_", "str_", "(_", "row_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "probs_", "=_", "(_", "probs_", "*_", "n", "\\u", "models_", "+_", "new", "\\u", "probs_", ")_", "/_", "(_", "n", "\\u", "models_", "+_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "score_", "=_", "self_", "._", "\\u", "metric_", "(_", "y_", ",_", "y", "\\u", "bin_", ",_", "new", "\\u", "probs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "score_", ",_", "new", "\\u", "probs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "ensembl", "e\\u", "from", "\\u", "candidates_", "(_", "self_", ",_", "db", "\\u", "conn_", ",_", "candidates_", ",_", "y_", ",_", "y", "\\u", "bin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Build", " ", "an", " ", "ensembl", "e", " ", "from", " ", "a", " ", "list", " ", "of", " ", "candidate", " ", "model", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ensemble_", "=_", "Counter_", "(_", "candidates_", "[_", ":_", "self_", "._", "n", "\\u", "best_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ens", "\\u", "score_", ",_", "ens", "\\u", "probs_", "=_", "self_", "._", "\\u", "get", "\\u", "ensembl", "e\\u", "score_", "(_", "db", "\\u", "conn_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ensemble_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y_", ",_", "y", "\\u", "bin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ens", "\\u", "count_", "=_", "sum_", "(_", "ensemble_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'%", "02", "d", "/", "%", ".3", "f", " ", "'_", "%_", "(_", "ens", "\\u", "count_", ",_", "ens", "\\u", "score_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cand", "\\u", "ensembl", "es_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "ens", "\\u", "count_", "<_", "self_", "._", "max", "\\u", "models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compute", " ", "and", " ", "collect", " ", "score", "s", " ", "after", " ", "addin", "g", " ", "each", " ", "candidate_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "scores_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "new", "\\u", "model", "\\u", "idx_", "in_", "candidates_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", ",_", "\\u_", "=_", "self_", "._", "\\u", "score", "\\u", "with", "\\u", "model_", "(_", "db", "\\u", "conn_", ",_", "y_", ",_", "y", "\\u", "bin_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ens", "\\u", "probs_", ",_", "ens", "\\u", "count_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "model", "\\u", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "scores_", "._", "append_", "(_", "{_", "'", "score", "'_", ":_", "score_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "new", "\\u", "model", "\\u", "idx", "'_", ":_", "new", "\\u", "model", "\\u", "idx_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "scores_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "[_", "'", "score", "'_", "]_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "ens", "\\u", "score_", "=_", "ens", "\\u", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ens", "\\u", "score_", "=_", "new", "\\u", "scores_", "[_", "0_", "]_", "[_", "'", "score", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "self_", "._", "use", "\\u", "epsilon_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "score", " ", "improvement", " ", "is", " ", "less", " ", "than", " ", "eps", "ilon", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "add", " ", "the", " ", "new", " ", "model", " ", "and", " ", "stop_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score", "\\u", "diff_", "=_", "ens", "\\u", "score_", "-_", "last", "\\u", "ens", "\\u", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "score", "\\u", "diff_", "<_", "self_", "._", "epsilon_", ")_", ":_", "\\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_", "new", "\\u", "model", "\\u", "idx_", "=_", "new", "\\u", "scores_", "[_", "0_", "]_", "[_", "'", "new", "\\u", "model", "\\u", "idx", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensemble_", "._", "update_", "(_", "{_", "new", "\\u", "model", "\\u", "idx_", ":_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", ",_", "ens", "\\u", "probs_", "=_", "self_", "._", "\\u", "score", "\\u", "with", "\\u", "model_", "(_", "db", "\\u", "conn_", ",_", "y_", ",_", "y", "\\u", "bin_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ens", "\\u", "probs_", ",_", "ens", "\\u", "count_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "model", "\\u", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "use", "\\u", "epsilon_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "store", " ", "current", " ", "ensembl", "e", " ", "to", " ", "select", " ", "best", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ens", "\\u", "copy_", "=_", "Counter_", "(_", "ensemble_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cand_", "=_", "{_", "'", "ens", "'_", ":_", "ens", "\\u", "copy_", ",_", "'", "score", "'_", ":_", "ens", "\\u", "score_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cand", "\\u", "ensembl", "es_", "._", "append_", "(_", "cand_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ens", "\\u", "count_", "=_", "sum_", "(_", "ensemble_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "(_", "ens", "\\u", "count_", "-_", "self_", "._", "n", "\\u", "best_", ")_", "%_", "8_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "stderr_", "._", "write_", "(_", "\"\\\\", "n", " ", " ", " ", " ", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "'%", "02", "d", "/", "%", ".3", "f", " ", "'_", "%_", "(_", "ens", "\\u", "count_", ",_", "ens", "\\u", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "use", "\\u", "epsilon_", "and_", "ens", "\\u", "count_", "==_", "self_", "._", "max", "\\u", "models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cand", "\\u", "ensembl", "es_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "[_", "'", "score", "'_", "]_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensemble_", "=_", "cand", "\\u", "ensembl", "es_", "[_", "0_", "]_", "[_", "'", "ens", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ensemble_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "best", "\\u", "model_", "(_", "self_", ",_", "curs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "perform", " ", "query", " ", "for", " ", "best", " ", "scor", "ing", " ", "model", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"\"\"", "select", " ", "model", "\\u", "idx", ",", " ", "pickled", "\\u", "model", "\\", "10", ";", " ", " ", " ", "from", " ", "model", "s", "\\", "10", ";", " ", " ", " ", "where", " ", "model", "\\u", "idx", " ", "=", "\\", "10", ";", " ", " ", " ", " ", " ", "(", "select", " ", "model", "\\u", "idx", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "from", " ", "model", "\\u", "score", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "order", " ", "by", " ", "score", " ", "desc", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "limit", " ", "1", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "row_", "[_", "0_", "]_", ",_", "loads_", "(_", "str_", "(_", "row_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "best", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "best", " ", "model", " ", "found", " ", "after", " ", "CV", " ", "scor", "ing", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "conn_", "=_", "sqlite3_", "._", "connect_", "(_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", ",_", "model_", "=_", "self_", "._", "\\u", "get", "\\u", "best", "\\u", "model_", "(_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "print", "\\u", "best", "\\u", "results_", "(_", "self_", ",_", "curs_", ",_", "best", "\\u", "model", "\\u", "score_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Show", " ", "best", " ", "model", " ", "and", " ", "score", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "Bes", "t", " ", "model", " ", "CV", " ", "score", ":", " ", "%", ".5", "f", "\\\\", "n", "'_", "%_", "best", "\\u", "model", "\\u", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", ",_", "best", "\\u", "model_", "=_", "self_", "._", "\\u", "get", "\\u", "best", "\\u", "model_", "(_", "curs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "Bes", "t", " ", "model", ":", " ", "%", "s", "\\\\", "n", "\\\\", "n", "'_", "%_", "repr_", "(_", "best", "\\u", "model_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "ensemble_", "(_", "self_", ",_", "X_", ",_", "y_", ",_", "resc", "ore_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "bag", "ged", " ", "ensembl", "e", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "n", "\\u", "classes_", "=_", "len_", "(_", "np_", "._", "unique_", "(_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "conn_", "=_", "sqlite3_", "._", "connect_", "(_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "binar", "ize_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "self_", "._", "\\u", "n", "\\u", "classes_", ">_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y", "\\u", "bin_", "=_", "Label", "Bin", "ari", "zer_", "(_", ")_", "._", "fit", "\\u", "transform_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y", "\\u", "bin_", "=_", "np_", "._", "column", "\\u", "stack_", "(_", "(_", "1_", "-_", "y_", ",_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "CV", " ", "score", "s", " ", "for", " ", "fitted", " ", "models_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "resc", "ore_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "score", "\\u", "models_", "(_", "db", "\\u", "conn_", ",_", "X_", ",_", "y_", ",_", "y", "\\u", "bin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "number", " ", "of", " ", "best", " ", "model", "s", " ", "to", " ", "take_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n", "\\u", "models_", "=_", "int_", "(_", "self_", "._", "\\u", "n", "\\u", "models_", "*_", "(_", "1.0_", "-_", "self_", "._", "prune", "\\u", "fraction_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bag", "\\u", "size_", "=_", "int_", "(_", "self_", "._", "bag", "\\u", "fraction_", "*_", "n", "\\u", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'%", "d", " ", "model", "s", " ", "left", " ", "after", " ", "prun", "ing", "\\\\", "n", "'_", "%_", "n", "\\u", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "leaving", " ", "%", "d", " ", "candidate", "s", " ", "per", " ", "bag", "\\\\", "n", "\\\\", "n", "'_", "%_", "bag", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "indice", "s", " ", "and", " ", "score", "s", " ", "from", " ", "DB_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"\"\"", "select", " ", "model", "\\u", "idx", ",", " ", "score", "\\", "10", ";", " ", " ", " ", "from", " ", "model", "\\u", "score", "s", "\\", "10", ";", " ", " ", " ", "order", " ", "by", " ", "score", " ", "desc", "\\", "10", ";", " ", " ", " ", "limit", " ", "%", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", "%_", "n", "\\u", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ranked", "\\u", "model", "\\u", "scores_", "=_", "[_", "(_", "r_", "[_", "0_", "]_", ",_", "r_", "[_", "1_", "]_", ")_", "for_", "r_", "in_", "curs_", "._", "fetchall_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "best", " ", "perform", "ing", " ", "model", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "best", "\\u", "model", "\\u", "score_", "=_", "ranked", "\\u", "model", "\\u", "scores_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "print", "\\u", "best", "\\u", "results_", "(_", "curs_", ",_", "best", "\\u", "model", "\\u", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "\"", "Ensemble", " ", "score", "s", " ", "for", " ", "each", " ", "bag", " ", "(", "size", "/", "score", "):", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ensembl", "es_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "bag", "s", " ", "and", " ", "ensembl", "es_", "\\u\\u\\uNL\\u\\u\\u_", "rs_", "=_", "check", "\\u", "random", "\\u", "state_", "(_", "self_", "._", "random", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "self_", "._", "n", "\\u", "bag", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "bag", "\\u", "size", " ", "element", "s", " ", "at", " ", "random_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cand", "\\u", "indices_", "=_", "rs_", "._", "permutation_", "(_", "n", "\\u", "models_", ")_", "[_", ":_", "bag", "\\u", "size_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sort", " ", "by", " ", "rank_", "\\u\\u\\uNL\\u\\u\\u_", "candidates_", "=_", "[_", "ranked", "\\u", "model", "\\u", "scores_", "[_", "ci_", "]_", "[_", "0_", "]_", "for_", "ci_", "in_", "cand", "\\u", "indices_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "Bag", " ", "%", "02", "d", "):", " ", "'_", "%_", "(_", "i_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "an", " ", "ensembl", "e", " ", "with", " ", "current", " ", "candidates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ensemble_", "=_", "self_", "._", "\\u", "ensembl", "e\\u", "from", "\\u", "candidates_", "(_", "db", "\\u", "conn_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "candidates_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y_", ",_", "y", "\\u", "bin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "es_", "._", "append_", "(_", "ensemble_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "combin", "e", " ", "ensembl", "es", " ", "from", " ", "each", " ", "bag_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "e_", "in_", "ensembl", "es_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "ensemble_", "+=_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "push", " ", "to", " ", "DB_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "insert", "\\u", "stmt_", "=_", "\"", "insert", " ", "int", "o", " ", "ensembl", "e", "(", "model", "\\u", "idx", ",", " ", "weight", ")", " ", "values", " ", "(?", ",", " ", "?)\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "db", "\\u", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val", "\\u", "gen_", "=_", "(_", "(_", "mi_", ",_", "w_", ")_", "for_", "mi_", ",_", "w_", "in_", "self_", "._", "\\u", "ensemble_", "._", "most", "\\u", "common_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "executemany", "_", "(_", "insert", "\\u", "stmt_", ",_", "val", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "verbose_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", ",_", "\\u_", "=_", "self_", "._", "\\u", "get", "\\u", "ensembl", "e\\u", "score_", "(_", "db", "\\u", "conn_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "ensemble_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y_", ",_", "y", "\\u", "bin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fmt_", "=_", "\"\\\\", "n", "Final", " ", "ensembl", "e", " ", "(%", "d", " ", "component", "s", ")", " ", "CV", " ", "score", ":", " ", "%", ".5", "f", "\\\\", "n", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "fmt_", "%_", "(_", "sum_", "(_", "self_", "._", "\\u", "ensemble_", "._", "values_", "(_", ")_", ")_", ",_", "score_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db", "\\u", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "model", "\\u", "predi", "ct", "\\u", "proba_", "(_", "self_", ",_", "X_", ",_", "model", "\\u", "idx_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "probabilit", "y", " ", "predicti", "ons", " ", "for", " ", "a", " ", "model", " ", "give", "n", " ", "its", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "conn_", "=_", "sqlite3_", "._", "connect_", "(_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curs_", "=_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "select", "\\u", "stmt_", "=_", "\"\"\"", "select", " ", "pickled", "\\u", "model", "\\", "10", ";", " ", " ", " ", "from", " ", "fitted", "\\u", "model", "s", "\\", "10", ";", " ", " ", " ", "where", " ", "model", "\\u", "idx", " ", "=", " ", "?", " ", "and", " ", "fold", "\\u", "idx", " ", "=", " ", "?\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "averag", "e", " ", "probs", " ", "over", " ", "each", " ", "n", "\\u", "fold", "s", " ", "models_", "\\u\\u\\uNL\\u\\u\\u_", "probs_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "X_", ")_", ",_", "self_", "._", "\\u", "n", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fold", "\\u", "idx_", "in_", "xrange_", "(_", "self_", "._", "n", "\\u", "folds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "curs_", "._", "execute_", "(_", "select", "\\u", "stmt_", ",_", "[_", "model", "\\u", "idx_", ",_", "fold", "\\u", "idx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "curs_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "loads_", "(_", "str_", "(_", "res_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "probs_", "+=_", "model_", "._", "predi", "ct", "\\u", "proba_", "(_", "X_", ")_", "/_", "float_", "(_", "self_", "._", "n", "\\u", "folds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db", "\\u", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "probs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "best", "\\u", "model", "\\u", "predi", "ct", "\\u", "proba_", "(_", "self_", ",_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Probabili", "ty", " ", "estimate", "s", " ", "for", " ", "all", " ", "classe", "s", " ", "(", "order", "ed", " ", "by", " ", "class", " ", "label", ")", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "best", " ", "model", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "conn_", "=_", "sqlite3_", "._", "connect_", "(_", "self_", "._", "db", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "model", "\\u", "idx_", ",_", "\\u_", "=_", "self_", "._", "\\u", "get", "\\u", "best", "\\u", "model_", "(_", "db", "\\u", "conn_", "._", "cursor_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "model", "\\u", "predi", "ct", "\\u", "proba_", "(_", "X_", ",_", "best", "\\u", "model", "\\u", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "best", "\\u", "model", "\\u", "predict_", "(_", "self_", ",_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Predic", "t", " ", "class", " ", "labels", " ", "for", " ", "samples", " ", "in", " ", "X", " ", "usi", "ng", " ", "best", " ", "model", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "np_", "._", "argmax_", "(_", "self_", "._", "best", "\\u", "model", "\\u", "predi", "ct", "\\u", "proba_", "(_", "X_", ")_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "\\u", "proba_", "(_", "self_", ",_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Probabili", "ty", " ", "estimate", "s", " ", "for", " ", "all", " ", "classe", "s", " ", "(", "order", "ed", " ", "by", " ", "class", " ", "label", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "models_", "=_", "float_", "(_", "sum_", "(_", "self_", "._", "\\u", "ensemble_", "._", "values_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "probs_", "=_", "np_", "._", "zeros_", "(_", "(_", "len_", "(_", "X_", ")_", ",_", "self_", "._", "\\u", "n", "\\u", "classes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "model", "\\u", "idx_", ",_", "weight_", "in_", "self_", "._", "\\u", "ensemble_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "probs_", "+=_", "self_", "._", "\\u", "model", "\\u", "predi", "ct", "\\u", "proba_", "(_", "X_", ",_", "model", "\\u", "idx_", ")_", "*_", "weight_", "/_", "n", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "probs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ensemble", "Selecti", "on", "Classifier_", "(_", "Base", "Estimator_", ",_", "Classif", "ier", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predict_", "(_", "self_", ",_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Predic", "t", " ", "class", " ", "labels", " ", "for", " ", "samples", " ", "in", " ", "X", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "np_", "._", "argmax_", "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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
enthought/traitsui/traitsui/wx/ui_panel.py
[ { "content": " def add_items ( self, content, panel, sizer ):\n \"\"\" Adds a list of Item objects to the panel.\n \"\"\"\n # Get local references to various objects we need:\n ui = self.ui\n info = ui.info\n handler = ui.handler\n\n group = self.group\n show_left = group.show_left\n padding = group.padding\n col = -1\n col_incr = 1\n self.label_flags = 0\n show_labels = False\n for item in content:\n show_labels |= item.show_label\n if (not self.is_horizontal) and (show_labels or (group.columns > 1)):\n # For a vertical list of Items with labels or multiple columns, use\n # a 'FlexGridSizer':\n self.label_pad = 0\n cols = group.columns\n if show_labels:\n cols *= 2\n col_incr = 2\n flags = wx.TOP | wx.BOTTOM\n border_size = 1\n item_sizer = wx.FlexGridSizer( 0, cols, 0, 5 )\n if show_left:\n self.label_flags = wx.ALIGN_RIGHT\n if show_labels:\n for i in range( 1, cols, 2 ):\n item_sizer.AddGrowableCol( i )\n else:\n # Otherwise, the current sizer will work as is:\n self.label_pad = 4\n cols = 1\n flags = wx.ALL\n border_size = 1\n item_sizer = sizer\n\n # Process each Item in the list:\n for item in content:\n\n # Get the item theme (if any):\n theme = item.item_theme\n\n # Get the name in order to determine its type:\n name = item.name\n\n # Check if is a label:\n if name == '':\n label = item.label\n if label != '':\n # Update the column counter:\n col += col_incr\n\n # If we are building a multi-column layout with labels,\n # just add space in the next column:\n if (cols > 1) and show_labels:\n item_sizer.Add( ( 1, 1 ) )\n\n if theme is not None:\n from image_text import ImageText\n\n label = ImageText( panel, theme, label )\n item_sizer.Add( label, 0, wx.EXPAND )\n elif item.style == 'simple':\n # Add a simple text label:\n label = wx.StaticText( panel, -1, label,\n style = wx.ALIGN_LEFT )\n item_sizer.Add( label, 0, wx.EXPAND )\n else:\n # Add the label to the sizer:\n label = heading_text( panel, text = label ).control\n item_sizer.Add( label, 0,\n wx.TOP | wx.BOTTOM | wx.EXPAND, 3 )\n\n if item.emphasized:\n self._add_emphasis( label )\n\n # Continue on to the next Item in the list:\n continue\n\n # Update the column counter:\n col += col_incr\n\n # Check if it is a separator:\n if name == '_':\n for i in range( cols ):\n if self.is_horizontal:\n # Add a vertical separator:\n line = wx.StaticLine( panel, -1,\n style = wx.LI_VERTICAL )\n item_sizer.Add( line, 0,\n wx.LEFT | wx.RIGHT | wx.EXPAND, 2 )\n else:\n # Add a horizontal separator:\n line = wx.StaticLine( panel, -1,\n style = wx.LI_HORIZONTAL )\n item_sizer.Add( line, 0,\n wx.TOP | wx.BOTTOM | wx.EXPAND, 2 )\n self._set_owner( line, item )\n # Continue on to the next Item in the list:\n continue\n\n # Convert a blank to a 5 pixel spacer:\n if name == ' ':\n name = '5'\n\n # Check if it is a spacer:\n if all_digits.match( name ):\n\n # If so, add the appropriate amount of space to the sizer:\n n = int( name )\n if self.is_horizontal:\n item_sizer.Add( ( n, 1 ) )\n else:\n spacer = ( 1, n )\n item_sizer.Add( spacer )\n if show_labels:\n item_sizer.Add( spacer )\n\n # Continue on to the next Item in the list:\n continue\n\n # Otherwise, it must be a trait Item:\n object = eval( item.object_, globals(), ui.context )\n trait = object.base_trait( name )\n desc = trait.desc or ''\n label = None\n\n # If we are displaying labels on the left, add the label to the\n # user interface:\n if show_left:\n if item.show_label:\n label = self.create_label( item, ui, desc, panel,\n item_sizer,\n border=group.show_border )\n elif (cols > 1) and show_labels:\n label = self.dummy_label( panel, item_sizer )\n\n # Get the editor factory associated with the Item:\n editor_factory = item.editor\n if editor_factory is None:\n editor_factory = trait.get_editor()\n\n # If still no editor factory found, use a default text editor:\n if editor_factory is None:\n from text_editor import ToolkitEditorFactory\n editor_factory = ToolkitEditorFactory()\n\n # If the item has formatting traits set them in the editor\n # factory:\n if item.format_func is not None:\n editor_factory.format_func = item.format_func\n\n if item.format_str != '':\n editor_factory.format_str = item.format_str\n\n # If the item has an invalid state extended trait name, set it\n # in the editor factory:\n if item.invalid != '':\n editor_factory.invalid = item.invalid\n\n # Set up the background image (if used):\n item_panel = panel\n if theme is not None:\n from image_panel import ImagePanel\n\n text = ''\n if item.show_label:\n text = item.get_label( ui )\n image_panel = ImagePanel( theme = theme, text = text )\n item_panel = image_panel.create_control( panel )\n\n # Create the requested type of editor from the editor factory:\n factory_method = getattr( editor_factory, item.style + '_editor' )\n editor = factory_method( ui, object, name, item.tooltip,\n item_panel ).set(\n item = item,\n object_name = item.object )\n\n # Tell editor to actually build the editing widget:\n editor.prepare( item_panel )\n\n # Set the initial 'enabled' state of the editor from the factory:\n editor.enabled = editor_factory.enabled\n\n # Add emphasis to the editor control if requested:\n if item.emphasized:\n self._add_emphasis( editor.control )\n\n # Give the editor focus if it requested it:\n if item.has_focus:\n editor.control.SetFocus()\n\n # Adjust the maximum border size based on the editor's settings:\n border_size = min( border_size, editor.border_size )\n\n # Set up the reference to the correct 'control' to use in the\n # following section, depending upon whether we have wrapped an\n # ImagePanel around the editor control or not:\n control = editor.control\n if theme is None:\n width, height = control.GetSizeTuple()\n else:\n item_panel.GetSizer().Add( control, 1, wx.EXPAND )\n control = item_panel\n width, height = image_panel.adjusted_size\n\n # Set the correct size on the control, as specified by the user:\n scrollable = editor.scrollable\n item_width = item.width\n item_height = item.height\n growable = 0\n if (item_width != -1.0) or (item_height != -1.0):\n if (0.0 < item_width <= 1.0) and self.is_horizontal:\n growable = int( 1000.0 * item_width )\n item_width = -1\n\n item_width = int( item_width )\n if item_width < -1:\n item_width = -item_width\n elif item_width != -1:\n item_width = max( item_width, width )\n\n if (0.0 < item_height <= 1.0) and (not self.is_horizontal):\n growable = int( 1000.0 * item_height )\n item_height = -1\n\n item_height = int( item_height )\n if item_height < -1:\n item_height = -item_height\n elif item_height != -1:\n item_height = max( item_height, height )\n\n control.SetMinSize( wx.Size( item_width, item_height ) )\n\n # Bind the item to the control and all of its children:\n self._set_owner( control, item )\n\n # Bind the editor into the UIInfo object name space so it can be\n # referred to by a Handler while the user interface is active:\n id = item.id or name\n info.bind( id, editor, item.id )\n\n # Also, add the editors to the list of editors used to construct\n # the user interface:\n ui._editors.append( editor )\n\n # If the handler wants to be notified when the editor is created,\n # add it to the list of methods to be called when the UI is\n # complete:\n defined = getattr( handler, id + '_defined', None )\n if defined is not None:\n ui.add_defined( defined )\n\n # If the editor is conditionally visible, add the visibility\n # 'expression' and the editor to the UI object's list of monitored\n # objects:\n if item.visible_when != '':\n ui.add_visible( item.visible_when, editor )\n\n # If the editor is conditionally enabled, add the enabling\n # 'expression' and the editor to the UI object's list of monitored\n # objects:\n if item.enabled_when != '':\n ui.add_enabled( item.enabled_when, editor )\n\n # Add the created editor control to the sizer with the appropriate\n # layout flags and values:\n ui._scrollable |= scrollable\n item_resizable = ((item.resizable is True) or\n ((item.resizable is Undefined) and scrollable))\n if item_resizable:\n growable = growable or 500\n self.resizable = True\n elif item.springy:\n growable = growable or 500\n\n # The following is a hack to allow 'readonly' text fields to\n # work correctly (wx has a bug that setting wx.EXPAND on a\n # StaticText control seems to cause the text to be aligned higher\n # than it would be otherwise, causing it to misalign with its\n # label).\n layout_style = editor.layout_style\n if not show_labels:\n layout_style |= wx.EXPAND\n\n item_sizer.Add( control, growable,\n flags | layout_style | wx.ALIGN_CENTER_VERTICAL,\n max( 0, border_size + padding + item.padding ) )\n\n # If we are displaying labels on the right, add the label to the\n # user interface:\n if not show_left:\n if item.show_label:\n label = self.create_label( item, ui, desc, panel,\n item_sizer, '', wx.RIGHT )\n elif (cols > 1) and show_labels:\n label = self.dummy_label( panel, item_sizer )\n\n # If the Item is resizable, and we are using a multi-column grid:\n if item_resizable and (cols > 1):\n # Mark the entire row as growable:\n item_sizer.AddGrowableRow( col / cols )\n\n # Save the reference to the label control (if any) in the editor:\n editor.label_control = label\n\n # If we created a grid sizer, add it to the original sizer:\n if item_sizer is not sizer:\n growable = 0\n if self.resizable:\n growable = 1\n\n sizer.Add( item_sizer, growable, wx.EXPAND | wx.ALL, 2 )", "metadata": "root.FillPanel.add_items", "header": "['class', 'FillPanel', '(', 'object', ')', ':', '___EOS___']", "index": 835 } ]
[]
[]
0
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Fil", "l", "Panel_", "(_", "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_", "add", "\\u", "items_", "(_", "self_", ",_", "content_", ",_", "panel_", ",_", "sizer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Add", "s", " ", "a", " ", "list", " ", "of", " ", "Item", " ", "object", "s", " ", "to", " ", "the", " ", "panel", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "local", " ", "reference", "s", " ", "to", " ", "vari", "ous", " ", "object", "s", " ", "we", " ", "need", ":_", "\\u\\u\\uNL\\u\\u\\u_", "ui_", "=_", "self_", "._", "ui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "ui_", "._", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "ui_", "._", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "self_", "._", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "\\u", "left_", "=_", "group_", "._", "show", "\\u", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "padding_", "=_", "group_", "._", "padding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "\\u", "incr_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "label", "\\u", "flags_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "\\u", "labels_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "show", "\\u", "labels_", "|=_", "item_", "._", "show", "\\u", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "is", "\\u", "horizontal_", ")_", "and_", "(_", "show", "\\u", "labels_", "or_", "(_", "group_", "._", "columns_", ">_", "1_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "a", " ", "vertical", " ", "list", " ", "of", " ", "Item", "s", " ", "with", " ", "labels", " ", "or", " ", "multiple", " ", "column", "s", ",", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "'", "Fle", "x", "Grid", "Sizer", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "label", "\\u", "pad_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cols_", "=_", "group_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "*=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "\\u", "incr_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flags_", "=_", "wx_", "._", "TOP_", "|_", "wx_", "._", "BOTTOM_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "border", "\\u", "size_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "=_", "wx_", "._", "Fle", "x", "Grid", "Sizer_", "(_", "0_", ",_", "cols_", ",_", "0_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "show", "\\u", "left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "label", "\\u", "flags_", "=_", "wx_", "._", "ALIGN", "\\u", "RIGHT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "cols_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "item", "\\u", "sizer_", "._", "Add", "Grow", "able", "Col_", "(_", "i_", ")_", "\\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_", "#", " ", "Ot", "her", "wis", "e", ",", " ", "the", " ", "current", " ", "sizer", " ", "will", " ", "work", " ", "as", " ", "is", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "label", "\\u", "pad_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cols_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "wx_", "._", "ALL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "border", "\\u", "size_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "=_", "sizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Process", " ", "each", " ", "Item", " ", "in", " ", "the", " ", "list", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item_", "in_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "item", " ", "them", "e", " ", "(", "if", " ", "any", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "theme_", "=_", "item_", "._", "item", "\\u", "theme_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "name", " ", "in", " ", "order", " ", "to", " ", "dete", "rmin", "e", " ", "its", " ", "type", ":_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "item_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "is", " ", "a", " ", "label", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label_", "=_", "item_", "._", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "label_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Update", " ", "the", " ", "column", " ", "counter", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "col_", "+=_", "col", "\\u", "incr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "are", " ", "buildi", "ng", " ", "a", " ", "multi", "-", "column", " ", "layout", " ", "with", " ", "labels", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "add", " ", "space", " ", "in", " ", "the", " ", "next", " ", "column", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "cols_", ">_", "1_", ")_", "and_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "item", "\\u", "sizer_", "._", "Add_", "(_", "(_", "1_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "theme_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "from_", "image", "\\u", "text_", "import_", "Image", "Text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "Image", "Text_", "(_", "panel_", ",_", "theme_", ",_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "label_", ",_", "0_", ",_", "wx_", "._", "EXPAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "item_", "._", "style_", "==_", "'", "simple", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "simple", " ", "text", " ", "label", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "label_", "=_", "wx_", "._", "Static", "Text_", "(_", "panel_", ",_", "-_", "1_", ",_", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "wx_", "._", "ALIGN", "\\u", "LEFT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "label_", ",_", "0_", ",_", "wx_", "._", "EXPAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "label", " ", "to", " ", "the", " ", "sizer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "label_", "=_", "heading", "\\u", "text_", "(_", "panel_", ",_", "text_", "=_", "label_", ")_", "._", "control_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "label_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wx_", "._", "TOP_", "|_", "wx_", "._", "BOTTOM_", "|_", "wx_", "._", "EXPAND_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "empha", "sized", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "add", "\\u", "empha", "sis_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Continu", "e", " ", "on", " ", "to", " ", "the", " ", "next", " ", "Item", " ", "in", " ", "the", " ", "list", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Update", " ", "the", " ", "column", " ", "counter", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "col_", "+=_", "col", "\\u", "incr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "it", " ", "is", " ", "a", " ", "separator", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "==_", "'\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "cols_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "is", "\\u", "horizontal_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "vertical", " ", "separator", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "line_", "=_", "wx_", "._", "Static", "Line_", "(_", "panel_", ",_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "wx_", "._", "LI", "\\u", "VERTICAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "line_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wx_", "._", "LEFT_", "|_", "wx_", "._", "RIGHT_", "|_", "wx_", "._", "EXPAND_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "horizon", "tal", " ", "separator", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "line_", "=_", "wx_", "._", "Static", "Line_", "(_", "panel_", ",_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "wx_", "._", "LI", "\\u", "HORIZONTAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "line_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wx_", "._", "TOP_", "|_", "wx_", "._", "BOTTOM_", "|_", "wx_", "._", "EXPAND_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "set\\u", "owner_", "(_", "line_", ",_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Continu", "e", " ", "on", " ", "to", " ", "the", " ", "next", " ", "Item", " ", "in", " ", "the", " ", "list", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "a", " ", "blank", " ", "to", " ", "a", " ", "5", " ", "pixel", " ", "spacer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "==_", "'", " ", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "it", " ", "is", " ", "a", " ", "spacer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "all", "\\u", "digits_", "._", "match_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "so", ",", " ", "add", " ", "the", " ", "appropr", "iate", " ", "amo", "unt", " ", "of", " ", "space", " ", "to", " ", "the", " ", "sizer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "int_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "horizontal_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "item", "\\u", "sizer_", "._", "Add_", "(_", "(_", "n_", ",_", "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 ", " ", "_", "spacer", "_", "=_", "(_", "1_", ",_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "spacer", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "item", "\\u", "sizer_", "._", "Add_", "(_", "spacer", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Continu", "e", " ", "on", " ", "to", " ", "the", " ", "next", " ", "Item", " ", "in", " ", "the", " ", "list", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", ",", " ", "it", " ", "must", " ", "be", " ", "a", " ", "tra", "it", " ", "Item", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "object_", "=_", "eval_", "(_", "item_", "._", "object\\u", "_", ",_", "globals_", "(_", ")_", ",_", "ui_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trait_", "=_", "object_", "._", "base", "\\u", "trait_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc_", "=_", "trait_", "._", "desc_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "are", " ", "display", "ing", " ", "labels", " ", "on", " ", "the", " ", "left", ",", " ", "add", " ", "the", " ", "label", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "user", " ", "interface", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "show", "\\u", "left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "._", "show", "\\u", "label_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "label_", "=_", "self_", "._", "create", "\\u", "label_", "(_", "item_", ",_", "ui_", ",_", "desc_", ",_", "panel_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "item", "\\u", "sizer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "border_", "=_", "group_", "._", "show", "\\u", "border_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "cols_", ">_", "1_", ")_", "and_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "label_", "=_", "self_", "._", "dummy", "\\u", "label_", "(_", "panel_", ",_", "item", "\\u", "sizer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "editor", " ", "factor", "y", " ", "associate", "d", " ", "with", " ", "the", " ", "Item", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "editor", "\\u", "factory_", "=_", "item_", "._", "editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "editor", "\\u", "factory_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "editor", "\\u", "factory_", "=_", "trait_", "._", "get", "\\u", "editor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "still", " ", "no", " ", "editor", " ", "factor", "y", " ", "found", ",", " ", "use", " ", "a", " ", "default", " ", "text", " ", "editor", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "editor", "\\u", "factory_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "from_", "text", "\\u", "editor_", "import_", "Tool", "kit", "Edit", "or", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "editor", "\\u", "factory_", "=_", "Tool", "kit", "Edit", "or", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "item", " ", "has", " ", "format", "ting", " ", "traits", " ", "set", " ", "them", " ", "in", " ", "the", " ", "editor_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "factor", "y", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "format\\u", "func_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "editor", "\\u", "factory_", "._", "format\\u", "func_", "=_", "item_", "._", "format\\u", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "format\\u", "str_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "editor", "\\u", "factory_", "._", "format\\u", "str_", "=_", "item_", "._", "format\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "item", " ", "has", " ", "an", " ", "invalid", " ", "state", " ", "extend", "ed", " ", "tra", "it", " ", "name", ",", " ", "set", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "editor", " ", "factor", "y", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "invalid_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "editor", "\\u", "factory_", "._", "invalid_", "=_", "item_", "._", "invalid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "the", " ", "background", " ", "image", " ", "(", "if", " ", "used", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "panel_", "=_", "panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "theme_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "image", "\\u", "panel_", "import_", "Image", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item_", "._", "show", "\\u", "label_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "text_", "=_", "item_", "._", "get", "\\u", "label_", "(_", "ui_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "image", "\\u", "panel_", "=_", "Image", "Panel_", "(_", "theme_", "=_", "theme_", ",_", "text_", "=_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "panel_", "=_", "image", "\\u", "panel_", "._", "create", "\\u", "control_", "(_", "panel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "request", "ed", " ", "type", " ", "of", " ", "editor", " ", "from", " ", "the", " ", "editor", " ", "factor", "y", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "factor", "y", "\\u", "method_", "=_", "getattr_", "(_", "editor", "\\u", "factory_", ",_", "item_", "._", "style_", "+_", "'\\u", "editor", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "editor_", "=_", "factor", "y", "\\u", "method_", "(_", "ui_", ",_", "object_", ",_", "name_", ",_", "item_", "._", "tooltip_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "item", "\\u", "panel_", ")_", "._", "set_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "item_", "=_", "item_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "object\\u", "name_", "=_", "item_", "._", "object_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tell", " ", "editor", " ", "to", " ", "actual", "ly", " ", "build", " ", "the", " ", "editin", "g", " ", "widget", ":_", "\\u\\u\\uNL\\u\\u\\u_", "editor_", "._", "prepare_", "(_", "item", "\\u", "panel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "initial", " ", "'", "enable", "d", "'", " ", "state", " ", "of", " ", "the", " ", "editor", " ", "from", " ", "the", " ", "factor", "y", ":_", "\\u\\u\\uNL\\u\\u\\u_", "editor_", "._", "enabled_", "=_", "editor", "\\u", "factory_", "._", "enabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "empha", "sis", " ", "to", " ", "the", " ", "editor", " ", "control", " ", "if", " ", "request", "ed", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "item_", "._", "empha", "sized", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "add", "\\u", "empha", "sis_", "(_", "editor_", "._", "control_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Give", " ", "the", " ", "editor", " ", "foc", "us", " ", "if", " ", "it", " ", "request", "ed", " ", "it", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "has", "\\u", "focus_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "editor_", "._", "control_", "._", "Set", "Focus_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Adjust", " ", "the", " ", "maxim", "um", " ", "border", " ", "size", " ", "based", " ", "on", " ", "the", " ", "editor", "'", "s", " ", "settings", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "border", "\\u", "size_", "=_", "min_", "(_", "border", "\\u", "size_", ",_", "editor_", "._", "border", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "the", " ", "reference", " ", "to", " ", "the", " ", "correct", " ", "'", "control", "'", " ", "to", " ", "use", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "follow", "ing", " ", "section", ",", " ", "depend", "ing", " ", "upo", "n", " ", "whe", "ther", " ", "we", " ", "have", " ", "wrapp", "ed", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Image", "Pane", "l", " ", "aro", "und", " ", "the", " ", "editor", " ", "control", " ", "or", " ", "not", ":_", "\\u\\u\\uNL\\u\\u\\u_", "control_", "=_", "editor_", "._", "control_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "theme_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "width_", ",_", "height_", "=_", "control_", "._", "Get", "Size", "Tuple_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item", "\\u", "panel_", "._", "Get", "Sizer_", "(_", ")_", "._", "Add_", "(_", "control_", ",_", "1_", ",_", "wx_", "._", "EXPAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "=_", "item", "\\u", "panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", ",_", "height_", "=_", "image", "\\u", "panel_", "._", "adjusted", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "correct", " ", "size", " ", "on", " ", "the", " ", "control", ",", " ", "as", " ", "specified", " ", "by", " ", "the", " ", "user", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scroll", "able_", "=_", "editor_", "._", "scroll", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "width_", "=_", "item_", "._", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "height_", "=_", "item_", "._", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grow", "able_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "item", "\\u", "width_", "!=_", "-_", "1.0_", ")_", "or_", "(_", "item", "\\u", "height_", "!=_", "-_", "1.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "0.0_", "<_", "item", "\\u", "width_", "<=_", "1.0_", ")_", "and_", "self_", "._", "is", "\\u", "horizontal_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "grow", "able_", "=_", "int_", "(_", "1000.0_", "*_", "item", "\\u", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "width_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "width_", "=_", "int_", "(_", "item", "\\u", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item", "\\u", "width_", "<_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "item", "\\u", "width_", "=_", "-_", "item", "\\u", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "item", "\\u", "width_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "item", "\\u", "width_", "=_", "max_", "(_", "item", "\\u", "width_", ",_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "0.0_", "<_", "item", "\\u", "height_", "<=_", "1.0_", ")_", "and_", "(_", "not_", "self_", "._", "is", "\\u", "horizontal_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "grow", "able_", "=_", "int_", "(_", "1000.0_", "*_", "item", "\\u", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "height_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "height_", "=_", "int_", "(_", "item", "\\u", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item", "\\u", "height_", "<_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "item", "\\u", "height_", "=_", "-_", "item", "\\u", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "item", "\\u", "height_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "item", "\\u", "height_", "=_", "max_", "(_", "item", "\\u", "height_", ",_", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "control_", "._", "Set", "Min", "Size_", "(_", "wx_", "._", "Size_", "(_", "item", "\\u", "width_", ",_", "item", "\\u", "height_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bind", " ", "the", " ", "item", " ", "to", " ", "the", " ", "control", " ", "and", " ", "all", " ", "of", " ", "its", " ", "child", "ren", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "set\\u", "owner_", "(_", "control_", ",_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bind", " ", "the", " ", "editor", " ", "int", "o", " ", "the", " ", "UI", "Info", " ", "object", " ", "name", " ", "space", " ", "so", " ", "it", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "referred", " ", "to", " ", "by", " ", "a", " ", "Handle", "r", " ", "whi", "le", " ", "the", " ", "user", " ", "interface", " ", "is", " ", "active", ":_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "item_", "._", "id_", "or_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "._", "bind_", "(_", "id_", ",_", "editor_", ",_", "item_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", ",", " ", "add", " ", "the", " ", "editors", " ", "to", " ", "the", " ", "list", " ", "of", " ", "editors", " ", "used", " ", "to", " ", "construct_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "user", " ", "interface", ":_", "\\u\\u\\uNL\\u\\u\\u_", "ui_", "._", "\\u", "editors", "_", "._", "append_", "(_", "editor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "handler", " ", "want", "s", " ", "to", " ", "be", " ", "notified", " ", "whe", "n", " ", "the", " ", "editor", " ", "is", " ", "created", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "it", " ", "to", " ", "the", " ", "list", " ", "of", " ", "method", "s", " ", "to", " ", "be", " ", "call", "ed", " ", "whe", "n", " ", "the", " ", "UI", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "complete", ":_", "\\u\\u\\uNL\\u\\u\\u_", "defined_", "=_", "getattr_", "(_", "handler_", ",_", "id_", "+_", "'\\u", "defin", "ed", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "defined_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ui_", "._", "add", "\\u", "defined_", "(_", "defined_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "editor", " ", "is", " ", "conditional", "ly", " ", "visi", "ble", ",", " ", "add", " ", "the", " ", "visibility_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "express", "ion", "'", " ", "and", " ", "the", " ", "editor", " ", "to", " ", "the", " ", "UI", " ", "object", "'", "s", " ", "list", " ", "of", " ", "monitored", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "visi", "ble", "\\u", "when_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ui_", "._", "add", "\\u", "visible_", "(_", "item_", "._", "visi", "ble", "\\u", "when_", ",_", "editor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "editor", " ", "is", " ", "conditional", "ly", " ", "enable", "d", ",", " ", "add", " ", "the", " ", "ena", "blin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "express", "ion", "'", " ", "and", " ", "the", " ", "editor", " ", "to", " ", "the", " ", "UI", " ", "object", "'", "s", " ", "list", " ", "of", " ", "monitored", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "enable", "d\\u", "when_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ui_", "._", "add", "\\u", "enabled_", "(_", "item_", "._", "enable", "d\\u", "when_", ",_", "editor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "created", " ", "editor", " ", "control", " ", "to", " ", "the", " ", "sizer", " ", "with", " ", "the", " ", "appropr", "iate", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "layout", " ", "flags", " ", "and", " ", "values", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ui_", "._", "\\u", "scroll", "able_", "|=_", "scroll", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item", "\\u", "resizable", "_", "=_", "(_", "(_", "item_", "._", "resizable", "_", "is_", "True_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "item_", "._", "resizable", "_", "is_", "Unde", "fined", "_", ")_", "and_", "scroll", "able_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item", "\\u", "resizable", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grow", "able_", "=_", "grow", "able_", "or_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resizable", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "item_", "._", "spring", "y_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grow", "able_", "=_", "grow", "able_", "or_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "is", " ", "a", " ", "hack", " ", "to", " ", "allow", " ", "'", "read", "only", "'", " ", "text", " ", "fields", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "work", " ", "correct", "ly", " ", "(", "wx", " ", "has", " ", "a", " ", "bug", " ", "tha", "t", " ", "setti", "ng", " ", "wx", ".", "EXPAN", "D", " ", "on", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Static", "Text", " ", "control", " ", "see", "ms", " ", "to", " ", "caus", "e", " ", "the", " ", "text", " ", "to", " ", "be", " ", "aligned", " ", "higher", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "than", " ", "it", " ", "wou", "ld", " ", "be", " ", "other", "wis", "e", ",", " ", "caus", "ing", " ", "it", " ", "to", " ", "misa", "lign", " ", "with", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "label", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "layout", "\\u", "style_", "=_", "editor_", "._", "layout", "\\u", "style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layout", "\\u", "style_", "|=_", "wx_", "._", "EXPAND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item", "\\u", "sizer_", "._", "Add_", "(_", "control_", ",_", "grow", "able_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "flags_", "|_", "layout", "\\u", "style_", "|_", "wx_", "._", "ALIGN", "\\u", "CENTER", "\\u", "VERTICAL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max_", "(_", "0_", ",_", "border", "\\u", "size_", "+_", "padding_", "+_", "item_", "._", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "are", " ", "display", "ing", " ", "labels", " ", "on", " ", "the", " ", "right", ",", " ", "add", " ", "the", " ", "label", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "user", " ", "interface", ":_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "show", "\\u", "left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "._", "show", "\\u", "label_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "label_", "=_", "self_", "._", "create", "\\u", "label_", "(_", "item_", ",_", "ui_", ",_", "desc_", ",_", "panel_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "item", "\\u", "sizer_", ",_", "''_", ",_", "wx_", "._", "RIGHT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "cols_", ">_", "1_", ")_", "and_", "show", "\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "label_", "=_", "self_", "._", "dummy", "\\u", "label_", "(_", "panel_", ",_", "item", "\\u", "sizer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "Item", " ", "is", " ", "resizable", ",", " ", "and", " ", "we", " ", "are", " ", "usi", "ng", " ", "a", " ", "multi", "-", "column", " ", "grid", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item", "\\u", "resizable", "_", "and_", "(_", "cols_", ">_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Mark", " ", "the", " ", "entire", " ", "row", " ", "as", " ", "grow", "able", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item", "\\u", "sizer_", "._", "Add", "Grow", "able", "Row_", "(_", "col_", "/_", "cols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Save", " ", "the", " ", "reference", " ", "to", " ", "the", " ", "label", " ", "control", " ", "(", "if", " ", "any", ")", " ", "in", " ", "the", " ", "editor", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "editor_", "._", "label", "\\u", "control_", "=_", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "created", " ", "a", " ", "grid", " ", "sizer", ",", " ", "add", " ", "it", " ", "to", " ", "the", " ", "original", " ", "sizer", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item", "\\u", "sizer_", "is_", "not_", "sizer_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grow", "able_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "resizable", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grow", "able_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "item", "\\u", "sizer_", ",_", "grow", "able_", ",_", "wx_", "._", "EXPAND_", "|_", "wx_", "._", "ALL_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Constant in conditional expression or statement
yildizberkay/MongoApp/MongoApp.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport subprocess\nimport threading\nimport tkFont\nimport ttk\nimport webbrowser\n\nfrom os import makedirs\nfrom os.path import exists, expanduser, join as path_join\nfrom sys import path as sys_path\nfrom Tkinter import *\n\nsys_path.append('libs')\nfrom PIL import ImageTk, Image\n\n\nHomeFolder = expanduser(\"~\")\nDATA_ROOT_FOLDER = path_join(HomeFolder, \"MongoAppData\")\n\n\n\n# Application structure:\n# http://docs.python.org/2/library/tkinter.html#a-simple-hello-world-program\n\n\nif __name__ == \"__main__\":\n if not exists(DATA_ROOT_FOLDER):\n makedirs(DATA_ROOT_FOLDER+\"/data/db\")\n makedirs(DATA_ROOT_FOLDER+\"/logs\")\n\n root = Tk()\n app = Application(master=root)\n app.master.title(\"MongoApp\")\n app.master.geometry(\"640x480\")\n app.mainloop()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[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_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tk", "Font_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ttk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "webbrowser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "os_", "import_", "makedirs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "._", "path_", "import_", "exists_", ",_", "expanduser_", ",_", "join_", "as_", "path", "\\u", "join_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sys_", "import_", "path_", "as_", "sys", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Tkinter_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys", "\\u", "path_", "._", "append_", "(_", "'", "libs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image", "Tk_", ",_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Home", "Folder_", "=_", "expanduser_", "(_", "\"~\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DATA", "\\u", "ROO", "T", "\\u", "FOLDER_", "=_", "path", "\\u", "join_", "(_", "Home", "Folder_", ",_", "\"", "Mon", "go", "App", "Data", "\"_", ")_", "\\u\\u\\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_", "#", " ", "Applica", "tion", " ", "structure", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "docs", ".", "python", ".", "org", "/", "2", "/", "librar", "y", "/", "tkin", "ter", ".", "html", "#", "a", "-", "simple", "-", "hell", "o", "-", "world", "-", "program_", "\\u\\u\\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 ", " _", "if_", "not_", "exists_", "(_", "DATA", "\\u", "ROO", "T", "\\u", "FOLDER_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "makedirs_", "(_", "DATA", "\\u", "ROO", "T", "\\u", "FOLDER_", "+_", "\"/", "data", "/", "db", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "makedirs_", "(_", "DATA", "\\u", "ROO", "T", "\\u", "FOLDER_", "+_", "\"/", "logs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root_", "=_", "Tk_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "Application_", "(_", "master_", "=_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "master_", "._", "title_", "(_", "\"", "Mon", "go", "App", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "master_", "._", "geometry_", "(_", "\"", "640", "x4", "80", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "mainloop_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jesolem/PCV/PCV/geometry/warp.py
[ { "content": "import matplotlib.delaunay as md \nfrom scipy import ndimage\nfrom pylab import *\nfrom numpy import *\n\nfrom PCV.geometry import homography\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 image_in_image(im1,im2,tp):\n \"\"\" Put im1 in im2 with an affine transformation\n such that corners are as close to tp as possible.\n tp are homogeneous and counter-clockwise from top left. \"\"\" \n \n # points to warp from\n m,n = im1.shape[:2]\n fp = array([[0,m,m,0],[0,0,n,n],[1,1,1,1]])\n \n # compute affine transform and apply\n H = homography.Haffine_from_points(tp,fp)\n im1_t = ndimage.affine_transform(im1,H[:2,:2],\n (H[0,2],H[1,2]),im2.shape[:2])\n alpha = (im1_t > 0)\n \n return (1-alpha)*im2 + alpha*im1_t", "metadata": "root.image_in_image", "header": "['module', '___EOS___']", "index": 8 }, { "content": "def combine_images(im1,im2,alpha):\n \"\"\" Blend two images with weights as in alpha. \"\"\"\n return (1-alpha)*im1 + alpha*im2 ", "metadata": "root.combine_images", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def alpha_for_triangle(points,m,n):\n \"\"\" Creates alpha map of size (m,n) \n for a triangle with corners defined by points\n (given in normalized homogeneous coordinates). \"\"\"\n \n alpha = zeros((m,n))\n for i in range(min(points[0]),max(points[0])):\n for j in range(min(points[1]),max(points[1])):\n x = linalg.solve(points,[i,j,1])\n if min(x) > 0: #all coefficients positive\n alpha[i,j] = 1\n return alpha", "metadata": "root.alpha_for_triangle", "header": "['module', '___EOS___']", "index": 31 }, { "content": "def triangulate_points(x,y):\n \"\"\" Delaunay triangulation of 2D points. \"\"\"\n \n centers,edges,tri,neighbors = md.delaunay(x,y)\n return tri", "metadata": "root.triangulate_points", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def plot_mesh(x,y,tri):\n \"\"\" Plot triangles. \"\"\" \n \n for t in tri:\n t_ext = [t[0], t[1], t[2], t[0]] # add first point to end\n plot(x[t_ext],y[t_ext],'r')", "metadata": "root.plot_mesh", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def pw_affine(fromim,toim,fp,tp,tri):\n \"\"\" Warp triangular patches from an image.\n fromim = image to warp \n toim = destination image\n fp = from points in hom. coordinates\n tp = to points in hom. coordinates\n tri = triangulation. \"\"\"\n \n im = toim.copy()\n \n # check if image is grayscale or color\n is_color = len(fromim.shape) == 3\n \n # create image to warp to (needed if iterate colors)\n im_t = zeros(im.shape, 'uint8') \n \n for t in tri:\n # compute affine transformation\n H = homography.Haffine_from_points(tp[:,t],fp[:,t])\n \n if is_color:\n for col in range(fromim.shape[2]):\n im_t[:,:,col] = ndimage.affine_transform(\n fromim[:,:,col],H[:2,:2],(H[0,2],H[1,2]),im.shape[:2])\n else:\n im_t = ndimage.affine_transform(\n fromim,H[:2,:2],(H[0,2],H[1,2]),im.shape[:2])\n \n # alpha for triangle\n alpha = alpha_for_triangle(tp[:,t],im.shape[0],im.shape[1])\n \n # add triangle to image\n im[alpha>0] = im_t[alpha>0]\n \n return im", "metadata": "root.pw_affine", "header": "['module', '___EOS___']", "index": 60 }, { "content": "def panorama(H,fromim,toim,padding=2400,delta=2400):\n \"\"\" Create horizontal panorama by blending two images \n using a homography H (preferably estimated using RANSAC).\n The result is an image with the same height as toim. 'padding' \n specifies number of fill pixels and 'delta' additional translation. \"\"\" \n \n # check if images are grayscale or color\n is_color = len(fromim.shape) == 3\n \n # homography transformation for geometric_transform()\n def transf(p):\n p2 = dot(H,[p[0],p[1],1])\n return (p2[0]/p2[2],p2[1]/p2[2])\n \n if H[1,2]<0: # fromim is to the right\n print 'warp - right'\n # transform fromim\n if is_color:\n # pad the destination image with zeros to the right\n toim_t = hstack((toim,zeros((toim.shape[0],padding,3))))\n fromim_t = zeros((toim.shape[0],toim.shape[1]+padding,toim.shape[2]))\n for col in range(3):\n fromim_t[:,:,col] = ndimage.geometric_transform(fromim[:,:,col],\n transf,(toim.shape[0],toim.shape[1]+padding))\n else:\n # pad the destination image with zeros to the right\n toim_t = hstack((toim,zeros((toim.shape[0],padding))))\n fromim_t = ndimage.geometric_transform(fromim,transf,\n (toim.shape[0],toim.shape[1]+padding)) \n else:\n print 'warp - left'\n # add translation to compensate for padding to the left\n H_delta = array([[1,0,0],[0,1,-delta],[0,0,1]])\n H = dot(H,H_delta)\n # transform fromim\n if is_color:\n # pad the destination image with zeros to the left\n toim_t = hstack((zeros((toim.shape[0],padding,3)),toim))\n fromim_t = zeros((toim.shape[0],toim.shape[1]+padding,toim.shape[2]))\n for col in range(3):\n fromim_t[:,:,col] = ndimage.geometric_transform(fromim[:,:,col],\n transf,(toim.shape[0],toim.shape[1]+padding))\n else:\n # pad the destination image with zeros to the left\n toim_t = hstack((zeros((toim.shape[0],padding)),toim))\n fromim_t = ndimage.geometric_transform(fromim,\n transf,(toim.shape[0],toim.shape[1]+padding))\n \n # blend and return (put fromim above toim)\n if is_color:\n # all non black pixels\n alpha = ((fromim_t[:,:,0] * fromim_t[:,:,1] * fromim_t[:,:,2] ) > 0)\n for col in range(3):\n toim_t[:,:,col] = fromim_t[:,:,col]*alpha + toim_t[:,:,col]*(1-alpha)\n else:\n alpha = (fromim_t > 0)\n toim_t = fromim_t*alpha + toim_t*(1-alpha)\n \n return toim_t", "metadata": "root.panorama", "header": "['module', '___EOS___']", "index": 97 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "matplotlib_", "._", "dela", "una", "y_", "as_", "md_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "import_", "ndimage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylab_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "PC", "V_", "._", "geometry_", "import_", "homo", "graphy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "image", "\\u", "in", "\\u", "image_", "(_", "im", "1_", ",_", "im2", "_", ",_", "tp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Put", " ", "im", "1", " ", "in", " ", "im2", " ", "with", " ", "an", " ", "affin", "e", " ", "transformation", "\\", "10", ";", " ", " ", " ", " ", "suc", "h", " ", "tha", "t", " ", "corners", " ", "are", " ", "as", " ", "close", " ", "to", " ", "tp", " ", "as", " ", "possib", "le", ".", "\\", "10", ";", " ", " ", " ", " ", "tp", " ", "are", " ", "homogene", "ous", " ", "and", " ", "counter", "-", "clockwise", " ", "from", " ", "top", " ", "left", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "points", " ", "to", " ", "warp", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "m_", ",_", "n_", "=_", "im", "1_", "._", "shape_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "=_", "array_", "(_", "[_", "[_", "0_", ",_", "m_", ",_", "m_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "n_", ",_", "n_", "]_", ",_", "[_", "1_", ",_", "1_", ",_", "1_", ",_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "affin", "e", " ", "transform", " ", "and", " ", "apply_", "\\u\\u\\uNL\\u\\u\\u_", "H_", "=_", "homo", "graphy_", "._", "Ha", "ffi", "ne", "\\u", "from", "\\u", "points_", "(_", "tp_", ",_", "fp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "1", "\\u", "t_", "=_", "ndimage_", "._", "affin", "e\\u", "transform_", "(_", "im", "1_", ",_", "H_", "[_", ":_", "2_", ",_", ":_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "H_", "[_", "0_", ",_", "2_", "]_", ",_", "H_", "[_", "1_", ",_", "2_", "]_", ")_", ",_", "im2", "_", "._", "shape_", "[_", ":_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alpha_", "=_", "(_", "im", "1", "\\u", "t_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "1_", "-_", "alpha_", ")_", "*_", "im2", "_", "+_", "alpha_", "*_", "im", "1", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "combin", "e\\u", "images_", "(_", "im", "1_", ",_", "im2", "_", ",_", "alpha_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Ble", "nd", " ", "two", " ", "images", " ", "with", " ", "weight", "s", " ", "as", " ", "in", " ", "alpha", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "1_", "-_", "alpha_", ")_", "*_", "im", "1_", "+_", "alpha_", "*_", "im2", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "alpha", "\\u", "for", "\\u", "triangle_", "(_", "points_", ",_", "m_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "es", " ", "alpha", " ", "map", " ", "of", " ", "size", " ", "(", "m", ",", "n", ")", " ", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "a", " ", "triangle", " ", "with", " ", "corners", " ", "defin", "ed", " ", "by", " ", "points", "\\", "10", ";", " ", " ", " ", " ", "(", "give", "n", " ", "in", " ", "normali", "zed", " ", "homogene", "ous", " ", "coordinate", "s", ").", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "alpha_", "=_", "zeros_", "(_", "(_", "m_", ",_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "min_", "(_", "points_", "[_", "0_", "]_", ")_", ",_", "max_", "(_", "points_", "[_", "0_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "range_", "(_", "min_", "(_", "points_", "[_", "1_", "]_", ")_", ",_", "max_", "(_", "points_", "[_", "1_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "linalg_", "._", "solve_", "(_", "points_", ",_", "[_", "i_", ",_", "j_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "min_", "(_", "x_", ")_", ">_", "0_", ":_", "#", "all", " ", "coefficient", "s", " ", "positive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "[_", "i_", ",_", "j_", "]_", "=_", "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_", "return_", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "triang", "ulate", "\\u", "points_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Del", "au", "na", "y", " ", "triang", "ulation", " ", "of", " ", "2", "D", " ", "points", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "centers_", ",_", "edges_", ",_", "tri_", ",_", "neighbors_", "=_", "md_", "._", "dela", "una", "y_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "mesh_", "(_", "x_", ",_", "y_", ",_", "tri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Plot", " ", "triangle", "s", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "tri_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t", "\\u", "ext_", "=_", "[_", "t_", "[_", "0_", "]_", ",_", "t_", "[_", "1_", "]_", ",_", "t_", "[_", "2_", "]_", ",_", "t_", "[_", "0_", "]_", "]_", "#", " ", "add", " ", "first", " ", "point", " ", "to", " ", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot_", "(_", "x_", "[_", "t", "\\u", "ext_", "]_", ",_", "y_", "[_", "t", "\\u", "ext_", "]_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pw", "\\u", "affine_", "(_", "from", "im_", ",_", "toi", "m_", ",_", "fp_", ",_", "tp_", ",_", "tri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "War", "p", " ", "triangular", " ", "patche", "s", " ", "from", " ", "an", " ", "image", ".", "\\", "10", ";", " ", " ", " ", " ", "from", "im", " ", "=", " ", "image", " ", "to", " ", "warp", " ", "\\", "10", ";", " ", " ", " ", " ", "toi", "m", " ", "=", " ", "destinat", "ion", " ", "image", "\\", "10", ";", " ", " ", " ", " ", "fp", " ", "=", " ", "from", " ", "points", " ", "in", " ", "hom", ".", " ", "coordinate", "s", "\\", "10", ";", " ", " ", " ", " ", "tp", " ", "=", " ", "to", " ", "points", " ", "in", " ", "hom", ".", " ", " ", "coordinate", "s", "\\", "10", ";", " ", " ", " ", " ", "tri", " ", "=", " ", "triang", "ulation", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "im_", "=_", "toi", "m_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "image", " ", "is", " ", "grayscale", " ", "or", " ", "color_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "color_", "=_", "len_", "(_", "from", "im_", "._", "shape_", ")_", "==_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "image", " ", "to", " ", "warp", " ", "to", " ", "(", "need", "ed", " ", "if", " ", "iterate", " ", "colors", ")_", "\\u\\u\\uNL\\u\\u\\u_", "im", "\\u", "t_", "=_", "zeros_", "(_", "im_", "._", "shape_", ",_", "'", "uint", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "tri_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compute", " ", "affin", "e", " ", "transformation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "H_", "=_", "homo", "graphy_", "._", "Ha", "ffi", "ne", "\\u", "from", "\\u", "points_", "(_", "tp_", "[_", ":_", ",_", "t_", "]_", ",_", "fp_", "[_", ":_", ",_", "t_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "color_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "col_", "in_", "range_", "(_", "from", "im_", "._", "shape_", "[_", "2_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", "=_", "ndimage_", "._", "affin", "e\\u", "transform_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "from", "im_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", ",_", "H_", "[_", ":_", "2_", ",_", ":_", "2_", "]_", ",_", "(_", "H_", "[_", "0_", ",_", "2_", "]_", ",_", "H_", "[_", "1_", ",_", "2_", "]_", ")_", ",_", "im_", "._", "shape_", "[_", ":_", "2_", "]_", ")_", "\\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 ", " _", "im", "\\u", "t_", "=_", "ndimage_", "._", "affin", "e\\u", "transform_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "from", "im_", ",_", "H_", "[_", ":_", "2_", ",_", ":_", "2_", "]_", ",_", "(_", "H_", "[_", "0_", ",_", "2_", "]_", ",_", "H_", "[_", "1_", ",_", "2_", "]_", ")_", ",_", "im_", "._", "shape_", "[_", ":_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "alpha", " ", "for", " ", "triangle_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "alpha_", "=_", "alpha", "\\u", "for", "\\u", "triangle_", "(_", "tp_", "[_", ":_", ",_", "t_", "]_", ",_", "im_", "._", "shape_", "[_", "0_", "]_", ",_", "im_", "._", "shape_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "triangle", " ", "to", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "im_", "[_", "alpha_", ">_", "0_", "]_", "=_", "im", "\\u", "t_", "[_", "alpha_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "im_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pano", "rama", "_", "(_", "H_", ",_", "from", "im_", ",_", "toi", "m_", ",_", "padding_", "=_", "2400", "_", ",_", "delta_", "=_", "2400", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "e", " ", "horizon", "tal", " ", "pano", "rama", " ", "by", " ", "blend", "ing", " ", "two", " ", "images", " ", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "a", " ", "homo", "graph", "y", " ", "H", " ", "(", "prefer", "abl", "y", " ", "estimate", "d", " ", "usi", "ng", " ", "RAN", "SA", "C", ").", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "result", " ", "is", " ", "an", " ", "image", " ", "with", " ", "the", " ", "same", " ", "height", " ", "as", " ", "toi", "m", ".", " ", "'", "padd", "ing", "'", " ", "\\", "10", ";", " ", " ", " ", " ", "speci", "fie", "s", " ", "number", " ", "of", " ", "fill", " ", "pixel", "s", " ", "and", " ", "'", "delta", "'", " ", "addition", "al", " ", "translatio", "n", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "images", " ", "are", " ", "grayscale", " ", "or", " ", "color_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "color_", "=_", "len_", "(_", "from", "im_", "._", "shape_", ")_", "==_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "homo", "graph", "y", " ", "transformation", " ", "for", " ", "geometric", "\\u", "transform", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "transf", "_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p2_", "=_", "dot_", "(_", "H_", ",_", "[_", "p_", "[_", "0_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "p2_", "[_", "0_", "]_", "/_", "p2_", "[_", "2_", "]_", ",_", "p2_", "[_", "1_", "]_", "/_", "p2_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "H_", "[_", "1_", ",_", "2_", "]_", "<_", "0_", ":_", "#", " ", "from", "im", " ", "is", " ", "to", " ", "the", " ", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "warp", " ", "-", " ", "right", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "transform", " ", "from", "im_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "color_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pad", " ", "the", " ", "destinat", "ion", " ", "image", " ", "with", " ", "zero", "s", " ", "to", " ", "the", " ", "right_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toi", "m", "\\u", "t_", "=_", "hstack_", "(_", "(_", "toi", "m_", ",_", "zeros_", "(_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "padding_", ",_", "3_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "im", "\\u", "t_", "=_", "zeros_", "(_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "toi", "m_", "._", "shape_", "[_", "1_", "]_", "+_", "padding_", ",_", "toi", "m_", "._", "shape_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", "=_", "ndimage_", "._", "geometric", "\\u", "transform_", "(_", "from", "im_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transf", "_", ",_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "toi", "m_", "._", "shape_", "[_", "1_", "]_", "+_", "padding_", ")_", ")_", "\\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_", "#", " ", "pad", " ", "the", " ", "destinat", "ion", " ", "image", " ", "with", " ", "zero", "s", " ", "to", " ", "the", " ", "right_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toi", "m", "\\u", "t_", "=_", "hstack_", "(_", "(_", "toi", "m_", ",_", "zeros_", "(_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "padding_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "im", "\\u", "t_", "=_", "ndimage_", "._", "geometric", "\\u", "transform_", "(_", "from", "im_", ",_", "transf", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "toi", "m_", "._", "shape_", "[_", "1_", "]_", "+_", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "warp", " ", "-", " ", "left", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "translatio", "n", " ", "to", " ", "compen", "sat", "e", " ", "for", " ", "padd", "ing", " ", "to", " ", "the", " ", "left_", "\\u\\u\\uNL\\u\\u\\u_", "H", "\\u", "delta_", "=_", "array_", "(_", "[_", "[_", "1_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "1_", ",_", "-_", "delta_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "H_", "=_", "dot_", "(_", "H_", ",_", "H", "\\u", "delta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "transform", " ", "from", "im_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "color_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pad", " ", "the", " ", "destinat", "ion", " ", "image", " ", "with", " ", "zero", "s", " ", "to", " ", "the", " ", "left_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toi", "m", "\\u", "t_", "=_", "hstack_", "(_", "(_", "zeros_", "(_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "padding_", ",_", "3_", ")_", ")_", ",_", "toi", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "im", "\\u", "t_", "=_", "zeros_", "(_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "toi", "m_", "._", "shape_", "[_", "1_", "]_", "+_", "padding_", ",_", "toi", "m_", "._", "shape_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", "=_", "ndimage_", "._", "geometric", "\\u", "transform_", "(_", "from", "im_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transf", "_", ",_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "toi", "m_", "._", "shape_", "[_", "1_", "]_", "+_", "padding_", ")_", ")_", "\\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_", "#", " ", "pad", " ", "the", " ", "destinat", "ion", " ", "image", " ", "with", " ", "zero", "s", " ", "to", " ", "the", " ", "left_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toi", "m", "\\u", "t_", "=_", "hstack_", "(_", "(_", "zeros_", "(_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "padding_", ")_", ")_", ",_", "toi", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "im", "\\u", "t_", "=_", "ndimage_", "._", "geometric", "\\u", "transform_", "(_", "from", "im_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transf", "_", ",_", "(_", "toi", "m_", "._", "shape_", "[_", "0_", "]_", ",_", "toi", "m_", "._", "shape_", "[_", "1_", "]_", "+_", "padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "blend", " ", "and", " ", "return", " ", "(", "put", " ", "from", "im", " ", "above", " ", "toi", "m", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "color_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "all", " ", "non", " ", "black", " ", "pixels_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "(_", "(_", "from", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "0_", "]_", "*_", "from", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "1_", "]_", "*_", "from", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "2_", "]_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toi", "m", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", "=_", "from", "im", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", "*_", "alpha_", "+_", "toi", "m", "\\u", "t_", "[_", ":_", ",_", ":_", ",_", "col_", "]_", "*_", "(_", "1_", "-_", "alpha_", ")_", "\\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 ", " _", "alpha_", "=_", "(_", "from", "im", "\\u", "t_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toi", "m", "\\u", "t_", "=_", "from", "im", "\\u", "t_", "*_", "alpha_", "+_", "toi", "m", "\\u", "t_", "*_", "(_", "1_", "-_", "alpha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "toi", "m", "\\u", "t_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ojii/django-server-manager/server_manager/admin.py
[ { "content": "from server_manager.models import Server\nfrom server_manager.loader import backend_loader\nfrom django.shortcuts import render_to_response\nfrom django.utils import simplejson\nfrom django.template import RequestContext, Template\nfrom django.http import HttpResponse, Http404\nfrom django.contrib import admin\nfrom django.contrib.sites.models import Site\n\n\n\n\n\nadmin.site.register(Server, ServerRestarterAdmin)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def dt2str(dt, request):\n t = Template('{{ dt }}')\n return t.render(RequestContext(request, {'dt': dt}))", "metadata": "root.dt2str", "header": "['module', '___EOS___']", "index": 9 }, { "content": "class SiteWrapper(object):\n \n \n \n \n ", "metadata": "root.SiteWrapper", "header": "['module', '___EOS___']", "index": 13 }, { "content": " def __init__(self, site, backend, request):\n self.site = site\n self.backend = backend\n self.request = request", "metadata": "root.SiteWrapper.__init__", "header": "['class', 'SiteWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 14 }, { "content": " def __getattr__(self, attr):\n return getattr(self.site, attr)", "metadata": "root.SiteWrapper.__getattr__", "header": "['class', 'SiteWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 19 }, { "content": " def can_restart(self):\n return self.backend.can_restart(self.site.pk, self.request)", "metadata": "root.SiteWrapper.can_restart", "header": "['class', 'SiteWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 22 }, { "content": " def can_stop(self):\n return self.backend.can_stop(self.site.pk, self.request)", "metadata": "root.SiteWrapper.can_stop", "header": "['class', 'SiteWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 25 }, { "content": " def can_start(self):\n return self.backend.can_start(self.site.pk, self.request)", "metadata": "root.SiteWrapper.can_start", "header": "['class', 'SiteWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 28 }, { "content": " def get_uptime(self):\n return self.backend.get_uptime(self.site.pk, self.request)", "metadata": "root.SiteWrapper.get_uptime", "header": "['class', 'SiteWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 31 }, { "content": "class ServerRestarterAdmin(admin.ModelAdmin):\n \n\n ", "metadata": "root.ServerRestarterAdmin", "header": "['module', '___EOS___']", "index": 35 }, { "content": " def changelist_view(self, request, extra_context=None):\n if not request.user.has_perm('server_manager.change_serverrestarter'):\n raise Http404\n if request.GET.get('ajax'):\n return self.ajax_call(request)\n sites = []\n for site in Site.objects.all():\n sites.append(SiteWrapper(site, self.backend, request))\n data = {\n 'sites': sites,\n 'media': self.media,\n }\n return render_to_response('server_manager/changelist.html', data, RequestContext(request))", "metadata": "root.ServerRestarterAdmin.changelist_view", "header": "['class', 'ServerRestarterAdmin', '(', 'admin', '.', 'ModelAdmin', ')', ':', '___EOS___']", "index": 36 }, { "content": " def ajax_call(self, request):\n site_id = request.POST.get('site_id', None)\n if not site_id:\n return self.ajax_response(False)\n try:\n site = Site.objects.get(pk=site_id)\n except Site.DoesNotExist:\n return self.ajax_response(False)\n action = request.POST.get('action', None)\n if action == 'restart':\n return self.ajax_response(self.backend.restart(site.pk, request))\n elif action == \"start\":\n return self.ajax_response(self.backend.start(site.pk, request))\n elif action == \"stop\":\n return self.ajax_response(self.backend.stop(site.pk, request))\n elif action == 'uptime':\n uptime = self.backend.get_uptime(site.pk, request)\n if uptime is None:\n return self.ajax_response(False)\n return self.ajax_response(dt2str(uptime, request))\n return self.ajax_response(False)", "metadata": "root.ServerRestarterAdmin.ajax_call", "header": "['class', 'ServerRestarterAdmin', '(', 'admin', '.', 'ModelAdmin', ')', ':', '___EOS___']", "index": 50 }, { "content": " def ajax_response(self, data):\n return HttpResponse(simplejson.dumps(data), mimetype='application/json')", "metadata": "root.ServerRestarterAdmin.ajax_response", "header": "['class', 'ServerRestarterAdmin', '(', 'admin', '.', 'ModelAdmin', ')', ':', '___EOS___']", "index": 72 }, { "content": " @property\n def backend(self):\n return backend_loader", "metadata": "root.ServerRestarterAdmin.backend", "header": "['class', 'ServerRestarterAdmin', '(', 'admin', '.', 'ModelAdmin', ')', ':', '___EOS___']", "index": 75 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "server", "\\u", "manager_", "._", "models_", "import_", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "server", "\\u", "manager_", "._", "loader_", "import_", "back", "end", "\\u", "loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "simplejson_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", ",_", "Template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", ",_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "import_", "admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "sites_", "._", "models_", "import_", "Site_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "admin_", "._", "site_", "._", "register_", "(_", "Server_", ",_", "Server", "Restart", "er", "Admin_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "dt", "2str_", "(_", "dt_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Template_", "(_", "'{{", " ", "dt", " ", "}}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "t_", "._", "render_", "(_", "Request", "Context_", "(_", "request_", ",_", "{_", "'", "dt", "'_", ":_", "dt_", "}_", ")_", ")_", "\\u\\u\\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_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "site_", ",_", "backend_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "site_", "=_", "site_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "backend_", "=_", "backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "request_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getattr\\u\\u_", "(_", "self_", ",_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", "._", "site_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "can", "\\u", "restart_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "backend_", "._", "can", "\\u", "restart_", "(_", "self_", "._", "site_", "._", "pk_", ",_", "self_", "._", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "can", "\\u", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "backend_", "._", "can", "\\u", "stop_", "(_", "self_", "._", "site_", "._", "pk_", ",_", "self_", "._", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "can", "\\u", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "backend_", "._", "can", "\\u", "start_", "(_", "self_", "._", "site_", "._", "pk_", ",_", "self_", "._", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Site", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "uptime_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "backend_", "._", "get", "\\u", "uptime_", "(_", "self_", "._", "site_", "._", "pk_", ",_", "self_", "._", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Server", "Restart", "er", "Admin_", "(_", "admin_", "._", "Model", "Admin_", ")_", ":_", "\\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_", "Server", "Restart", "er", "Admin_", "(_", "admin_", "._", "Model", "Admin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "changeli", "st", "\\u", "view_", "(_", "self_", ",_", "request_", ",_", "extra", "\\u", "context_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "'", "server", "\\u", "manage", "r", ".", "change", "\\u", "server", "restart", "er", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "GET_", "._", "get_", "(_", "'", "aja", "x", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "call_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sites_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "site_", "in_", "Site_", "._", "objects_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sites_", "._", "append_", "(_", "Site", "Wrapper_", "(_", "site_", ",_", "self_", "._", "backend_", ",_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sites", "'_", ":_", "sites_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "media", "'_", ":_", "self_", "._", "media_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "server", "\\u", "manage", "r", "/", "changeli", "st", ".", "html", "'_", ",_", "data_", ",_", "Request", "Context_", "(_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Server", "Restart", "er", "Admin_", "(_", "admin_", "._", "Model", "Admin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "aja", "x", "\\u", "call_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "site", "\\u", "id_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "site", "\\u", "id", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "site", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "False_", ")_", "\\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 ", " _", "site_", "=_", "Site_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "site", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Site_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "action_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "action", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "action_", "==_", "'", "restart", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "self_", "._", "backend_", "._", "restart_", "(_", "site_", "._", "pk_", ",_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "\"", "start", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "self_", "._", "backend_", "._", "start_", "(_", "site_", "._", "pk_", ",_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "\"", "stop", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "self_", "._", "backend_", "._", "stop_", "(_", "site_", "._", "pk_", ",_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "upti", "me", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uptime_", "=_", "self_", "._", "backend_", "._", "get", "\\u", "uptime_", "(_", "site_", "._", "pk_", ",_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "uptime_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "dt", "2str_", "(_", "uptime_", ",_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "aja", "x", "\\u", "response_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Server", "Restart", "er", "Admin_", "(_", "admin_", "._", "Model", "Admin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "aja", "x", "\\u", "response_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Response_", "(_", "simplejson_", "._", "dumps_", "(_", "data_", ")_", ",_", "mimetype_", "=_", "'", "applica", "tion", "/", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Server", "Restart", "er", "Admin_", "(_", "admin_", "._", "Model", "Admin_", ")_", ":_", "\\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_", "backend_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "back", "end", "\\u", "loader_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
openstack/freezer-web-ui/disaster_recovery/api/api.py
[ { "content": " def delete(self, action_id):\n return self.client.actions.delete(action_id)", "metadata": "root.Action.delete", "header": "['class', 'Action', '(', 'object', ')', ':', '___EOS___']", "index": 420 } ]
[]
[]
0
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Action_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ",_", "action", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "client_", "._", "actions_", "._", "delete_", "(_", "action", "\\u", "id_", ")_", "\\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 ]
Unused import
anandology/pyjamas/pyjd/sessionhistory.py
[ { "content": "# Copyright (C) 2007, One Laptop Per Child\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 2 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, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n\nimport logging\n\nimport gobject\nimport xpcom\nfrom xpcom.components import interfaces\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class HistoryListener(gobject.GObject):\n _com_interfaces_ = interfaces.nsISHistoryListener\n\n __gsignals__ = {\n 'session-history-changed': (gobject.SIGNAL_RUN_FIRST, \n gobject.TYPE_NONE,\n ([int])),\n 'session-link-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,\n ([str]))\n }\n\n\n\n\n\n\n\n", "metadata": "root.HistoryListener", "header": "['module', '___EOS___']", "index": 22 }, { "content": " def __init__(self):\n gobject.GObject.__init__(self)\n\n self._wrapped_self = xpcom.server.WrapObject( \\\n self, interfaces.nsISHistoryListener)\n weak_ref = xpcom.client.WeakReference(self._wrapped_self)", "metadata": "root.HistoryListener.__init__", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 33 }, { "content": " def setup(self, web_navigation):\n self._session_history = web_navigation.sessionHistory\n self._session_history.addSHistoryListener(self._wrapped_self)", "metadata": "root.HistoryListener.setup", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 40 }, { "content": " def OnHistoryGoBack(self, back_uri):\n logging.debug(\"OnHistoryGoBack: %s\" % back_uri.spec)\n self.emit('session-link-changed', back_uri.spec)\n self.emit('session-history-changed', self._session_history.index - 1)\n return True", "metadata": "root.HistoryListener.OnHistoryGoBack", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 44 }, { "content": " def OnHistoryGoForward(self, forward_uri):\n logging.debug(\"OnHistoryGoForward: %s\" % forward_uri.spec)\n self.emit('session-link-changed', forward_uri.spec)\n self.emit('session-history-changed', self._session_history.index + 1)\n return True", "metadata": "root.HistoryListener.OnHistoryGoForward", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 50 }, { "content": " def OnHistoryGotoIndex(self, index, goto_uri):\n logging.debug(\"OnHistoryGotoIndex: %i %s\" % (index, goto_uri.spec))\n self.emit('session-link-changed', goto_uri.spec)\n self.emit('session-history-changed', index)\n return True", "metadata": "root.HistoryListener.OnHistoryGotoIndex", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 56 }, { "content": " def OnHistoryNewEntry(self, new_uri):\n logging.debug(\"OnHistoryNewEntry: %s\" % new_uri.spec)\n self.emit('session-link-changed', new_uri.spec)\n self.emit('session-history-changed', self._session_history.index + 1)", "metadata": "root.HistoryListener.OnHistoryNewEntry", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 62 }, { "content": " def OnHistoryPurge(self, num_entries):\n logging.debug(\"OnHistoryPurge: %i\" % num_entries)\n #self.emit('session-history-changed')\n return True", "metadata": "root.HistoryListener.OnHistoryPurge", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 67 }, { "content": " def OnHistoryReload(self, reload_uri, reload_flags):\n self.emit('session-link-changed', reload_uri.spec)\n logging.debug(\"OnHistoryReload: %s\" % reload_uri.spec)\n return True", "metadata": "root.HistoryListener.OnHistoryReload", "header": "['class', 'HistoryListener', '(', 'gobject', '.', 'GObject', ')', ':', '___EOS___']", "index": 72 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2007", ",", " ", "One", " ", "Lap", "top", " ", "Per", " ", "Child_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "as", " ", "publi", "shed", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "2", " ", "of", " ", "the", " ", "License", ",", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "along", " ", "with", " ", "this", " ", "program", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "1", " ", "Frankl", "in", " ", "St", ",", " ", "Fifth", " ", "Flo", "or", ",", " ", "Bo", "ston", ",", " ", "MA", " ", " ", "0211", "0", "-1", "301", " ", " ", "USA", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "gobject_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xp", "com_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xp", "com_", "._", "components_", "import_", "interfaces_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "com", "\\u", "interface", "s\\u_", "=_", "interfaces_", "._", "ns", "ISH", "isto", "ry", "Listener_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "gsi", "gna", "ls", "\\u\\u_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "session", "-", "histo", "ry", "-", "change", "d", "'_", ":_", "(_", "gobject_", "._", "SIGN", "AL", "\\u", "RUN", "\\u", "FIRST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gobject_", "._", "TYPE", "\\u", "NONE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "int_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "session", "-", "link", "-", "change", "d", "'_", ":_", "(_", "gobject_", "._", "SIGN", "AL", "\\u", "RUN", "\\u", "FIRST_", ",_", "gobject_", "._", "TYPE", "\\u", "NONE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "str_", "]_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\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 ", " _", "gobject_", "._", "GO", "bject_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "wrapp", "ed", "\\u", "self_", "=_", "xp", "com_", "._", "server_", "._", "Wra", "p", "Object_", "(_", "self_", ",_", "interfaces_", "._", "ns", "ISH", "isto", "ry", "Listener_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "weak", "\\u", "ref_", "=_", "xp", "com_", "._", "client_", "._", "Wea", "k", "Reference_", "(_", "self_", "._", "\\u", "wrapp", "ed", "\\u", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup_", "(_", "self_", ",_", "web", "\\u", "navigation", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "session", "\\u", "history_", "=_", "web", "\\u", "navigation", "_", "._", "session", "History_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "session", "\\u", "history_", "._", "add", "SH", "isto", "ry", "Listener_", "(_", "self_", "._", "\\u", "wrapp", "ed", "\\u", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Hist", "ory", "Go", "Back_", "(_", "self_", ",_", "back", "\\u", "uri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "On", "Hist", "ory", "Go", "Back", ":", " ", "%", "s", "\"_", "%_", "back", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "link", "-", "change", "d", "'_", ",_", "back", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "histo", "ry", "-", "change", "d", "'_", ",_", "self_", "._", "\\u", "session", "\\u", "history_", "._", "index_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Hist", "ory", "Go", "Forward_", "(_", "self_", ",_", "forward", "\\u", "uri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "On", "Hist", "ory", "Go", "Forward", ":", " ", "%", "s", "\"_", "%_", "forward", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "link", "-", "change", "d", "'_", ",_", "forward", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "histo", "ry", "-", "change", "d", "'_", ",_", "self_", "._", "\\u", "session", "\\u", "history_", "._", "index_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Hist", "ory", "Got", "o", "Index_", "(_", "self_", ",_", "index_", ",_", "got", "o", "\\u", "uri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "On", "Hist", "ory", "Got", "o", "Index", ":", " ", "%", "i", " ", "%", "s", "\"_", "%_", "(_", "index_", ",_", "got", "o", "\\u", "uri_", "._", "spec_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "link", "-", "change", "d", "'_", ",_", "got", "o", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "histo", "ry", "-", "change", "d", "'_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Hist", "ory", "New", "Entry_", "(_", "self_", ",_", "new", "\\u", "uri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "On", "Hist", "ory", "New", "Entr", "y", ":", " ", "%", "s", "\"_", "%_", "new", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "link", "-", "change", "d", "'_", ",_", "new", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "emit_", "(_", "'", "session", "-", "histo", "ry", "-", "change", "d", "'_", ",_", "self_", "._", "\\u", "session", "\\u", "history_", "._", "index_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Hist", "ory", "Purg", "e_", "(_", "self_", ",_", "num", "\\u", "entries_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "On", "Hist", "ory", "Purg", "e", ":", " ", "%", "i", "\"_", "%_", "num", "\\u", "entries_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "emit", "('", "session", "-", "histo", "ry", "-", "change", "d", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hist", "ory", "Listener_", "(_", "gobject_", "._", "GO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Hist", "ory", "Relo", "ad_", "(_", "self_", ",_", "relo", "ad", "\\u", "uri_", ",_", "relo", "ad", "\\u", "flags_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "emit_", "(_", "'", "session", "-", "link", "-", "change", "d", "'_", ",_", "relo", "ad", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "On", "Hist", "ory", "Relo", "ad", ":", " ", "%", "s", "\"_", "%_", "relo", "ad", "\\u", "uri_", "._", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_" ]
[ 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Module is imported with 'import' and 'import from'
dimagi/commcare-hq/corehq/apps/fixtures/dispatcher.py
[ { "content": "from corehq import privileges\nfrom corehq.apps.accounting.decorators import requires_privilege_with_fallback\nfrom corehq.apps.reports.dispatcher import ProjectReportDispatcher\nfrom django.utils.decorators import method_decorator\nfrom corehq.apps.users.decorators import require_permission\nfrom corehq.apps.users.models import Permissions\n\n\nrequire_can_edit_fixtures = lambda *args, **kwargs: (\n require_permission(Permissions.edit_data)(\n requires_privilege_with_fallback(privileges.LOOKUP_TABLES)(*args, **kwargs)\n )\n)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "core", "hq", "_", "import_", "privilege", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "accounti", "ng_", "._", "decorators_", "import_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "reports_", "._", "dispatcher_", "import_", "Project", "Report", "Dispatcher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "decorators_", "import_", "method", "\\u", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "users_", "._", "decorators_", "import_", "require", "\\u", "permission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "apps_", "._", "users_", "._", "models_", "import_", "Permissions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "can", "\\u", "edit", "\\u", "fixtures_", "=_", "lambda_", "*_", "args_", ",_", "**_", "kwargs_", ":_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "permission_", "(_", "Permissions_", "._", "edit", "\\u", "data_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "s", "\\u", "privilege", "\\u", "with", "\\u", "fallback_", "(_", "privilege", "s_", "._", "LOOKUP", "\\u", "TABLES", "_", ")_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
dcm-oss/blockade/blockade/net.py
[ { "content": " def get_container_device(self, docker_client, container_id):\n try:\n exec_handle = docker_client.exec_create(container_id, ['ip', 'link', 'show', 'eth0'])\n res = docker_client.exec_start(exec_handle).decode('utf-8')\n device = re.search('^([0-9]+):', res)\n if not device:\n raise BlockadeError(\n \"Problem determining host network device for container '%s'\" %\n (container_id))\n\n peer_idx = int(device.group(1))\n\n # all my experiments showed the host device index was\n # one greater than its associated container device index\n host_idx = peer_idx + 1\n host_res = subprocess.check_output(['ip', 'link'])\n\n host_rgx = '^%d: ([^:@]+)[:@]' % host_idx\n host_match = re.search(host_rgx, host_res.decode(), re.M)\n if not host_match:\n raise BlockadeError(\n \"Problem determining host network device for container '%s'\" %\n (container_id))\n\n host_device = host_match.group(1)\n return host_device\n except subprocess.CalledProcessError:\n raise BlockadeError(\n \"Problem determining host network device for container '%s'\" %\n (container_id))", "metadata": "root.BlockadeNetwork.get_container_device", "header": "['class', 'BlockadeNetwork', '(', 'object', ')', ':', '___EOS___']", "index": 66 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Block", "ade", "Network_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "container", "\\u", "device_", "(_", "self_", ",_", "docker", "\\u", "client_", ",_", "container", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec", "\\u", "handle_", "=_", "docker", "\\u", "client_", "._", "exec", "\\u", "create_", "(_", "container", "\\u", "id_", ",_", "[_", "'", "ip", "'_", ",_", "'", "link", "'_", ",_", "'", "show", "'_", ",_", "'", "eth", "0", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "docker", "\\u", "client_", "._", "exec", "\\u", "start_", "(_", "exec", "\\u", "handle_", ")_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "device_", "=_", "re_", "._", "search_", "(_", "'", "^", "([", "0", "-", "9", "]+)", ":'_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "device_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Block", "ade", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Prob", "lem", " ", "determini", "ng", " ", "host", " ", "network", " ", "device", " ", "for", " ", "container", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "container", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "peer", "\\u", "idx_", "=_", "int_", "(_", "device_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "my", " ", "experiment", "s", " ", "show", "ed", " ", "the", " ", "host", " ", "device", " ", "index", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "one", " ", "great", "er", " ", "than", " ", "its", " ", "associate", "d", " ", "container", " ", "device", " ", "index_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "idx_", "=_", "peer", "\\u", "idx_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "\\u", "res_", "=_", "subprocess_", "._", "check", "\\u", "output_", "(_", "[_", "'", "ip", "'_", ",_", "'", "link", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "rg", "x_", "=_", "'", "^", "%", "d", ":", " ", "([", "^", ":", "@]", "+)", "[:", "@]", "'_", "%_", "host", "\\u", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "\\u", "match_", "=_", "re_", "._", "search_", "(_", "host", "\\u", "rg", "x_", ",_", "host", "\\u", "res_", "._", "decode_", "(_", ")_", ",_", "re_", "._", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "host", "\\u", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Block", "ade", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Prob", "lem", " ", "determini", "ng", " ", "host", " ", "network", " ", "device", " ", "for", " ", "container", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "container", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "host", "\\u", "device_", "=_", "host", "\\u", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "host", "\\u", "device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "subprocess_", "._", "Call", "ed", "Process", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Block", "ade", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Prob", "lem", " ", "determini", "ng", " ", "host", " ", "network", " ", "device", " ", "for", " ", "container", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "container", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Use of the return value of a procedure
mrknow/filmkodi/plugin.video.mrknow/lib/utils/javascriptUtils.py
[ { "content": " def ionX(self, x, arrayX):\n r = []\n s = 0\n w = 0\n \n for d in x:\n w |= int(arrayX[ord(d)-48]) << s\n if (s):\n r.append(chr(165 ^ w & 255))\n w >>= 8\n s -= 2\n else:\n s = 6\n\n r = ''.join(r)\n return r", "metadata": "root.JsUnIonCube.ionX", "header": "['class', 'JsUnIonCube', ':', '___EOS___']", "index": 194 }, { "content": " def unIonALL(self,data):\n in_data=data\n sPattern = 'c=\"(.*?)\";eval\\\\(unescape\\\\(\".*\"\\\\)\\\\);x\\\\(\"(.*?)\"\\\\)'\n undc_data=re.compile(sPattern).findall(in_data)\n c = undc_data[0][0]\n x = undc_data[0][1]\n\n l = list(c)\n for i in range(0, len(c), 3):\n l[i]='%'\n\n c = ''.join(l)\n c = urllib.unquote_plus(c)\n\n arrayPattern = 't=Array\\\\((.*?)\\\\)'\n arrayData = re.compile(arrayPattern).findall(c)\n ionArray = arrayData[0].split(',')\n data=self.ionX(x,ionArray)\n\n return data", "metadata": "root.JsUnIonCube.unIonALL", "header": "['class', 'JsUnIonCube', ':', '___EOS___']", "index": 211 } ]
[]
[]
0
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "class_", "Js", "Un", "Io", "n", "Cube_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "ion", "X_", "(_", "self_", ",_", "x_", ",_", "array", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "d_", "in_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "|=_", "int_", "(_", "array", "X_", "[_", "ord_", "(_", "d_", ")_", "-_", "48_", "]_", ")_", "<<_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "._", "append_", "(_", "chr_", "(_", "165_", "^_", "w_", "&_", "255_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", ">>", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "-=_", "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 ", " _", "s_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "''_", "._", "join_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Js", "Un", "Io", "n", "Cube_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "un", "Io", "n", "ALL_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "in", "\\u", "data_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s", "Pattern_", "=_", "'", "c", "=\"(", ".*?)", "\";", "eval", "\\\\\\\\", "(", "unescape", "\\\\\\\\", "(\".", "*\"", "\\\\\\\\", ")\\\\\\\\", ");", "x", "\\\\\\\\", "(\"", "(.*?)", "\"\\\\\\\\", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "und", "c\\u", "data_", "=_", "re_", "._", "compile_", "(_", "s", "Pattern_", ")_", "._", "findall_", "(_", "in", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "und", "c\\u", "data_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "und", "c\\u", "data_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "list_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "c_", ")_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "[_", "i_", "]_", "=_", "'%'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "''_", "._", "join_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "urllib_", "._", "unqu", "ote", "\\u", "plus_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "array", "Pattern_", "=_", "'", "t", "=", "Array", "\\\\\\\\", "((", ".*?)", "\\\\\\\\", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array", "Data_", "=_", "re_", "._", "compile_", "(_", "array", "Pattern_", ")_", "._", "findall_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ion", "Array_", "=_", "array", "Data_", "[_", "0_", "]_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "ion", "X_", "(_", "x_", ",_", "ion", "Array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
acba/elm/elm/elmk.py
[ { "content": "# -*- coding: utf-8 -*-\n\n\"\"\"\n This file contains ELMKernel classes and all developed methods.\n\"\"\"\n\n# Python2 support\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nfrom .mltools import *\n\nimport numpy as np\nimport optunity\nimport ast\n\nimport sys\nif sys.version_info < (3, 0):\n import ConfigParser as configparser\nelse:\n import configparser\n\n\n# Find configuration file\nfrom pkg_resources import Requirement, resource_filename\n_ELMK_CONFIG = resource_filename(Requirement.parse(\"elm\"), \"elm/elmk.cfg\")\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ELMKernel(MLTools):\n \"\"\"\n A Python implementation of ELM Kernel defined by Huang[1].\n\n An ELM is a single-hidden layer feedforward network (SLFN) proposed by\n Huang back in 2006, in 2012 the author revised and introduced a new\n concept of using kernel functions to his previous work.\n\n This implementation currently accepts both methods proposed at 2012,\n random neurons and kernel functions to estimate classifier/regression\n functions.\n\n Let the dimensionality \"d\" of the problem be the sum of \"t\" size (number of\n targets per pattern) and \"f\" size (number of features per pattern).\n So, d = t + f\n\n The data will be set as Pattern = (Target | Features).\n\n If database has *N* patterns, its size follows *Nxd*.\n\n\n Note:\n [1] Paper reference: Huang, 2012, \"Extreme Learning Machine for\n Regression and Multiclass Classification\"\n\n Attributes:\n output_weight (numpy.ndarray): a column vector (*Nx1*) calculated\n after training, represent :math:\\\\beta.\n training_patterns (numpy.ndarray): a matrix (*Nxd*) containing all\n patterns used for training.\n\n Need to save all training patterns to perform kernel\n calculation at testing and prediction phase.\n param_kernel_function (str): kernel function that will be used\n for training.\n param_c (float): regularization coefficient (*C*) used for training.\n param_kernel_params (list of float): kernel function parameters\n that will be used for training.\n\n Other Parameters:\n regressor_name (str): The name of classifier/regressor.\n available_kernel_functions (list of str): List with all available\n kernel functions.\n default_param_kernel_function (str): Default kernel function if\n not set at class constructor.\n default_param_c (float): Default parameter c value if\n not set at class constructor.\n default_param_kernel_params (list of float): Default kernel\n function parameters if not set at class constructor.\n\n Note:\n * **regressor_name**: defaults to \"elmk\".\n * **default_param_kernel_function**: defaults to \"rbf\".\n * **default_param_c**: defaults to 9.\n * **default_param_kernel_params**: defaults to [-15].\n\n \"\"\"\n\n\n # ########################\n # Private Methods\n # ########################\n\n\n\n\n # ########################\n # Public Methods\n # ########################\n\n\n\n\n\n\n", "metadata": "root.ELMKernel", "header": "['module', '___EOS___']", "index": 30 }, { "content": " def __init__(self, params=[]):\n \"\"\"\n Class constructor.\n\n Arguments:\n params (list): first argument (*str*) is an available kernel\n function, second argument (*float*) is the coefficient\n *C* of regularization and the third and last argument is\n a list of arguments for the kernel function.\n\n Example:\n\n >>> import elm\n >>> params = [\"linear\", 5, []]\n >>> elmk = elm.ELMKernel(params)\n\n \"\"\"\n super(self.__class__, self).__init__()\n\n self.regressor_name = \"elmk\"\n\n self.available_kernel_functions = [\"rbf\", \"linear\", \"poly\"]\n\n self.default_param_kernel_function = \"rbf\"\n self.default_param_c = 9\n self.default_param_kernel_params = [-15]\n\n self.output_weight = []\n self.training_patterns = []\n\n # Initialized parameters values\n if not params:\n self.param_kernel_function = self.default_param_kernel_function\n self.param_c = self.default_param_c\n self.param_kernel_params = self.default_param_kernel_params\n else:\n self.param_kernel_function = params[0]\n self.param_c = params[1]\n self.param_kernel_params = params[2]", "metadata": "root.ELMKernel.__init__", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 88 }, { "content": " def _kernel_matrix(self, training_patterns, kernel_type, kernel_param,\n test_patterns=None):\n \"\"\" Calculate the Omega matrix (kernel matrix).\n\n If test_patterns is None, then the training Omega matrix will be\n calculated. This matrix represents the kernel value from each\n pattern of the training matrix with each other. If test_patterns\n exists, then the test Omega matrix will be calculated. This\n matrix represents the kernel value from each pattern of the\n training matrix with the patterns of test matrix.\n\n Arguments:\n training_patterns (numpy.ndarray): A matrix containing the\n features from all training patterns.\n kernel_type (str): The type of kernel to be used e.g: rbf\n kernel_param (list of float): The parameters of the chosen\n kernel.\n test_patterns (numpy.ndarray): An optional parameter used to\n calculate the Omega test matrix.\n\n Returns:\n numpy.ndarray: Omega matrix\n\n \"\"\"\n number_training_patterns = training_patterns.shape[0]\n\n if kernel_type == \"rbf\":\n if test_patterns is None:\n temp_omega = np.dot(\n np.sum(training_patterns ** 2, axis=1).reshape(-1, 1),\n np.ones((1, number_training_patterns)))\n\n temp_omega = temp_omega + temp_omega.conj().T\n\n omega = np.exp(\n -(2 ** kernel_param[0]) * (temp_omega - 2 * (np.dot(\n training_patterns, training_patterns.conj().T))))\n\n else:\n number_test_patterns = test_patterns.shape[0]\n\n temp1 = np.dot(\n np.sum(training_patterns ** 2, axis=1).reshape(-1, 1),\n np.ones((1, number_test_patterns)))\n temp2 = np.dot(\n np.sum(test_patterns ** 2, axis=1).reshape(-1, 1),\n np.ones((1, number_training_patterns)))\n temp_omega = temp1 + temp2.conj().T\n\n omega = \\\n np.exp(- (2 ** kernel_param[0]) *\n (temp_omega - 2 * np.dot(training_patterns,\n test_patterns.conj().T)))\n elif kernel_type == \"linear\":\n if test_patterns is None:\n omega = np.dot(training_patterns, training_patterns.conj().T)\n else:\n omega = np.dot(training_patterns, test_patterns.conj().T)\n\n elif kernel_type == \"poly\":\n # Power a**x is undefined when x is real and 'a' is negative,\n # so is necessary to force an integer value\n kernel_param[1] = round(kernel_param[1])\n\n if test_patterns is None:\n temp = np.dot(training_patterns, training_patterns.conj().T)+ kernel_param[0]\n\n omega = temp ** kernel_param[1]\n else:\n temp = np.dot(training_patterns, test_patterns.conj().T)+ kernel_param[0]\n omega = temp ** kernel_param[1]\n\n else:\n print(\"Error: Invalid or unavailable kernel function.\")\n return\n\n return omega", "metadata": "root.ELMKernel._kernel_matrix", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 132 }, { "content": " def _local_train(self, training_patterns, training_expected_targets,\n params):\n\n # If params not provided, uses initialized parameters values\n if not params:\n pass\n else:\n self.param_kernel_function = params[0]\n self.param_c = params[1]\n self.param_kernel_params = params[2]\n\n # Need to save all training patterns to perform kernel calculation at\n # testing and prediction phase\n self.training_patterns = training_patterns\n\n number_training_patterns = self.training_patterns.shape[0]\n\n # Training phase\n\n omega_train = self._kernel_matrix(self.training_patterns,\n self.param_kernel_function,\n self.param_kernel_params)\n\n self.output_weight = np.linalg.solve(\n (omega_train + np.eye(number_training_patterns) /\n (2 ** self.param_c)),\n training_expected_targets).reshape(-1, 1)\n\n training_predicted_targets = np.dot(omega_train, self.output_weight)\n\n return training_predicted_targets", "metadata": "root.ELMKernel._local_train", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 210 }, { "content": " def _local_test(self, testing_patterns, testing_expected_targets,\n predicting):\n\n omega_test = self._kernel_matrix(self.training_patterns,\n self.param_kernel_function,\n self.param_kernel_params,\n testing_patterns)\n\n testing_predicted_targets = np.dot(omega_test.conj().T,\n self.output_weight)\n\n return testing_predicted_targets", "metadata": "root.ELMKernel._local_test", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 242 }, { "content": " def get_available_kernel_functions(self):\n \"\"\"\n Return available kernel functions.\n \"\"\"\n\n return self.available_kernel_functions", "metadata": "root.ELMKernel.get_available_kernel_functions", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 259 }, { "content": " def print_parameters(self):\n \"\"\"\n Print parameters values.\n \"\"\"\n\n print()\n print(\"Regressor Parameters\")\n print()\n print(\"Regularization coefficient: \", self.param_c)\n print(\"Kernel Function: \", self.param_kernel_function)\n print(\"Kernel parameters: \", self.param_kernel_params)\n print()\n print(\"CV error: \", self.cv_best_rmse)\n print()", "metadata": "root.ELMKernel.print_parameters", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 266 }, { "content": " def search_param(self, database, dataprocess=None, path_filename=(\"\", \"\"),\n save=False, cv=\"ts\", of=\"rmse\", kf=None, eval=50):\n \"\"\"\n Search best hyperparameters for classifier/regressor based on\n optunity algorithms.\n\n Arguments:\n database (numpy.ndarray): a matrix containing all patterns\n that will be used for training/testing at some\n cross-validation method.\n dataprocess (DataProcess): an object that will pre-process\n database before training. Defaults to None.\n path_filename (tuple): *TODO*.\n save (bool): *TODO*.\n cv (str): Cross-validation method. Defaults to \"ts\".\n of (str): Objective function to be minimized at\n optunity.minimize. Defaults to \"rmse\".\n kf (list of str): a list of kernel functions to be used by\n the search. Defaults to None, this set all available\n functions.\n eval (int): Number of steps (evaluations) to optunity algorithm.\n\n\n Each set of hyperparameters will perform a cross-validation\n method chosen by param cv.\n\n\n Available *cv* methods:\n - \"ts\" :func:`mltools.time_series_cross_validation()`\n Perform a time-series cross-validation suggested by Hydman.\n\n - \"kfold\" :func:`mltools.kfold_cross_validation()`\n Perform a k-fold cross-validation.\n\n Available *of* function:\n - \"accuracy\", \"rmse\", \"mape\", \"me\".\n\n\n See Also:\n http://optunity.readthedocs.org/en/latest/user/index.html\n \"\"\"\n\n if kf is None:\n search_kernel_functions = self.available_kernel_functions\n elif type(kf) is list:\n search_kernel_functions = kf\n else:\n raise Exception(\"Invalid format for argument 'kf'.\")\n\n print(self.regressor_name)\n print(\"##### Start search #####\")\n\n config = configparser.ConfigParser()\n\n if sys.version_info < (3, 0):\n config.readfp(open(_ELMK_CONFIG))\n else:\n config.read_file(open(_ELMK_CONFIG))\n\n best_function_error = 99999.9\n temp_error = best_function_error\n best_param_c = 0\n best_param_kernel_function = \"\"\n best_param_kernel_param = []\n for kernel_function in search_kernel_functions:\n\n if sys.version_info < (3, 0):\n elmk_c_range = ast.literal_eval(config.get(\"DEFAULT\",\n \"elmk_c_range\"))\n\n n_parameters = config.getint(kernel_function, \"kernel_n_param\")\n kernel_p_range = \\\n ast.literal_eval(config.get(kernel_function,\n \"kernel_params_range\"))\n\n else:\n kernel_config = config[kernel_function]\n\n elmk_c_range = ast.literal_eval(kernel_config[\"elmk_c_range\"])\n\n n_parameters = int(kernel_config[\"kernel_n_param\"])\n kernel_p_range = \\\n ast.literal_eval(kernel_config[\"kernel_params_range\"])\n\n param_ranges = [[elmk_c_range[0][0], elmk_c_range[0][1]]]\n for param in range(n_parameters):\n param_ranges.append([kernel_p_range[param][0],\n kernel_p_range[param][1]])\n\n def wrapper_0param(param_c):\n \"\"\"\n Wrapper for objective function.\n \"\"\"\n\n if cv == \"ts\":\n cv_tr_error, cv_te_error = \\\n time_series_cross_validation(self, database,\n [kernel_function,\n param_c,\n list([])],\n number_folds=10,\n dataprocess=dataprocess)\n\n elif cv == \"kfold\":\n cv_tr_error, cv_te_error = \\\n kfold_cross_validation(self, database,\n [kernel_function,\n param_c,\n list([])],\n number_folds=10,\n dataprocess=dataprocess)\n\n else:\n raise Exception(\"Invalid type of cross-validation.\")\n\n if of == \"accuracy\":\n util = 1 / cv_te_error.get_accuracy()\n else:\n util = cv_te_error.get(of)\n\n # print(\"c:\", param_c, \"util: \", util)\n return util\n\n def wrapper_1param(param_c, param_kernel):\n \"\"\"\n Wrapper for optunity.\n \"\"\"\n\n if cv == \"ts\":\n cv_tr_error, cv_te_error = \\\n time_series_cross_validation(self, database,\n [kernel_function,\n param_c,\n list([param_kernel])],\n number_folds=10,\n dataprocess=dataprocess)\n\n elif cv == \"kfold\":\n cv_tr_error, cv_te_error = \\\n kfold_cross_validation(self, database,\n [kernel_function,\n param_c,\n list([param_kernel])],\n number_folds=10,\n dataprocess=dataprocess)\n\n else:\n raise Exception(\"Invalid type of cross-validation.\")\n\n if of == \"accuracy\":\n util = 1 / cv_te_error.get_accuracy()\n else:\n util = cv_te_error.get(of)\n\n # print(\"c:\", param_c, \" gamma:\", param_kernel, \"util: \", util)\n return util\n\n def wrapper_2param(param_c, param_kernel1, param_kernel2):\n \"\"\"\n Wrapper for optunity.\n \"\"\"\n\n if cv == \"ts\":\n cv_tr_error, cv_te_error = \\\n time_series_cross_validation(self, database,\n [kernel_function,\n param_c,\n list([param_kernel1,\n param_kernel2])],\n number_folds=10,\n dataprocess=dataprocess)\n\n elif cv == \"kfold\":\n cv_tr_error, cv_te_error = \\\n kfold_cross_validation(self, database,\n [kernel_function,\n param_c,\n list([param_kernel1,\n param_kernel2])],\n number_folds=10,\n dataprocess=dataprocess)\n\n else:\n raise Exception(\"Invalid type of cross-validation.\")\n\n if of == \"accuracy\":\n util = 1 / cv_te_error.get_accuracy()\n else:\n util = cv_te_error.get(of)\n\n # print(\"c:\", param_c, \" param1:\", param_kernel1,\n # \" param2:\", param_kernel2, \"util: \", util)\n return util\n\n if kernel_function == \"linear\":\n optimal_parameters, details, _ = \\\n optunity.minimize(wrapper_0param,\n solver_name=\"cma-es\",\n num_evals=eval,\n param_c=param_ranges[0])\n\n elif kernel_function == \"rbf\":\n optimal_parameters, details, _ = \\\n optunity.minimize(wrapper_1param,\n solver_name=\"cma-es\",\n num_evals=eval,\n param_c=param_ranges[0],\n param_kernel=param_ranges[1])\n\n elif kernel_function == \"poly\":\n optimal_parameters, details, _ = \\\n optunity.minimize(wrapper_2param,\n solver_name=\"cma-es\",\n num_evals=eval,\n param_c=param_ranges[0],\n param_kernel1=param_ranges[1],\n param_kernel2=param_ranges[2])\n else:\n raise Exception(\"Invalid kernel function.\")\n\n # Save best kernel result\n if details[0] < temp_error:\n temp_error = details[0]\n\n if of == \"accuracy\":\n best_function_error = 1 / temp_error\n else:\n best_function_error = temp_error\n\n best_param_kernel_function = kernel_function\n best_param_c = optimal_parameters[\"param_c\"]\n\n if best_param_kernel_function == \"linear\":\n best_param_kernel_param = []\n elif best_param_kernel_function == \"rbf\":\n best_param_kernel_param = [optimal_parameters[\"param_kernel\"]]\n elif best_param_kernel_function == \"poly\":\n best_param_kernel_param = \\\n [optimal_parameters[\"param_kernel1\"],\n optimal_parameters[\"param_kernel2\"]]\n else:\n raise Exception(\"Invalid kernel function.\")\n\n # print(\"best: \", best_param_kernel_function,\n # best_function_error, best_param_c, best_param_kernel_param)\n\n if of == \"accuracy\":\n print(\"Kernel function: \", kernel_function,\n \" best cv value: \", 1/details[0])\n else:\n print(\"Kernel function: \", kernel_function,\n \" best cv value: \", details[0])\n\n\n # MLTools attribute\n self.cv_best_rmse = best_function_error\n\n # ELM attribute\n self.param_c = best_param_c\n self.param_kernel_function = best_param_kernel_function\n self.param_kernel_params = best_param_kernel_param\n\n print(\"##### Search complete #####\")\n self.print_parameters()\n\n return None", "metadata": "root.ELMKernel.search_param", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 281 }, { "content": " def train(self, training_matrix, params=[]):\n \"\"\"\n Calculate output_weight values needed to test/predict data.\n\n If params is provided, this method will use at training phase.\n Else, it will use the default value provided at object\n initialization.\n\n Arguments:\n training_matrix (numpy.ndarray): a matrix containing all\n patterns that will be used for training.\n params (list): a list of parameters defined at\n :func:`ELMKernel.__init__`\n\n Returns:\n :class:`Error`: training error object containing expected,\n predicted targets and all error metrics.\n\n Note:\n Training matrix must have target variables as the first column.\n\n \"\"\"\n\n return self._ml_train(training_matrix, params)", "metadata": "root.ELMKernel.train", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 548 }, { "content": " def test(self, testing_matrix, predicting=False):\n \"\"\"\n Calculate test predicted values based on previous training.\n\n Args:\n testing_matrix (numpy.ndarray): a matrix containing all\n patterns that will be used for testing.\n predicting (bool): Don't set.\n\n Returns:\n :class:`Error`: testing error object containing expected,\n predicted targets and all error metrics.\n\n Note:\n Testing matrix must have target variables as the first column.\n \"\"\"\n\n return self._ml_test(testing_matrix, predicting)", "metadata": "root.ELMKernel.test", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 573 }, { "content": " @copy_doc_of(MLTools._ml_predict)\n def predict(self, horizon=1):\n # self.__doc__ = self._ml_predict.__doc__\n\n return self._ml_predict(horizon)", "metadata": "root.ELMKernel.predict", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 592 }, { "content": " @copy_doc_of(MLTools._ml_train_iterative)\n def train_iterative(self, database_matrix, params=[],\n sliding_window=168, k=1):\n # self.__doc__ = self._ml_train_iterative.__doc__\n\n return self._ml_train_iterative(database_matrix, params,\n sliding_window, k)", "metadata": "root.ELMKernel.train_iterative", "header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']", "index": 598 } ]
[]
[]
0
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", ";", " ", " ", " ", " ", "Thi", "s", " ", "file", " ", "contain", "s", " ", "EL", "MK", "ern", "el", " ", "classe", "s", " ", "and", " ", "all", " ", "develop", "ed", " ", "method", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on2", " ", "support_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "ml", "tools_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "opt", "unity", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "<_", "(_", "3_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Config", "Parser_", "as_", "configparser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "configparser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "configura", "tion", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "pkg", "\\u", "resources_", "import_", "Requirement", "_", ",_", "resource", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "EL", "MK", "\\u", "CONFIG_", "=_", "resource", "\\u", "filename_", "(_", "Requirement", "_", "._", "parse_", "(_", "\"", "elm", "\"_", ")_", ",_", "\"", "elm", "/", "elm", "k", ".", "cfg", "\"_", ")_", "\\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_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "Pyth", "on", " ", "implementation", " ", "of", " ", "EL", "M", " ", "Kern", "el", " ", "defin", "ed", " ", "by", " ", "Hua", "ng", "[", "1", "].", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "EL", "M", " ", "is", " ", "a", " ", "single", "-", "hidden", " ", "layer", " ", "feed", "forward", " ", "network", " ", "(", "SL", "FN", ")", " ", "proposed", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "Hua", "ng", " ", " ", "back", " ", "in", " ", "2006", ",", " ", "in", " ", "2012", " ", "the", " ", "author", " ", "revis", "ed", " ", "and", " ", "introduce", "d", " ", "a", " ", "new", "\\", "10", ";", " ", " ", " ", " ", "concept", " ", "of", " ", "usi", "ng", " ", "kernel", " ", "function", "s", " ", "to", " ", "his", " ", "previ", "ous", " ", "work", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "implementation", " ", "currentl", "y", " ", "accepts", " ", "bot", "h", " ", "method", "s", " ", "proposed", " ", "at", " ", "2012", ",", "\\", "10", ";", " ", " ", " ", " ", "random", " ", "neuro", "ns", " ", "and", " ", "kernel", " ", "function", "s", " ", "to", " ", "estimate", " ", "classif", "ier", "/", "regress", "ion", "\\", "10", ";", " ", " ", " ", " ", "function", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Let", " ", "the", " ", "dimensionality", " ", "\"", "d", "\"", " ", "of", " ", "the", " ", "problem", " ", "be", " ", "the", " ", "sum", " ", "of", " ", "\"", "t", "\"", " ", "size", " ", "(", "number", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "target", "s", " ", "per", " ", "pattern", ")", " ", "and", " ", "\"", "f", "\"", " ", "size", " ", "(", "number", " ", "of", " ", "features", " ", "per", " ", "pattern", ").", "\\", "10", ";", " ", " ", " ", " ", "So", ",", " ", "d", " ", "=", " ", "t", " ", "+", " ", "f", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "data", " ", "will", " ", "be", " ", "set", " ", "as", " ", "Pat", "tern", " ", "=", " ", "(", "Target", " ", "|", " ", "Feature", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "databa", "se", " ", "has", " ", "*", "N", "*", " ", "pattern", "s", ",", " ", "its", " ", "size", " ", "follow", "s", " ", "*", "Nx", "d", "*.", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", "\\", "10", ";", " ", " ", " ", " ", "[", "1", "]", " ", "Pap", "er", " ", "reference", ":", " ", "Hua", "ng", ",", " ", "2012", ",", " ", "\"", "Extr", "eme", " ", "Learn", "ing", " ", "Machine", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "Regr", "ession", " ", "and", " ", " ", "Multi", "class", " ", "Classificat", "ion", "\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Attribute", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "output", "\\u", "weight", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "a", " ", "column", " ", "vector", " ", "(*", "Nx", "1", "*)", " ", "calculated", "\\", "10", ";", " ", " ", " ", " ", "after", " ", "train", "ing", ",", " ", "represent", " ", ":", "math", ":\\\\", "\\\\", "beta", ".", "\\", "10", ";", " ", " ", " ", " ", "train", "ing", "\\u", "pattern", "s", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "a", " ", "matrix", " ", "(*", "Nx", "d", "*)", " ", "contain", "ing", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "pattern", "s", " ", "used", " ", "for", " ", "train", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ne", "ed", " ", "to", " ", "save", " ", "all", " ", "train", "ing", " ", "pattern", "s", " ", "to", " ", "perform", " ", "kernel", "\\", "10", ";", " ", " ", " ", " ", "calculati", "on", " ", "at", " ", "testi", "ng", " ", "and", " ", "predicti", "on", " ", "phase", ".", "\\", "10", ";", " ", " ", " ", " ", "param", "\\u", "kernel", "\\u", "function", " ", "(", "str", "):", " ", "kernel", " ", "function", " ", "tha", "t", " ", "will", " ", "be", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "train", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "param", "\\u", "c", " ", "(", "float", "):", " ", "regularization", " ", "coefficient", " ", "(*", "C", "*)", " ", "used", " ", "for", " ", "train", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "param", "\\u", "kernel", "\\u", "params", " ", "(", "list", " ", "of", " ", "float", "):", " ", "kernel", " ", "function", " ", "parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "for", " ", "train", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ot", "her", " ", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "regressor", "\\u", "name", " ", "(", "str", "):", " ", "The", " ", "name", " ", "of", " ", "classif", "ier", "/", "regressor", ".", "\\", "10", ";", " ", " ", " ", " ", "avail", "able", "\\u", "kernel", "\\u", "function", "s", " ", "(", "list", " ", "of", " ", "str", "):", " ", "List", " ", "with", " ", "all", " ", "avail", "able", "\\", "10", ";", " ", " ", " ", " ", "kernel", " ", "function", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "default", "\\u", "param", "\\u", "kernel", "\\u", "function", " ", "(", "str", "):", " ", "Default", " ", "kernel", " ", "function", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "not", " ", "set", " ", "at", " ", "class", " ", "construct", "or", ".", "\\", "10", ";", " ", " ", " ", " ", "default", "\\u", "param", "\\u", "c", " ", "(", "float", "):", " ", "Default", " ", "parameter", " ", "c", " ", "value", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "not", " ", "set", " ", "at", " ", "class", " ", "construct", "or", ".", "\\", "10", ";", " ", " ", " ", " ", "default", "\\u", "param", "\\u", "kernel", "\\u", "params", " ", "(", "list", " ", "of", " ", "float", "):", " ", "Default", " ", "kernel", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "parameter", "s", " ", "if", " ", "not", " ", "set", " ", "at", " ", "class", " ", "construct", "or", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "**", "regressor", "\\u", "name", "**", ":", " ", "default", "s", " ", "to", " ", "\"", "elm", "k", "\".\\", "10", ";", " ", " ", " ", " ", "*", " ", "**", "default", "\\u", "param", "\\u", "kernel", "\\u", "function", "**", ":", " ", "default", "s", " ", "to", " ", "\"", "rbf", "\".\\", "10", ";", " ", " ", " ", " ", "*", " ", "**", "default", "\\u", "param", "\\u", "c", "**", ":", " ", "default", "s", " ", "to", " ", "9", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "**", "default", "\\u", "param", "\\u", "kernel", "\\u", "params", "**", ":", " ", "default", "s", " ", "to", " ", "[-", "15", "].", "\\", "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\\uNL\\u\\u\\u_", "#", " ", "Priva", "te", " ", "Methods_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Public", " ", "Methods_", "\\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_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "params_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Class", " ", "construct", "or", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "params", " ", "(", "list", "):", " ", "first", " ", "argu", "ment", " ", "(*", "str", "*)", " ", "is", " ", "an", " ", "avail", "able", " ", "kernel", "\\", "10", ";", " ", " ", "function", ",", " ", "second", " ", "argu", "ment", " ", "(*", "float", "*)", " ", "is", " ", "the", " ", "coefficient", "\\", "10", ";", " ", " ", "*", "C", "*", " ", "of", " ", "regularization", " ", "and", " ", "the", " ", "third", " ", "and", " ", "last", " ", "argu", "ment", " ", "is", "\\", "10", ";", " ", " ", "a", " ", "list", " ", "of", " ", "argu", "ment", "s", " ", "for", " ", "the", " ", "kernel", " ", "function", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ple", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "import", " ", "elm", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "params", " ", "=", " ", "[\"", "linear", "\",", " ", "5", ",", " ", "[]", "]", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "elm", "k", " ", "=", " ", "elm", ".", "EL", "MK", "ern", "el", "(", "params", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "regressor", "\\u", "name_", "=_", "\"", "elm", "k", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "avail", "able", "\\u", "kernel", "\\u", "functions_", "=_", "[_", "\"", "rbf", "\"_", ",_", "\"", "linear", "\"_", ",_", "\"", "poly", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default", "\\u", "param", "\\u", "kernel", "\\u", "function_", "=_", "\"", "rbf", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "\\u", "param", "\\u", "c_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "\\u", "param", "\\u", "kernel", "\\u", "params_", "=_", "[_", "-_", "15_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "output", "\\u", "weight_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "train", "ing", "\\u", "patterns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialized", " ", "parameter", "s", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "param", "\\u", "kernel", "\\u", "function_", "=_", "self_", "._", "default", "\\u", "param", "\\u", "kernel", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "c_", "=_", "self_", "._", "default", "\\u", "param", "\\u", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", "=_", "self_", "._", "default", "\\u", "param", "\\u", "kernel", "\\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_", "._", "param", "\\u", "kernel", "\\u", "function_", "=_", "params_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "c_", "=_", "params_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", "=_", "params_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\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", "kernel", "\\u", "matrix_", "(_", "self_", ",_", "train", "ing", "\\u", "patterns_", ",_", "kernel", "\\u", "type_", ",_", "kernel", "\\u", "param_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "patterns_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Calculat", "e", " ", "the", " ", "Ome", "ga", " ", "matrix", " ", "(", "kernel", " ", "matrix", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "test\\u", "pattern", "s", " ", "is", " ", "Non", "e", ",", " ", "then", " ", "the", " ", "train", "ing", " ", "Ome", "ga", " ", "matrix", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "calculated", ".", " ", "Thi", "s", " ", "matrix", " ", "represent", "s", " ", "the", " ", "kernel", " ", "value", " ", "from", " ", "each", "\\", "10", ";", " ", " ", " ", " ", "pattern", " ", "of", " ", "the", " ", "train", "ing", " ", "matrix", " ", "with", " ", "each", " ", "other", ".", " ", "If", " ", "test\\u", "pattern", "s", "\\", "10", ";", " ", " ", " ", " ", "exist", "s", ",", " ", "then", " ", "the", " ", "test", " ", "Ome", "ga", " ", "matrix", " ", "will", " ", "be", " ", "calculated", ".", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "matrix", " ", " ", "represent", "s", " ", "the", " ", "kernel", " ", "value", " ", "from", " ", "each", " ", "pattern", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "train", "ing", " ", "matrix", " ", "with", " ", "the", " ", "pattern", "s", " ", "of", " ", "test", " ", "matrix", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "train", "ing", "\\u", "pattern", "s", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "A", " ", "matrix", " ", "contain", "ing", " ", "the", "\\", "10", ";", " ", " ", "features", " ", "from", " ", "all", " ", "train", "ing", " ", "pattern", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "kernel", "\\u", "type", " ", "(", "str", "):", " ", "The", " ", "type", " ", "of", " ", "kernel", " ", "to", " ", "be", " ", "used", " ", "e", ".", "g", ":", " ", "rbf", "\\", "10", ";", " ", " ", " ", " ", "kernel", "\\u", "param", " ", "(", "list", " ", "of", " ", "float", "):", " ", "The", " ", "parameter", "s", " ", "of", " ", "the", " ", "chosen", "\\", "10", ";", " ", " ", "kernel", ".", "\\", "10", ";", " ", " ", " ", " ", "test\\u", "pattern", "s", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "An", " ", "option", "al", " ", "parameter", " ", "used", " ", "to", "\\", "10", ";", " ", " ", " ", " ", " ", "calcul", "ate", " ", "the", " ", "Ome", "ga", " ", "test", " ", "matrix", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "nump", "y", ".", "ndar", "ray", ":", " ", "Ome", "ga", " ", "matrix", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "number", "\\u", "train", "ing", "\\u", "patterns_", "=_", "train", "ing", "\\u", "patterns_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "kernel", "\\u", "type_", "==_", "\"", "rbf", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "test\\u", "patterns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp", "\\u", "omega_", "=_", "np_", "._", "dot_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "sum_", "(_", "train", "ing", "\\u", "patterns_", "**_", "2_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "-_", "1_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "ones_", "(_", "(_", "1_", ",_", "number", "\\u", "train", "ing", "\\u", "patterns_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp", "\\u", "omega_", "=_", "temp", "\\u", "omega_", "+_", "temp", "\\u", "omega_", "._", "conj_", "(_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "omega_", "=_", "np_", "._", "exp_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "-_", "(_", "2_", "**_", "kernel", "\\u", "param_", "[_", "0_", "]_", ")_", "*_", "(_", "temp", "\\u", "omega_", "-_", "2_", "*_", "(_", "np_", "._", "dot_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "train", "ing", "\\u", "patterns_", ",_", "train", "ing", "\\u", "patterns_", "._", "conj_", "(_", ")_", "._", "T_", ")_", ")_", ")_", ")_", "\\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 ", " _", "number", "\\u", "test\\u", "patterns_", "=_", "test\\u", "patterns_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp", "1_", "=_", "np_", "._", "dot_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "sum_", "(_", "train", "ing", "\\u", "patterns_", "**_", "2_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "-_", "1_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "ones_", "(_", "(_", "1_", ",_", "number", "\\u", "test\\u", "patterns_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "2_", "=_", "np_", "._", "dot_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "sum_", "(_", "test\\u", "patterns_", "**_", "2_", ",_", "axis_", "=_", "1_", ")_", "._", "reshape_", "(_", "-_", "1_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "ones_", "(_", "(_", "1_", ",_", "number", "\\u", "train", "ing", "\\u", "patterns_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "\\u", "omega_", "=_", "temp", "1_", "+_", "temp", "2_", "._", "conj_", "(_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "omega_", "=_", "np_", "._", "exp_", "(_", "-_", "(_", "2_", "**_", "kernel", "\\u", "param_", "[_", "0_", "]_", ")_", "*_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "temp", "\\u", "omega_", "-_", "2_", "*_", "np_", "._", "dot_", "(_", "train", "ing", "\\u", "patterns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "patterns_", "._", "conj_", "(_", ")_", "._", "T_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "kernel", "\\u", "type_", "==_", "\"", "linear", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "test\\u", "patterns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "omega_", "=_", "np_", "._", "dot_", "(_", "train", "ing", "\\u", "patterns_", ",_", "train", "ing", "\\u", "patterns_", "._", "conj_", "(_", ")_", "._", "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 ", " _", "omega_", "=_", "np_", "._", "dot_", "(_", "train", "ing", "\\u", "patterns_", ",_", "test\\u", "patterns_", "._", "conj_", "(_", ")_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "kernel", "\\u", "type_", "==_", "\"", "poly", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Power", " ", "a", "**", "x", " ", "is", " ", "undefined", " ", "whe", "n", " ", "x", " ", "is", " ", "real", " ", "and", " ", "'", "a", "'", " ", "is", " ", "negati", "ve", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "is", " ", "necessar", "y", " ", "to", " ", "force", " ", "an", " ", "integ", "er", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kernel", "\\u", "param_", "[_", "1_", "]_", "=_", "round_", "(_", "kernel", "\\u", "param_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "test\\u", "patterns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "np_", "._", "dot_", "(_", "train", "ing", "\\u", "patterns_", ",_", "train", "ing", "\\u", "patterns_", "._", "conj_", "(_", ")_", "._", "T_", ")_", "+_", "kernel", "\\u", "param_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "omega_", "=_", "temp_", "**_", "kernel", "\\u", "param_", "[_", "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 ", " _", "temp_", "=_", "np_", "._", "dot_", "(_", "train", "ing", "\\u", "patterns_", ",_", "test\\u", "patterns_", "._", "conj_", "(_", ")_", "._", "T_", ")_", "+_", "kernel", "\\u", "param_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "omega_", "=_", "temp_", "**_", "kernel", "\\u", "param_", "[_", "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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Error", ":", " ", "Inva", "lid", " ", "or", " ", "unava", "ilab", "le", " ", "kernel", " ", "function", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "omega_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "local", "\\u", "train_", "(_", "self_", ",_", "train", "ing", "\\u", "patterns_", ",_", "train", "ing", "\\u", "expected", "\\u", "targets_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "params", " ", "not", " ", "provided", ",", " ", "use", "s", " ", "initialize", "d", " ", "parameter", "s", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "param", "\\u", "kernel", "\\u", "function_", "=_", "params_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "c_", "=_", "params_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", "=_", "params_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ne", "ed", " ", "to", " ", "save", " ", "all", " ", "train", "ing", " ", "pattern", "s", " ", "to", " ", "perform", " ", "kernel", " ", "calculati", "on", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "testi", "ng", " ", "and", " ", "predicti", "on", " ", "phase_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "train", "ing", "\\u", "patterns_", "=_", "train", "ing", "\\u", "patterns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "train", "ing", "\\u", "patterns_", "=_", "self_", "._", "train", "ing", "\\u", "patterns_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Train", "ing", " ", "phase_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "omega", "\\u", "train_", "=_", "self_", "._", "\\u", "kernel", "\\u", "matrix_", "(_", "self_", "._", "train", "ing", "\\u", "patterns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "output", "\\u", "weight_", "=_", "np_", "._", "linalg_", "._", "solve_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "omega", "\\u", "train_", "+_", "np_", "._", "eye_", "(_", "number", "\\u", "train", "ing", "\\u", "patterns_", ")_", "/_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", "**_", "self_", "._", "param", "\\u", "c_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "train", "ing", "\\u", "expected", "\\u", "targets_", ")_", "._", "reshape_", "(_", "-_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "ing", "\\u", "predi", "cte", "d\\u", "targets_", "=_", "np_", "._", "dot_", "(_", "omega", "\\u", "train_", ",_", "self_", "._", "output", "\\u", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "train", "ing", "\\u", "predi", "cte", "d\\u", "targets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "local", "\\u", "test_", "(_", "self_", ",_", "testi", "ng", "\\u", "patterns_", ",_", "testi", "ng", "\\u", "expected", "\\u", "targets_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "predicti", "ng_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "omega", "\\u", "test_", "=_", "self_", "._", "\\u", "kernel", "\\u", "matrix_", "(_", "self_", "._", "train", "ing", "\\u", "patterns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "testi", "ng", "\\u", "patterns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "testi", "ng", "\\u", "predi", "cte", "d\\u", "targets_", "=_", "np_", "._", "dot_", "(_", "omega", "\\u", "test_", "._", "conj_", "(_", ")_", "._", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "output", "\\u", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "testi", "ng", "\\u", "predi", "cte", "d\\u", "targets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "avail", "able", "\\u", "kernel", "\\u", "functions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "avail", "able", " ", "kernel", " ", "function", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "avail", "able", "\\u", "kernel", "\\u", "functions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Print", " ", "parameter", "s", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Regr", "esso", "r", " ", "Parameter", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Regula", "riz", "ation", " ", "coefficient", ":", " ", "\"_", ",_", "self_", "._", "param", "\\u", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Kern", "el", " ", "Function", ":", " ", "\"_", ",_", "self_", "._", "param", "\\u", "kernel", "\\u", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Kern", "el", " ", "parameter", "s", ":", " ", "\"_", ",_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "CV", " ", "error", ":", " ", "\"_", ",_", "self_", "._", "cv", "\\u", "best", "\\u", "rmse", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "search", "\\u", "param_", "(_", "self_", ",_", "database_", ",_", "datapro", "cess", "_", "=_", "None_", ",_", "path", "\\u", "filename_", "=_", "(_", "\"\"_", ",_", "\"\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save_", "=_", "False_", ",_", "cv_", "=_", "\"", "ts", "\"_", ",_", "of_", "=_", "\"", "rmse", "\"_", ",_", "kf_", "=_", "None_", ",_", "eval_", "=_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sear", "ch", " ", "best", " ", "hyperparameters", " ", "for", " ", "classif", "ier", "/", "regressor", " ", "based", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "opt", "unity", " ", "algo", "rit", "hms", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "databa", "se", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "a", " ", "matrix", " ", "contain", "ing", " ", "all", " ", "pattern", "s", "\\", "10", ";", " ", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "for", " ", "train", "ing", "/", "testi", "ng", " ", "at", " ", "some", "\\", "10", ";", " ", " ", "cross", "-", "validation", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "datapro", "cess", " ", "(", "Data", "Process", "):", " ", "an", " ", "object", " ", "tha", "t", " ", "will", " ", "pre", "-", "process", "\\", "10", ";", " ", " ", "databa", "se", " ", "bef", "ore", " ", "train", "ing", ".", " ", "Default", "s", " ", "to", " ", "Non", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "path", "\\u", "filename", " ", "(", "tuple", "):", " ", "*", "TOD", "O", "*.", "\\", "10", ";", " ", " ", " ", " ", "save", " ", "(", "bool", "):", " ", "*", "TOD", "O", "*.", "\\", "10", ";", " ", " ", " ", " ", "cv", " ", "(", "str", "):", " ", "Cross", "-", "validation", " ", "method", ".", " ", "Default", "s", " ", "to", " ", "\"", "ts", "\".\\", "10", ";", " ", " ", " ", " ", "of", " ", "(", "str", "):", " ", "Objecti", "ve", " ", "function", " ", "to", " ", "be", " ", "minimize", "d", " ", "at", "\\", "10", ";", " ", " ", "opt", "unity", ".", "minimize", ".", " ", "Default", "s", " ", "to", " ", "\"", "rmse", "\".\\", "10", ";", " ", " ", " ", " ", "kf", " ", "(", "list", " ", "of", " ", "str", "):", " ", "a", " ", "list", " ", "of", " ", "kernel", " ", "function", "s", " ", "to", " ", "be", " ", "used", " ", "by", "\\", "10", ";", " ", " ", "the", " ", "search", ".", " ", "Default", "s", " ", "to", " ", "Non", "e", ",", " ", "this", " ", "set", " ", "all", " ", "avail", "able", "\\", "10", ";", " ", " ", "function", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "eval", " ", "(", "int", "):", " ", "Number", " ", "of", " ", "step", "s", " ", "(", "evaluations", ")", " ", "to", " ", "opt", "unity", " ", "algo", "rit", "hm", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "set", " ", "of", " ", "hyperparameters", " ", "will", " ", "perform", " ", "a", " ", "cross", "-", "validation", "\\", "10", ";", " ", " ", " ", " ", "method", " ", "chosen", " ", "by", " ", "param", " ", "cv", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Avail", "able", " ", "*", "cv", "*", " ", "method", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "\"", "ts", "\"", " ", ":", "func", ":`", "ml", "tool", "s", ".", "time", "\\u", "series", "\\u", "cross", "\\u", "validation", "()`", "\\", "10", ";", " ", " ", "Perform", " ", "a", " ", "time", "-", "series", " ", "cross", "-", "validation", " ", "suggested", " ", "by", " ", "Hy", "dma", "n", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "\"", "kf", "old", "\"", " ", ":", "func", ":`", "ml", "tool", "s", ".", "kf", "old", "\\u", "cross", "\\u", "validation", "()`", "\\", "10", ";", " ", " ", "Perform", " ", "a", " ", "k", "-", "fold", " ", "cross", "-", "validation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Avail", "able", " ", "*", "of", "*", " ", "function", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "\"", "accu", "rac", "y", "\",", " ", "\"", "rmse", "\",", " ", "\"", "map", "e", "\",", " ", "\"", "me", "\".\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "Al", "so", ":", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "opt", "unity", ".", "read", "the", "docs", ".", "org", "/", "en", "/", "late", "st", "/", "user", "/", "index", ".", "html", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "kf_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "kernel", "\\u", "functions_", "=_", "self_", "._", "avail", "able", "\\u", "kernel", "\\u", "functions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "kf_", ")_", "is_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "kernel", "\\u", "functions_", "=_", "kf_", "\\u\\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_", "(_", "\"", "Inva", "lid", " ", "format", " ", "for", " ", "argu", "ment", " ", "'", "kf", "'.\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "self_", "._", "regressor", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"###", "##", " ", "Start", " ", "search", " ", "#####", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "configparser_", "._", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "<_", "(_", "3_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "._", "readf", "p_", "(_", "open_", "(_", "\\u", "EL", "MK", "\\u", "CONFIG_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "._", "read", "\\u", "file_", "(_", "open_", "(_", "\\u", "EL", "MK", "\\u", "CONFIG_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "best", "\\u", "function", "\\u", "error_", "=_", "9999", "9.9", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "\\u", "error_", "=_", "best", "\\u", "function", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "param", "\\u", "c_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "param", "\\u", "kernel", "\\u", "function_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "param", "\\u", "kernel", "\\u", "param_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kernel", "\\u", "function_", "in_", "search", "\\u", "kernel", "\\u", "functions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sys_", "._", "version", "\\u", "info_", "<_", "(_", "3_", ",_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elm", "k", "\\u", "c\\u", "range_", "=_", "ast_", "._", "literal", "\\u", "eval_", "(_", "config_", "._", "get_", "(_", "\"", "DEF", "AUL", "T", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "elm", "k", "\\u", "c\\u", "range", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "parameters_", "=_", "config_", "._", "getint_", "(_", "kernel", "\\u", "function_", ",_", "\"", "kernel", "\\u", "n", "\\u", "param", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kernel", "\\u", "p", "\\u", "range_", "=_", "ast_", "._", "literal", "\\u", "eval_", "(_", "config_", "._", "get_", "(_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "kernel", "\\u", "params", "\\u", "range", "\"_", ")_", ")_", "\\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 ", " _", "kernel", "\\u", "config_", "=_", "config_", "[_", "kernel", "\\u", "function_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "elm", "k", "\\u", "c\\u", "range_", "=_", "ast_", "._", "literal", "\\u", "eval_", "(_", "kernel", "\\u", "config_", "[_", "\"", "elm", "k", "\\u", "c\\u", "range", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "parameters_", "=_", "int_", "(_", "kernel", "\\u", "config_", "[_", "\"", "kernel", "\\u", "n", "\\u", "param", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kernel", "\\u", "p", "\\u", "range_", "=_", "ast_", "._", "literal", "\\u", "eval_", "(_", "kernel", "\\u", "config_", "[_", "\"", "kernel", "\\u", "params", "\\u", "range", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "param", "\\u", "ranges_", "=_", "[_", "[_", "elm", "k", "\\u", "c\\u", "range_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "elm", "k", "\\u", "c\\u", "range_", "[_", "0_", "]_", "[_", "1_", "]_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param_", "in_", "range_", "(_", "n", "\\u", "parameters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "param", "\\u", "ranges_", "._", "append_", "(_", "[_", "kernel", "\\u", "p", "\\u", "range_", "[_", "param_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "kernel", "\\u", "p", "\\u", "range_", "[_", "param_", "]_", "[_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrapp", "er", "\\u", "0", "param_", "(_", "param", "\\u", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Wrapper", " ", "for", " ", "objecti", "ve", " ", "function", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cv_", "==_", "\"", "ts", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cv", "\\u", "tr", "\\u", "error_", ",_", "cv", "\\u", "te", "\\u", "error_", "=_", "time", "\\u", "series", "\\u", "cross", "\\u", "validation_", "(_", "self_", ",_", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "[_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "folds_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datapro", "cess", "_", "=_", "datapro", "cess", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cv_", "==_", "\"", "kf", "old", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cv", "\\u", "tr", "\\u", "error_", ",_", "cv", "\\u", "te", "\\u", "error_", "=_", "kf", "old", "\\u", "cross", "\\u", "validation_", "(_", "self_", ",_", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "[_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "folds_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datapro", "cess", "_", "=_", "datapro", "cess", "_", ")_", "\\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 ", " ", "_", "raise_", "Exception_", "(_", "\"", "Inva", "lid", " ", "type", " ", "of", " ", "cross", "-", "validation", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "of_", "==_", "\"", "accu", "rac", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "util_", "=_", "1_", "/_", "cv", "\\u", "te", "\\u", "error_", "._", "get", "\\u", "accuracy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "util_", "=_", "cv", "\\u", "te", "\\u", "error_", "._", "get_", "(_", "of_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "c", ":\"", ",", " ", "param", "\\u", "c", ",", " ", "\"", "util", ":", " ", "\",", " ", "util", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrapp", "er", "\\u", "1p", "aram", "_", "(_", "param", "\\u", "c_", ",_", "param", "\\u", "kernel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Wrapper", " ", "for", " ", "opt", "unity", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cv_", "==_", "\"", "ts", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cv", "\\u", "tr", "\\u", "error_", ",_", "cv", "\\u", "te", "\\u", "error_", "=_", "time", "\\u", "series", "\\u", "cross", "\\u", "validation_", "(_", "self_", ",_", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "[_", "param", "\\u", "kernel_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "folds_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datapro", "cess", "_", "=_", "datapro", "cess", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cv_", "==_", "\"", "kf", "old", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cv", "\\u", "tr", "\\u", "error_", ",_", "cv", "\\u", "te", "\\u", "error_", "=_", "kf", "old", "\\u", "cross", "\\u", "validation_", "(_", "self_", ",_", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "[_", "param", "\\u", "kernel_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "folds_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datapro", "cess", "_", "=_", "datapro", "cess", "_", ")_", "\\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 ", " ", "_", "raise_", "Exception_", "(_", "\"", "Inva", "lid", " ", "type", " ", "of", " ", "cross", "-", "validation", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "of_", "==_", "\"", "accu", "rac", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "util_", "=_", "1_", "/_", "cv", "\\u", "te", "\\u", "error_", "._", "get", "\\u", "accuracy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "util_", "=_", "cv", "\\u", "te", "\\u", "error_", "._", "get_", "(_", "of_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "c", ":\"", ",", " ", "param", "\\u", "c", ",", " ", "\"", " ", "gamma", ":\"", ",", " ", "param", "\\u", "kernel", ",", " ", "\"", "util", ":", " ", "\",", " ", "util", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wrapp", "er", "\\u", "2p", "aram", "_", "(_", "param", "\\u", "c_", ",_", "param", "\\u", "kernel", "1_", ",_", "param", "\\u", "kernel", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", "Wrapper", " ", "for", " ", "opt", "unity", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cv_", "==_", "\"", "ts", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cv", "\\u", "tr", "\\u", "error_", ",_", "cv", "\\u", "te", "\\u", "error_", "=_", "time", "\\u", "series", "\\u", "cross", "\\u", "validation_", "(_", "self_", ",_", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "[_", "param", "\\u", "kernel", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "kernel", "2_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "folds_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datapro", "cess", "_", "=_", "datapro", "cess", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cv_", "==_", "\"", "kf", "old", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cv", "\\u", "tr", "\\u", "error_", ",_", "cv", "\\u", "te", "\\u", "error_", "=_", "kf", "old", "\\u", "cross", "\\u", "validation_", "(_", "self_", ",_", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "[_", "param", "\\u", "kernel", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "kernel", "2_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "folds_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datapro", "cess", "_", "=_", "datapro", "cess", "_", ")_", "\\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 ", " ", "_", "raise_", "Exception_", "(_", "\"", "Inva", "lid", " ", "type", " ", "of", " ", "cross", "-", "validation", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "of_", "==_", "\"", "accu", "rac", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "util_", "=_", "1_", "/_", "cv", "\\u", "te", "\\u", "error_", "._", "get", "\\u", "accuracy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "util_", "=_", "cv", "\\u", "te", "\\u", "error_", "._", "get_", "(_", "of_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "c", ":\"", ",", " ", "param", "\\u", "c", ",", " ", "\"", " ", "param", "1", ":\"", ",", " ", "param", "\\u", "kernel", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", " ", "param", "2", ":\"", ",", " ", "param", "\\u", "kernel", "2", ",", " ", "\"", "util", ":", " ", "\",", " ", "util", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "kernel", "\\u", "function_", "==_", "\"", "linear", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "optim", "al", "\\u", "parameters_", ",_", "details_", ",_", "\\u_", "=_", "opt", "unity", "_", "._", "minimize_", "(_", "wrapp", "er", "\\u", "0", "param_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "solve", "r", "\\u", "name_", "=_", "\"", "cma", "-", "es", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "evals_", "=_", "eval_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", "=_", "param", "\\u", "ranges_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "kernel", "\\u", "function_", "==_", "\"", "rbf", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "optim", "al", "\\u", "parameters_", ",_", "details_", ",_", "\\u_", "=_", "opt", "unity", "_", "._", "minimize_", "(_", "wrapp", "er", "\\u", "1p", "aram", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "solve", "r", "\\u", "name_", "=_", "\"", "cma", "-", "es", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "evals_", "=_", "eval_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", "=_", "param", "\\u", "ranges_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "kernel_", "=_", "param", "\\u", "ranges_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "kernel", "\\u", "function_", "==_", "\"", "poly", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "optim", "al", "\\u", "parameters_", ",_", "details_", ",_", "\\u_", "=_", "opt", "unity", "_", "._", "minimize_", "(_", "wrapp", "er", "\\u", "2p", "aram", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "solve", "r", "\\u", "name_", "=_", "\"", "cma", "-", "es", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "evals_", "=_", "eval_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "c_", "=_", "param", "\\u", "ranges_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "kernel", "1_", "=_", "param", "\\u", "ranges_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "param", "\\u", "kernel", "2_", "=_", "param", "\\u", "ranges_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Inva", "lid", " ", "kernel", " ", "function", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Save", " ", "best", " ", "kernel", " ", "result_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "details_", "[_", "0_", "]_", "<_", "temp", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp", "\\u", "error_", "=_", "details_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "of_", "==_", "\"", "accu", "rac", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "best", "\\u", "function", "\\u", "error_", "=_", "1_", "/_", "temp", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "best", "\\u", "function", "\\u", "error_", "=_", "temp", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "best", "\\u", "param", "\\u", "kernel", "\\u", "function_", "=_", "kernel", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "param", "\\u", "c_", "=_", "optim", "al", "\\u", "parameters_", "[_", "\"", "param", "\\u", "c", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "best", "\\u", "param", "\\u", "kernel", "\\u", "function_", "==_", "\"", "linear", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "best", "\\u", "param", "\\u", "kernel", "\\u", "param_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "best", "\\u", "param", "\\u", "kernel", "\\u", "function_", "==_", "\"", "rbf", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "best", "\\u", "param", "\\u", "kernel", "\\u", "param_", "=_", "[_", "optim", "al", "\\u", "parameters_", "[_", "\"", "param", "\\u", "kernel", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "best", "\\u", "param", "\\u", "kernel", "\\u", "function_", "==_", "\"", "poly", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "best", "\\u", "param", "\\u", "kernel", "\\u", "param_", "=_", "[_", "optim", "al", "\\u", "parameters_", "[_", "\"", "param", "\\u", "kernel", "1", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optim", "al", "\\u", "parameters_", "[_", "\"", "param", "\\u", "kernel", "2", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "Inva", "lid", " ", "kernel", " ", "function", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "best", ":", " ", "\",", " ", "best", "\\u", "param", "\\u", "kernel", "\\u", "function", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "best", "\\u", "function", "\\u", "error", ",", " ", "best", "\\u", "param", "\\u", "c", ",", " ", "best", "\\u", "param", "\\u", "kernel", "\\u", "param", ")_", "\\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_", "of_", "==_", "\"", "accu", "rac", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Kern", "el", " ", "function", ":", " ", "\"_", ",_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "best", " ", "cv", " ", "value", ":", " ", "\"_", ",_", "1_", "/_", "details_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Kern", "el", " ", "function", ":", " ", "\"_", ",_", "kernel", "\\u", "function_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "best", " ", "cv", " ", "value", ":", " ", "\"_", ",_", "details_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ML", "Tool", "s", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "cv", "\\u", "best", "\\u", "rmse", "_", "=_", "best", "\\u", "function", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "EL", "M", " ", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "param", "\\u", "c_", "=_", "best", "\\u", "param", "\\u", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "function_", "=_", "best", "\\u", "param", "\\u", "kernel", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "kernel", "\\u", "params_", "=_", "best", "\\u", "param", "\\u", "kernel", "\\u", "param_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"###", "##", " ", "Sear", "ch", " ", "complete", " ", "#####", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "print", "\\u", "parameters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ",_", "train", "ing", "\\u", "matrix_", ",_", "params_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "e", " ", "output", "\\u", "weight", " ", "values", " ", "need", "ed", " ", "to", " ", "test", "/", "predi", "ct", " ", "data", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "params", " ", "is", " ", "provided", ",", " ", "this", " ", "method", " ", "will", " ", "use", " ", "at", " ", "train", "ing", " ", "phase", ".", "\\", "10", ";", " ", " ", " ", " ", "Else", ",", " ", "it", " ", "will", " ", "use", " ", "the", " ", "default", " ", "value", " ", "provided", " ", "at", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "initialization", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "train", "ing", "\\u", "matrix", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "a", " ", "matrix", " ", "contain", "ing", " ", "all", "\\", "10", ";", " ", " ", "pattern", "s", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "for", " ", "train", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "params", " ", "(", "list", "):", " ", "a", " ", "list", " ", "of", " ", "parameter", "s", " ", "defin", "ed", " ", "at", "\\", "10", ";", " ", " ", ":", "func", ":`", "EL", "MK", "ern", "el", ".\\u", "\\u", "init", "\\u\\u", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "Error", "`", ":", " ", "train", "ing", " ", "error", " ", "object", " ", "contain", "ing", " ", "expected", ",", "\\", "10", ";", " ", " ", "predi", "cte", "d", " ", "target", "s", " ", "and", " ", "all", " ", "error", " ", "metric", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", "\\", "10", ";", " ", " ", " ", " ", "Train", "ing", " ", "matrix", " ", "must", " ", "have", " ", "target", " ", "variab", "les", " ", "as", " ", "the", " ", "first", " ", "column", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "ml", "\\u", "train_", "(_", "train", "ing", "\\u", "matrix_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test_", "(_", "self_", ",_", "testi", "ng", "\\u", "matrix_", ",_", "predicti", "ng_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Calculat", "e", " ", "test", " ", "predi", "cte", "d", " ", "values", " ", "based", " ", "on", " ", "previ", "ous", " ", "train", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "testi", "ng", "\\u", "matrix", " ", "(", "nump", "y", ".", "ndar", "ray", "):", " ", "a", " ", "matrix", " ", "contain", "ing", " ", "all", "\\", "10", ";", " ", " ", "pattern", "s", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "for", " ", "testi", "ng", ".", "\\", "10", ";", " ", " ", " ", " ", "predicti", "ng", " ", "(", "bool", "):", " ", "Don", "'", "t", " ", "set", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "Error", "`", ":", " ", "testi", "ng", " ", "error", " ", "object", " ", "contain", "ing", " ", "expected", ",", "\\", "10", ";", " ", " ", "predi", "cte", "d", " ", "target", "s", " ", "and", " ", "all", " ", "error", " ", "metric", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", "\\", "10", ";", " ", " ", " ", " ", "Test", "ing", " ", "matrix", " ", "must", " ", "have", " ", "target", " ", "variab", "les", " ", "as", " ", "the", " ", "first", " ", "column", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "ml", "\\u", "test_", "(_", "testi", "ng", "\\u", "matrix_", ",_", "predicti", "ng_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "copy", "\\u", "doc", "\\u", "of_", "(_", "ML", "Tools_", "._", "\\u", "ml", "\\u", "predict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "predict_", "(_", "self_", ",_", "horizon_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".\\u", "\\u", "doc", "\\u\\u", " ", "=", " ", "self", ".\\u", "ml", "\\u", "predi", "ct", ".\\u", "\\u", "doc\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "ml", "\\u", "predict_", "(_", "horizon_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "EL", "MK", "ern", "el_", "(_", "ML", "Tools_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "copy", "\\u", "doc", "\\u", "of_", "(_", "ML", "Tools_", "._", "\\u", "ml", "\\u", "train", "\\u", "iterative", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "train", "\\u", "iterative", "_", "(_", "self_", ",_", "databa", "se", "\\u", "matrix_", ",_", "params_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slid", "ing", "\\u", "window_", "=_", "168_", ",_", "k_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".\\u", "\\u", "doc", "\\u\\u", " ", "=", " ", "self", ".\\u", "ml", "\\u", "train", "\\u", "iterative", ".\\u", "\\u", "doc\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "ml", "\\u", "train", "\\u", "iterative", "_", "(_", "databa", "se", "\\u", "matrix_", ",_", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slid", "ing", "\\u", "window_", ",_", "k_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Redundant comparison
lionheart/django-pyodbc/django_pyodbc/base.py
[ { "content": " def _get_connection_string(self):\n settings_dict = self.settings_dict\n db_str, user_str, passwd_str, port_str = None, None, \"\", None\n options = settings_dict['OPTIONS']\n if settings_dict['NAME']:\n db_str = settings_dict['NAME']\n if settings_dict['HOST']:\n host_str = settings_dict['HOST']\n else:\n host_str = 'localhost'\n if settings_dict['USER']:\n user_str = settings_dict['USER']\n if settings_dict['PASSWORD']:\n passwd_str = settings_dict['PASSWORD']\n if settings_dict['PORT']:\n port_str = settings_dict['PORT']\n\n if not db_str:\n raise ImproperlyConfigured('You need to specify NAME in your Django settings file.')\n\n cstr_parts = []\n if 'driver' in options:\n driver = options['driver']\n else:\n if os.name == 'nt':\n driver = 'SQL Server'\n else:\n driver = 'FreeTDS'\n\n if driver == 'FreeTDS' or driver.endswith('/libtdsodbc.so'):\n driver_is_freetds = True\n else:\n driver_is_freetds = False\n\n # Microsoft driver names assumed here are:\n # * SQL Server\n # * SQL Native Client\n # * SQL Server Native Client 10.0/11.0\n # * ODBC Driver 11 for SQL Server\n ms_drivers = re.compile('.*SQL (Server$|(Server )?Native Client)')\n\n if 'dsn' in options:\n cstr_parts.append('DSN=%s' % options['dsn'])\n else:\n # Only append DRIVER if DATABASE_ODBC_DSN hasn't been set\n if os.path.isabs(driver):\n cstr_parts.append('DRIVER=%s' % driver)\n else:\n cstr_parts.append('DRIVER={%s}' % driver)\n\n if ms_drivers.match(driver) or driver_is_freetds and \\\n options.get('host_is_server', False):\n if port_str:\n host_str += ';PORT=%s' % port_str\n cstr_parts.append('SERVER=%s' % host_str)\n else:\n cstr_parts.append('SERVERNAME=%s' % host_str)\n\n if user_str:\n cstr_parts.append('UID=%s;PWD=%s' % (user_str, passwd_str))\n else:\n if ms_drivers.match(driver):\n cstr_parts.append('Trusted_Connection=yes')\n else:\n cstr_parts.append('Integrated Security=SSPI')\n\n cstr_parts.append('DATABASE=%s' % db_str)\n\n if self.MARS_Connection:\n cstr_parts.append('MARS_Connection=yes')\n\n if 'extra_params' in options:\n cstr_parts.append(options['extra_params'])\n connectionstring = ';'.join(cstr_parts)\n return connectionstring", "metadata": "root.DatabaseWrapper._get_connection_string", "header": "['class', 'DatabaseWrapper', '(', 'BaseDatabaseWrapper', ')', ':', '___EOS___']", "index": 203 } ]
[]
[]
0
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "class_", "Databa", "se", "Wrapper_", "(_", "Base", "Databa", "se", "Wrapper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "connecti", "on", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings", "\\u", "dict_", "=_", "self_", "._", "settings", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "str_", ",_", "user", "\\u", "str_", ",_", "passw", "d\\u", "str_", ",_", "port", "\\u", "str_", "=_", "None_", ",_", "None_", ",_", "\"\"_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "=_", "settings", "\\u", "dict_", "[_", "'", "OPTION", "S", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings", "\\u", "dict_", "[_", "'", "NAME", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "str_", "=_", "settings", "\\u", "dict_", "[_", "'", "NAME", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings", "\\u", "dict_", "[_", "'", "HOST", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "str_", "=_", "settings", "\\u", "dict_", "[_", "'", "HOST", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "str_", "=_", "'", "local", "host", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings", "\\u", "dict_", "[_", "'", "USER", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "str_", "=_", "settings", "\\u", "dict_", "[_", "'", "USER", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings", "\\u", "dict_", "[_", "'", "PASS", "WORD", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "passw", "d\\u", "str_", "=_", "settings", "\\u", "dict_", "[_", "'", "PASS", "WORD", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings", "\\u", "dict_", "[_", "'", "PORT", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port", "\\u", "str_", "=_", "settings", "\\u", "dict_", "[_", "'", "PORT", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "db", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Impro", "perl", "y", "Configured_", "(_", "'", "You", " ", "need", " ", "to", " ", "speci", "fy", " ", "NAME", " ", "in", " ", "your", " ", "Dj", "ang", "o", " ", "settings", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cstr", "\\u", "parts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "driver", "'_", "in_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "=_", "options_", "[_", "'", "driver", "'_", "]_", "\\u\\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_", "os_", "._", "name_", "==_", "'", "nt", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "=_", "'", "SQL", " ", "Server", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "=_", "'", "Free", "TD", "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_", "driver_", "==_", "'", "Free", "TD", "S", "'_", "or_", "driver_", "._", "endswith_", "(_", "'/", "libt", "dso", "dbc", ".", "so", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver", "\\u", "is", "\\u", "free", "tds_", "=_", "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 ", " _", "driver", "\\u", "is", "\\u", "free", "tds_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Micro", "soft", " ", "driver", " ", "names", " ", "assume", "d", " ", "here", " ", "are", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "SQL", " ", "Server_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "SQL", " ", "Nat", "ive", " ", "Client_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "SQL", " ", "Server", " ", "Nat", "ive", " ", "Client", " ", "10.", "0", "/", "11.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "OD", "BC", " ", "Drive", "r", " ", "11", " ", "for", " ", "SQL", " ", "Server_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ms", "\\u", "drivers_", "=_", "re_", "._", "compile_", "(_", "'.*", "SQL", " ", "(", "Server", "$", "|(", "Server", " ", ")?", "Nat", "ive", " ", "Client", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "dsn", "'_", "in_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "DS", "N", "=", "%", "s", "'_", "%_", "options_", "[_", "'", "dsn", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", "ly", " ", "append", " ", "DRIVER", " ", "if", " ", "DATA", "BASE", "\\u", "OD", "BC", "\\u", "DS", "N", " ", "hasn", "'", "t", " ", "bee", "n", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isabs_", "(_", "driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "DRIVER", "=", "%", "s", "'_", "%_", "driver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "DRIVER", "={", "%", "s", "}'_", "%_", "driver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ms", "\\u", "drivers_", "._", "match_", "(_", "driver_", ")_", "or_", "driver", "\\u", "is", "\\u", "free", "tds_", "and_", "options_", "._", "get_", "(_", "'", "host", "\\u", "is", "\\u", "server", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "port", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "host", "\\u", "str_", "+=_", "';", "PORT", "=", "%", "s", "'_", "%_", "port", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "SERVER", "=", "%", "s", "'_", "%_", "host", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "SERVER", "NAME", "=", "%", "s", "'_", "%_", "host", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "UI", "D", "=", "%", "s", ";", "PWD", "=", "%", "s", "'_", "%_", "(_", "user", "\\u", "str_", ",_", "passw", "d\\u", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ms", "\\u", "drivers_", "._", "match_", "(_", "driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "Trust", "ed", "\\u", "Connect", "ion", "=", "ye", "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 ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "Integrate", "d", " ", "Secur", "it", "y", "=", "SSP", "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_", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "DATA", "BASE", "=", "%", "s", "'_", "%_", "db", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "MAR", "S", "\\u", "Connection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "'", "MAR", "S", "\\u", "Connect", "ion", "=", "ye", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "extra", "\\u", "params", "'_", "in_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cstr", "\\u", "parts_", "._", "append_", "(_", "options_", "[_", "'", "extra", "\\u", "params", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connections", "tring_", "=_", "';'_", "._", "join_", "(_", "cstr", "\\u", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "connections", "tring_", "\\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, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
beetbox/beets/beetsplug/ipfs.py
[ { "content": " def ipfs_add(self, album):\n try:\n album_dir = album.item_dir()\n except AttributeError:\n return False\n try:\n if album.ipfs:\n self._log.debug('{0} already added', album_dir)\n # Already added to ipfs\n return False\n except AttributeError:\n pass\n\n self._log.info('Adding {0} to ipfs', album_dir)\n\n cmd = \"ipfs add -q -r\".split()\n cmd.append(album_dir)\n try:\n output = util.command_output(cmd).split()\n except (OSError, subprocess.CalledProcessError) as exc:\n self._log.error(u'Failed to add {0}, error: {1}', album_dir, exc)\n return False\n length = len(output)\n\n for linenr, line in enumerate(output):\n line = line.strip()\n if linenr == length - 1:\n # last printed line is the album hash\n self._log.info(\"album: {0}\", line)\n album.ipfs = line\n else:\n try:\n item = album.items()[linenr]\n self._log.info(\"item: {0}\", line)\n item.ipfs = line\n item.store()\n except IndexError:\n # if there's non music files in the to-add folder they'll\n # get ignored here\n pass\n\n return True", "metadata": "root.IPFSPlugin.ipfs_add", "header": "['class', 'IPFSPlugin', '(', 'BeetsPlugin', ')', ':', '___EOS___']", "index": 103 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "IP", "FS", "Plugin_", "(_", "Bee", "ts", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ip", "fs", "\\u", "add_", "(_", "self_", ",_", "album_", ")_", ":_", "\\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 ", " _", "album", "\\u", "dir_", "=_", "album_", "._", "item", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\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_", "album_", "._", "ip", "fs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "debug_", "(_", "'{", "0", "}", " ", "alr", "ead", "y", " ", "adde", "d", "'_", ",_", "album", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Al", "read", "y", " ", "adde", "d", " ", "to", " ", "ip", "fs_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "log_", "._", "info_", "(_", "'", "Add", "ing", " ", "{", "0", "}", " ", "to", " ", "ip", "fs", "'_", ",_", "album", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "\"", "ip", "fs", " ", "add", " ", "-", "q", " ", "-", "r", "\"_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "._", "append_", "(_", "album", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "util_", "._", "command", "\\u", "output_", "(_", "cmd_", ")_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "OSE", "rror_", ",_", "subprocess_", "._", "Call", "ed", "Process", "Error_", ")_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "error_", "(_", "u", "'", "Fail", "ed", " ", "to", " ", "add", " ", "{", "0", "},", " ", "error", ":", " ", "{", "1", "}'_", ",_", "album", "\\u", "dir_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "length_", "=_", "len_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "linen", "r_", ",_", "line_", "in_", "enumerate_", "(_", "output_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "linen", "r_", "==_", "length_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "last", " ", "printed", " ", "line", " ", "is", " ", "the", " ", "album", " ", "hash_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "log_", "._", "info_", "(_", "\"", "album", ":", " ", "{", "0", "}\"_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "album_", "._", "ip", "fs_", "=_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "item_", "=_", "album_", "._", "items_", "(_", ")_", "[_", "linen", "r_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "log_", "._", "info_", "(_", "\"", "item", ":", " ", "{", "0", "}\"_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "ip", "fs_", "=_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "store_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "there", "'", "s", " ", "non", " ", "music", " ", "files", " ", "in", " ", "the", " ", "to", "-", "add", " ", "folder", " ", "the", "y", "'", "ll_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "ignore", "d", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ",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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
nltk/nltk/nltk/stem/lancaster.py
[ { "content": "# Natural Language Toolkit: Stemmers\n#\n# Copyright (C) 2001-2016 NLTK Project\n# Author: Steven Tomcavage <stomcava@law.upenn.edu>\n# URL: <http://nltk.org/>\n# For license information, see LICENSE.TXT\n\n\"\"\"\nA word stemmer based on the Lancaster stemming algorithm.\nPaice, Chris D. \"Another Stemmer.\" ACM SIGIR Forum 24.3 (1990): 56-61.\n\"\"\"\nfrom __future__ import unicode_literals\nimport re\n\nfrom nltk.stem.api import StemmerI\nfrom nltk.compat import python_2_unicode_compatible\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@python_2_unicode_compatible\nclass LancasterStemmer(StemmerI):\n \"\"\"\n Lancaster Stemmer\n\n >>> from nltk.stem.lancaster import LancasterStemmer\n >>> st = LancasterStemmer()\n >>> st.stem('maximum') # Remove \"-um\" when word is intact\n 'maxim'\n >>> st.stem('presumably') # Don't remove \"-um\" when word is not intact\n 'presum'\n >>> st.stem('multiply') # No action taken if word ends with \"-ply\"\n 'multiply'\n >>> st.stem('provision') # Replace \"-sion\" with \"-j\" to trigger \"j\" set of rules\n 'provid'\n >>> st.stem('owed') # Word starting with vowel must contain at least 2 letters\n 'ow'\n >>> st.stem('ear') # ditto\n 'ear'\n >>> st.stem('saying') # Words starting with consonant must contain at least 3\n 'say'\n >>> st.stem('crying') # letters and one of those letters must be a vowel\n 'cry'\n >>> st.stem('string') # ditto\n 'string'\n >>> st.stem('meant') # ditto\n 'meant'\n >>> st.stem('cement') # ditto\n 'cem'\n \"\"\"\n\n # The rule list is static since it doesn't change between instances\n rule_tuple = (\n \"ai*2.\", # -ia > - if intact\n \"a*1.\", # -a > - if intact\n \"bb1.\", # -bb > -b\n \"city3s.\", # -ytic > -ys\n \"ci2>\", # -ic > -\n \"cn1t>\", # -nc > -nt\n \"dd1.\", # -dd > -d\n \"dei3y>\", # -ied > -y\n \"deec2ss.\", # -ceed >\", -cess\n \"dee1.\", # -eed > -ee\n \"de2>\", # -ed > -\n \"dooh4>\", # -hood > -\n \"e1>\", # -e > -\n \"feil1v.\", # -lief > -liev\n \"fi2>\", # -if > -\n \"gni3>\", # -ing > -\n \"gai3y.\", # -iag > -y\n \"ga2>\", # -ag > -\n \"gg1.\", # -gg > -g\n \"ht*2.\", # -th > - if intact\n \"hsiug5ct.\", # -guish > -ct\n \"hsi3>\", # -ish > -\n \"i*1.\", # -i > - if intact\n \"i1y>\", # -i > -y\n \"ji1d.\", # -ij > -id -- see nois4j> & vis3j>\n \"juf1s.\", # -fuj > -fus\n \"ju1d.\", # -uj > -ud\n \"jo1d.\", # -oj > -od\n \"jeh1r.\", # -hej > -her\n \"jrev1t.\", # -verj > -vert\n \"jsim2t.\", # -misj > -mit\n \"jn1d.\", # -nj > -nd\n \"j1s.\", # -j > -s\n \"lbaifi6.\", # -ifiabl > -\n \"lbai4y.\", # -iabl > -y\n \"lba3>\", # -abl > -\n \"lbi3.\", # -ibl > -\n \"lib2l>\", # -bil > -bl\n \"lc1.\", # -cl > c\n \"lufi4y.\", # -iful > -y\n \"luf3>\", # -ful > -\n \"lu2.\", # -ul > -\n \"lai3>\", # -ial > -\n \"lau3>\", # -ual > -\n \"la2>\", # -al > -\n \"ll1.\", # -ll > -l\n \"mui3.\", # -ium > -\n \"mu*2.\", # -um > - if intact\n \"msi3>\", # -ism > -\n \"mm1.\", # -mm > -m\n \"nois4j>\", # -sion > -j\n \"noix4ct.\", # -xion > -ct\n \"noi3>\", # -ion > -\n \"nai3>\", # -ian > -\n \"na2>\", # -an > -\n \"nee0.\", # protect -een\n \"ne2>\", # -en > -\n \"nn1.\", # -nn > -n\n \"pihs4>\", # -ship > -\n \"pp1.\", # -pp > -p\n \"re2>\", # -er > -\n \"rae0.\", # protect -ear\n \"ra2.\", # -ar > -\n \"ro2>\", # -or > -\n \"ru2>\", # -ur > -\n \"rr1.\", # -rr > -r\n \"rt1>\", # -tr > -t\n \"rei3y>\", # -ier > -y\n \"sei3y>\", # -ies > -y\n \"sis2.\", # -sis > -s\n \"si2>\", # -is > -\n \"ssen4>\", # -ness > -\n \"ss0.\", # protect -ss\n \"suo3>\", # -ous > -\n \"su*2.\", # -us > - if intact\n \"s*1>\", # -s > - if intact\n \"s0.\", # -s > -s\n \"tacilp4y.\", # -plicat > -ply\n \"ta2>\", # -at > -\n \"tnem4>\", # -ment > -\n \"tne3>\", # -ent > -\n \"tna3>\", # -ant > -\n \"tpir2b.\", # -ript > -rib\n \"tpro2b.\", # -orpt > -orb\n \"tcud1.\", # -duct > -duc\n \"tpmus2.\", # -sumpt > -sum\n \"tpec2iv.\", # -cept > -ceiv\n \"tulo2v.\", # -olut > -olv\n \"tsis0.\", # protect -sist\n \"tsi3>\", # -ist > -\n \"tt1.\", # -tt > -t\n \"uqi3.\", # -iqu > -\n \"ugo1.\", # -ogu > -og\n \"vis3j>\", # -siv > -j\n \"vie0.\", # protect -eiv\n \"vi2>\", # -iv > -\n \"ylb1>\", # -bly > -bl\n \"yli3y>\", # -ily > -y\n \"ylp0.\", # protect -ply\n \"yl2>\", # -ly > -\n \"ygo1.\", # -ogy > -og\n \"yhp1.\", # -phy > -ph\n \"ymo1.\", # -omy > -om\n \"ypo1.\", # -opy > -op\n \"yti3>\", # -ity > -\n \"yte3>\", # -ety > -\n \"ytl2.\", # -lty > -l\n \"yrtsi5.\", # -istry > -\n \"yra3>\", # -ary > -\n \"yro3>\", # -ory > -\n \"yfi3.\", # -ify > -\n \"ycn2t>\", # -ncy > -nt\n \"yca3>\", # -acy > -\n \"zi2>\", # -iz > -\n \"zy1s.\" # -yz > -ys\n )\n\n\n\n\n\n\n\n\n\n", "metadata": "root.LancasterStemmer", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def __init__(self):\n \"\"\"Create an instance of the Lancaster stemmer.\n \"\"\"\n # Setup an empty rule dictionary - this will be filled in later\n self.rule_dictionary = {}", "metadata": "root.LancasterStemmer.__init__", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 168 }, { "content": " def parseRules(self, rule_tuple):\n \"\"\"Validate the set of rules used in this stemmer.\n \"\"\"\n valid_rule = re.compile(\"^[a-z]+\\*?\\d[a-z]*[>\\.]?$\")\n # Empty any old rules from the rule set before adding new ones\n self.rule_dictionary = {}\n\n for rule in rule_tuple:\n if not valid_rule.match(rule):\n raise ValueError(\"The rule %s is invalid\" % rule)\n first_letter = rule[0:1]\n if first_letter in self.rule_dictionary:\n self.rule_dictionary[first_letter].append(rule)\n else:\n self.rule_dictionary[first_letter] = [rule]", "metadata": "root.LancasterStemmer.parseRules", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 174 }, { "content": " def stem(self, word):\n \"\"\"Stem a word using the Lancaster stemmer.\n \"\"\"\n # Lower-case the word, since all the rules are lower-cased\n word = word.lower()\n\n # Save a copy of the original word\n intact_word = word\n\n # If the user hasn't supplied any rules, setup the default rules\n if len(self.rule_dictionary) == 0:\n self.parseRules(LancasterStemmer.rule_tuple)\n\n return self.__doStemming(word, intact_word)", "metadata": "root.LancasterStemmer.stem", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 190 }, { "content": " def __doStemming(self, word, intact_word):\n \"\"\"Perform the actual word stemming\n \"\"\"\n\n valid_rule = re.compile(\"^([a-z]+)(\\*?)(\\d)([a-z]*)([>\\.]?)$\")\n\n proceed = True\n\n while proceed:\n\n # Find the position of the last letter of the word to be stemmed\n last_letter_position = self.__getLastLetter(word)\n\n # Only stem the word if it has a last letter and a rule matching that last letter\n if last_letter_position < 0 or word[last_letter_position] not in self.rule_dictionary:\n proceed = False\n\n else:\n rule_was_applied = False\n\n # Go through each rule that matches the word's final letter\n for rule in self.rule_dictionary[word[last_letter_position]]:\n rule_match = valid_rule.match(rule)\n if rule_match:\n (ending_string,\n intact_flag,\n remove_total,\n append_string,\n cont_flag) = rule_match.groups()\n\n # Convert the number of chars to remove when stemming\n # from a string to an integer\n remove_total = int(remove_total)\n\n # Proceed if word's ending matches rule's word ending\n if word.endswith(ending_string[::-1]):\n if intact_flag:\n if (word == intact_word and\n self.__isAcceptable(word, remove_total)):\n word = self.__applyRule(word,\n remove_total,\n append_string)\n rule_was_applied = True\n if cont_flag == '.':\n proceed = False\n break\n elif self.__isAcceptable(word, remove_total):\n word = self.__applyRule(word,\n remove_total,\n append_string)\n rule_was_applied = True\n if cont_flag == '.':\n proceed = False\n break\n # If no rules apply, the word doesn't need any more stemming\n if rule_was_applied == False:\n proceed = False\n return word", "metadata": "root.LancasterStemmer.__doStemming", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 205 }, { "content": " def __getLastLetter(self, word):\n \"\"\"Get the zero-based index of the last alphabetic character in this string\n \"\"\"\n last_letter = -1\n for position in range(len(word)):\n if word[position].isalpha():\n last_letter = position\n else:\n break\n return last_letter", "metadata": "root.LancasterStemmer.__getLastLetter", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 264 }, { "content": " def __isAcceptable(self, word, remove_total):\n \"\"\"Determine if the word is acceptable for stemming.\n \"\"\"\n word_is_acceptable = False\n # If the word starts with a vowel, it must be at least 2\n # characters long to be stemmed\n if word[0] in \"aeiouy\":\n if (len(word) - remove_total >= 2):\n word_is_acceptable = True\n # If the word starts with a consonant, it must be at least 3\n # characters long (including one vowel) to be stemmed\n elif (len(word) - remove_total >= 3):\n if word[1] in \"aeiouy\":\n word_is_acceptable = True\n elif word[2] in \"aeiouy\":\n word_is_acceptable = True\n return word_is_acceptable", "metadata": "root.LancasterStemmer.__isAcceptable", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 275 }, { "content": " def __applyRule(self, word, remove_total, append_string):\n \"\"\"Apply the stemming rule to the word\n \"\"\"\n # Remove letters from the end of the word\n new_word_length = len(word) - remove_total\n word = word[0:new_word_length]\n\n # And add new letters to the end of the truncated word\n if append_string:\n word += append_string\n return word", "metadata": "root.LancasterStemmer.__applyRule", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 294 }, { "content": " def __repr__(self):\n return '<LancasterStemmer>'", "metadata": "root.LancasterStemmer.__repr__", "header": "['class', 'LancasterStemmer', '(', 'StemmerI', ')', ':', '___EOS___']", "index": 306 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Nat", "ural", " ", "Lang", "ua", "ge", " ", "Tool", "kit", ":", " ", "Stem", "mers", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "200", "1", "-", "2016", " ", "NL", "TK", " ", "Project_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Ste", "ven", " ", "Tom", "cav", "age", " ", "<", "sto", "mca", "va", "@", "law", ".", "upe", "nn", ".", "edu", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "URL", ":", " ", "<", "http", "://", "nlt", "k", ".", "org", "/>", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "license", " ", "informati", "on", ",", " ", "see", " ", "LICENSE", ".", "TXT", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "A", " ", "word", " ", "stemme", "r", " ", "based", " ", "on", " ", "the", " ", "Lan", "caster", " ", "stem", "ming", " ", "algo", "rit", "hm", ".", "\\", "10", ";", "Pai", "ce", ",", " ", "Chr", "is", " ", "D", ".", " ", "\"", "Ano", "ther", " ", "Stem", "mer", ".\"", " ", "ACM", " ", "SIG", "IR", " ", "For", "um", " ", "24.", "3", " ", "(", "1990", "):", " ", "56", "-", "61.", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nltk_", "._", "stem_", "._", "api_", "import_", "Stem", "mer", "I_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nltk_", "._", "compat_", "import_", "python", "\\u", "2", "\\u", "unicode", "\\u", "compatible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "python", "\\u", "2", "\\u", "unicode", "\\u", "compatible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Lan", "caster", " ", "Stem", "mer", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "nlt", "k", ".", "stem", ".", "lanc", "aster", " ", "import", " ", "Lan", "caster", "Stem", "mer", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", " ", "=", " ", "Lan", "caster", "Stem", "mer", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "maxim", "um", "')", " ", "#", " ", "Remove", " ", "\"-", "um", "\"", " ", "whe", "n", " ", "word", " ", "is", " ", "inta", "ct", "\\", "10", ";", " ", " ", " ", " ", "'", "maxim", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "presu", "mab", "ly", "')", " ", " ", "#", " ", "Don", "'", "t", " ", "remove", " ", "\"-", "um", "\"", " ", "whe", "n", " ", "word", " ", "is", " ", "not", " ", "inta", "ct", "\\", "10", ";", " ", " ", " ", " ", "'", "presu", "m", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "multipl", "y", "')", " ", " ", " ", " ", "#", " ", "No", " ", "action", " ", "take", "n", " ", "if", " ", "word", " ", "ends", " ", "with", " ", "\"-", "ply", "\"", "\\", "10", ";", " ", " ", " ", " ", "'", "multipl", "y", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "provision", "')", " ", " ", " ", "#", " ", "Replace", " ", "\"-", "sion", "\"", " ", "with", " ", "\"-", "j", "\"", " ", "to", " ", "trigger", " ", "\"", "j", "\"", " ", "set", " ", "of", " ", "rule", "s", "\\", "10", ";", " ", " ", " ", " ", "'", "provi", "d", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "owe", "d", "')", " ", " ", " ", " ", "#", " ", "Word", " ", "startin", "g", " ", "with", " ", "vowel", " ", "must", " ", "contain", " ", "at", " ", "leas", "t", " ", "2", " ", "letter", "s", "\\", "10", ";", " ", " ", " ", " ", "'", "ow", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "ear", "')", " ", " ", " ", " ", " ", "#", " ", "dit", "to", "\\", "10", ";", " ", " ", " ", " ", "'", "ear", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "say", "ing", "')", " ", " ", "#", " ", "Word", "s", " ", "startin", "g", " ", "with", " ", "conso", "nant", " ", "must", " ", "contain", " ", "at", " ", "leas", "t", " ", "3", "\\", "10", ";", " ", " ", " ", " ", "'", "say", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "cry", "ing", "')", " ", " ", "#", " ", "letter", "s", " ", "and", " ", "one", " ", "of", " ", "tho", "se", " ", "letter", "s", " ", "must", " ", "be", " ", "a", " ", "vowel", "\\", "10", ";", " ", " ", " ", " ", "'", "cry", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "string", "')", " ", " ", "#", " ", "dit", "to", "\\", "10", ";", " ", " ", " ", " ", "'", "string", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "mean", "t", "')", " ", " ", " ", "#", " ", "dit", "to", "\\", "10", ";", " ", " ", " ", " ", "'", "mean", "t", "'", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "st", ".", "stem", "('", "cem", "ent", "')", " ", " ", "#", " ", "dit", "to", "\\", "10", ";", " ", " ", " ", " ", "'", "cem", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "rule", " ", "list", " ", "is", " ", "static", " ", "sinc", "e", " ", "it", " ", "doe", "sn", "'", "t", " ", "change", " ", "bet", "ween", " ", "instances_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "\\u", "tuple_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ai", "*", "2", ".\"_", ",_", "#", " ", "-", "ia", " ", ">", " ", "-", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "a", "*", "1", ".\"_", ",_", "#", " ", "-", "a", " ", ">", " ", "-", " ", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bb", "1", ".\"_", ",_", "#", " ", "-", "bb", " ", ">", " ", "-", "b_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "city", "3", "s", ".\"_", ",_", "#", " ", "-", "yti", "c", " ", ">", " ", "-", "ys_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ci", "2", ">\"_", ",_", "#", " ", "-", "ic", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cn", "1", "t", ">\"_", ",_", "#", " ", "-", "nc", " ", ">", " ", "-", "nt_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dd", "1", ".\"_", ",_", "#", " ", "-", "dd", " ", ">", " ", "-", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dei", "3", "y", ">\"_", ",_", "#", " ", "-", "ied", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dee", "c2", "ss", ".\"_", ",_", "#", " ", "-", "cee", "d", " ", ">\"", ",", " ", "-", "cess", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dee", "1", ".\"_", ",_", "#", " ", "-", "eed", " ", ">", " ", "-", "ee_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "de", "2", ">\"_", ",_", "#", " ", "-", "ed", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "doo", "h", "4", ">\"_", ",_", "#", " ", "-", "hood", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "e1", ">\"_", ",_", "#", " ", "-", "e", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fei", "l1", "v", ".\"_", ",_", "#", " ", "-", "lie", "f", " ", ">", " ", "-", "lie", "v_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fi", "2", ">\"_", ",_", "#", " ", "-", "if", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gni", "3", ">\"_", ",_", "#", " ", "-", "ing", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gai", "3", "y", ".\"_", ",_", "#", " ", "-", "iag", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ga", "2", ">\"_", ",_", "#", " ", "-", "ag", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gg", "1", ".\"_", ",_", "#", " ", "-", "gg", " ", ">", " ", "-", "g_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ht", "*", "2", ".\"_", ",_", "#", " ", "-", "th", " ", ">", " ", "-", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hsi", "ug", "5c", "t", ".\"_", ",_", "#", " ", "-", "gui", "sh", " ", ">", " ", "-", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hsi", "3", ">\"_", ",_", "#", " ", "-", "ish", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "i", "*", "1", ".\"_", ",_", "#", " ", "-", "i", " ", ">", " ", "-", " ", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "i1", "y", ">\"_", ",_", "#", " ", "-", "i", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ji", "1d", ".\"_", ",_", "#", " ", "-", "ij", " ", ">", " ", "-", "id", " ", " ", " ", "--", " ", " ", "see", " ", "noi", "s", "4j", ">", " ", "&", " ", "vis", "3", "j", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ju", "f1", "s", ".\"_", ",_", "#", " ", "-", "fu", "j", " ", ">", " ", "-", "fu", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ju", "1d", ".\"_", ",_", "#", " ", "-", "uj", " ", ">", " ", "-", "ud_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "jo", "1d", ".\"_", ",_", "#", " ", "-", "oj", " ", ">", " ", "-", "od_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "je", "h1", "r", ".\"_", ",_", "#", " ", "-", "he", "j", " ", ">", " ", "-", "her_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "jre", "v1", "t", ".\"_", ",_", "#", " ", "-", "ver", "j", " ", ">", " ", "-", "vert_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "jsi", "m2", "t", ".\"_", ",_", "#", " ", "-", "mis", "j", " ", ">", " ", "-", "mit_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "jn", "1d", ".\"_", ",_", "#", " ", "-", "nj", " ", ">", " ", "-", "nd_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "j", "1s", ".\"_", ",_", "#", " ", "-", "j", " ", ">", " ", "-", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lba", "ifi", "6", ".\"_", ",_", "#", " ", "-", "ifi", "abl", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lba", "i", "4", "y", ".\"_", ",_", "#", " ", "-", "ia", "bl", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lba", "3", ">\"_", ",_", "#", " ", "-", "abl", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lb", "i3", ".\"_", ",_", "#", " ", "-", "ibl", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lib", "2l", ">\"_", ",_", "#", " ", "-", "bil", " ", ">", " ", "-", "bl_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lc", "1", ".\"_", ",_", "#", " ", "-", "cl", " ", ">", " ", "c_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lu", "fi", "4", "y", ".\"_", ",_", "#", " ", "-", "if", "ul", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lu", "f3", ">\"_", ",_", "#", " ", "-", "ful", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lu", "2", ".\"_", ",_", "#", " ", "-", "ul", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lai", "3", ">\"_", ",_", "#", " ", "-", "ial", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "lau", "3", ">\"_", ",_", "#", " ", "-", "ual", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "la", "2", ">\"_", ",_", "#", " ", "-", "al", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ll", "1", ".\"_", ",_", "#", " ", "-", "ll", " ", ">", " ", "-", "l_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mu", "i3", ".\"_", ",_", "#", " ", "-", "ium", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mu", "*", "2", ".\"_", ",_", "#", " ", "-", "um", " ", ">", " ", "-", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "msi", "3", ">\"_", ",_", "#", " ", "-", "ism", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mm", "1", ".\"_", ",_", "#", " ", "-", "mm", " ", ">", " ", "-", "m_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "noi", "s", "4j", ">\"_", ",_", "#", " ", "-", "sion", " ", ">", " ", "-", "j_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "noi", "x4", "ct", ".\"_", ",_", "#", " ", "-", "xion", " ", ">", " ", "-", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "noi", "3", ">\"_", ",_", "#", " ", "-", "ion", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nai", "3", ">\"_", ",_", "#", " ", "-", "ian", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "na", "2", ">\"_", ",_", "#", " ", "-", "an", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nee", "0.", "\"_", ",_", "#", " ", "protect", " ", " ", "-", "een", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ne", "2", ">\"_", ",_", "#", " ", "-", "en", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nn", "1", ".\"_", ",_", "#", " ", "-", "nn", " ", ">", " ", "-", "n_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pi", "hs", "4", ">\"_", ",_", "#", " ", "-", "ship", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pp", "1", ".\"_", ",_", "#", " ", "-", "pp", " ", ">", " ", "-", "p_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "re", "2", ">\"_", ",_", "#", " ", "-", "er", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ra", "e0", ".\"_", ",_", "#", " ", "protect", " ", " ", "-", "ear_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ra", "2", ".\"_", ",_", "#", " ", "-", "ar", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ro", "2", ">\"_", ",_", "#", " ", "-", "or", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ru", "2", ">\"_", ",_", "#", " ", "-", "ur", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rr", "1", ".\"_", ",_", "#", " ", "-", "rr", " ", ">", " ", "-", "r_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rt", "1", ">\"_", ",_", "#", " ", "-", "tr", " ", ">", " ", "-", "t_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rei", "3", "y", ">\"_", ",_", "#", " ", "-", "ier", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sei", "3", "y", ">\"_", ",_", "#", " ", "-", "ies", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sis", "2", ".\"_", ",_", "#", " ", "-", "sis", " ", ">", " ", "-", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "si", "2", ">\"_", ",_", "#", " ", "-", "is", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sse", "n4", ">\"_", ",_", "#", " ", "-", "ness", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ss", "0.", "\"_", ",_", "#", " ", "protect", " ", " ", "-", "ss_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "su", "o3", ">\"_", ",_", "#", " ", "-", "ous", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "su", "*", "2", ".\"_", ",_", "#", " ", "-", "us", " ", ">", " ", "-", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "s", "*", "1", ">\"_", ",_", "#", " ", "-", "s", " ", ">", " ", "-", " ", " ", " ", " ", "if", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "s0", ".\"_", ",_", "#", " ", "-", "s", " ", ">", " ", "-", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tac", "il", "p4", "y", ".\"_", ",_", "#", " ", "-", "pli", "cat", " ", ">", " ", "-", "ply_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ta", "2", ">\"_", ",_", "#", " ", "-", "at", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tne", "m4", ">\"_", ",_", "#", " ", "-", "ment", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tne", "3", ">\"_", ",_", "#", " ", "-", "ent", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tn", "a3", ">\"_", ",_", "#", " ", "-", "ant", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tp", "ir", "2b", ".\"_", ",_", "#", " ", "-", "ript", " ", ">", " ", "-", "rib", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tpr", "o", "2b", ".\"_", ",_", "#", " ", "-", "orp", "t", " ", ">", " ", "-", "orb_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tc", "ud", "1", ".\"_", ",_", "#", " ", "-", "duct", " ", ">", " ", "-", "du", "c_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tp", "mus", "2", ".\"_", ",_", "#", " ", "-", "sum", "pt", " ", ">", " ", "-", "sum_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tp", "ec", "2i", "v", ".\"_", ",_", "#", " ", "-", "cept", " ", ">", " ", "-", "ce", "iv_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tul", "o", "2v", ".\"_", ",_", "#", " ", "-", "olu", "t", " ", ">", " ", "-", "ol", "v_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tsi", "s0", ".\"_", ",_", "#", " ", "protect", " ", " ", "-", "sis", "t_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tsi", "3", ">\"_", ",_", "#", " ", "-", "ist", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tt", "1", ".\"_", ",_", "#", " ", "-", "tt", " ", ">", " ", "-", "t_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "uq", "i3", ".\"_", ",_", "#", " ", "-", "iq", "u", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ug", "o", "1", ".\"_", ",_", "#", " ", "-", "og", "u", " ", ">", " ", "-", "og_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vis", "3", "j", ">\"_", ",_", "#", " ", "-", "si", "v", " ", ">", " ", "-", "j_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vie", "0.", "\"_", ",_", "#", " ", "protect", " ", " ", "-", "ei", "v_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "vi", "2", ">\"_", ",_", "#", " ", "-", "iv", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yl", "b1", ">\"_", ",_", "#", " ", "-", "bly", " ", ">", " ", "-", "bl_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yli", "3", "y", ">\"_", ",_", "#", " ", "-", "il", "y", " ", ">", " ", "-", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yl", "p0", ".\"_", ",_", "#", " ", "protect", " ", " ", "-", "ply_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yl", "2", ">\"_", ",_", "#", " ", "-", "ly", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yg", "o", "1", ".\"_", ",_", "#", " ", "-", "og", "y", " ", ">", " ", "-", "og_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yh", "p1", ".\"_", ",_", "#", " ", "-", "phy", " ", ">", " ", "-", "ph_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ymo", "1", ".\"_", ",_", "#", " ", "-", "omy", " ", ">", " ", "-", "om_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ypo", "1", ".\"_", ",_", "#", " ", "-", "opy", " ", ">", " ", "-", "op_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yti", "3", ">\"_", ",_", "#", " ", "-", "it", "y", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yte", "3", ">\"_", ",_", "#", " ", "-", "ety", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yt", "l2", ".\"_", ",_", "#", " ", "-", "lty", " ", ">", " ", "-", "l_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yr", "tsi", "5", ".\"_", ",_", "#", " ", "-", "istr", "y", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yra", "3", ">\"_", ",_", "#", " ", "-", "ary", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yro", "3", ">\"_", ",_", "#", " ", "-", "ory", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yfi", "3", ".\"_", ",_", "#", " ", "-", "if", "y", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yc", "n2", "t", ">\"_", ",_", "#", " ", "-", "nc", "y", " ", ">", " ", "-", "nt_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "yc", "a3", ">\"_", ",_", "#", " ", "-", "ac", "y", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "zi", "2", ">\"_", ",_", "#", " ", "-", "iz", " ", ">", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "zy", "1s", ".\"_", "#", " ", "-", "yz", " ", ">", " ", "-", "ys_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\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 ", " _", "\"\"\"", "Creat", "e", " ", "an", " ", "instance", " ", "of", " ", "the", " ", "Lan", "caster", " ", "stemme", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", "up", " ", "an", " ", "empty", " ", "rule", " ", "dictionar", "y", " ", "-", " ", "this", " ", "will", " ", "be", " ", "filled", " ", "in", " ", "later_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rule", "\\u", "dictionary_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "Rules_", "(_", "self_", ",_", "rule", "\\u", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Validate", " ", "the", " ", "set", " ", "of", " ", "rule", "s", " ", "used", " ", "in", " ", "this", " ", "stemme", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "rule_", "=_", "re_", "._", "compile_", "(_", "\"", "^", "[", "a", "-", "z", "]+\\\\", "*?", "\\\\", "d", "[", "a", "-", "z", "]*", "[", ">\\\\", ".]", "?$", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Emp", "ty", " ", "any", " ", "old", " ", "rule", "s", " ", "from", " ", "the", " ", "rule", " ", "set", " ", "bef", "ore", " ", "addin", "g", " ", "new", " ", "ones_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rule", "\\u", "dictionary_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "rule_", "in_", "rule", "\\u", "tuple_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "valid", "\\u", "rule_", "._", "match_", "(_", "rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "The", " ", "rule", " ", "%", "s", " ", "is", " ", "invalid", "\"_", "%_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "first", "\\u", "letter_", "=_", "rule_", "[_", "0_", ":_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "first", "\\u", "letter_", "in_", "self_", "._", "rule", "\\u", "dictionary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rule", "\\u", "dictionary_", "[_", "first", "\\u", "letter_", "]_", "._", "append_", "(_", "rule_", ")_", "\\u\\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_", "._", "rule", "\\u", "dictionary_", "[_", "first", "\\u", "letter_", "]_", "=_", "[_", "rule_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\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_", "stem_", "(_", "self_", ",_", "word_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Stem", " ", "a", " ", "word", " ", "usi", "ng", " ", "the", " ", "Lan", "caster", " ", "stemme", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Lower", "-", "case", " ", "the", " ", "word", ",", " ", "sinc", "e", " ", "all", " ", "the", " ", "rule", "s", " ", "are", " ", "lower", "-", "case", "d_", "\\u\\u\\uNL\\u\\u\\u_", "word_", "=_", "word_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Save", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "original", " ", "word_", "\\u\\u\\uNL\\u\\u\\u_", "inta", "ct", "\\u", "word_", "=_", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "user", " ", "hasn", "'", "t", " ", "supplie", "d", " ", "any", " ", "rule", "s", ",", " ", "setup", " ", "the", " ", "default", " ", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "rule", "\\u", "dictionary_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parse", "Rules_", "(_", "Lan", "caster", "Stem", "mer_", "._", "rule", "\\u", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "do", "Stem", "ming", "_", "(_", "word_", ",_", "inta", "ct", "\\u", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "do", "Stem", "ming", "_", "(_", "self_", ",_", "word_", ",_", "inta", "ct", "\\u", "word_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Perform", " ", "the", " ", "actual", " ", "word", " ", "stem", "ming", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "valid", "\\u", "rule_", "=_", "re_", "._", "compile_", "(_", "\"", "^", "([", "a", "-", "z", "]+)", "(\\\\", "*?)", "(\\\\", "d", ")(", "[", "a", "-", "z", "]*)", "([", ">\\\\", ".]", "?)", "$\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "proceed", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "proceed", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "the", " ", "position", " ", "of", " ", "the", " ", "last", " ", "letter", " ", "of", " ", "the", " ", "word", " ", "to", " ", "be", " ", "stemme", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "letter", "\\u", "position_", "=_", "self_", "._", "\\u\\u", "get", "Las", "t", "Letter", "_", "(_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "stem", " ", "the", " ", "word", " ", "if", " ", "it", " ", "has", " ", "a", " ", "last", " ", "letter", " ", "and", " ", "a", " ", "rule", " ", "matchi", "ng", " ", "tha", "t", " ", "last", " ", "letter_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "last", "\\u", "letter", "\\u", "position_", "<_", "0_", "or_", "word_", "[_", "last", "\\u", "letter", "\\u", "position_", "]_", "not_", "in_", "self_", "._", "rule", "\\u", "dictionary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proceed", "_", "=_", "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 ", " _", "rule", "\\u", "was", "\\u", "applied", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Go", " ", "through", " ", "each", " ", "rule", " ", "tha", "t", " ", "matche", "s", " ", "the", " ", "word", "'", "s", " ", "final", " ", "letter_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "rule_", "in_", "self_", "._", "rule", "\\u", "dictionary_", "[_", "word_", "[_", "last", "\\u", "letter", "\\u", "position_", "]_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "rule", "\\u", "match_", "=_", "valid", "\\u", "rule_", "._", "match_", "(_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rule", "\\u", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "(_", "ending", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inta", "ct", "\\u", "flag_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "\\u", "total_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "append", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cont", "\\u", "flag_", ")_", "=_", "rule", "\\u", "match_", "._", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "the", " ", "number", " ", "of", " ", "char", "s", " ", "to", " ", "remove", " ", "whe", "n", " ", "stem", "ming", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "a", " ", "string", " ", "to", " ", "an", " ", "integer_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "\\u", "total_", "=_", "int_", "(_", "remove", "\\u", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Proce", "ed", " ", "if", " ", "word", "'", "s", " ", "ending", " ", "matche", "s", " ", "rule", "'", "s", " ", "word", " ", "ending_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "word_", "._", "endswith_", "(_", "ending", "\\u", "string_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "inta", "ct", "\\u", "flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "(_", "word_", "==_", "inta", "ct", "\\u", "word_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "is", "Accepta", "ble_", "(_", "word_", ",_", "remove", "\\u", "total_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "word_", "=_", "self_", "._", "\\u\\u", "appl", "y", "Rule_", "(_", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "\\u", "total_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "append", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "\\u", "was", "\\u", "applied", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cont", "\\u", "flag_", "==_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "proceed", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "\\u\\u", "is", "Accepta", "ble_", "(_", "word_", ",_", "remove", "\\u", "total_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "word_", "=_", "self_", "._", "\\u\\u", "appl", "y", "Rule_", "(_", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "\\u", "total_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "append", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "\\u", "was", "\\u", "applied", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cont", "\\u", "flag_", "==_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "proceed", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "no", " ", "rule", "s", " ", "appl", "y", ",", " ", "the", " ", "word", " ", "doe", "sn", "'", "t", " ", "need", " ", "any", " ", "more", " ", "stem", "ming", "_", "\\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_", "rule", "\\u", "was", "\\u", "applied", "_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "proceed", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get", "Las", "t", "Letter", "_", "(_", "self_", ",_", "word_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "zero", "-", "based", " ", "index", " ", "of", " ", "the", " ", "last", " ", "alphabetic", " ", "character", " ", "in", " ", "this", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "letter_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "position_", "in_", "range_", "(_", "len_", "(_", "word_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "word_", "[_", "position_", "]_", "._", "isalpha_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "letter_", "=_", "position_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "last", "\\u", "letter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "is", "Accepta", "ble_", "(_", "self_", ",_", "word_", ",_", "remove", "\\u", "total_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Det", "erm", "ine", " ", "if", " ", "the", " ", "word", " ", "is", " ", "acceptabl", "e", " ", "for", " ", "stem", "ming", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word", "\\u", "is", "\\u", "acceptabl", "e_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "word", " ", "starts", " ", "with", " ", "a", " ", "vowel", ",", " ", "it", " ", "must", " ", "be", " ", "at", " ", "leas", "t", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "character", "s", " ", "long", " ", "to", " ", "be", " ", "stemme", "d_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "word_", "[_", "0_", "]_", "in_", "\"", "ae", "iou", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "len_", "(_", "word_", ")_", "-_", "remove", "\\u", "total_", ">=_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word", "\\u", "is", "\\u", "acceptabl", "e_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "word", " ", "starts", " ", "with", " ", "a", " ", "conso", "nant", ",", " ", "it", " ", "must", " ", "be", " ", "at", " ", "leas", "t", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "character", "s", " ", "long", " ", "(", "inclu", "ding", " ", "one", " ", "vowel", ")", " ", "to", " ", "be", " ", "stemme", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "len_", "(_", "word_", ")_", "-_", "remove", "\\u", "total_", ">=_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "word_", "[_", "1_", "]_", "in_", "\"", "ae", "iou", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word", "\\u", "is", "\\u", "acceptabl", "e_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "word_", "[_", "2_", "]_", "in_", "\"", "ae", "iou", "y", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word", "\\u", "is", "\\u", "acceptabl", "e_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "word", "\\u", "is", "\\u", "acceptabl", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "appl", "y", "Rule_", "(_", "self_", ",_", "word_", ",_", "remove", "\\u", "total_", ",_", "append", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Apply", " ", "the", " ", "stem", "ming", " ", "rule", " ", "to", " ", "the", " ", "word", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "letter", "s", " ", "from", " ", "the", " ", "end", " ", "of", " ", "the", " ", "word_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "word", "\\u", "length_", "=_", "len_", "(_", "word_", ")_", "-_", "remove", "\\u", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word_", "=_", "word_", "[_", "0_", ":_", "new", "\\u", "word", "\\u", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "add", " ", "new", " ", "letter", "s", " ", "to", " ", "the", " ", "end", " ", "of", " ", "the", " ", "truncat", "ed", " ", "word_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "append", "\\u", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word_", "+=_", "append", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lan", "caster", "Stem", "mer_", "(_", "Stem", "mer", "I_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDE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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ClusterHQ/eliot/docs/source/conf.py
[ { "content": "# -*- coding: utf-8 -*-\n#\n# Eliot documentation build configuration file, created by\n# sphinx-quickstart on Mon Apr 14 12:04:03 2014.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\n\n# Make sure local eliot is used when importing:\nsys.path.insert(0, os.path.abspath(os.path.join('..', '..')))\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = []\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Eliot'\ncopyright = u'2014-2015, ClusterHQ'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nimport eliot\nversion = eliot.__version__\n# Versioneer adds .dirty suffix to version if checkout is dirty, and\n# therefore ReadTheDocs somehow ends up with this in its version, so strip\n# it out.\nif version.endswith(\".dirty\"):\n version = version[:-len(\".dirty\")]\n# The full version, including alpha/beta/rc tags.\nrelease = version\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = []\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Eliotdoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n ('index', 'Eliot.tex', u'Eliot Documentation',\n u'ClusterHQ', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n ('index', 'eliot', u'Eliot Documentation',\n [u'ClusterHQ'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n ('index', 'Eliot', u'Eliot Documentation',\n u'ClusterHQ', 'Eliot', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
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_", "#", " ", "Eli", "ot", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Mon", " ", "Ap", "r", " ", "14", " ", "1", "2", ":", "04", ":", "03", " ", "2014", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "local", " ", "eli", "ot", " ", "is", " ", "used", " ", "whe", "n", " ", "import", "ing", ":_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'..'_", ",_", "'..'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "u", "'", "Eli", "ot", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "u", "'", "2014", "-", "201", "5", ",", " ", "Cluster", "HQ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "eli", "ot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "eli", "ot_", "._", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Versione", "er", " ", "adds", " ", ".", "dir", "ty", " ", "suff", "ix", " ", "to", " ", "version", " ", "if", " ", "check", "out", " ", "is", " ", "dir", "ty", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "there", "fore", " ", "Read", "The", "Docs", " ", "some", "how", " ", "ends", " ", "up", " ", "with", " ", "this", " ", "in", " ", "its", " ", "version", ",", " ", "so", " ", "strip_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "out", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "version_", "._", "endswith_", "(_", "\".", "dir", "ty", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "version_", "[_", ":_", "-_", "len_", "(_", "\".", "dir", "ty", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "release_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "keep", " ", "warn", "ings", " ", "as", " ", "\"", "system", " ", "message", "\"", " ", "paragraph", "s", " ", "in", " ", "the", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "warn", "ings", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "robots", ".", "txt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "hta", "ccess", ")", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "se", " ", "files", " ", "are", " ", "copied_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", "ly", " ", "to", " ", "the", " ", "root", " ", "of", " ", "the", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "extra", "\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "Eli", "ot", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "points", "ize", "':", " ", "'", "10", "pt", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "preamble", "':", " ", "''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Eli", "ot", ".", "tex", "'_", ",_", "u", "'", "Eli", "ot", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Cluster", "HQ", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "eli", "ot", "'_", ",_", "u", "'", "Eli", "ot", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "u", "'", "Cluster", "HQ", "'_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Eli", "ot", "'_", ",_", "u", "'", "Eli", "ot", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "Cluster", "HQ", "'_", ",_", "'", "Eli", "ot", "'_", ",_", "'", "One", " ", "line", " ", "description", " ", "of", " ", "project", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mis", "cell", "ane", "ous", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "w", " ", "to", " ", "display", " ", "URL", " ", "addresse", "s", ":", " ", "'", "footnote", "',", " ", "'", "no", "',", " ", "or", " ", "'", "inline", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "show", "\\u", "urls", " ", "=", " ", "'", "footnote", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "do", " ", "not", " ", "generat", "e", " ", "a", " ", "@", "deta", "il", "menu", " ", "in", " ", "the", " ", "\"", "Top", "\"", " ", "node", "'", "s", " ", "menu", "._", "\\u\\u\\uNL\\u\\u\\u_",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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
pyjs/pyjs/pyjswidgets/pyjamas/Canvas/GWTCanvasImplDefault.hulahop.py
[ { "content": " def createElement(self):\n e = DOM.createElement(\"CANVAS\")\n try:\n # This results occasionally in an error:\n # AttributeError: XPCOM component '<unknown>' has no attribute 'MozGetIPCContext'\n self.setCanvasContext(e.MozGetIPCContext(u'2d'))\n except AttributeError:\n # In which case this seems to work:\n self.setCanvasContext(e.getContext('2d'))\n return e", "metadata": "root.GWTCanvasImplDefault.createElement", "header": "['class', 'GWTCanvasImplDefault', ':', '___EOS___']", "index": 7 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "GW", "TC", "anv", "as", "Impl", "Default_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "create", "Element_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "DOM_", "._", "create", "Element_", "(_", "\"", "CAN", "VA", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "results", " ", "occ", "asi", "onal", "ly", " ", "in", " ", "an", " ", "error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Attribute", "Error", ":", " ", "XP", "COM", " ", "component", " ", "'<", "unknown", ">'", " ", "has", " ", "no", " ", "attribute", " ", "'", "Mo", "z", "Get", "IPC", "Context", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Can", "vas", "Context_", "(_", "e_", "._", "Mo", "z", "Get", "IPC", "Context_", "(_", "u", "'", "2d", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "In", " ", "whi", "ch", " ", "case", " ", "this", " ", "see", "ms", " ", "to", " ", "work", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Can", "vas", "Context_", "(_", "e_", "._", "get", "Context_", "(_", "'", "2d", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "e_" ]
[ 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 ]
Except block handles 'BaseException'
dimagi/commcare-hq/corehq/apps/cleanup/management/commands/undelete_docs.py
[ { "content": "def get_deleted_doc(db, doc_id, rev):\n res = db.get(doc_id, revs=True, rev=rev)\n start = res['_revisions']['start']\n ids = res['_revisions']['ids']\n prev_revision = \"{}-{}\".format(start-1, ids[1])\n try:\n doc = db.get(doc_id, rev=prev_revision)\n except ResourceNotFound:\n res.pop('_deleted')\n res.pop('_revisions')\n doc = res\n doc.pop('_rev')\n return doc", "metadata": "root.get_deleted_doc", "header": "['module', '___EOS___']", "index": 11 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "delete", "d\\u", "doc_", "(_", "db_", ",_", "doc", "\\u", "id_", ",_", "rev_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "db_", "._", "get_", "(_", "doc", "\\u", "id_", ",_", "revs_", "=_", "True_", ",_", "rev_", "=_", "rev_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "res_", "[_", "'\\u", "revis", "ion", "s", "'_", "]_", "[_", "'", "start", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ids_", "=_", "res_", "[_", "'\\u", "revis", "ion", "s", "'_", "]_", "[_", "'", "ids", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "revision_", "=_", "\"{}", "-{}", "\"_", "._", "format_", "(_", "start_", "-_", "1_", ",_", "ids_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "db_", "._", "get_", "(_", "doc", "\\u", "id_", ",_", "rev_", "=_", "prev", "\\u", "revision_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Reso", "urc", "e", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "._", "pop_", "(_", "'\\u", "delete", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "._", "pop_", "(_", "'\\u", "revis", "ion", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "doc_", "._", "pop_", "(_", "'\\u", "rev", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "doc_", "\\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 ]
Use of the return value of a procedure
statsmodels/statsmodels/statsmodels/tsa/arima_process.py
[ { "content": "def deconvolve(num, den, n=None):\n \"\"\"Deconvolves divisor out of signal, division of polynomials for n terms\n\n calculates den^{-1} * num\n\n Parameters\n ----------\n num : array_like\n signal or lag polynomial\n denom : array_like\n coefficients of lag polynomial (linear filter)\n n : None or int\n number of terms of quotient\n\n Returns\n -------\n quot : array\n quotient or filtered series\n rem : array\n remainder\n\n Notes\n -----\n If num is a time series, then this applies the linear filter den^{-1}.\n If both num and den are both lagpolynomials, then this calculates the\n quotient polynomial for n terms and also returns the remainder.\n\n This is copied from scipy.signal.signaltools and added n as optional\n parameter.\n\n \"\"\"\n num = np.atleast_1d(num)\n den = np.atleast_1d(den)\n N = len(num)\n D = len(den)\n if D > N and n is None:\n quot = []\n rem = num\n else:\n if n is None:\n n = N-D+1\n input = np.zeros(n, float)\n input[0] = 1\n quot = signal.lfilter(num, den, input)\n num_approx = signal.convolve(den, quot, mode='full')\n if len(num) < len(num_approx): # 1d only ?\n num = np.concatenate((num, np.zeros(len(num_approx)-len(num))))\n rem = num - num_approx\n return quot, rem", "metadata": "root.deconvolve", "header": "['module', '___EOS___']", "index": 545 } ]
[]
[]
0
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deconv", "olve", "_", "(_", "num_", ",_", "den_", ",_", "n_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Deco", "nv", "olve", "s", " ", "divisor", " ", "out", " ", "of", " ", "signal", ",", " ", "divisi", "on", " ", "of", " ", "polynomial", "s", " ", "for", " ", "n", " ", "term", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "calcul", "ates", " ", "den", "^", "{-", "1", "}", " ", "*", " ", "num", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "num", " ", ":", " ", "array", "\\u", "like", "\\", "10", ";", " ", " ", " ", " ", "signal", " ", "or", " ", "lag", " ", "polynomial", "\\", "10", ";", " ", " ", " ", " ", "deno", "m", " ", ":", " ", "array", "\\u", "like", "\\", "10", ";", " ", " ", " ", " ", "coefficient", "s", " ", "of", " ", "lag", " ", "polynomial", " ", "(", "linear", " ", "filter", ")", "\\", "10", ";", " ", " ", " ", " ", "n", " ", ":", " ", "Non", "e", " ", "or", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "number", " ", "of", " ", "term", "s", " ", "of", " ", "quot", "ient", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "quot", " ", ":", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "quot", "ient", " ", "or", " ", "filter", "ed", " ", "series", "\\", "10", ";", " ", " ", " ", " ", "rem", " ", ":", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "remainder", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "es", "\\", "10", ";", " ", " ", " ", " ", "-----", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "num", " ", "is", " ", "a", " ", "time", " ", "series", ",", " ", "then", " ", "this", " ", "appli", "es", " ", "the", " ", "linear", " ", "filter", " ", "den", "^", "{-", "1", "}.", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "bot", "h", " ", "num", " ", "and", " ", "den", " ", "are", " ", "bot", "h", " ", "lag", "polynomial", "s", ",", " ", "then", " ", "this", " ", "calcul", "ates", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "quot", "ient", " ", "polynomial", " ", "for", " ", "n", " ", "term", "s", " ", "and", " ", "als", "o", " ", "return", "s", " ", "the", " ", "remainder", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "copie", "d", " ", "from", " ", "sci", "py", ".", "signal", ".", "signal", "tool", "s", " ", "and", " ", "adde", "d", " ", "n", " ", "as", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "parameter", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num_", "=_", "np_", "._", "atl", "east", "\\u", "1d_", "(_", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "den_", "=_", "np_", "._", "atl", "east", "\\u", "1d_", "(_", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "len_", "(_", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "=_", "len_", "(_", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "D_", ">_", "N_", "and_", "n_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "quot", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rem_", "=_", "num_", "\\u\\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_", "n_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "N_", "-_", "D_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "input_", "=_", "np_", "._", "zeros_", "(_", "n_", ",_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input_", "[_", "0_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "quot", "_", "=_", "signal_", "._", "lfil", "ter_", "(_", "num_", ",_", "den_", ",_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "approx_", "=_", "signal_", "._", "convolve", "_", "(_", "den_", ",_", "quot", "_", ",_", "mode_", "=_", "'", "full", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "num_", ")_", "<_", "len_", "(_", "num", "\\u", "approx_", ")_", ":_", "#", " ", "1d", " ", "only", " ", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "num_", "=_", "np_", "._", "concatenate_", "(_", "(_", "num_", ",_", "np_", "._", "zeros_", "(_", "len_", "(_", "num", "\\u", "approx_", ")_", "-_", "len_", "(_", "num_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rem_", "=_", "num_", "-_", "num", "\\u", "approx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "quot", "_", ",_", "rem_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
cloudera/hue/desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/layout.py
[ { "content": "class ManualLayout(Serialisable):\n\n tagname = \"manualLayout\"\n\n layoutTarget = NestedNoneSet(values=(['inner', 'outer']))\n xMode = NestedNoneSet(values=(['edge', 'factor']))\n yMode = NestedNoneSet(values=(['edge', 'factor']))\n wMode = NestedNoneSet(values=(['edge', 'factor']))\n hMode = NestedNoneSet(values=(['edge', 'factor']))\n x = NestedFloat(allow_none=True)\n y = NestedFloat(allow_none=True)\n w = NestedFloat(allow_none=True)\n h = NestedFloat(allow_none=True)\n extLst = Typed(expected_type=ExtensionList, allow_none=True)\n\n __elements__ = ('layoutTarget', 'xMode', 'yMode', 'wMode', 'hMode', 'x',\n 'y', 'w', 'h')\n", "metadata": "root.ManualLayout", "header": "['module', '___EOS___']", "index": 17 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Manu", "al", "Layout_", "(_", "Seriali", "sab", "le_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tagname_", "=_", "\"", "manu", "al", "Lay", "out", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "layout", "Target_", "=_", "Nest", "ed", "Non", "e", "Set_", "(_", "values_", "=_", "(_", "[_", "'", "inner", "'_", ",_", "'", "outer", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "Mode_", "=_", "Nest", "ed", "Non", "e", "Set_", "(_", "values_", "=_", "(_", "[_", "'", "edge", "'_", ",_", "'", "factor", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "Mode_", "=_", "Nest", "ed", "Non", "e", "Set_", "(_", "values_", "=_", "(_", "[_", "'", "edge", "'_", ",_", "'", "factor", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w", "Mode_", "=_", "Nest", "ed", "Non", "e", "Set_", "(_", "values_", "=_", "(_", "[_", "'", "edge", "'_", ",_", "'", "factor", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "Mode_", "=_", "Nest", "ed", "Non", "e", "Set_", "(_", "values_", "=_", "(_", "[_", "'", "edge", "'_", ",_", "'", "factor", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "Nest", "ed", "Float_", "(_", "allow", "\\u", "none_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "Nest", "ed", "Float_", "(_", "allow", "\\u", "none_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", "=_", "Nest", "ed", "Float_", "(_", "allow", "\\u", "none_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "Nest", "ed", "Float_", "(_", "allow", "\\u", "none_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ext", "Lst_", "=_", "Type", "d_", "(_", "expected", "\\u", "type_", "=_", "Ext", "ensi", "on", "List_", ",_", "allow", "\\u", "none_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "element", "s\\u\\u_", "=_", "(_", "'", "layout", "Target", "'_", ",_", "'", "x", "Mode", "'_", ",_", "'", "y", "Mode", "'_", ",_", "'", "w", "Mode", "'_", ",_", "'", "h", "Mode", "'_", ",_", "'", "x", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y", "'_", ",_", "'", "w", "'_", ",_", "'", "h", "'_", ")_", "\\u\\u\\uNEWLINE\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
google/grr/grr/lib/artifact_registry.py
[ { "content": " def GetArtifact(self, name):\n \"\"\"Get artifact by name.\n\n Args:\n name: artifact name string.\n\n Returns:\n artifact object.\n Raises:\n ArtifactNotRegisteredError: if artifact doesn't exist in the registy.\n \"\"\"\n self._CheckDirty()\n result = self._artifacts.get(name)\n if not result:\n raise ArtifactNotRegisteredError(\n \"Artifact %s missing from registry. You may need \"\n \"to sync the artifact repo by running make in the artifact \"\n \"directory.\" % name)\n return result", "metadata": "root.ArtifactRegistry.GetArtifact", "header": "['class', 'ArtifactRegistry', '(', 'object', ')', ':', '___EOS___']", "index": 277 } ]
[]
[]
0
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Artifact", "Registry_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Artifact", "_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "artifact", " ", "by", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "name", ":", " ", "artifact", " ", "name", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "artifact", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", "Artifact", "Not", "Register", "ed", "Error", ":", " ", "if", " ", "artifact", " ", "doe", "sn", "'", "t", " ", "exist", " ", "in", " ", "the", " ", "regi", "sty", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Check", "Dirty", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "\\u", "artifacts_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Artifact", "Not", "Register", "ed", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Artifact", " ", "%", "s", " ", "missi", "ng", " ", "from", " ", "registr", "y", ".", " ", "You", " ", "may", " ", "need", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "to", " ", "sync", " ", "the", " ", "artifact", " ", "repo", " ", "by", " ", "runn", "ing", " ", "make", " ", "in", " ", "the", " ", "artifact", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "director", "y", ".\"_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Missing call to `__init__` during object initialization
django-bmf/django-bmf/djangobmf/contrib/position/tests.py
[ { "content": "class PositionModuleTests(ModuleMixin, TestCase):\n\n\n# data = self.autotest_ajax_get('create', kwargs={'key': 'default'})\n# self.autotest_get('api', status_code=404)\n# self.autotest_post('api', status_code=302)\n\n# data = self.autotest_ajax_post('create', kwargs={'key': 'default'}, data={\n# 'project': 1, 'name': 'Service', 'price': '100', 'product': 1, 'date': '2012-01-01', 'amount': '2.0', 'employee': 1, 'invoiceable': 1,\n# })\n# data = self.autotest_ajax_post('create', kwargs={'key': 'default'}, data={\n# 'project': 2, 'name': 'Service', 'price': '100', 'product': 1, 'date': '2012-01-02', 'amount': '0.1', 'employee': 1, 'invoiceable': 1,\n# })\n# data = self.autotest_ajax_post('create', kwargs={'key': 'default'}, data={\n# 'project': 1, 'name': 'Service', 'price': '100', 'product': 1, 'date': '2012-01-01', 'amount': '1.0', 'employee': 2, 'invoiceable': 1,\n# })\n# data = self.autotest_ajax_post('create', kwargs={'key': 'default'}, data={\n# 'project': 2, 'name': 'Service', 'price': '100', 'product': 1, 'date': '2012-01-02', 'amount': '5.0', 'employee': 2, 'invoiceable': 1,\n# })\n# self.assertNotEqual(data[\"object_pk\"], 0)\n\n# self.autotest_get('index')\n\n# obj = self.get_latest_object()\n# self.assertEqual(obj.has_invoice(), False)\n# a = '%s'%obj # check if object name has any errors\n\n# self.autotest_get('detail', kwargs={'pk': obj.pk}, api=False)\n# data = self.autotest_ajax_get('update', kwargs={'pk': obj.pk})\n# self.autotest_get('delete', kwargs={'pk': obj.pk})\n# self.autotest_post('delete', status_code=302, kwargs={'pk': obj.pk})\n\n# obj = Position.objects.filter(invoice__isnull=True)\n# data = {}\n# pks = []\n# for i in obj:\n# data['pk.%s' % i.pk] = 1\n# pks.append(i.pk)\n\n# #self.autotest_post('api', status_code=302, data=data)\n# #obj = Position.objects.filter(pk__in=pks)\n# #for i in obj:\n# # self.assertEqual(bool(i.invoice_id), True)\n", "metadata": "root.PositionModuleTests", "header": "['module', '___EOS___']", "index": 19 } ]
[]
[]
0
false
[ "[CLS]_", "Missing", "_", "call_", "to_", " _", "`_", "\\u\\u", "init\\u\\u_", "`_", "dur", "ing_", "object_", "initialization", "_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Position", "Modul", "e", "Tests_", "(_", "Modul", "e", "Mixin_", ",_", "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_", "#", " ", " ", " ", "data", " ", "=", " ", "self", ".", "autotest", "\\u", "aja", "x", "\\u", "get", "('", "create", "',", " ", "kwarg", "s", "={", "'", "key", "':", " ", "'", "default", "'})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "autotest", "\\u", "get", "('", "api", "',", " ", "status", "\\u", "code", "=", "404", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "autotest", "\\u", "post", "('", "api", "',", " ", "status", "\\u", "code", "=", "302", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", " ", "=", " ", "self", ".", "autotest", "\\u", "aja", "x", "\\u", "post", "('", "create", "',", " ", "kwarg", "s", "={", "'", "key", "':", " ", "'", "default", "'}", ",", " ", "data", "={", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "project", "':", " ", "1", ",", " ", "'", "name", "':", " ", "'", "Service", "',", " ", "'", "price", "':", " ", "'", "100", "',", " ", "'", "product", "':", " ", "1", ",", " ", "'", "date", "':", " ", "'", "2012", "-0", "1", "-0", "1", "',", " ", "'", "amo", "unt", "':", " ", "'", "2.0", "',", " ", "'", "employ", "ee", "':", " ", "1", ",", " ", "'", "invoic", "eab", "le", "':", " ", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", " ", "=", " ", "self", ".", "autotest", "\\u", "aja", "x", "\\u", "post", "('", "create", "',", " ", "kwarg", "s", "={", "'", "key", "':", " ", "'", "default", "'}", ",", " ", "data", "={", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "project", "':", " ", "2", ",", " ", "'", "name", "':", " ", "'", "Service", "',", " ", "'", "price", "':", " ", "'", "100", "',", " ", "'", "product", "':", " ", "1", ",", " ", "'", "date", "':", " ", "'", "2012", "-0", "1", "-0", "2", "',", " ", "'", "amo", "unt", "':", " ", "'", "0.", "1", "',", " ", "'", "employ", "ee", "':", " ", "1", ",", " ", "'", "invoic", "eab", "le", "':", " ", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", " ", "=", " ", "self", ".", "autotest", "\\u", "aja", "x", "\\u", "post", "('", "create", "',", " ", "kwarg", "s", "={", "'", "key", "':", " ", "'", "default", "'}", ",", " ", "data", "={", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "project", "':", " ", "1", ",", " ", "'", "name", "':", " ", "'", "Service", "',", " ", "'", "price", "':", " ", "'", "100", "',", " ", "'", "product", "':", " ", "1", ",", " ", "'", "date", "':", " ", "'", "2012", "-0", "1", "-0", "1", "',", " ", "'", "amo", "unt", "':", " ", "'", "1.0", "',", " ", "'", "employ", "ee", "':", " ", "2", ",", " ", "'", "invoic", "eab", "le", "':", " ", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", " ", "=", " ", "self", ".", "autotest", "\\u", "aja", "x", "\\u", "post", "('", "create", "',", " ", "kwarg", "s", "={", "'", "key", "':", " ", "'", "default", "'}", ",", " ", "data", "={", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "project", "':", " ", "2", ",", " ", "'", "name", "':", " ", "'", "Service", "',", " ", "'", "price", "':", " ", "'", "100", "',", " ", "'", "product", "':", " ", "1", ",", " ", "'", "date", "':", " ", "'", "2012", "-0", "1", "-0", "2", "',", " ", "'", "amo", "unt", "':", " ", "'", "5.0", "',", " ", "'", "employ", "ee", "':", " ", "2", ",", " ", "'", "invoic", "eab", "le", "':", " ", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "assert", "Not", "Equal", "(", "data", "[\"", "object\\u", "pk", "\"]", ",", " ", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "autotest", "\\u", "get", "('", "index", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "obj", " ", "=", " ", "self", ".", "get", "\\u", "late", "st", "\\u", "object", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "assert", "Equal", "(", "obj", ".", "has", "\\u", "invoic", "e", "()", ",", " ", "Fal", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "a", " ", "=", " ", "'%", "s", "'%", "obj", " ", "#", " ", "check", " ", "if", " ", "object", " ", "name", " ", "has", " ", "any", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "autotest", "\\u", "get", "('", "deta", "il", "',", " ", "kwarg", "s", "={", "'", "pk", "':", " ", "obj", ".", "pk", "},", " ", "api", "=", "Fal", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", " ", "=", " ", "self", ".", "autotest", "\\u", "aja", "x", "\\u", "get", "('", "update", "',", " ", "kwarg", "s", "={", "'", "pk", "':", " ", "obj", ".", "pk", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "autotest", "\\u", "get", "('", "delete", "',", " ", "kwarg", "s", "={", "'", "pk", "':", " ", "obj", ".", "pk", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "autotest", "\\u", "post", "('", "delete", "',", " ", "status", "\\u", "code", "=", "302", ",", " ", "kwarg", "s", "={", "'", "pk", "':", " ", "obj", ".", "pk", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "obj", " ", "=", " ", "Position", ".", "object", "s", ".", "filter", "(", "invoic", "e\\u", "\\u", "isn", "ull", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "pks", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "for", " ", "i", " ", "in", " ", "obj", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "data", "['", "pk", ".", "%", "s", "'", " ", "%", " ", "i", ".", "pk", "]", " ", "=", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "pks", ".", "append", "(", "i", ".", "pk", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "#", "self", ".", "autotest", "\\u", "post", "('", "api", "',", " ", "status", "\\u", "code", "=", "302", ",", " ", "data", "=", "data", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "#", "obj", " ", "=", " ", "Position", ".", "object", "s", ".", "filter", "(", "pk", "\\u\\u", "in", "=", "pks", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "#", "for", " ", "i", " ", "in", " ", "obj", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "bool", "(", "i", ".", "invoic", "e\\u", "id", "),", " ", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
cloudera/hue/apps/useradmin/setup.py
[ { "content": "# Licensed to Cloudera, Inc. under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. Cloudera, Inc. licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, 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.\nfrom setuptools import setup, find_packages\nfrom hueversion import VERSION\n\nsetup(\n name = \"useradmin\",\n version = VERSION,\n author = \"Hue\",\n url = 'http://github.com/cloudera/hue',\n description = \"Hue User Administration\",\n packages = find_packages('src'),\n package_dir = {'': 'src'},\n install_requires = ['setuptools', 'desktop'],\n entry_points = { 'desktop.sdk.application': 'useradmin=useradmin' },\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "License", "d", " ", "to", " ", "Cloud", "era", ",", " ", "Inc", ".", " ", "under", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "more", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "with", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", ".", " ", " ", "Cloud", "era", ",", " ", "Inc", ".", " ", "license", "s", " ", "this", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "you", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "ance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "License", ".", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "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_", "from_", "setuptools_", "import_", "setup_", ",_", "find", "\\u", "packages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "hue", "version_", "import_", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "usera", "dmin", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "VERSION_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "\"", "Hu", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "git", "hub", ".", "com", "/", "cloud", "era", "/", "hue", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Hu", "e", " ", "User", " ", "Administrati", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "find", "\\u", "packages_", "(_", "'", "src", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "dir_", "=_", "{_", "''_", ":_", "'", "src", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "'", "setup", "tool", "s", "'_", ",_", "'", "desk", "top", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "points_", "=_", "{_", "'", "desk", "top", ".", "sd", "k", ".", "applica", "tion", "'_", ":_", "'", "usera", "dmin", "=", "usera", "dmin", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
pindexis/qfc/qfc/core.py
[ { "content": " def reset_input(self):\n self.input = self.default_input", "metadata": "root.State.reset_input", "header": "['class', 'State', '(', 'object', ')', ':', '___EOS___']", "index": 65 } ]
[]
[]
0
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "State_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "reset", "\\u", "input_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "input_", "=_", "self_", "._", "default", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
mongodb/motor/test/tornado_tests/test_motor_gridfs.py
[ { "content": " @gen_test\n def test_gridfs_secondary(self):\n primary_host, primary_port = test.env.primary\n primary = self.motor_client(primary_host, primary_port)\n if test.env.auth:\n yield primary.admin.authenticate(test.db_user, test.db_password)\n \n secondary_host, secondary_port = test.env.secondaries[0]\n\n secondary = self.motor_client(\n secondary_host, secondary_port,\n read_preference=ReadPreference.SECONDARY)\n\n if test.env.auth:\n yield secondary.admin.authenticate(db_user, db_password)\n\n yield primary.motor_test.drop_collection(\"fs.files\")\n yield primary.motor_test.drop_collection(\"fs.chunks\")\n\n # Should detect it's connected to secondary and not attempt to\n # create index\n fs = motor.MotorGridFS(secondary.motor_test)\n\n # This won't detect secondary, raises error\n with self.assertRaises(AutoReconnect):\n yield fs.put(b'foo')", "metadata": "root.TestGridfsReplicaSet.test_gridfs_secondary", "header": "['class', 'TestGridfsReplicaSet', '(', 'MotorReplicaSetTestBase', ')', ':', '___EOS___']", "index": 222 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Grid", "fs", "Replica", "Set_", "(_", "Moto", "r", "Replica", "Set", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "gen", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "grid", "fs", "\\u", "secondary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "primary", "\\u", "host_", ",_", "primary", "\\u", "port_", "=_", "test_", "._", "env_", "._", "primary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primary_", "=_", "self_", "._", "motor", "\\u", "client_", "(_", "primary", "\\u", "host_", ",_", "primary", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "test_", "._", "env_", "._", "auth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "primary_", "._", "admin_", "._", "authenticate_", "(_", "test_", "._", "db", "\\u", "user_", ",_", "test_", "._", "db", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "second", "ary", "\\u", "host_", ",_", "second", "ary", "\\u", "port_", "=_", "test_", "._", "env_", "._", "second", "aries", "_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "secondary_", "=_", "self_", "._", "motor", "\\u", "client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "second", "ary", "\\u", "host_", ",_", "second", "ary", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "read", "\\u", "preference_", "=_", "Read", "Preference", "_", "._", "SECOND", "ARY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "test_", "._", "env_", "._", "auth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "secondary_", "._", "admin_", "._", "authenticate_", "(_", "db", "\\u", "user_", ",_", "db", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "primary_", "._", "motor", "\\u", "test_", "._", "drop", "\\u", "collection_", "(_", "\"", "fs", ".", "files", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "primary_", "._", "motor", "\\u", "test_", "._", "drop", "\\u", "collection_", "(_", "\"", "fs", ".", "chunks", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "detect", " ", "it", "'", "s", " ", "connect", "ed", " ", "to", " ", "second", "ary", " ", "and", " ", "not", " ", "atte", "mpt", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "index_", "\\u\\u\\uNL\\u\\u\\u_", "fs_", "=_", "motor_", "._", "Moto", "r", "Grid", "FS_", "(_", "secondary_", "._", "motor", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "won", "'", "t", " ", "detect", " ", "second", "ary", ",", " ", "raise", "s", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Auto", "Recon", "nect", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "fs_", "._", "put_", "(_", "b", "'", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
mgaitan/waliki/waliki/rst2html5.py
[ { "content": " def _strip_spaces(self, text):\n return re.sub(r'\\s+', ' ', text)", "metadata": "root.HTML5Translator._strip_spaces", "header": "['class', 'HTML5Translator', '(', 'nodes', '.', 'NodeVisitor', ')', ':', '___EOS___']", "index": 540 } ]
[]
[]
0
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "HTM", "L", "5", "Translator_", "(_", "nodes_", "._", "Node", "Visitor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "strip", "\\u", "spaces_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "re_", "._", "sub_", "(_", "r", "'\\\\", "s", "+'_", ",_", "'", " ", "'_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ooici/pyon/pyon/ion/test/test_process.py
[ { "content": "#!/usr/bin/env python\n\n__author__ = 'Dave Foster <dfoster@asascience.com>'\n\nfrom pyon.ion.process import IonProcessThread\nfrom pyon.ion.endpoint import ProcessRPCServer\nfrom gevent.event import AsyncResult, Event\nfrom gevent.coros import Semaphore\nfrom gevent.timeout import Timeout\nfrom pyon.util.unit_test import PyonTestCase\nfrom pyon.util.int_test import IonIntegrationTestCase\nfrom pyon.util.context import LocalContextMixin\nfrom pyon.core.exception import IonException, NotFound, ContainerError, Timeout as IonTimeout\nfrom pyon.util.async import spawn\nfrom mock import sentinel, Mock, MagicMock, ANY, patch\nfrom nose.plugins.attrib import attr\nfrom pyon.net.endpoint import RPCClient\nfrom pyon.ion.service import BaseService\nfrom interface.objects import ProcessStateEnum\nimport time\nimport os\nimport unittest\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@attr('UNIT', group='coi')\nclass ProcessTest(PyonTestCase):\n\n class ExpectedFailure(StandardError):\n pass\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ProcessTest", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def _make_service(self):\n \"\"\"\n Test helper to make a passable service.\n \"\"\"\n svc = LocalContextMixin()\n svc.id = \"test_id\"\n svc.name = \"test_svc\"\n svc.container = Mock()\n svc.container.context = LocalContextMixin()\n\n return svc", "metadata": "root.ProcessTest._make_service", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_spawn_proc_with_no_listeners(self):\n p = IonProcessThread(name=sentinel.name, listeners=[])\n p.start()\n p.get_ready_event().wait(timeout=5)\n\n self.assertEquals(len(p.thread_manager.children), 1)\n\n p._notify_stop()\n\n self.assertTrue(p.thread_manager.children[0].proc.dead)\n\n p.stop()", "metadata": "root.ProcessTest.test_spawn_proc_with_no_listeners", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 41 }, { "content": " def test_spawn_proc_with_one_listener(self):\n mocklistener = Mock(spec=ProcessRPCServer)\n p = IonProcessThread(name=sentinel.name, listeners=[mocklistener])\n readyev = Event()\n readyev.set()\n mocklistener.get_ready_event.return_value = readyev\n p.start()\n p.get_ready_event().wait(timeout=5)\n p.start_listeners()\n\n self.assertEquals(len(p.thread_manager.children), 2)\n mocklistener.listen.assert_called_once_with(thread_name=ANY)\n self.assertEqual(mocklistener.routing_call, p._routing_call)\n\n p._notify_stop()\n\n mocklistener.close.assert_called_once_with()\n\n p.stop()", "metadata": "root.ProcessTest.test_spawn_proc_with_one_listener", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 54 }, { "content": " @unittest.skip(\"must be retooled to work with new listener spawn rules\")\n def test_spawn_with_listener_failure(self):\n mocklistener = Mock(spec=ProcessRPCServer)\n mocklistener.listen.side_effect = self.ExpectedFailure\n readyev = Event()\n readyev.set()\n mocklistener.get_ready_event.return_value = readyev\n\n p = IonProcessThread(name=sentinel.name, listeners=[mocklistener])\n p.start()\n p.get_ready_event().wait(timeout=5)\n p.start_listeners()\n\n # the exception is linked to the main proc inside the IonProcess, so that should be dead now\n self.assertTrue(p.proc.dead)\n self.assertIsInstance(p.proc.exception, self.ExpectedFailure)\n\n # stopping will raise an error as proc died already\n self.assertRaises(self.ExpectedFailure, p._notify_stop)\n\n # make sure control flow proc died though\n self.assertTrue(p.thread_manager.children[-1].proc.dead)\n\n p.stop()", "metadata": "root.ProcessTest.test_spawn_with_listener_failure", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 74 }, { "content": " def test__routing_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n\n ar = AsyncResult()\n p._routing_call(ar.set, None, value=sentinel.callarg)\n\n v = ar.get(timeout=5)\n self.assertEquals(v, sentinel.callarg)\n\n p._notify_stop()\n p.stop()", "metadata": "root.ProcessTest.test__routing_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 99 }, { "content": " def test_competing__routing_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n\n sem = Semaphore()\n\n # define a callable method that tries to grab a shared semaphore\n def thecall(ar=None):\n\n semres = sem.acquire(blocking=False)\n if not semres:\n raise StandardError(\"Could not get semaphore, routing_call/control flow is broken!\")\n\n # make this take a sec\n time.sleep(1)\n\n # make sure we release\n sem.release()\n\n # set the ar\n ar.set(True)\n\n # schedule some calls (in whatever order)\n ar1 = AsyncResult()\n ar2 = AsyncResult()\n ar3 = AsyncResult()\n\n p._routing_call(thecall, None, ar=ar3)\n p._routing_call(thecall, None, ar=ar1)\n p._routing_call(thecall, None, ar=ar2)\n\n # wait on all the ARs to be set\n ar1.get(timeout=5)\n ar2.get(timeout=5)\n ar3.get(timeout=5)\n\n # just getting here without throwing an exception is the true test!\n\n p._notify_stop()\n p.stop()", "metadata": "root.ProcessTest.test_competing__routing_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 114 }, { "content": " def test_known_error(self):\n\n # IonExceptions and TypeErrors get forwarded back intact\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n def proc_call():\n raise NotFound(\"didn't find it\")\n\n def client_call(p=None, ar=None):\n try:\n ca = p._routing_call(proc_call, None)\n ca.get(timeout=5)\n\n except IonException as e:\n ar.set(e)\n\n ar = AsyncResult()\n gl_call = spawn(client_call, p=p, ar=ar)\n\n e = ar.get(timeout=5)\n\n self.assertIsInstance(e, NotFound)", "metadata": "root.ProcessTest.test_known_error", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 157 }, { "content": " def test_unknown_error(self):\n\n # Unhandled exceptions get handled and then converted to ContainerErrors\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n def proc_call():\n raise self.ExpectedError(\"didn't find it\")\n\n def client_call(p=None, ar=None):\n try:\n ca = p._routing_call(proc_call, None)\n ca.get(timeout=5)\n\n except IonException as e:\n ar.set(e)\n\n ar = AsyncResult()\n gl_call = spawn(client_call, p=p, ar=ar)\n\n e = ar.get(timeout=5)\n\n self.assertIsInstance(e, ContainerError)\n self.assertEquals(len(p._errors), 1)", "metadata": "root.ProcessTest.test_unknown_error", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 184 }, { "content": " def test_has_pending_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n\n ar = p._routing_call(sentinel.call, MagicMock())\n self.assertTrue(p.has_pending_call(ar))", "metadata": "root.ProcessTest.test_has_pending_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 212 }, { "content": " def test_has_pending_call_with_no_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n\n ar = p._routing_call(sentinel.call, MagicMock())\n # pretend we've processed it\n p._ctrl_queue.get()\n\n self.assertFalse(p.has_pending_call(ar))", "metadata": "root.ProcessTest.test_has_pending_call_with_no_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 219 }, { "content": " def test__cancel_pending_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n\n ar = p._routing_call(sentinel.call, MagicMock())\n val = p._cancel_pending_call(ar)\n\n self.assertTrue(val)\n self.assertTrue(ar.ready())", "metadata": "root.ProcessTest.test__cancel_pending_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 229 }, { "content": " def test__cancel_pending_call_with_no_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n\n ar = p._routing_call(sentinel.call, MagicMock())\n # pretend we've processed it\n p._ctrl_queue.get()\n\n val = p._cancel_pending_call(ar)\n\n self.assertFalse(val)", "metadata": "root.ProcessTest.test__cancel_pending_call_with_no_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 239 }, { "content": " def test__interrupt_control_thread(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n # put a call in that will never finish\n waitar = AsyncResult() # test specific, wait for this to indicate we're being processed/hung\n callar = AsyncResult() # test specific, an ar that is just waited on by the spin call\n def spin(inar, outar):\n outar.set(True)\n inar.wait()\n\n ar = p._routing_call(spin, MagicMock(), callar, waitar)\n\n # wait until we get notice we're being processed\n waitar.get(timeout=2)\n\n # interrupt it\n p._interrupt_control_thread()\n\n # the ar we got back from routing_call will not be set, it never finished the call\n self.assertFalse(ar.ready())\n\n # to prove we're unblocked, run another call through the control thread\n ar2 = p._routing_call(callar.set, MagicMock(), sentinel.val)\n ar2.get(timeout=2)\n self.assertTrue(callar.ready())\n self.assertEquals(callar.get(), sentinel.val)", "metadata": "root.ProcessTest.test__interrupt_control_thread", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 251 }, { "content": " def test__control_flow_cancelled_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n # put a call in that will never finish\n waitar = AsyncResult() # test specific, wait for this to indicate we're being processed/hung\n callar = AsyncResult() # test specific, an ar that is just waited on by the spin call (eventually set in this test)\n def spin(inar, outar):\n outar.set(True)\n inar.wait()\n\n ar = p._routing_call(spin, MagicMock(), callar, waitar)\n\n # schedule a second call that we're going to cancel\n futurear = AsyncResult()\n ar2 = p._routing_call(futurear.set, MagicMock(), sentinel.val)\n\n # wait until we get notice we're being processed\n waitar.get(timeout=2)\n\n # cancel the SECOND call\n p.cancel_or_abort_call(ar2)\n\n # prove we didn't interrupt the current proc by allowing it to continue\n callar.set()\n ar.get(timeout=2)\n\n # now the second proc will get queued and never called because it is cancelled\n self.assertRaises(Timeout, futurear.get, timeout=2)\n self.assertTrue(ar2.ready())", "metadata": "root.ProcessTest.test__control_flow_cancelled_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 282 }, { "content": " def test__control_flow_expired_call(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n def make_call(call, ctx, val):\n ar = p._routing_call(call, ctx, val)\n return ar.get(timeout=10)\n\n ctx = { 'reply-by' : 0 } # no need for real time, as it compares by CURRENT >= this value\n futurear = AsyncResult()\n with patch('pyon.ion.process.greenlet') as gcm:\n waitar = AsyncResult()\n gcm.getcurrent().kill.side_effect = lambda *a, **k: waitar.set()\n\n ar = p._routing_call(futurear.set, ctx, sentinel.val)\n\n waitar.get(timeout=10)\n\n # futurear is not set\n self.assertFalse(futurear.ready())\n\n # neither is the ar we got back from routing_call\n self.assertFalse(ar.ready())\n\n # we should've been killed, though\n self.assertEquals(gcm.getcurrent().kill.call_count, 1)\n self.assertIsInstance(gcm.getcurrent().kill.call_args[1]['exception'], IonTimeout)\n\n # put a new call through (to show unblocked)\n futurear2 = AsyncResult()\n ar2 = p._routing_call(futurear2.set, MagicMock(), sentinel.val2)\n ar2.get(timeout=2)", "metadata": "root.ProcessTest.test__control_flow_expired_call", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 316 }, { "content": " def test_heartbeat_no_listeners(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n hb = p.heartbeat()\n\n self.assertEquals((True, True, True), hb)\n self.assertEquals(0, p._heartbeat_count)\n self.assertIsNone(p._heartbeat_op)", "metadata": "root.ProcessTest.test_heartbeat_no_listeners", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 352 }, { "content": " def test_heartbeat_with_listeners(self):\n mocklistener = Mock(spec=ProcessRPCServer)\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[mocklistener], service=svc)\n readyev = Event()\n readyev.set()\n mocklistener.get_ready_event.return_value = readyev\n\n def fake_listen(evout, evin):\n evout.set(True)\n evin.wait()\n\n listenoutev = AsyncResult()\n listeninev = Event()\n\n mocklistener.listen = lambda *a, **kw: fake_listen(listenoutev, listeninev)\n\n p.start()\n p.get_ready_event().wait(timeout=5)\n p.start_listeners()\n\n listenoutev.wait(timeout=5) # wait for listen loop to start\n\n self.addCleanup(listeninev.set) # makes listen loop fall out on shutdown\n self.addCleanup(p.stop)\n\n # now test heartbeat!\n hb = p.heartbeat()\n\n self.assertEquals((True, True, True), hb)\n self.assertEquals(0, p._heartbeat_count)\n self.assertIsNone(p._heartbeat_op)", "metadata": "root.ProcessTest.test_heartbeat_with_listeners", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 365 }, { "content": " def test_heartbeat_listener_dead(self):\n mocklistener = Mock(spec=ProcessRPCServer)\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[mocklistener], service=svc)\n readyev = Event()\n readyev.set()\n mocklistener.get_ready_event.return_value = readyev\n\n def fake_listen(evout, evin):\n evout.set(True)\n evin.wait()\n\n listenoutev = AsyncResult()\n listeninev = Event()\n\n p.start()\n p.get_ready_event().wait(timeout=5)\n p.start_listeners()\n\n listenoutev.wait(timeout=5) # wait for listen loop to start\n\n self.addCleanup(listeninev.set) # makes listen loop fall out on shutdown\n self.addCleanup(p.stop)\n\n listeninev.set() # stop the listen loop\n p.thread_manager.children[1].join(timeout=5) # wait for listen loop to terminate\n\n hb = p.heartbeat()\n\n self.assertEquals((False, True, True), hb)\n self.assertEquals(0, p._heartbeat_count)\n self.assertIsNone(p._heartbeat_op)", "metadata": "root.ProcessTest.test_heartbeat_listener_dead", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 398 }, { "content": " def test_heartbeat_ctrl_thread_dead(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n self.addCleanup(p.stop)\n\n p._ctrl_thread.stop()\n\n hb = p.heartbeat()\n\n self.assertEquals((True, False, True), hb)\n self.assertEquals(0, p._heartbeat_count)\n self.assertIsNone(p._heartbeat_op)", "metadata": "root.ProcessTest.test_heartbeat_ctrl_thread_dead", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 431 }, { "content": " def test_heartbeat_with_current_op(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n p._ctrl_thread.ev_exit.set() # prevent heartbeat loop in proc's target\n\n def fake_op(evout, evin):\n evout.set(True)\n evin.wait()\n\n listenoutev = AsyncResult()\n listeninev = Event()\n\n self.addCleanup(listeninev.set) # allow graceful termination\n self.addCleanup(p.stop)\n\n ar = p._routing_call(fake_op, None, listenoutev, listeninev)\n\n listenoutev.wait(timeout=5) # wait for ctrl thread to run our op\n\n hb = p.heartbeat()\n\n self.assertEquals((True, True, True), hb)\n self.assertEquals(1, p._heartbeat_count)\n self.assertEquals(ar, p._heartbeat_op)\n self.assertIsNotNone(p._heartbeat_time)\n self.assertIsNotNone(p._heartbeat_stack)\n\n self.assertIn(\"evin.wait\", str(p._heartbeat_stack))", "metadata": "root.ProcessTest.test_heartbeat_with_current_op", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 446 }, { "content": " def test_heartbeat_with_current_op_multiple_times(self):\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n p._ctrl_thread.ev_exit.set() # prevent heartbeat loop in proc's target\n\n def fake_op(evout, evin):\n evout.set(True)\n evin.wait()\n\n listenoutev = AsyncResult()\n listeninev = Event()\n\n self.addCleanup(listeninev.set) # allow graceful termination\n self.addCleanup(p.stop)\n\n ar = p._routing_call(fake_op, None, listenoutev, listeninev)\n\n listenoutev.wait(timeout=5) # wait for ctrl thread to run our op\n\n for x in xrange(5):\n hb = p.heartbeat()\n\n self.assertEquals((True, True, True), hb)\n self.assertEquals(5, p._heartbeat_count)\n self.assertEquals(ar, p._heartbeat_op)", "metadata": "root.ProcessTest.test_heartbeat_with_current_op_multiple_times", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 477 }, { "content": " def test_heartbeat_current_op_over_limit(self):\n self.patch_cfg('pyon.ion.process.CFG', {'cc':{'timeout':{'heartbeat_proc_count_threshold':2}}})\n\n svc = self._make_service()\n p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)\n p.start()\n p.get_ready_event().wait(timeout=5)\n p._ctrl_thread.ev_exit.set() # prevent heartbeat loop in proc's target\n\n def fake_op(evout, evin):\n evout.set(True)\n evin.wait()\n\n listenoutev = AsyncResult()\n listeninev = Event()\n\n self.addCleanup(listeninev.set) # allow graceful termination\n self.addCleanup(p.stop)\n\n ar = p._routing_call(fake_op, None, listenoutev, listeninev)\n\n listenoutev.wait(timeout=5) # wait for ctrl thread to run our op\n\n # make sure it's over the threshold\n for x in xrange(3):\n hb = p.heartbeat()\n\n self.assertEquals((True, True, False), hb)", "metadata": "root.ProcessTest.test_heartbeat_current_op_over_limit", "header": "['class', 'ProcessTest', '(', 'PyonTestCase', ')', ':', '___EOS___']", "index": 505 }, { "content": "class FakeService(BaseService):\n \"\"\"\n Class to use for testing below.\n \"\"\"\n name = 'fake_service'\n dependencies = []\n", "metadata": "root.FakeService", "header": "['module', '___EOS___']", "index": 534 }, { "content": " def takes_too_long(self, noticear=None):\n if noticear is not None:\n noticear.set(True)\n ar = AsyncResult()\n ar.wait()", "metadata": "root.FakeService.takes_too_long", "header": "['class', 'FakeService', '(', 'BaseService', ')', ':', '___EOS___']", "index": 541 }, { "content": "@attr('INT', group='coi')\n@unittest.skip(\"no active tests, 18 oct 2012\")\nclass TestProcessInt(IonIntegrationTestCase):\n\n", "metadata": "root.TestProcessInt", "header": "['module', '___EOS___']", "index": 547 }, { "content": " def setUp(self):\n self._start_container()\n self.pid = self.container.spawn_process('fake', 'pyon.ion.test.test_process', 'FakeService')\n self.fsclient = RPCClient(to_name='fake_service')", "metadata": "root.TestProcessInt.setUp", "header": "['class', 'TestProcessInt', '(', 'IonIntegrationTestCase', ')', ':', '___EOS___']", "index": 550 }, { "content": " @unittest.skip(\"timeouts removed 18 oct 2012\")\n def test_timeout_with_messaging(self):\n with self.assertRaises(IonTimeout) as cm:\n self.fsclient.request({}, op='takes_too_long', timeout=5)\n\n self.assertIn('execute in allotted time', cm.exception.message)", "metadata": "root.TestProcessInt.test_timeout_with_messaging", "header": "['class', 'TestProcessInt', '(', 'IonIntegrationTestCase', ')', ':', '___EOS___']", "index": 555 }, { "content": " @unittest.skipIf(os.getenv('CEI_LAUNCH_TEST', False), \"Test reaches into container, doesn't work with CEI\")\n @unittest.skip(\"heartbeat failing process is disabled\")\n def test_heartbeat_failure(self):\n self.patch_cfg('pyon.ion.process.CFG', {'cc':{'timeout':{'heartbeat_proc_count_threshold':2, 'heartbeat':1.0}}})\n\n svc = self.container.proc_manager.procs[self.pid]\n ip = svc._process\n stopar = AsyncResult()\n self.container.proc_manager.add_proc_state_changed_callback(lambda *args: stopar.set(args))\n\n noticear = AsyncResult() # notify us when the call has been made\n ar = ip._routing_call(svc.takes_too_long, None, noticear=noticear)\n\n noticear.get(timeout=10) # wait for the call to be made\n\n # heartbeat a few times so we trigger the failure soon\n for x in xrange(2):\n ip.heartbeat()\n\n # wait for ip thread to kick over\n ip._ctrl_thread.join(timeout=5)\n\n # now wait for notice proc got canned\n stopargs = stopar.get(timeout=5)\n\n self.assertEquals(stopargs, (svc, ProcessStateEnum.FAILED, self.container))\n\n # should've shut down, no longer in container's process list\n self.assertEquals(len(self.container.proc_manager.procs), 0)", "metadata": "root.TestProcessInt.test_heartbeat_failure", "header": "['class', 'TestProcessInt', '(', 'IonIntegrationTestCase', ')', ':', '___EOS___']", "index": 562 } ]
[]
[]
0
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", "author\\u\\u_", "=_", "'", "Dav", "e", " ", "Fos", "ter", " ", "<", "df", "ost", "er", "@", "asa", "scie", "nce", ".", "com", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyo", "n_", "._", "ion_", "._", "process_", "import_", "Io", "n", "Process", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "ion_", "._", "endpoint_", "import_", "Process", "RP", "CS", "erver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gevent_", "._", "event_", "import_", "Async", "Result_", ",_", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gevent_", "._", "coros", "_", "import_", "Semaphore", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gevent_", "._", "timeout_", "import_", "Timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "util_", "._", "unit", "\\u", "test_", "import_", "Py", "on", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "util_", "._", "int\\u", "test_", "import_", "Io", "n", "Integrati", "on", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "util_", "._", "context_", "import_", "Local", "Context", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "core_", "._", "exception_", "import_", "Io", "n", "Exception_", ",_", "Not", "Found_", ",_", "Containe", "r", "Error_", ",_", "Timeout_", "as_", "Io", "n", "Timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "util_", "._", "async_", "import_", "spawn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock_", "import_", "sentinel_", ",_", "Mock_", ",_", "Mag", "ic", "Mock_", ",_", "ANY_", ",_", "patch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "plugins_", "._", "attrib_", "import_", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "net_", "._", "endpoint_", "import_", "RP", "CC", "lient_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "ion_", "._", "service_", "import_", "Base", "Service_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "interface_", "._", "objects_", "import_", "Process", "State", "Enum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "attr_", "(_", "'", "UNIT", "'_", ",_", "group_", "=_", "'", "co", "i", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Expect", "ed", "Failure_", "(_", "Standard", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "make", "\\u", "service_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "help", "er", " ", "to", " ", "make", " ", "a", " ", "pass", "able", " ", "service", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "=_", "Local", "Context", "Mixin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "._", "id_", "=_", "\"", "test\\u", "id", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "._", "name_", "=_", "\"", "test\\u", "svc", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "._", "container_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "._", "container_", "._", "context_", "=_", "Local", "Context", "Mixin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "svc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "spawn", "\\u", "proc", "\\u", "with", "\\u", "no", "\\u", "listeners_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "p_", "._", "thread", "\\u", "manager_", "._", "children_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "notif", "y", "\\u", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "thread", "\\u", "manager_", "._", "children_", "[_", "0_", "]_", "._", "proc_", "._", "dead_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "spawn", "\\u", "proc", "\\u", "with", "\\u", "one", "\\u", "listener_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "listener_", "=_", "Mock_", "(_", "spec_", "=_", "Process", "RP", "CS", "erver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "mock", "listener_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "listener_", "._", "get", "\\u", "read", "y", "\\u", "event_", "._", "return", "\\u", "value_", "=_", "read", "ye", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start", "\\u", "listeners_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "p_", "._", "thread", "\\u", "manager_", "._", "children_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "listener_", "._", "listen_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "thread", "\\u", "name_", "=_", "ANY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "mock", "listener_", "._", "routin", "g", "\\u", "call_", ",_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "notif", "y", "\\u", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "listener_", "._", "close_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "\"", "must", " ", "be", " ", "ret", "ool", "ed", " ", "to", " ", "work", " ", "with", " ", "new", " ", "listen", "er", " ", "spawn", " ", "rule", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "spawn", "\\u", "with", "\\u", "listen", "er", "\\u", "failure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "listener_", "=_", "Mock_", "(_", "spec_", "=_", "Process", "RP", "CS", "erver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "listener_", "._", "listen_", "._", "side", "\\u", "effect_", "=_", "self_", "._", "Expect", "ed", "Failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "listener_", "._", "get", "\\u", "read", "y", "\\u", "event_", "._", "return", "\\u", "value_", "=_", "read", "ye", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "mock", "listener_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start", "\\u", "listeners_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "exception", " ", "is", " ", "linked", " ", "to", " ", "the", " ", "main", " ", "proc", " ", "insi", "de", " ", "the", " ", "Io", "n", "Process", ",", " ", "so", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "dead", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "proc_", "._", "dead_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "p_", "._", "proc_", "._", "exception_", ",_", "self_", "._", "Expect", "ed", "Failure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stopping", " ", "will", " ", "raise", " ", "an", " ", "error", " ", "as", " ", "proc", " ", "die", "d", " ", "alr", "ead", "y_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "self_", "._", "Expect", "ed", "Failure_", ",_", "p_", "._", "\\u", "notif", "y", "\\u", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "control", " ", "flow", " ", "proc", " ", "die", "d", " ", "tho", "ugh", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "thread", "\\u", "manager_", "._", "children_", "[_", "-_", "1_", "]_", "._", "proc_", "._", "dead_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "\\u", "routin", "g", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "ar_", "._", "set_", ",_", "None_", ",_", "value_", "=_", "sentinel_", "._", "calla", "rg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "v_", "=_", "ar_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "sentinel_", "._", "calla", "rg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "notif", "y", "\\u", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "compet", "ing", "\\u\\u", "routin", "g", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sem_", "=_", "Semaphore", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "e", " ", "a", " ", "calla", "ble", " ", "method", " ", "tha", "t", " ", "trie", "s", " ", "to", " ", "gra", "b", " ", "a", " ", "shared", " ", "semaphore", "_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "the", "call_", "(_", "ar_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sem", "res_", "=_", "sem_", "._", "acquire_", "(_", "blocking_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sem", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Standard", "Error_", "(_", "\"", "Cou", "ld", " ", "not", " ", "get", " ", "semaphore", ",", " ", "routin", "g", "\\u", "call", "/", "control", " ", "flow", " ", "is", " ", "broken", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "this", " ", "take", " ", "a", " ", "sec_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "we", " ", "release_", "\\u\\u\\uNL\\u\\u\\u_", "sem_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "the", " ", "ar_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", " ", "some", " ", "calls", " ", "(", "in", " ", "what", "ever", " ", "order", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ar", "1_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "2_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "3_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "the", "call_", ",_", "None_", ",_", "ar_", "=_", "ar", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "the", "call_", ",_", "None_", ",_", "ar_", "=_", "ar", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "the", "call_", ",_", "None_", ",_", "ar_", "=_", "ar", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait", " ", "on", " ", "all", " ", "the", " ", "AR", "s", " ", "to", " ", "be", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "ar", "1_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "2_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "3_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "getti", "ng", " ", "here", " ", "with", "out", " ", "throw", "ing", " ", "an", " ", "exception", " ", "is", " ", "the", " ", "true", " ", "test", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "notif", "y", "\\u", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "know", "n", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Io", "n", "Except", "ion", "s", " ", "and", " ", "Type", "Error", "s", " ", "get", " ", "forwarded", " ", "back", " ", "inta", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "proc", "\\u", "call_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Found_", "(_", "\"", "did", "n", "'", "t", " ", "find", " ", "it", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "client", "\\u", "call_", "(_", "p_", "=_", "None_", ",_", "ar_", "=_", "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 ", " _", "ca_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "proc", "\\u", "call_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ca_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Io", "n", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ar_", "._", "set_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gl", "\\u", "call_", "=_", "spawn_", "(_", "client", "\\u", "call_", ",_", "p_", "=_", "p_", ",_", "ar_", "=_", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "ar_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "e_", ",_", "Not", "Found_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "unknown", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unh", "andle", "d", " ", "exception", "s", " ", "get", " ", "handle", "d", " ", "and", " ", "then", " ", "convert", "ed", " ", "to", " ", "Containe", "r", "Errors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "proc", "\\u", "call_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "self_", "._", "Expect", "ed", "Error_", "(_", "\"", "did", "n", "'", "t", " ", "find", " ", "it", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "client", "\\u", "call_", "(_", "p_", "=_", "None_", ",_", "ar_", "=_", "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 ", " _", "ca_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "proc", "\\u", "call_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ca_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Io", "n", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ar_", "._", "set_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gl", "\\u", "call_", "=_", "spawn_", "(_", "client", "\\u", "call_", ",_", "p_", "=_", "p_", ",_", "ar_", "=_", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "ar_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "e_", ",_", "Containe", "r", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "p_", "._", "\\u", "errors_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "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", "pend", "ing", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "sentinel_", "._", "call_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "has", "\\u", "pend", "ing", "\\u", "call_", "(_", "ar_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "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", "pend", "ing", "\\u", "call", "\\u", "with", "\\u", "no", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "sentinel_", "._", "call_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prete", "nd", " ", "we", "'", "ve", " ", "process", "ed", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "ctrl", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "p_", "._", "has", "\\u", "pend", "ing", "\\u", "call_", "(_", "ar_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "\\u", "cancel", "\\u", "pend", "ing", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "sentinel_", "._", "call_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "p_", "._", "\\u", "cancel", "\\u", "pend", "ing", "\\u", "call_", "(_", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ar_", "._", "ready_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "\\u", "cancel", "\\u", "pend", "ing", "\\u", "call", "\\u", "with", "\\u", "no", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "sentinel_", "._", "call_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prete", "nd", " ", "we", "'", "ve", " ", "process", "ed", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "ctrl", "\\u", "queue_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "val_", "=_", "p_", "._", "\\u", "cancel", "\\u", "pend", "ing", "\\u", "call_", "(_", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "\\u", "interrupt", "\\u", "control", "\\u", "thread_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "a", " ", "call", " ", "in", " ", "tha", "t", " ", "will", " ", "neve", "r", " ", "finish_", "\\u\\u\\uNL\\u\\u\\u_", "wait", "ar_", "=_", "Async", "Result_", "(_", ")_", "#", " ", "test", " ", "specific", ",", " ", "wait", " ", "for", " ", "this", " ", "to", " ", "indicat", "e", " ", "we", "'", "re", " ", "bei", "ng", " ", "process", "ed", "/", "hun", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calla", "r_", "=_", "Async", "Result_", "(_", ")_", "#", " ", "test", " ", "specific", ",", " ", "an", " ", "ar", " ", "tha", "t", " ", "is", " ", "just", " ", "wait", "ed", " ", "on", " ", "by", " ", "the", " ", "spin", " ", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "spin_", "(_", "inar", "_", ",_", "out", "ar_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "ar_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inar", "_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "spin_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "calla", "r_", ",_", "wait", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait", " ", "unti", "l", " ", "we", " ", "get", " ", "notice", " ", "we", "'", "re", " ", "bei", "ng", " ", "processed_", "\\u\\u\\uNL\\u\\u\\u_", "wait", "ar_", "._", "get_", "(_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "interrupt", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "interrupt", "\\u", "control", "\\u", "thread_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "ar", " ", "we", " ", "got", " ", "back", " ", "from", " ", "routin", "g", "\\u", "call", " ", "will", " ", "not", " ", "be", " ", "set", ",", " ", "it", " ", "neve", "r", " ", "finish", "ed", " ", "the", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "ar_", "._", "ready_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "prove", " ", "we", "'", "re", " ", "unbl", "ock", "ed", ",", " ", "run", " ", "anot", "her", " ", "call", " ", "through", " ", "the", " ", "control", " ", "thread_", "\\u\\u\\uNL\\u\\u\\u_", "ar", "2_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "calla", "r_", "._", "set_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "sentinel_", "._", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "2_", "._", "get_", "(_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "calla", "r_", "._", "ready_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "calla", "r_", "._", "get_", "(_", ")_", ",_", "sentinel_", "._", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "\\u", "control", "\\u", "flow", "\\u", "cancel", "led", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "a", " ", "call", " ", "in", " ", "tha", "t", " ", "will", " ", "neve", "r", " ", "finish_", "\\u\\u\\uNL\\u\\u\\u_", "wait", "ar_", "=_", "Async", "Result_", "(_", ")_", "#", " ", "test", " ", "specific", ",", " ", "wait", " ", "for", " ", "this", " ", "to", " ", "indicat", "e", " ", "we", "'", "re", " ", "bei", "ng", " ", "process", "ed", "/", "hun", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calla", "r_", "=_", "Async", "Result_", "(_", ")_", "#", " ", "test", " ", "specific", ",", " ", "an", " ", "ar", " ", "tha", "t", " ", "is", " ", "just", " ", "wait", "ed", " ", "on", " ", "by", " ", "the", " ", "spin", " ", "call", " ", "(", "eventual", "ly", " ", "set", " ", "in", " ", "this", " ", "test", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "spin_", "(_", "inar", "_", ",_", "out", "ar_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "ar_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inar", "_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "spin_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "calla", "r_", ",_", "wait", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "schedule", " ", "a", " ", "second", " ", "call", " ", "tha", "t", " ", "we", "'", "re", " ", "goi", "ng", " ", "to", " ", "cancel_", "\\u\\u\\uNL\\u\\u\\u_", "future", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "2_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "future", "ar_", "._", "set_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "sentinel_", "._", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait", " ", "unti", "l", " ", "we", " ", "get", " ", "notice", " ", "we", "'", "re", " ", "bei", "ng", " ", "processed_", "\\u\\u\\uNL\\u\\u\\u_", "wait", "ar_", "._", "get_", "(_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cancel", " ", "the", " ", "SECOND", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "cancel", "\\u", "or", "\\u", "abort", "\\u", "call_", "(_", "ar", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prove", " ", "we", " ", "did", "n", "'", "t", " ", "interrupt", " ", "the", " ", "current", " ", "proc", " ", "by", " ", "allow", "ing", " ", "it", " ", "to", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "calla", "r_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar_", "._", "get_", "(_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "the", " ", "second", " ", "proc", " ", "will", " ", "get", " ", "queue", "d", " ", "and", " ", "neve", "r", " ", "call", "ed", " ", "bec", "aus", "e", " ", "it", " ", "is", " ", "cancelled_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Timeout_", ",_", "future", "ar_", "._", "get_", ",_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ar", "2_", "._", "ready_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "\\u", "control", "\\u", "flow", "\\u", "expir", "ed", "\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "\\u", "call_", "(_", "call_", ",_", "ctx_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "call_", ",_", "ctx_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ar_", "._", "get_", "(_", "timeout_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "=_", "{_", "'", "repl", "y", "-", "by", "'_", ":_", "0_", "}_", "#", " ", "no", " ", "need", " ", "for", " ", "real", " ", "time", ",", " ", "as", " ", "it", " ", "compare", "s", " ", "by", " ", "CURREN", "T", " ", ">=", " ", "this", " ", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "future", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "patch_", "(_", "'", "pyo", "n", ".", "ion", ".", "process", ".", "greenlet", "'_", ")_", "as_", "gcm", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wait", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gcm", "_", "._", "getc", "urrent", "_", "(_", ")_", "._", "kill_", "._", "side", "\\u", "effect_", "=_", "lambda_", "*_", "a_", ",_", "**_", "k_", ":_", "wait", "ar_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "future", "ar_", "._", "set_", ",_", "ctx_", ",_", "sentinel_", "._", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wait", "ar_", "._", "get_", "(_", "timeout_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "future", "ar", " ", "is", " ", "not", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "future", "ar_", "._", "ready_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nei", "ther", " ", "is", " ", "the", " ", "ar", " ", "we", " ", "got", " ", "back", " ", "from", " ", "routin", "g", "\\u", "call_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "ar_", "._", "ready_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "shou", "ld", "'", "ve", " ", "bee", "n", " ", "kille", "d", ",", " ", "tho", "ugh", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "gcm", "_", "._", "getc", "urrent", "_", "(_", ")_", "._", "kill_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "gcm", "_", "._", "getc", "urrent", "_", "(_", ")_", "._", "kill_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "exception", "'_", "]_", ",_", "Io", "n", "Timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "a", " ", "new", " ", "call", " ", "through", " ", "(", "to", " ", "show", " ", "unbl", "ock", "ed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "future", "ar", "2_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "2_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "future", "ar", "2_", "._", "set_", ",_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "sentinel_", "._", "val2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar", "2_", "._", "get_", "(_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "no", "\\u", "listeners_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "True_", ",_", "True_", ",_", "True_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "with", "\\u", "listeners_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "listener_", "=_", "Mock_", "(_", "spec_", "=_", "Process", "RP", "CS", "erver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "mock", "listener_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "listener_", "._", "get", "\\u", "read", "y", "\\u", "event_", "._", "return", "\\u", "value_", "=_", "read", "ye", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fake", "\\u", "listen_", "(_", "evo", "ut_", ",_", "evi", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "evo", "ut_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "evi", "n_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "listen", "oute", "v_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ine", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "listener_", "._", "listen_", "=_", "lambda_", "*_", "a_", ",_", "**_", "kw_", ":_", "fake", "\\u", "listen_", "(_", "listen", "oute", "v_", ",_", "listen", "ine", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start", "\\u", "listeners_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "oute", "v_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "#", " ", "wait", " ", "for", " ", "listen", " ", "loop", " ", "to", " ", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "listen", "ine", "v_", "._", "set_", ")_", "#", " ", "make", "s", " ", "listen", " ", "loop", " ", "fall", " ", "out", " ", "on", " ", "shutdown_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "test", " ", "heart", "beat", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "True_", ",_", "True_", ",_", "True_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "listen", "er", "\\u", "dead_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "listener_", "=_", "Mock_", "(_", "spec_", "=_", "Process", "RP", "CS", "erver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "mock", "listener_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read", "ye", "v_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "listener_", "._", "get", "\\u", "read", "y", "\\u", "event_", "._", "return", "\\u", "value_", "=_", "read", "ye", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fake", "\\u", "listen_", "(_", "evo", "ut_", ",_", "evi", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "evo", "ut_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "evi", "n_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "listen", "oute", "v_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ine", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start", "\\u", "listeners_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "oute", "v_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "#", " ", "wait", " ", "for", " ", "listen", " ", "loop", " ", "to", " ", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "listen", "ine", "v_", "._", "set_", ")_", "#", " ", "make", "s", " ", "listen", " ", "loop", " ", "fall", " ", "out", " ", "on", " ", "shutdown_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "ine", "v_", "._", "set_", "(_", ")_", "#", " ", "stop", " ", "the", " ", "listen", " ", "loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "thread", "\\u", "manager_", "._", "children_", "[_", "1_", "]_", "._", "join_", "(_", "timeout_", "=_", "5_", ")_", "#", " ", "wait", " ", "for", " ", "listen", " ", "loop", " ", "to", " ", "terminate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "False_", ",_", "True_", ",_", "True_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "ctrl", "\\u", "thread", "\\u", "dead_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "\\u", "ctrl", "\\u", "thread_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "True_", ",_", "False_", ",_", "True_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "with", "\\u", "current", "\\u", "op_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "ctrl", "\\u", "thread_", "._", "ev", "\\u", "exit_", "._", "set_", "(_", ")_", "#", " ", "prevent", " ", "heart", "beat", " ", "loop", " ", "in", " ", "proc", "'", "s", " ", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fake", "\\u", "op_", "(_", "evo", "ut_", ",_", "evi", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "evo", "ut_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "evi", "n_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "listen", "oute", "v_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ine", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "listen", "ine", "v_", "._", "set_", ")_", "#", " ", "allow", " ", "graceful", " ", "termination", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "fake", "\\u", "op_", ",_", "None_", ",_", "listen", "oute", "v_", ",_", "listen", "ine", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "oute", "v_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "#", " ", "wait", " ", "for", " ", "ctrl", " ", "thread", " ", "to", " ", "run", " ", "our", " ", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "True_", ",_", "True_", ",_", "True_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "ar_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "stack_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\"", "evi", "n", ".", "wait", "\"_", ",_", "str_", "(_", "p_", "._", "\\u", "heart", "beat", "\\u", "stack_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "with", "\\u", "current", "\\u", "op", "\\u", "multiple", "\\u", "times_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "ctrl", "\\u", "thread_", "._", "ev", "\\u", "exit_", "._", "set_", "(_", ")_", "#", " ", "prevent", " ", "heart", "beat", " ", "loop", " ", "in", " ", "proc", "'", "s", " ", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fake", "\\u", "op_", "(_", "evo", "ut_", ",_", "evi", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "evo", "ut_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "evi", "n_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "listen", "oute", "v_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ine", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "listen", "ine", "v_", "._", "set_", ")_", "#", " ", "allow", " ", "graceful", " ", "termination", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "fake", "\\u", "op_", ",_", "None_", ",_", "listen", "oute", "v_", ",_", "listen", "ine", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "oute", "v_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "#", " ", "wait", " ", "for", " ", "ctrl", " ", "thread", " ", "to", " ", "run", " ", "our", " ", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "True_", ",_", "True_", ",_", "True_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "5_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "ar_", ",_", "p_", "._", "\\u", "heart", "beat", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "Test_", "(_", "Py", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "current", "\\u", "op", "\\u", "over", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "cfg_", "(_", "'", "pyo", "n", ".", "ion", ".", "process", ".", "CF", "G", "'_", ",_", "{_", "'", "cc", "'_", ":_", "{_", "'", "timeo", "ut", "'_", ":_", "{_", "'", "heart", "beat", "\\u", "proc", "\\u", "count", "\\u", "threshol", "d", "'_", ":_", "2_", "}_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "svc_", "=_", "self_", "._", "\\u", "make", "\\u", "service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Io", "n", "Process", "Thread_", "(_", "name_", "=_", "sentinel_", "._", "name_", ",_", "listeners_", "=_", "[_", "]_", ",_", "service_", "=_", "svc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "get", "\\u", "read", "y", "\\u", "event_", "(_", ")_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "ctrl", "\\u", "thread_", "._", "ev", "\\u", "exit_", "._", "set_", "(_", ")_", "#", " ", "prevent", " ", "heart", "beat", " ", "loop", " ", "in", " ", "proc", "'", "s", " ", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fake", "\\u", "op_", "(_", "evo", "ut_", ",_", "evi", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "evo", "ut_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "evi", "n_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "listen", "oute", "v_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ine", "v_", "=_", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "listen", "ine", "v_", "._", "set_", ")_", "#", " ", "allow", " ", "graceful", " ", "termination", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "p_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ar_", "=_", "p_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "fake", "\\u", "op_", ",_", "None_", ",_", "listen", "oute", "v_", ",_", "listen", "ine", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "oute", "v_", "._", "wait_", "(_", "timeout_", "=_", "5_", ")_", "#", " ", "wait", " ", "for", " ", "ctrl", " ", "thread", " ", "to", " ", "run", " ", "our", " ", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "it", "'", "s", " ", "over", " ", "the", " ", "threshold_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hb_", "=_", "p_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "(_", "True_", ",_", "True_", ",_", "False_", ")_", ",_", "hb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Fake", "Service_", "(_", "Base", "Service_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Class", " ", "to", " ", "use", " ", "for", " ", "testi", "ng", " ", "belo", "w", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "'", "fake", "\\u", "service", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dependencies_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Service_", "(_", "Base", "Service_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "take", "s", "\\u", "too", "\\u", "long_", "(_", "self_", ",_", "notice", "ar_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "notice", "ar_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notice", "ar_", "._", "set_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "attr_", "(_", "'", "INT", "'_", ",_", "group_", "=_", "'", "co", "i", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "\"", "no", " ", "active", " ", "tests", ",", " ", "1", "8", " ", "oct", " ", "2012", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Test", "Process", "Int_", "(_", "Io", "n", "Integrati", "on", "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_", "[SEP]_", "class_", "Test", "Process", "Int_", "(_", "Io", "n", "Integrati", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "start", "\\u", "container_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pid_", "=_", "self_", "._", "container_", "._", "spawn", "\\u", "process_", "(_", "'", "fake", "'_", ",_", "'", "pyo", "n", ".", "ion", ".", "test", ".", "test\\u", "process", "'_", ",_", "'", "Fake", "Service", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fsc", "lient_", "=_", "RP", "CC", "lient_", "(_", "to", "\\u", "name_", "=_", "'", "fake", "\\u", "service", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Process", "Int_", "(_", "Io", "n", "Integrati", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "\"", "timeouts", " ", "remove", "d", " ", "1", "8", " ", "oct", " ", "2012", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "timeo", "ut", "\\u", "with", "\\u", "messaging_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "Io", "n", "Timeout_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fsc", "lient_", "._", "request_", "(_", "{_", "}_", ",_", "op_", "=_", "'", "take", "s", "\\u", "too", "\\u", "long", "'_", ",_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "execute", " ", "in", " ", "allo", "tted", " ", "time", "'_", ",_", "cm_", "._", "exception_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Process", "Int_", "(_", "Io", "n", "Integrati", "on", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip", "If_", "(_", "os_", "._", "getenv_", "(_", "'", "CE", "I", "\\u", "LAUN", "CH", "\\u", "TEST", "'_", ",_", "False_", ")_", ",_", "\"", "Test", " ", "reache", "s", " ", "int", "o", " ", "container", ",", " ", "doe", "sn", "'", "t", " ", "work", " ", "with", " ", "CE", "I", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "unittest_", "._", "skip_", "(_", "\"", "heart", "beat", " ", "faili", "ng", " ", "process", " ", "is", " ", "disable", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "heart", "beat", "\\u", "failure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "cfg_", "(_", "'", "pyo", "n", ".", "ion", ".", "process", ".", "CF", "G", "'_", ",_", "{_", "'", "cc", "'_", ":_", "{_", "'", "timeo", "ut", "'_", ":_", "{_", "'", "heart", "beat", "\\u", "proc", "\\u", "count", "\\u", "threshol", "d", "'_", ":_", "2_", ",_", "'", "heart", "beat", "'_", ":_", "1.0_", "}_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "svc_", "=_", "self_", "._", "container_", "._", "proc", "\\u", "manager_", "._", "procs_", "[_", "self_", "._", "pid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip_", "=_", "svc_", "._", "\\u", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "ar_", "=_", "Async", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "container_", "._", "proc", "\\u", "manager_", "._", "add", "\\u", "proc", "\\u", "state", "\\u", "change", "d\\u", "callback_", "(_", "lambda_", "*_", "args_", ":_", "stop", "ar_", "._", "set_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "notice", "ar_", "=_", "Async", "Result_", "(_", ")_", "#", " ", "notif", "y", " ", "us", " ", "whe", "n", " ", "the", " ", "call", " ", "has", " ", "bee", "n", " ", "made", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ar_", "=_", "ip_", "._", "\\u", "routin", "g", "\\u", "call_", "(_", "svc_", "._", "take", "s", "\\u", "too", "\\u", "long_", ",_", "None_", ",_", "notice", "ar_", "=_", "notice", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "notice", "ar_", "._", "get_", "(_", "timeout_", "=_", "10_", ")_", "#", " ", "wait", " ", "for", " ", "the", " ", "call", " ", "to", " ", "be", " ", "made", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "heart", "beat", " ", "a", " ", "few", " ", "times", " ", "so", " ", "we", " ", "trigger", " ", "the", " ", "fail", "ure", " ", "soo", "n_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip_", "._", "heartbeat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait", " ", "for", " ", "ip", " ", "thread", " ", "to", " ", "kick", " ", "over_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ip_", "._", "\\u", "ctrl", "\\u", "thread_", "._", "join_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "wait", " ", "for", " ", "notice", " ", "proc", " ", "got", " ", "cann", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "stop", "args_", "=_", "stop", "ar_", "._", "get_", "(_", "timeout_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "stop", "args_", ",_", "(_", "svc_", ",_", "Process", "State", "Enum_", "._", "FAILED_", ",_", "self_", "._", "container_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", "'", "ve", " ", "shut", " ", "down", ",", " ", "no", " ", "long", "er", " ", "in", " ", "container", "'", "s", " ", "process", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "self_", "._", "container_", "._", "proc", "\\u", "manager_", "._", "procs_", ")_", ",_", "0_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Comparison using is when operands support `__eq__`
gregmuellegger/django-autofixture/autofixture/base.py
[ { "content": "# -*- coding: utf-8 -*-\nimport warnings\nfrom django.db.models import fields, ImageField\nfrom django.db.models.fields import related\nfrom django.utils.six import with_metaclass\n\nimport autofixture\nfrom autofixture import constraints, generators, signals\nfrom autofixture.values import Values\nfrom autofixture.compat import (\n OrderedDict,\n get_GenericRelation,\n get_remote_field,\n get_remote_field_to,\n getargnames,\n)\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def __init__(self, fields=None, default=None):\n self.fields = {}\n self.subfields = {}\n self.default = default\n\n fields = fields or {}\n if fields is True:\n fields = {'ALL': None}\n if not isinstance(fields, dict):\n fields = dict([(v, None) for v in fields])\n for field, value in fields.items():\n try:\n fieldname, subfield = field.split('__', 1)\n self.subfields.setdefault(fieldname, {})[subfield] = value\n except ValueError:\n self.fields[field] = value", "metadata": "root.Link.__init__", "header": "['class', 'Link', '(', 'object', ')', ':', '___EOS___']", "index": 26 } ]
[]
[]
0
false
[ "[CLS]_", "Compari", "son_", "using_", "is_", "when_", "operands_", "support_", " _", "`_", "\\u\\u", "eq\\u\\u_", "`_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "fields_", ",_", "Image", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "fields_", "import_", "related_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "six_", "import_", "with", "\\u", "metaclass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "autof", "ix", "ture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "autof", "ix", "ture_", "import_", "constraints_", ",_", "generators_", ",_", "signals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "autof", "ix", "ture_", "._", "values_", "import_", "Values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "autof", "ix", "ture_", "._", "compat_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Order", "ed", "Dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "Gene", "ric", "Relation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "remote", "\\u", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "remote", "\\u", "field", "\\u", "to_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "geta", "rg", "names_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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]_", "class_", "Link_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "fields_", "=_", "None_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fields_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subfield", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default_", "=_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fields_", "=_", "fields_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fields_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "{_", "'", "ALL", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "fields_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "dict_", "(_", "[_", "(_", "v_", ",_", "None_", ")_", "for_", "v_", "in_", "fields_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "field_", ",_", "value_", "in_", "fields_", "._", "items_", "(_", ")_", ":_", "\\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 ", " _", "fieldname_", ",_", "subfield", "_", "=_", "field_", "._", "split_", "(_", "'\\u\\u'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subfield", "s_", "._", "setdefault_", "(_", "fieldname_", ",_", "{_", "}_", ")_", "[_", "subfield", "_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fields_", "[_", "field_", "]_", "=_", "value_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
maxtepkeev/architect/tests/models/pony.py
[ { "content": "from __future__ import absolute_import\n\nimport os\nimport datetime\n\nfrom pony.orm import *\nfrom architect import install\n\ndatabases = {\n 'sqlite': {'type': 'sqlite', 'args': (':memory:',), 'kwargs': {}},\n 'pgsql': {'type': 'postgres', 'args': (), 'kwargs': {'user': 'postgres', 'database': 'architect'}},\n 'postgresql': {'type': 'postgres', 'args': (), 'kwargs': {'user': 'postgres', 'database': 'architect'}},\n 'mysql': {'type': 'mysql', 'args': (), 'kwargs': {'user': 'root', 'database': 'architect'}}\n}\n\ncurrent = os.environ.get('DB')\ndb = Database(databases[current].pop('type'), *databases[current]['args'], **databases[current]['kwargs'])\n\n# Generation of entities for date range partitioning\nfor item in ('day', 'week', 'month', 'year'):\n name = 'RangeDate{0}'.format(item.capitalize())\n partition = install('partition', type='range', subtype='date', constraint=item, column='created')\n\n locals()[name] = partition(type(name, (db.Entity,), {\n '_table_': 'test_rangedate{0}'.format(item),\n 'name': Required(unicode),\n 'created': Optional(datetime.datetime, nullable=True),\n }))\n\nif os.environ.get('DB') in ('pgsql', 'postgresql'):\n # Generation of entities for integer range partitioning\n for item in ('2', '5'):\n name = 'RangeInteger{0}'.format(item)\n partition = install('partition', type='range', subtype='integer', constraint=item, column='num')\n\n locals()[name] = partition(type(name, (db.Entity,), {\n '_table_': 'test_rangeinteger{0}'.format(item),\n 'name': Required(unicode),\n 'num': Optional(int, nullable=True)\n }))\n\n # Generation of entities for string range partitioning\n for subtype in ('string_firstchars', 'string_lastchars'):\n for item in ('2', '5'):\n name = 'Range{0}{1}'.format(''.join(s.capitalize() for s in subtype.split('_')), item)\n partition = install('partition', type='range', subtype=subtype, constraint=item, column='title')\n\n locals()[name] = partition(type(name, (db.Entity,), {\n '_table_': 'test_range{0}{1}'.format(subtype, item),\n 'name': Required(unicode),\n 'title': Optional(unicode, nullable=True),\n }))\n\ndb.generate_mapping(create_tables=True)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pon", "y_", "._", "orm_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "archi", "tect", "_", "import_", "install_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "databases_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sql", "ite", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "sql", "ite", "'_", ",_", "'", "args", "'_", ":_", "(_", "':", "memory", ":'_", ",_", ")_", ",_", "'", "kwarg", "s", "'_", ":_", "{_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pgs", "ql", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "postgres", "'_", ",_", "'", "args", "'_", ":_", "(_", ")_", ",_", "'", "kwarg", "s", "'_", ":_", "{_", "'", "user", "'_", ":_", "'", "postgres", "'_", ",_", "'", "databa", "se", "'_", ":_", "'", "archi", "tect", "'_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "postgres", "ql", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "postgres", "'_", ",_", "'", "args", "'_", ":_", "(_", ")_", ",_", "'", "kwarg", "s", "'_", ":_", "{_", "'", "user", "'_", ":_", "'", "postgres", "'_", ",_", "'", "databa", "se", "'_", ":_", "'", "archi", "tect", "'_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mysql", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "mysql", "'_", ",_", "'", "args", "'_", ":_", "(_", ")_", ",_", "'", "kwarg", "s", "'_", ":_", "{_", "'", "user", "'_", ":_", "'", "root", "'_", ",_", "'", "databa", "se", "'_", ":_", "'", "archi", "tect", "'_", "}_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "current_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "DB", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "Database_", "(_", "databases_", "[_", "current_", "]_", "._", "pop_", "(_", "'", "type", "'_", ")_", ",_", "*_", "databases_", "[_", "current_", "]_", "[_", "'", "args", "'_", "]_", ",_", "**_", "databases_", "[_", "current_", "]_", "[_", "'", "kwarg", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generat", "ion", " ", "of", " ", "entit", "ies", " ", "for", " ", "date", " ", "range", " ", "partitioning", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "(_", "'", "day", "'_", ",_", "'", "week", "'_", ",_", "'", "month", "'_", ",_", "'", "year", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "Range", "Date", "{", "0", "}'_", "._", "format_", "(_", "item_", "._", "capitalize_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "partition_", "=_", "install_", "(_", "'", "partit", "ion", "'_", ",_", "type_", "=_", "'", "range", "'_", ",_", "subtype_", "=_", "'", "date", "'_", ",_", "constraint_", "=_", "item_", ",_", "column_", "=_", "'", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "locals_", "(_", ")_", "[_", "name_", "]_", "=_", "partition_", "(_", "type_", "(_", "name_", ",_", "(_", "db_", "._", "Entity_", ",_", ")_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "table", "\\u'_", ":_", "'", "test\\u", "range", "date", "{", "0", "}'_", "._", "format_", "(_", "item_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "Required_", "(_", "unicode_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "Optional_", "(_", "datetime_", "._", "datetime_", ",_", "nullable_", "=_", "True_", ")_", ",_", "\\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_", "os_", "._", "environ_", "._", "get_", "(_", "'", "DB", "'_", ")_", "in_", "(_", "'", "pgs", "ql", "'_", ",_", "'", "postgres", "ql", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Generat", "ion", " ", "of", " ", "entit", "ies", " ", "for", " ", "integ", "er", " ", "range", " ", "partitioning", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "(_", "'", "2", "'_", ",_", "'", "5", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "Range", "Integer", "{", "0", "}'_", "._", "format_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "partition_", "=_", "install_", "(_", "'", "partit", "ion", "'_", ",_", "type_", "=_", "'", "range", "'_", ",_", "subtype_", "=_", "'", "integ", "er", "'_", ",_", "constraint_", "=_", "item_", ",_", "column_", "=_", "'", "num", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "locals_", "(_", ")_", "[_", "name_", "]_", "=_", "partition_", "(_", "type_", "(_", "name_", ",_", "(_", "db_", "._", "Entity_", ",_", ")_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "table", "\\u'_", ":_", "'", "test\\u", "range", "integ", "er", "{", "0", "}'_", "._", "format_", "(_", "item_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "Required_", "(_", "unicode_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "num", "'_", ":_", "Optional_", "(_", "int_", ",_", "nullable_", "=_", "True_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generat", "ion", " ", "of", " ", "entit", "ies", " ", "for", " ", "string", " ", "range", " ", "partitioning", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "subtype_", "in_", "(_", "'", "string", "\\u", "first", "char", "s", "'_", ",_", "'", "string", "\\u", "lastc", "har", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "(_", "'", "2", "'_", ",_", "'", "5", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "Range", "{", "0", "}{", "1", "}'_", "._", "format_", "(_", "''_", "._", "join_", "(_", "s_", "._", "capitalize_", "(_", ")_", "for_", "s_", "in_", "subtype_", "._", "split_", "(_", "'\\u'_", ")_", ")_", ",_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "partition_", "=_", "install_", "(_", "'", "partit", "ion", "'_", ",_", "type_", "=_", "'", "range", "'_", ",_", "subtype_", "=_", "subtype_", ",_", "constraint_", "=_", "item_", ",_", "column_", "=_", "'", "title", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "locals_", "(_", ")_", "[_", "name_", "]_", "=_", "partition_", "(_", "type_", "(_", "name_", ",_", "(_", "db_", "._", "Entity_", ",_", ")_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "table", "\\u'_", ":_", "'", "test\\u", "range", "{", "0", "}{", "1", "}'_", "._", "format_", "(_", "subtype_", ",_", "item_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "Required_", "(_", "unicode_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "Optional_", "(_", "unicode_", ",_", "nullable_", "=_", "True_", ")_", ",_", "\\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_", "db_", "._", "generat", "e\\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 ]
Unused import
benadida/helios-server/helios_auth/utils.py
[ { "content": "\"\"\"\nSome basic utils \n(previously were in helios module, but making things less interdependent\n\n2010-08-17\n\"\"\"\n\nimport json\n\n## JSON\n \n \n \n \n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def to_json(d):\n return json.dumps(d, sort_keys=True)", "metadata": "root.to_json", "header": "['module', '___EOS___']", "index": 10 }, { "content": "def from_json(json_str):\n if not json_str: return None\n return json.loads(json_str)", "metadata": "root.from_json", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def JSONtoDict(json):\n x=json.loads(json)\n return x", "metadata": "root.JSONtoDict", "header": "['module', '___EOS___']", "index": 17 }, { "content": "def JSONFiletoDict(filename):\n f = open(filename, 'r')\n content = f.read()\n f.close()\n return JSONtoDict(content)", "metadata": "root.JSONFiletoDict", "header": "['module', '___EOS___']", "index": 21 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Some", " ", "basic", " ", "util", "s", " ", "\\", "10", ";", "(", "previ", "ously", " ", "wer", "e", " ", "in", " ", "heli", "os", " ", "module", ",", " ", "but", " ", "mak", "ing", " ", "thing", "s", " ", "less", " ", "inter", "dependent", "\\", "10", ";", "\\", "10", ";", "2010", "-0", "8", "-1", "7", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "JSON_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "to", "\\u", "json_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "dumps_", "(_", "d_", ",_", "sort", "\\u", "keys_", "=_", "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_", "from", "\\u", "json_", "(_", "json", "\\u", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "json", "\\u", "str_", ":_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "loads_", "(_", "json", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "JSO", "Nt", "o", "Dict_", "(_", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "json_", "._", "loads_", "(_", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "JSO", "NF", "ile", "to", "Dict_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "JSO", "Nt", "o", "Dict_", "(_", "content_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 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 ]
Comparison of identical values
google/transitfeed/transitfeed/schedule.py
[ { "content": " def GetStopsInBoundingBox(self, north, east, south, west, n):\n \"\"\"Return a sample of up to n stops in a bounding box\"\"\"\n stop_list = []\n for s in self.stops.values():\n if (s.stop_lat <= north and s.stop_lat >= south and\n s.stop_lon <= east and s.stop_lon >= west):\n stop_list.append(s)\n if len(stop_list) == n:\n break\n return stop_list", "metadata": "root.Schedule.GetStopsInBoundingBox", "header": "['class', 'Schedule', '(', 'object', ')', ':', '___EOS___']", "index": 592 } ]
[]
[]
0
true
[ "[CLS]_", "Compari", "son_", "of_", "identical_", "values_", "[SEP]_", "class_", "Schedule_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Stops", "In", "Bound", "ing", "Box_", "(_", "self_", ",_", "north_", ",_", "east_", ",_", "south_", ",_", "west", "_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "sample", " ", "of", " ", "up", " ", "to", " ", "n", " ", "stop", "s", " ", "in", " ", "a", " ", "bound", "ing", " ", "box", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "self_", "._", "stops_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "s_", "._", "stop", "\\u", "lat_", "<=_", "north_", "and_", "s_", "._", "stop", "\\u", "lat_", ">=_", "south_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "stop", "\\u", "lon_", "<=_", "east_", "and_", "s_", "._", "stop", "\\u", "lon_", ">=_", "west", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stop", "\\u", "list_", "._", "append_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "stop", "\\u", "list_", ")_", "==_", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "stop", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
m-vdb/github-buildservice-boilerplate/buildservice/tests/views/test_oauth.py
[ { "content": " @patch.object(Repository, 'add_user_to_known_repositories')\n @patch('requests_oauthlib.OAuth2Session.fetch_token', return_value={'access_token': 'abc'})\n def test_callback_ok(self, fetch_token, add_repos):\n self.assertTrue(self.client.login(username='user', password='pwd'))\n session = self.client.session\n session['oauth_state'] = 'the_state'\n session.save()\n resp = self.client.get(self.callback_url)\n fetch_token.assert_called_with(\n settings.GITHUB_TOKEN_URL,\n client_secret='the_secret',\n authorization_response=resp.wsgi_request.build_absolute_uri()\n )\n add_repos.assert_called_with(self.user)\n self.assertEqual(resp.status_code, 302)\n self.assertEqual(resp.url, '/')\n token = OAuthToken.objects.get(user=self.user)\n self.assertEqual(token.value, 'abc')", "metadata": "root.OAuthViewsTestCase.test_callback_ok", "header": "['class', 'OAuthViewsTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 77 } ]
[]
[]
0
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "OA", "uth", "View", "s", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Repository_", ",_", "'", "add", "\\u", "user", "\\u", "to", "\\u", "know", "n", "\\u", "repos", "itori", "es", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "request", "s", "\\u", "oauth", "lib", ".", "OA", "uth", "2", "Sess", "ion", ".", "fetch", "\\u", "token", "'_", ",_", "return", "\\u", "value_", "=_", "{_", "'", "access", "\\u", "token", "'_", ":_", "'", "abc", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "callback", "\\u", "ok_", "(_", "self_", ",_", "fetch", "\\u", "token_", ",_", "add", "\\u", "repos_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "client_", "._", "login_", "(_", "username_", "=_", "'", "user", "'_", ",_", "password_", "=_", "'", "pwd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "=_", "self_", "._", "client_", "._", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "[_", "'", "oauth", "\\u", "state", "'_", "]_", "=_", "'", "the", "\\u", "state", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "callback", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fetch", "\\u", "token_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "GIT", "HUB", "\\u", "TOKEN", "\\u", "URL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "secret_", "=_", "'", "the", "\\u", "secret", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "authoriz", "ation", "\\u", "response_", "=_", "resp_", "._", "wsgi", "\\u", "request_", "._", "build", "\\u", "abs", "olute", "\\u", "uri_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "repos_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "self_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "302_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "url_", ",_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", "=_", "OA", "uth", "Token_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "self_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "token_", "._", "value_", ",_", "'", "abc", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
thumbor/thumbor/tests/detectors/test_queued_detector.py
[ { "content": "class QueuedDetectorTestCase(TestCase):\n\n\n", "metadata": "root.QueuedDetectorTestCase", "header": "['module', '___EOS___']", "index": 20 } ]
[]
[]
0
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Queued", "Detect", "or", "Test", "Case_", "(_", "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_" ]
[ 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 ]
Unused local variable
carpedm20/LINE/line/api.py
[ { "content": " def _sendMessage(self, message, seq=0):\n \"\"\"Send a message to `id`. `id` could be contact id or group id\n\n :param message: `message` instance\n \"\"\"\n return self._client.sendMessage(seq, message)", "metadata": "root.LineAPI._sendMessage", "header": "['class', 'LineAPI', '(', 'object', ')', ':', '___EOS___']", "index": 302 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Line", "API_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "send", "Message_", "(_", "self_", ",_", "message_", ",_", "seq_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "d", " ", "a", " ", "message", " ", "to", " ", "`", "id", "`.", " ", "`", "id", "`", " ", "coul", "d", " ", "be", " ", "contact", " ", "id", " ", "or", " ", "group", " ", "id", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "message", ":", " ", "`", "message", "`", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "client_", "._", "send", "Message_", "(_", "seq_", ",_", "message_", ")_", "\\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 ]
Unused local variable
kivy/python-for-android/pythonforandroid/recipes/zeroconf/__init__.py
[ { "content": " def get_recipe_env(self, arch=None):\n env = super(ZeroconfRecipe, self).get_recipe_env(arch)\n\n # TODO: fix hardcoded path\n # This is required to prevent issue with _io.so import.\n hostpython = self.get_recipe('hostpython2', self.ctx)\n env['PYTHONPATH'] = (\n join(hostpython.get_build_dir(arch.arch), 'build',\n 'lib.linux-x86_64-2.7') + ':' + env.get('PYTHONPATH', '')\n )\n return env", "metadata": "root.ZeroconfRecipe.get_recipe_env", "header": "['class', 'ZeroconfRecipe', '(', 'PythonRecipe', ')', ':', '___EOS___']", "index": 10 } ]
[]
[]
0
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Zero", "conf", "Recipe_", "(_", "Pyth", "on", "Recipe_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "recip", "e\\u", "env_", "(_", "self_", ",_", "arch_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "=_", "super_", "(_", "Zero", "conf", "Recipe_", ",_", "self_", ")_", "._", "get", "\\u", "recip", "e\\u", "env_", "(_", "arch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "fix", " ", "hard", "code", "d", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "require", "d", " ", "to", " ", "prevent", " ", "issue", " ", "with", " ", "\\u", "io", ".", "so", " ", "import", "._", "\\u\\u\\uNL\\u\\u\\u_", "hostp", "ython_", "=_", "self_", "._", "get", "\\u", "recipe_", "(_", "'", "hostp", "yth", "on2", "'_", ",_", "self_", "._", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "[_", "'", "PYTHON", "PATH", "'_", "]_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "join_", "(_", "hostp", "ython_", "._", "get", "\\u", "build", "\\u", "dir_", "(_", "arch_", "._", "arch_", ")_", ",_", "'", "build", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lib", ".", "linux", "-", "x8", "6", "\\u", "64", "-", "2.7", "'_", ")_", "+_", "':'_", "+_", "env_", "._", "get_", "(_", "'", "PYTHON", "PATH", "'_", ",_", "''_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "env_", "\\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 ]
Unused import
kuri65536/python-for-android/python-modules/twisted/twisted/names/dns.py
[ { "content": "# -*- test-case-name: twisted.names.test.test_dns -*-\n# Copyright (c) 2001-2010 Twisted Matrix Laboratories.\n# See LICENSE for details.\n\n\"\"\"\nDNS protocol implementation.\n\nFuture Plans:\n - Get rid of some toplevels, maybe.\n\n@author: Moshe Zadka\n@author: Jean-Paul Calderone\n\"\"\"\n\n__all__ = [\n 'IEncodable', 'IRecord',\n\n 'A', 'A6', 'AAAA', 'AFSDB', 'CNAME', 'DNAME', 'HINFO',\n 'MAILA', 'MAILB', 'MB', 'MD', 'MF', 'MG', 'MINFO', 'MR', 'MX',\n 'NAPTR', 'NS', 'NULL', 'PTR', 'RP', 'SOA', 'SPF', 'SRV', 'TXT', 'WKS',\n\n 'ANY', 'CH', 'CS', 'HS', 'IN',\n\n 'ALL_RECORDS', 'AXFR', 'IXFR',\n\n 'EFORMAT', 'ENAME', 'ENOTIMP', 'EREFUSED', 'ESERVER',\n\n 'Record_A', 'Record_A6', 'Record_AAAA', 'Record_AFSDB', 'Record_CNAME',\n 'Record_DNAME', 'Record_HINFO', 'Record_MB', 'Record_MD', 'Record_MF',\n 'Record_MG', 'Record_MINFO', 'Record_MR', 'Record_MX', 'Record_NAPTR',\n 'Record_NS', 'Record_NULL', 'Record_PTR', 'Record_RP', 'Record_SOA',\n 'Record_SPF', 'Record_SRV', 'Record_TXT', 'Record_WKS',\n\n 'QUERY_CLASSES', 'QUERY_TYPES', 'REV_CLASSES', 'REV_TYPES', 'EXT_QUERIES',\n\n 'Charstr', 'Message', 'Name', 'Query', 'RRHeader', 'SimpleRecord',\n 'DNSDatagramProtocol', 'DNSMixin', 'DNSProtocol',\n\n 'OK', 'OP_INVERSE', 'OP_NOTIFY', 'OP_QUERY', 'OP_STATUS', 'OP_UPDATE',\n 'PORT',\n\n 'AuthoritativeDomainError', 'DNSQueryTimeoutError', 'DomainError',\n ]\n\n\n# System imports\nimport warnings\n\nimport struct, random, types, socket\n\ntry:\n import cStringIO as StringIO\nexcept ImportError:\n import StringIO\n\nAF_INET6 = socket.AF_INET6\n\nfrom zope.interface import implements, Interface, Attribute\n\n\n# Twisted imports\nfrom twisted.internet import protocol, defer\nfrom twisted.internet.error import CannotListenError\nfrom twisted.python import log, failure\nfrom twisted.python import util as tputil\nfrom twisted.python import randbytes\n\n\n\n\nPORT = 53\n\n(A, NS, MD, MF, CNAME, SOA, MB, MG, MR, NULL, WKS, PTR, HINFO, MINFO, MX, TXT,\n RP, AFSDB) = range(1, 19)\nAAAA = 28\nSRV = 33\nNAPTR = 35\nA6 = 38\nDNAME = 39\nSPF = 99\n\nQUERY_TYPES = {\n A: 'A',\n NS: 'NS',\n MD: 'MD',\n MF: 'MF',\n CNAME: 'CNAME',\n SOA: 'SOA',\n MB: 'MB',\n MG: 'MG',\n MR: 'MR',\n NULL: 'NULL',\n WKS: 'WKS',\n PTR: 'PTR',\n HINFO: 'HINFO',\n MINFO: 'MINFO',\n MX: 'MX',\n TXT: 'TXT',\n RP: 'RP',\n AFSDB: 'AFSDB',\n\n # 19 through 27? Eh, I'll get to 'em.\n\n AAAA: 'AAAA',\n SRV: 'SRV',\n NAPTR: 'NAPTR',\n A6: 'A6',\n DNAME: 'DNAME',\n SPF: 'SPF'\n}\n\nIXFR, AXFR, MAILB, MAILA, ALL_RECORDS = range(251, 256)\n\n# \"Extended\" queries (Hey, half of these are deprecated, good job)\nEXT_QUERIES = {\n IXFR: 'IXFR',\n AXFR: 'AXFR',\n MAILB: 'MAILB',\n MAILA: 'MAILA',\n ALL_RECORDS: 'ALL_RECORDS'\n}\n\nREV_TYPES = dict([\n (v, k) for (k, v) in QUERY_TYPES.items() + EXT_QUERIES.items()\n])\n\nIN, CS, CH, HS = range(1, 5)\nANY = 255\n\nQUERY_CLASSES = {\n IN: 'IN',\n CS: 'CS',\n CH: 'CH',\n HS: 'HS',\n ANY: 'ANY'\n}\nREV_CLASSES = dict([\n (v, k) for (k, v) in QUERY_CLASSES.items()\n])\n\n\n# Opcodes\nOP_QUERY, OP_INVERSE, OP_STATUS = range(3)\nOP_NOTIFY = 4 # RFC 1996\nOP_UPDATE = 5 # RFC 2136\n\n\n# Response Codes\nOK, EFORMAT, ESERVER, ENAME, ENOTIMP, EREFUSED = range(6)\n\n\n\n# Backwards compatibility aliases - these should be deprecated or something I\n# suppose. -exarkun\nfrom twisted.names.error import DomainError, AuthoritativeDomainError\nfrom twisted.names.error import DNSQueryTimeoutError\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Kinds of RRs - oh my!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Oh god, Record_TXT how I hate thee.\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def randomSource():\n \"\"\"\n Wrapper around L{randbytes.secureRandom} to return 2 random chars.\n \"\"\"\n return struct.unpack('H', randbytes.secureRandom(2, fallback=True))[0]", "metadata": "root.randomSource", "header": "['module', '___EOS___']", "index": 68 }, { "content": "class IRecord(Interface):\n \"\"\"\n An single entry in a zone of authority.\n \"\"\"\n\n TYPE = Attribute(\"An indicator of what kind of record this is.\")", "metadata": "root.IRecord", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def str2time(s):\n suffixes = (\n ('S', 1), ('M', 60), ('H', 60 * 60), ('D', 60 * 60 * 24),\n ('W', 60 * 60 * 24 * 7), ('Y', 60 * 60 * 24 * 365)\n )\n if isinstance(s, types.StringType):\n s = s.upper().strip()\n for (suff, mult) in suffixes:\n if s.endswith(suff):\n return int(float(s[:-1]) * mult)\n try:\n s = int(s)\n except ValueError:\n raise ValueError, \"Invalid time interval specifier: \" + s\n return s", "metadata": "root.str2time", "header": "['module', '___EOS___']", "index": 169 }, { "content": "def readPrecisely(file, l):\n buff = file.read(l)\n if len(buff) < l:\n raise EOFError\n return buff", "metadata": "root.readPrecisely", "header": "['module', '___EOS___']", "index": 186 }, { "content": "class IEncodable(Interface):\n \"\"\"\n Interface for something which can be encoded to and decoded\n from a file object.\n \"\"\"\n\n", "metadata": "root.IEncodable", "header": "['module', '___EOS___']", "index": 193 }, { "content": " def encode(strio, compDict = None):\n \"\"\"\n Write a representation of this object to the given\n file object.\n\n @type strio: File-like object\n @param strio: The stream to which to write bytes\n\n @type compDict: C{dict} or C{None}\n @param compDict: A dictionary of backreference addresses that have\n have already been written to this stream and that may be used for\n compression.\n \"\"\"", "metadata": "root.IEncodable.encode", "header": "['class', 'IEncodable', '(', 'Interface', ')', ':', '___EOS___']", "index": 199 }, { "content": " def decode(strio, length = None):\n \"\"\"\n Reconstruct an object from data read from the given\n file object.\n\n @type strio: File-like object\n @param strio: The stream from which bytes may be read\n\n @type length: C{int} or C{None}\n @param length: The number of bytes in this RDATA field. Most\n implementations can ignore this value. Only in the case of\n records similar to TXT where the total length is in no way\n encoded in the data is it necessary.\n \"\"\"", "metadata": "root.IEncodable.decode", "header": "['class', 'IEncodable', '(', 'Interface', ')', ':', '___EOS___']", "index": 213 }, { "content": "class Charstr(object):\n implements(IEncodable)\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Charstr", "header": "['module', '___EOS___']", "index": 230 }, { "content": " def __init__(self, string=''):\n if not isinstance(string, str):\n raise ValueError(\"%r is not a string\" % (string,))\n self.string = string", "metadata": "root.Charstr.__init__", "header": "['class', 'Charstr', '(', 'object', ')', ':', '___EOS___']", "index": 233 }, { "content": " def encode(self, strio, compDict=None):\n \"\"\"\n Encode this Character string into the appropriate byte format.\n\n @type strio: file\n @param strio: The byte representation of this Charstr will be written\n to this file.\n \"\"\"\n string = self.string\n ind = len(string)\n strio.write(chr(ind))\n strio.write(string)", "metadata": "root.Charstr.encode", "header": "['class', 'Charstr', '(', 'object', ')', ':', '___EOS___']", "index": 239 }, { "content": " def decode(self, strio, length=None):\n \"\"\"\n Decode a byte string into this Name.\n\n @type strio: file\n @param strio: Bytes will be read from this file until the full string\n is decoded.\n\n @raise EOFError: Raised when there are not enough bytes available from\n C{strio}.\n \"\"\"\n self.string = ''\n l = ord(readPrecisely(strio, 1))\n self.string = readPrecisely(strio, l)", "metadata": "root.Charstr.decode", "header": "['class', 'Charstr', '(', 'object', ')', ':', '___EOS___']", "index": 253 }, { "content": " def __eq__(self, other):\n if isinstance(other, Charstr):\n return self.string == other.string\n return False", "metadata": "root.Charstr.__eq__", "header": "['class', 'Charstr', '(', 'object', ')', ':', '___EOS___']", "index": 269 }, { "content": " def __hash__(self):\n return hash(self.string)", "metadata": "root.Charstr.__hash__", "header": "['class', 'Charstr', '(', 'object', ')', ':', '___EOS___']", "index": 275 }, { "content": " def __str__(self):\n return self.string", "metadata": "root.Charstr.__str__", "header": "['class', 'Charstr', '(', 'object', ')', ':', '___EOS___']", "index": 279 }, { "content": "class Name:\n implements(IEncodable)\n\n\n\n\n\n\n\n\n", "metadata": "root.Name", "header": "['module', '___EOS___']", "index": 284 }, { "content": " def __init__(self, name=''):\n assert isinstance(name, types.StringTypes), \"%r is not a string\" % (name,)\n self.name = name", "metadata": "root.Name.__init__", "header": "['class', 'Name', ':', '___EOS___']", "index": 287 }, { "content": " def encode(self, strio, compDict=None):\n \"\"\"\n Encode this Name into the appropriate byte format.\n\n @type strio: file\n @param strio: The byte representation of this Name will be written to\n this file.\n\n @type compDict: dict\n @param compDict: dictionary of Names that have already been encoded\n and whose addresses may be backreferenced by this Name (for the purpose\n of reducing the message size).\n \"\"\"\n name = self.name\n while name:\n if compDict is not None:\n if name in compDict:\n strio.write(\n struct.pack(\"!H\", 0xc000 | compDict[name]))\n return\n else:\n compDict[name] = strio.tell() + Message.headerSize\n ind = name.find('.')\n if ind > 0:\n label, name = name[:ind], name[ind + 1:]\n else:\n label, name = name, ''\n ind = len(label)\n strio.write(chr(ind))\n strio.write(label)\n strio.write(chr(0))", "metadata": "root.Name.encode", "header": "['class', 'Name', ':', '___EOS___']", "index": 291 }, { "content": " def decode(self, strio, length=None):\n \"\"\"\n Decode a byte string into this Name.\n\n @type strio: file\n @param strio: Bytes will be read from this file until the full Name\n is decoded.\n\n @raise EOFError: Raised when there are not enough bytes available\n from C{strio}.\n \"\"\"\n self.name = ''\n off = 0\n while 1:\n l = ord(readPrecisely(strio, 1))\n if l == 0:\n if off > 0:\n strio.seek(off)\n return\n if (l >> 6) == 3:\n new_off = ((l&63) << 8\n | ord(readPrecisely(strio, 1)))\n if off == 0:\n off = strio.tell()\n strio.seek(new_off)\n continue\n label = readPrecisely(strio, l)\n if self.name == '':\n self.name = label\n else:\n self.name = self.name + '.' + label", "metadata": "root.Name.decode", "header": "['class', 'Name', ':', '___EOS___']", "index": 324 }, { "content": " def __eq__(self, other):\n if isinstance(other, Name):\n return str(self) == str(other)\n return 0", "metadata": "root.Name.__eq__", "header": "['class', 'Name', ':', '___EOS___']", "index": 356 }, { "content": " def __hash__(self):\n return hash(str(self))", "metadata": "root.Name.__hash__", "header": "['class', 'Name', ':', '___EOS___']", "index": 362 }, { "content": " def __str__(self):\n return self.name", "metadata": "root.Name.__str__", "header": "['class', 'Name', ':', '___EOS___']", "index": 366 }, { "content": "class Query:\n \"\"\"\n Represent a single DNS query.\n\n @ivar name: The name about which this query is requesting information.\n @ivar type: The query type.\n @ivar cls: The query class.\n \"\"\"\n\n implements(IEncodable)\n\n name = None\n type = None\n cls = None\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Query", "header": "['module', '___EOS___']", "index": 369 }, { "content": " def __init__(self, name='', type=A, cls=IN):\n \"\"\"\n @type name: C{str}\n @param name: The name about which to request information.\n\n @type type: C{int}\n @param type: The query type.\n\n @type cls: C{int}\n @param cls: The query class.\n \"\"\"\n self.name = Name(name)\n self.type = type\n self.cls = cls", "metadata": "root.Query.__init__", "header": "['class', 'Query', ':', '___EOS___']", "index": 384 }, { "content": " def encode(self, strio, compDict=None):\n self.name.encode(strio, compDict)\n strio.write(struct.pack(\"!HH\", self.type, self.cls))", "metadata": "root.Query.encode", "header": "['class', 'Query', ':', '___EOS___']", "index": 400 }, { "content": " def decode(self, strio, length = None):\n self.name.decode(strio)\n buff = readPrecisely(strio, 4)\n self.type, self.cls = struct.unpack(\"!HH\", buff)", "metadata": "root.Query.decode", "header": "['class', 'Query', ':', '___EOS___']", "index": 405 }, { "content": " def __hash__(self):\n return hash((str(self.name).lower(), self.type, self.cls))", "metadata": "root.Query.__hash__", "header": "['class', 'Query', ':', '___EOS___']", "index": 411 }, { "content": " def __cmp__(self, other):\n return isinstance(other, Query) and cmp(\n (str(self.name).lower(), self.type, self.cls),\n (str(other.name).lower(), other.type, other.cls)\n ) or cmp(self.__class__, other.__class__)", "metadata": "root.Query.__cmp__", "header": "['class', 'Query', ':', '___EOS___']", "index": 415 }, { "content": " def __str__(self):\n t = QUERY_TYPES.get(self.type, EXT_QUERIES.get(self.type, 'UNKNOWN (%d)' % self.type))\n c = QUERY_CLASSES.get(self.cls, 'UNKNOWN (%d)' % self.cls)\n return '<Query %s %s %s>' % (self.name, t, c)", "metadata": "root.Query.__str__", "header": "['class', 'Query', ':', '___EOS___']", "index": 422 }, { "content": " def __repr__(self):\n return 'Query(%r, %r, %r)' % (str(self.name), self.type, self.cls)", "metadata": "root.Query.__repr__", "header": "['class', 'Query', ':', '___EOS___']", "index": 428 }, { "content": "class RRHeader(tputil.FancyEqMixin):\n \"\"\"\n A resource record header.\n\n @cvar fmt: C{str} specifying the byte format of an RR.\n\n @ivar name: The name about which this reply contains information.\n @ivar type: The query type of the original request.\n @ivar cls: The query class of the original request.\n @ivar ttl: The time-to-live for this record.\n @ivar payload: An object that implements the IEncodable interface\n @ivar auth: Whether this header is authoritative or not.\n \"\"\"\n\n implements(IEncodable)\n\n compareAttributes = ('name', 'type', 'cls', 'ttl', 'payload', 'auth')\n\n fmt = \"!HHIH\"\n\n name = None\n type = None\n cls = None\n ttl = None\n payload = None\n rdlength = None\n\n cachedResponse = None\n\n\n\n\n\n\n\n\n\n\n\n __repr__ = __str__", "metadata": "root.RRHeader", "header": "['module', '___EOS___']", "index": 432 }, { "content": " def __init__(self, name='', type=A, cls=IN, ttl=0, payload=None, auth=False):\n \"\"\"\n @type name: C{str}\n @param name: The name about which this reply contains information.\n\n @type type: C{int}\n @param type: The query type.\n\n @type cls: C{int}\n @param cls: The query class.\n\n @type ttl: C{int}\n @param ttl: Time to live for this record.\n\n @type payload: An object implementing C{IEncodable}\n @param payload: A Query Type specific data object.\n \"\"\"\n assert (payload is None) or (payload.TYPE == type)\n\n self.name = Name(name)\n self.type = type\n self.cls = cls\n self.ttl = ttl\n self.payload = payload\n self.auth = auth", "metadata": "root.RRHeader.__init__", "header": "['class', 'RRHeader', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 461 }, { "content": " def encode(self, strio, compDict=None):\n self.name.encode(strio, compDict)\n strio.write(struct.pack(self.fmt, self.type, self.cls, self.ttl, 0))\n if self.payload:\n prefix = strio.tell()\n self.payload.encode(strio, compDict)\n aft = strio.tell()\n strio.seek(prefix - 2, 0)\n strio.write(struct.pack('!H', aft - prefix))\n strio.seek(aft, 0)", "metadata": "root.RRHeader.encode", "header": "['class', 'RRHeader', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 488 }, { "content": " def decode(self, strio, length = None):\n self.name.decode(strio)\n l = struct.calcsize(self.fmt)\n buff = readPrecisely(strio, l)\n r = struct.unpack(self.fmt, buff)\n self.type, self.cls, self.ttl, self.rdlength = r", "metadata": "root.RRHeader.decode", "header": "['class', 'RRHeader', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 500 }, { "content": " def isAuthoritative(self):\n return self.auth", "metadata": "root.RRHeader.isAuthoritative", "header": "['class', 'RRHeader', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 508 }, { "content": " def __str__(self):\n t = QUERY_TYPES.get(self.type, EXT_QUERIES.get(self.type, 'UNKNOWN (%d)' % self.type))\n c = QUERY_CLASSES.get(self.cls, 'UNKNOWN (%d)' % self.cls)\n return '<RR name=%s type=%s class=%s ttl=%ds auth=%s>' % (self.name, t, c, self.ttl, self.auth and 'True' or 'False')", "metadata": "root.RRHeader.__str__", "header": "['class', 'RRHeader', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 512 }, { "content": "class SimpleRecord(tputil.FancyStrMixin, tputil.FancyEqMixin):\n \"\"\"\n A Resource Record which consists of a single RFC 1035 domain-name.\n\n @type name: L{Name}\n @ivar name: The name associated with this record.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n\n showAttributes = (('name', 'name', '%s'), 'ttl')\n compareAttributes = ('name', 'ttl')\n\n TYPE = None\n name = None\n\n\n\n\n\n\n", "metadata": "root.SimpleRecord", "header": "['module', '___EOS___']", "index": 522 }, { "content": " def __init__(self, name='', ttl=None):\n self.name = Name(name)\n self.ttl = str2time(ttl)", "metadata": "root.SimpleRecord.__init__", "header": "['class', 'SimpleRecord', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 541 }, { "content": " def encode(self, strio, compDict = None):\n self.name.encode(strio, compDict)", "metadata": "root.SimpleRecord.encode", "header": "['class', 'SimpleRecord', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 546 }, { "content": " def decode(self, strio, length = None):\n self.name = Name()\n self.name.decode(strio)", "metadata": "root.SimpleRecord.decode", "header": "['class', 'SimpleRecord', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 550 }, { "content": " def __hash__(self):\n return hash(self.name)", "metadata": "root.SimpleRecord.__hash__", "header": "['class', 'SimpleRecord', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 555 }, { "content": "class Record_NS(SimpleRecord):\n \"\"\"\n An authoritative nameserver.\n \"\"\"\n TYPE = NS\n fancybasename = 'NS'", "metadata": "root.Record_NS", "header": "['module', '___EOS___']", "index": 560 }, { "content": "class Record_MD(SimpleRecord):\n \"\"\"\n A mail destination.\n\n This record type is obsolete.\n\n @see: L{Record_MX}\n \"\"\"\n TYPE = MD\n fancybasename = 'MD'", "metadata": "root.Record_MD", "header": "['module', '___EOS___']", "index": 569 }, { "content": "class Record_MF(SimpleRecord):\n \"\"\"\n A mail forwarder.\n\n This record type is obsolete.\n\n @see: L{Record_MX}\n \"\"\"\n TYPE = MF\n fancybasename = 'MF'", "metadata": "root.Record_MF", "header": "['module', '___EOS___']", "index": 582 }, { "content": "class Record_CNAME(SimpleRecord):\n \"\"\"\n The canonical name for an alias.\n \"\"\"\n TYPE = CNAME\n fancybasename = 'CNAME'", "metadata": "root.Record_CNAME", "header": "['module', '___EOS___']", "index": 595 }, { "content": "class Record_MB(SimpleRecord):\n \"\"\"\n A mailbox domain name.\n\n This is an experimental record type.\n \"\"\"\n TYPE = MB\n fancybasename = 'MB'", "metadata": "root.Record_MB", "header": "['module', '___EOS___']", "index": 604 }, { "content": "class Record_MG(SimpleRecord):\n \"\"\"\n A mail group member.\n\n This is an experimental record type.\n \"\"\"\n TYPE = MG\n fancybasename = 'MG'", "metadata": "root.Record_MG", "header": "['module', '___EOS___']", "index": 615 }, { "content": "class Record_MR(SimpleRecord):\n \"\"\"\n A mail rename domain name.\n\n This is an experimental record type.\n \"\"\"\n TYPE = MR\n fancybasename = 'MR'", "metadata": "root.Record_MR", "header": "['module', '___EOS___']", "index": 626 }, { "content": "class Record_PTR(SimpleRecord):\n \"\"\"\n A domain name pointer.\n \"\"\"\n TYPE = PTR\n fancybasename = 'PTR'", "metadata": "root.Record_PTR", "header": "['module', '___EOS___']", "index": 637 }, { "content": "class Record_DNAME(SimpleRecord):\n \"\"\"\n A non-terminal DNS name redirection.\n\n This record type provides the capability to map an entire subtree of the\n DNS name space to another domain. It differs from the CNAME record which\n maps a single node of the name space.\n\n @see: U{http://www.faqs.org/rfcs/rfc2672.html}\n @see: U{http://www.faqs.org/rfcs/rfc3363.html}\n \"\"\"\n TYPE = DNAME\n fancybasename = 'DNAME'", "metadata": "root.Record_DNAME", "header": "['module', '___EOS___']", "index": 646 }, { "content": "class Record_A(tputil.FancyEqMixin):\n \"\"\"\n An IPv4 host address.\n\n @type address: C{str}\n @ivar address: The packed network-order representation of the IPv4 address\n associated with this record.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n\n compareAttributes = ('address', 'ttl')\n\n TYPE = A\n address = None\n\n\n\n\n\n\n\n\n\n __repr__ = __str__\n\n", "metadata": "root.Record_A", "header": "['module', '___EOS___']", "index": 662 }, { "content": " def __init__(self, address='0.0.0.0', ttl=None):\n address = socket.inet_aton(address)\n self.address = address\n self.ttl = str2time(ttl)", "metadata": "root.Record_A.__init__", "header": "['class', 'Record_A', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 681 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(self.address)", "metadata": "root.Record_A.encode", "header": "['class', 'Record_A', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 687 }, { "content": " def decode(self, strio, length = None):\n self.address = readPrecisely(strio, 4)", "metadata": "root.Record_A.decode", "header": "['class', 'Record_A', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 691 }, { "content": " def __hash__(self):\n return hash(self.address)", "metadata": "root.Record_A.__hash__", "header": "['class', 'Record_A', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 695 }, { "content": " def __str__(self):\n return '<A address=%s ttl=%s>' % (self.dottedQuad(), self.ttl)", "metadata": "root.Record_A.__str__", "header": "['class', 'Record_A', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 699 }, { "content": " def dottedQuad(self):\n return socket.inet_ntoa(self.address)", "metadata": "root.Record_A.dottedQuad", "header": "['class', 'Record_A', '(', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 704 }, { "content": "class Record_SOA(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n Marks the start of a zone of authority.\n\n This record describes parameters which are shared by all records within a\n particular zone.\n\n @type mname: L{Name}\n @ivar mname: The domain-name of the name server that was the original or\n primary source of data for this zone.\n\n @type rname: L{Name}\n @ivar rname: A domain-name which specifies the mailbox of the person\n responsible for this zone.\n\n @type serial: C{int}\n @ivar serial: The unsigned 32 bit version number of the original copy of\n the zone. Zone transfers preserve this value. This value wraps and\n should be compared using sequence space arithmetic.\n\n @type refresh: C{int}\n @ivar refresh: A 32 bit time interval before the zone should be refreshed.\n\n @type minimum: C{int}\n @ivar minimum: The unsigned 32 bit minimum TTL field that should be\n exported with any RR from this zone.\n\n @type expire: C{int}\n @ivar expire: A 32 bit time value that specifies the upper limit on the\n time interval that can elapse before the zone is no longer\n authoritative.\n\n @type retry: C{int}\n @ivar retry: A 32 bit time interval that should elapse before a failed\n refresh should be retried.\n\n @type ttl: C{int}\n @ivar ttl: The default TTL to use for records served from this zone.\n \"\"\"\n implements(IEncodable, IRecord)\n\n fancybasename = 'SOA'\n compareAttributes = ('serial', 'mname', 'rname', 'refresh', 'expire', 'retry', 'minimum', 'ttl')\n showAttributes = (('mname', 'mname', '%s'), ('rname', 'rname', '%s'), 'serial', 'refresh', 'retry', 'expire', 'minimum', 'ttl')\n\n TYPE = SOA\n\n\n\n\n\n\n", "metadata": "root.Record_SOA", "header": "['module', '___EOS___']", "index": 709 }, { "content": " def __init__(self, mname='', rname='', serial=0, refresh=0, retry=0, expire=0, minimum=0, ttl=None):\n self.mname, self.rname = Name(mname), Name(rname)\n self.serial, self.refresh = str2time(serial), str2time(refresh)\n self.minimum, self.expire = str2time(minimum), str2time(expire)\n self.retry = str2time(retry)\n self.ttl = str2time(ttl)", "metadata": "root.Record_SOA.__init__", "header": "['class', 'Record_SOA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 756 }, { "content": " def encode(self, strio, compDict = None):\n self.mname.encode(strio, compDict)\n self.rname.encode(strio, compDict)\n strio.write(\n struct.pack(\n '!LlllL',\n self.serial, self.refresh, self.retry, self.expire,\n self.minimum\n )\n )", "metadata": "root.Record_SOA.encode", "header": "['class', 'Record_SOA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 764 }, { "content": " def decode(self, strio, length = None):\n self.mname, self.rname = Name(), Name()\n self.mname.decode(strio)\n self.rname.decode(strio)\n r = struct.unpack('!LlllL', readPrecisely(strio, 20))\n self.serial, self.refresh, self.retry, self.expire, self.minimum = r", "metadata": "root.Record_SOA.decode", "header": "['class', 'Record_SOA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 776 }, { "content": " def __hash__(self):\n return hash((\n self.serial, self.mname, self.rname,\n self.refresh, self.expire, self.retry\n ))", "metadata": "root.Record_SOA.__hash__", "header": "['class', 'Record_SOA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 784 }, { "content": "class Record_NULL(tputil.FancyStrMixin, tputil.FancyEqMixin):\n \"\"\"\n A null record.\n\n This is an experimental record type.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n\n fancybasename = 'NULL'\n showAttributes = compareAttributes = ('payload', 'ttl')\n\n TYPE = NULL\n\n\n\n\n\n\n", "metadata": "root.Record_NULL", "header": "['module', '___EOS___']", "index": 792 }, { "content": " def __init__(self, payload=None, ttl=None):\n self.payload = payload\n self.ttl = str2time(ttl)", "metadata": "root.Record_NULL.__init__", "header": "['class', 'Record_NULL', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 809 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(self.payload)", "metadata": "root.Record_NULL.encode", "header": "['class', 'Record_NULL', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 814 }, { "content": " def decode(self, strio, length = None):\n self.payload = readPrecisely(strio, length)", "metadata": "root.Record_NULL.decode", "header": "['class', 'Record_NULL', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 818 }, { "content": " def __hash__(self):\n return hash(self.payload)", "metadata": "root.Record_NULL.__hash__", "header": "['class', 'Record_NULL', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 822 }, { "content": "class Record_WKS(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n A well known service description.\n\n This record type is obsolete. See L{Record_SRV}.\n\n @type address: C{str}\n @ivar address: The packed network-order representation of the IPv4 address\n associated with this record.\n\n @type protocol: C{int}\n @ivar protocol: The 8 bit IP protocol number for which this service map is\n relevant.\n\n @type map: C{str}\n @ivar map: A bitvector indicating the services available at the specified\n address.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n\n fancybasename = \"WKS\"\n compareAttributes = ('address', 'protocol', 'map', 'ttl')\n showAttributes = [('_address', 'address', '%s'), 'protocol', 'ttl']\n\n TYPE = WKS\n\n _address = property(lambda self: socket.inet_ntoa(self.address))\n\n\n\n\n\n\n", "metadata": "root.Record_WKS", "header": "['module', '___EOS___']", "index": 827 }, { "content": " def __init__(self, address='0.0.0.0', protocol=0, map='', ttl=None):\n self.address = socket.inet_aton(address)\n self.protocol, self.map = protocol, map\n self.ttl = str2time(ttl)", "metadata": "root.Record_WKS.__init__", "header": "['class', 'Record_WKS', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 859 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(self.address)\n strio.write(struct.pack('!B', self.protocol))\n strio.write(self.map)", "metadata": "root.Record_WKS.encode", "header": "['class', 'Record_WKS', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 865 }, { "content": " def decode(self, strio, length = None):\n self.address = readPrecisely(strio, 4)\n self.protocol = struct.unpack('!B', readPrecisely(strio, 1))[0]\n self.map = readPrecisely(strio, length - 5)", "metadata": "root.Record_WKS.decode", "header": "['class', 'Record_WKS', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 871 }, { "content": " def __hash__(self):\n return hash((self.address, self.protocol, self.map))", "metadata": "root.Record_WKS.__hash__", "header": "['class', 'Record_WKS', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 877 }, { "content": "class Record_AAAA(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n An IPv6 host address.\n\n @type address: C{str}\n @ivar address: The packed network-order representation of the IPv6 address\n associated with this record.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n\n @see: U{http://www.faqs.org/rfcs/rfc1886.html}\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = AAAA\n\n fancybasename = 'AAAA'\n showAttributes = (('_address', 'address', '%s'), 'ttl')\n compareAttributes = ('address', 'ttl')\n\n _address = property(lambda self: socket.inet_ntop(AF_INET6, self.address))\n\n\n\n\n\n\n", "metadata": "root.Record_AAAA", "header": "['module', '___EOS___']", "index": 882 }, { "content": " def __init__(self, address = '::', ttl=None):\n self.address = socket.inet_pton(AF_INET6, address)\n self.ttl = str2time(ttl)", "metadata": "root.Record_AAAA.__init__", "header": "['class', 'Record_AAAA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 905 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(self.address)", "metadata": "root.Record_AAAA.encode", "header": "['class', 'Record_AAAA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 910 }, { "content": " def decode(self, strio, length = None):\n self.address = readPrecisely(strio, 16)", "metadata": "root.Record_AAAA.decode", "header": "['class', 'Record_AAAA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 914 }, { "content": " def __hash__(self):\n return hash(self.address)", "metadata": "root.Record_AAAA.__hash__", "header": "['class', 'Record_AAAA', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 918 }, { "content": "class Record_A6(tputil.FancyStrMixin, tputil.FancyEqMixin):\n \"\"\"\n An IPv6 address.\n\n This is an experimental record type.\n\n @type prefixLen: C{int}\n @ivar prefixLen: The length of the suffix.\n\n @type suffix: C{str}\n @ivar suffix: An IPv6 address suffix in network order.\n\n @type prefix: L{Name}\n @ivar prefix: If specified, a name which will be used as a prefix for other\n A6 records.\n\n @type bytes: C{int}\n @ivar bytes: The length of the prefix.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n\n @see: U{http://www.faqs.org/rfcs/rfc2874.html}\n @see: U{http://www.faqs.org/rfcs/rfc3363.html}\n @see: U{http://www.faqs.org/rfcs/rfc3364.html}\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = A6\n\n fancybasename = 'A6'\n showAttributes = (('_suffix', 'suffix', '%s'), ('prefix', 'prefix', '%s'), 'ttl')\n compareAttributes = ('prefixLen', 'prefix', 'suffix', 'ttl')\n\n _suffix = property(lambda self: socket.inet_ntop(AF_INET6, self.suffix))\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Record_A6", "header": "['module', '___EOS___']", "index": 923 }, { "content": " def __init__(self, prefixLen=0, suffix='::', prefix='', ttl=None):\n self.prefixLen = prefixLen\n self.suffix = socket.inet_pton(AF_INET6, suffix)\n self.prefix = Name(prefix)\n self.bytes = int((128 - self.prefixLen) / 8.0)\n self.ttl = str2time(ttl)", "metadata": "root.Record_A6.__init__", "header": "['class', 'Record_A6', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 959 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(struct.pack('!B', self.prefixLen))\n if self.bytes:\n strio.write(self.suffix[-self.bytes:])\n if self.prefixLen:\n # This may not be compressed\n self.prefix.encode(strio, None)", "metadata": "root.Record_A6.encode", "header": "['class', 'Record_A6', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 967 }, { "content": " def decode(self, strio, length = None):\n self.prefixLen = struct.unpack('!B', readPrecisely(strio, 1))[0]\n self.bytes = int((128 - self.prefixLen) / 8.0)\n if self.bytes:\n self.suffix = '\\x00' * (16 - self.bytes) + readPrecisely(strio, self.bytes)\n if self.prefixLen:\n self.prefix.decode(strio)", "metadata": "root.Record_A6.decode", "header": "['class', 'Record_A6', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 976 }, { "content": " def __eq__(self, other):\n if isinstance(other, Record_A6):\n return (self.prefixLen == other.prefixLen and\n self.suffix[-self.bytes:] == other.suffix[-self.bytes:] and\n self.prefix == other.prefix and\n self.ttl == other.ttl)\n return NotImplemented", "metadata": "root.Record_A6.__eq__", "header": "['class', 'Record_A6', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 985 }, { "content": " def __hash__(self):\n return hash((self.prefixLen, self.suffix[-self.bytes:], self.prefix))", "metadata": "root.Record_A6.__hash__", "header": "['class', 'Record_A6', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 994 }, { "content": " def __str__(self):\n return '<A6 %s %s (%d) ttl=%s>' % (\n self.prefix,\n socket.inet_ntop(AF_INET6, self.suffix),\n self.prefixLen, self.ttl\n )", "metadata": "root.Record_A6.__str__", "header": "['class', 'Record_A6', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 998 }, { "content": "class Record_SRV(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n The location of the server(s) for a specific protocol and domain.\n\n This is an experimental record type.\n\n @type priority: C{int}\n @ivar priority: The priority of this target host. A client MUST attempt to\n contact the target host with the lowest-numbered priority it can reach;\n target hosts with the same priority SHOULD be tried in an order defined\n by the weight field.\n\n @type weight: C{int}\n @ivar weight: Specifies a relative weight for entries with the same\n priority. Larger weights SHOULD be given a proportionately higher\n probability of being selected.\n\n @type port: C{int}\n @ivar port: The port on this target host of this service.\n\n @type target: L{Name}\n @ivar target: The domain name of the target host. There MUST be one or\n more address records for this name, the name MUST NOT be an alias (in\n the sense of RFC 1034 or RFC 2181). Implementors are urged, but not\n required, to return the address record(s) in the Additional Data\n section. Unless and until permitted by future standards action, name\n compression is not to be used for this field.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n\n @see: U{http://www.faqs.org/rfcs/rfc2782.html}\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = SRV\n\n fancybasename = 'SRV'\n compareAttributes = ('priority', 'weight', 'target', 'port', 'ttl')\n showAttributes = ('priority', 'weight', ('target', 'target', '%s'), 'port', 'ttl')\n\n\n\n\n\n\n", "metadata": "root.Record_SRV", "header": "['module', '___EOS___']", "index": 1007 }, { "content": " def __init__(self, priority=0, weight=0, port=0, target='', ttl=None):\n self.priority = int(priority)\n self.weight = int(weight)\n self.port = int(port)\n self.target = Name(target)\n self.ttl = str2time(ttl)", "metadata": "root.Record_SRV.__init__", "header": "['class', 'Record_SRV', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1048 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(struct.pack('!HHH', self.priority, self.weight, self.port))\n # This can't be compressed\n self.target.encode(strio, None)", "metadata": "root.Record_SRV.encode", "header": "['class', 'Record_SRV', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1056 }, { "content": " def decode(self, strio, length = None):\n r = struct.unpack('!HHH', readPrecisely(strio, struct.calcsize('!HHH')))\n self.priority, self.weight, self.port = r\n self.target = Name()\n self.target.decode(strio)", "metadata": "root.Record_SRV.decode", "header": "['class', 'Record_SRV', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1062 }, { "content": " def __hash__(self):\n return hash((self.priority, self.weight, self.port, self.target))", "metadata": "root.Record_SRV.__hash__", "header": "['class', 'Record_SRV', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1069 }, { "content": "class Record_NAPTR(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n The location of the server(s) for a specific protocol and domain.\n\n @type order: C{int}\n @ivar order: An integer specifying the order in which the NAPTR records\n MUST be processed to ensure the correct ordering of rules. Low numbers\n are processed before high numbers.\n\n @type preference: C{int}\n @ivar preference: An integer that specifies the order in which NAPTR\n records with equal \"order\" values SHOULD be processed, low numbers\n being processed before high numbers.\n\n @type flag: L{Charstr}\n @ivar flag: A <character-string> containing flags to control aspects of the\n rewriting and interpretation of the fields in the record. Flags\n aresingle characters from the set [A-Z0-9]. The case of the alphabetic\n characters is not significant.\n\n At this time only four flags, \"S\", \"A\", \"U\", and \"P\", are defined.\n\n @type service: L{Charstr}\n @ivar service: Specifies the service(s) available down this rewrite path.\n It may also specify the particular protocol that is used to talk with a\n service. A protocol MUST be specified if the flags field states that\n the NAPTR is terminal.\n\n @type regexp: L{Charstr}\n @ivar regexp: A STRING containing a substitution expression that is applied\n to the original string held by the client in order to construct the\n next domain name to lookup.\n\n @type replacement: L{Name}\n @ivar replacement: The next NAME to query for NAPTR, SRV, or address\n records depending on the value of the flags field. This MUST be a\n fully qualified domain-name.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n\n @see: U{http://www.faqs.org/rfcs/rfc2915.html}\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = NAPTR\n\n compareAttributes = ('order', 'preference', 'flags', 'service', 'regexp',\n 'replacement')\n fancybasename = 'NAPTR'\n showAttributes = ('order', 'preference', ('flags', 'flags', '%s'),\n ('service', 'service', '%s'), ('regexp', 'regexp', '%s'),\n ('replacement', 'replacement', '%s'), 'ttl')\n\n\n\n\n\n\n", "metadata": "root.Record_NAPTR", "header": "['module', '___EOS___']", "index": 1074 }, { "content": " def __init__(self, order=0, preference=0, flags='', service='', regexp='',\n replacement='', ttl=None):\n self.order = int(order)\n self.preference = int(preference)\n self.flags = Charstr(flags)\n self.service = Charstr(service)\n self.regexp = Charstr(regexp)\n self.replacement = Name(replacement)\n self.ttl = str2time(ttl)", "metadata": "root.Record_NAPTR.__init__", "header": "['class', 'Record_NAPTR', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1128 }, { "content": " def encode(self, strio, compDict=None):\n strio.write(struct.pack('!HH', self.order, self.preference))\n # This can't be compressed\n self.flags.encode(strio, None)\n self.service.encode(strio, None)\n self.regexp.encode(strio, None)\n self.replacement.encode(strio, None)", "metadata": "root.Record_NAPTR.encode", "header": "['class', 'Record_NAPTR', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1139 }, { "content": " def decode(self, strio, length=None):\n r = struct.unpack('!HH', readPrecisely(strio, struct.calcsize('!HH')))\n self.order, self.preference = r\n self.flags = Charstr()\n self.service = Charstr()\n self.regexp = Charstr()\n self.replacement = Name()\n self.flags.decode(strio)\n self.service.decode(strio)\n self.regexp.decode(strio)\n self.replacement.decode(strio)", "metadata": "root.Record_NAPTR.decode", "header": "['class', 'Record_NAPTR', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1148 }, { "content": " def __hash__(self):\n return hash((\n self.order, self.preference, self.flags,\n self.service, self.regexp, self.replacement))", "metadata": "root.Record_NAPTR.__hash__", "header": "['class', 'Record_NAPTR', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1161 }, { "content": "class Record_AFSDB(tputil.FancyStrMixin, tputil.FancyEqMixin):\n \"\"\"\n Map from a domain name to the name of an AFS cell database server.\n\n @type subtype: C{int}\n @ivar subtype: In the case of subtype 1, the host has an AFS version 3.0\n Volume Location Server for the named AFS cell. In the case of subtype\n 2, the host has an authenticated name server holding the cell-root\n directory node for the named DCE/NCA cell.\n\n @type hostname: L{Name}\n @ivar hostname: The domain name of a host that has a server for the cell\n named by this record.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n\n @see: U{http://www.faqs.org/rfcs/rfc1183.html}\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = AFSDB\n\n fancybasename = 'AFSDB'\n compareAttributes = ('subtype', 'hostname', 'ttl')\n showAttributes = ('subtype', ('hostname', 'hostname', '%s'), 'ttl')\n\n\n\n\n\n\n", "metadata": "root.Record_AFSDB", "header": "['module', '___EOS___']", "index": 1168 }, { "content": " def __init__(self, subtype=0, hostname='', ttl=None):\n self.subtype = int(subtype)\n self.hostname = Name(hostname)\n self.ttl = str2time(ttl)", "metadata": "root.Record_AFSDB.__init__", "header": "['class', 'Record_AFSDB', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1195 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(struct.pack('!H', self.subtype))\n self.hostname.encode(strio, compDict)", "metadata": "root.Record_AFSDB.encode", "header": "['class', 'Record_AFSDB', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1201 }, { "content": " def decode(self, strio, length = None):\n r = struct.unpack('!H', readPrecisely(strio, struct.calcsize('!H')))\n self.subtype, = r\n self.hostname.decode(strio)", "metadata": "root.Record_AFSDB.decode", "header": "['class', 'Record_AFSDB', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1206 }, { "content": " def __hash__(self):\n return hash((self.subtype, self.hostname))", "metadata": "root.Record_AFSDB.__hash__", "header": "['class', 'Record_AFSDB', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1212 }, { "content": "class Record_RP(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n The responsible person for a domain.\n\n @type mbox: L{Name}\n @ivar mbox: A domain name that specifies the mailbox for the responsible\n person.\n\n @type txt: L{Name}\n @ivar txt: A domain name for which TXT RR's exist (indirection through\n which allows information sharing about the contents of this RP record).\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n\n @see: U{http://www.faqs.org/rfcs/rfc1183.html}\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = RP\n\n fancybasename = 'RP'\n compareAttributes = ('mbox', 'txt', 'ttl')\n showAttributes = (('mbox', 'mbox', '%s'), ('txt', 'txt', '%s'), 'ttl')\n\n\n\n\n\n\n", "metadata": "root.Record_RP", "header": "['module', '___EOS___']", "index": 1217 }, { "content": " def __init__(self, mbox='', txt='', ttl=None):\n self.mbox = Name(mbox)\n self.txt = Name(txt)\n self.ttl = str2time(ttl)", "metadata": "root.Record_RP.__init__", "header": "['class', 'Record_RP', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1242 }, { "content": " def encode(self, strio, compDict = None):\n self.mbox.encode(strio, compDict)\n self.txt.encode(strio, compDict)", "metadata": "root.Record_RP.encode", "header": "['class', 'Record_RP', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1248 }, { "content": " def decode(self, strio, length = None):\n self.mbox = Name()\n self.txt = Name()\n self.mbox.decode(strio)\n self.txt.decode(strio)", "metadata": "root.Record_RP.decode", "header": "['class', 'Record_RP', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1253 }, { "content": " def __hash__(self):\n return hash((self.mbox, self.txt))", "metadata": "root.Record_RP.__hash__", "header": "['class', 'Record_RP', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1260 }, { "content": "class Record_HINFO(tputil.FancyStrMixin, tputil.FancyEqMixin):\n \"\"\"\n Host information.\n\n @type cpu: C{str}\n @ivar cpu: Specifies the CPU type.\n\n @type os: C{str}\n @ivar os: Specifies the OS.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = HINFO\n\n fancybasename = 'HINFO'\n showAttributes = compareAttributes = ('cpu', 'os', 'ttl')\n\n\n\n\n\n\n\n\n", "metadata": "root.Record_HINFO", "header": "['module', '___EOS___']", "index": 1265 }, { "content": " def __init__(self, cpu='', os='', ttl=None):\n self.cpu, self.os = cpu, os\n self.ttl = str2time(ttl)", "metadata": "root.Record_HINFO.__init__", "header": "['class', 'Record_HINFO', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1285 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(struct.pack('!B', len(self.cpu)) + self.cpu)\n strio.write(struct.pack('!B', len(self.os)) + self.os)", "metadata": "root.Record_HINFO.encode", "header": "['class', 'Record_HINFO', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1290 }, { "content": " def decode(self, strio, length = None):\n cpu = struct.unpack('!B', readPrecisely(strio, 1))[0]\n self.cpu = readPrecisely(strio, cpu)\n os = struct.unpack('!B', readPrecisely(strio, 1))[0]\n self.os = readPrecisely(strio, os)", "metadata": "root.Record_HINFO.decode", "header": "['class', 'Record_HINFO', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1295 }, { "content": " def __eq__(self, other):\n if isinstance(other, Record_HINFO):\n return (self.os.lower() == other.os.lower() and\n self.cpu.lower() == other.cpu.lower() and\n self.ttl == other.ttl)\n return NotImplemented", "metadata": "root.Record_HINFO.__eq__", "header": "['class', 'Record_HINFO', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1302 }, { "content": " def __hash__(self):\n return hash((self.os.lower(), self.cpu.lower()))", "metadata": "root.Record_HINFO.__hash__", "header": "['class', 'Record_HINFO', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1310 }, { "content": "class Record_MINFO(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n Mailbox or mail list information.\n\n This is an experimental record type.\n\n @type rmailbx: L{Name}\n @ivar rmailbx: A domain-name which specifies a mailbox which is responsible\n for the mailing list or mailbox. If this domain name names the root,\n the owner of the MINFO RR is responsible for itself.\n\n @type emailbx: L{Name}\n @ivar emailbx: A domain-name which specifies a mailbox which is to receive\n error messages related to the mailing list or mailbox specified by the\n owner of the MINFO record. If this domain name names the root, errors\n should be returned to the sender of the message.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = MINFO\n\n rmailbx = None\n emailbx = None\n\n fancybasename = 'MINFO'\n compareAttributes = ('rmailbx', 'emailbx', 'ttl')\n showAttributes = (('rmailbx', 'responsibility', '%s'),\n ('emailbx', 'errors', '%s'),\n 'ttl')\n\n\n\n\n\n\n", "metadata": "root.Record_MINFO", "header": "['module', '___EOS___']", "index": 1315 }, { "content": " def __init__(self, rmailbx='', emailbx='', ttl=None):\n self.rmailbx, self.emailbx = Name(rmailbx), Name(emailbx)\n self.ttl = str2time(ttl)", "metadata": "root.Record_MINFO.__init__", "header": "['class', 'Record_MINFO', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1348 }, { "content": " def encode(self, strio, compDict = None):\n self.rmailbx.encode(strio, compDict)\n self.emailbx.encode(strio, compDict)", "metadata": "root.Record_MINFO.encode", "header": "['class', 'Record_MINFO', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1353 }, { "content": " def decode(self, strio, length = None):\n self.rmailbx, self.emailbx = Name(), Name()\n self.rmailbx.decode(strio)\n self.emailbx.decode(strio)", "metadata": "root.Record_MINFO.decode", "header": "['class', 'Record_MINFO', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1358 }, { "content": " def __hash__(self):\n return hash((self.rmailbx, self.emailbx))", "metadata": "root.Record_MINFO.__hash__", "header": "['class', 'Record_MINFO', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1364 }, { "content": "class Record_MX(tputil.FancyStrMixin, tputil.FancyEqMixin):\n \"\"\"\n Mail exchange.\n\n @type preference: C{int}\n @ivar preference: Specifies the preference given to this RR among others at\n the same owner. Lower values are preferred.\n\n @type name: L{Name}\n @ivar name: A domain-name which specifies a host willing to act as a mail\n exchange.\n\n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be\n cached.\n \"\"\"\n implements(IEncodable, IRecord)\n TYPE = MX\n\n fancybasename = 'MX'\n compareAttributes = ('preference', 'name', 'ttl')\n showAttributes = ('preference', ('name', 'name', '%s'), 'ttl')\n\n\n\n\n\n\n exchange = property(exchange)\n", "metadata": "root.Record_MX", "header": "['module', '___EOS___']", "index": 1369 }, { "content": " def __init__(self, preference=0, name='', ttl=None, **kwargs):\n self.preference, self.name = int(preference), Name(kwargs.get('exchange', name))\n self.ttl = str2time(ttl)", "metadata": "root.Record_MX.__init__", "header": "['class', 'Record_MX', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1392 }, { "content": " def encode(self, strio, compDict = None):\n strio.write(struct.pack('!H', self.preference))\n self.name.encode(strio, compDict)", "metadata": "root.Record_MX.encode", "header": "['class', 'Record_MX', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1396 }, { "content": " def decode(self, strio, length = None):\n self.preference = struct.unpack('!H', readPrecisely(strio, 2))[0]\n self.name = Name()\n self.name.decode(strio)", "metadata": "root.Record_MX.decode", "header": "['class', 'Record_MX', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1401 }, { "content": " def exchange(self):\n warnings.warn(\"use Record_MX.name instead\", DeprecationWarning, stacklevel=2)\n return self.name", "metadata": "root.Record_MX.exchange", "header": "['class', 'Record_MX', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1406 }, { "content": " def __hash__(self):\n return hash((self.preference, self.name))", "metadata": "root.Record_MX.__hash__", "header": "['class', 'Record_MX', '(', 'tputil', '.', 'FancyStrMixin', ',', 'tputil', '.', 'FancyEqMixin', ')', ':', '___EOS___']", "index": 1412 }, { "content": "class Record_TXT(tputil.FancyEqMixin, tputil.FancyStrMixin):\n \"\"\"\n Freeform text.\n\n @type data: C{list} of C{str}\n @ivar data: Freeform text which makes up this record.\n \n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be cached.\n \"\"\"\n implements(IEncodable, IRecord)\n\n TYPE = TXT\n\n fancybasename = 'TXT'\n showAttributes = compareAttributes = ('data', 'ttl')\n\n\n\n\n\n\n", "metadata": "root.Record_TXT", "header": "['module', '___EOS___']", "index": 1418 }, { "content": " def __init__(self, *data, **kw):\n self.data = list(data)\n # arg man python sucks so bad\n self.ttl = str2time(kw.get('ttl', None))", "metadata": "root.Record_TXT.__init__", "header": "['class', 'Record_TXT', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1435 }, { "content": " def encode(self, strio, compDict = None):\n for d in self.data:\n strio.write(struct.pack('!B', len(d)) + d)", "metadata": "root.Record_TXT.encode", "header": "['class', 'Record_TXT', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1441 }, { "content": " def decode(self, strio, length = None):\n soFar = 0\n self.data = []\n while soFar < length:\n L = struct.unpack('!B', readPrecisely(strio, 1))[0]\n self.data.append(readPrecisely(strio, L))\n soFar += L + 1\n if soFar != length:\n log.msg(\n \"Decoded %d bytes in %s record, but rdlength is %d\" % (\n soFar, self.fancybasename, length\n )\n )", "metadata": "root.Record_TXT.decode", "header": "['class', 'Record_TXT', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1446 }, { "content": " def __hash__(self):\n return hash(tuple(self.data))", "metadata": "root.Record_TXT.__hash__", "header": "['class', 'Record_TXT', '(', 'tputil', '.', 'FancyEqMixin', ',', 'tputil', '.', 'FancyStrMixin', ')', ':', '___EOS___']", "index": 1461 }, { "content": "class Record_SPF(Record_TXT):\n \"\"\"\n Structurally, freeform text. Semantically, a policy definition, formatted\n as defined in U{rfc 4408<http://www.faqs.org/rfcs/rfc4408.html>}.\n \n @type data: C{list} of C{str}\n @ivar data: Freeform text which makes up this record.\n \n @type ttl: C{int}\n @ivar ttl: The maximum number of seconds which this record should be cached.\n \"\"\"\n TYPE = SPF\n fancybasename = 'SPF'", "metadata": "root.Record_SPF", "header": "['module', '___EOS___']", "index": 1466 }, { "content": "class Message:\n \"\"\"\n L{Message} contains all the information represented by a single\n DNS request or response.\n \"\"\"\n headerFmt = \"!H2B4H\"\n headerSize = struct.calcsize(headerFmt)\n\n # Question, answer, additional, and nameserver lists\n queries = answers = add = ns = None\n\n\n\n\n\n\n\n\n\n\n\n # Create a mapping from record types to their corresponding Record_*\n # classes. This relies on the global state which has been created so\n # far in initializing this module (so don't define Record classes after\n # this).\n _recordTypes = {}\n for name in globals():\n if name.startswith('Record_'):\n _recordTypes[globals()[name].TYPE] = globals()[name]\n\n # Clear the iteration variable out of the class namespace so it\n # doesn't become an attribute.\n del name\n\n\n\n\n\n", "metadata": "root.Message", "header": "['module', '___EOS___']", "index": 1482 }, { "content": " def __init__(self, id=0, answer=0, opCode=0, recDes=0, recAv=0,\n auth=0, rCode=OK, trunc=0, maxSize=512):\n self.maxSize = maxSize\n self.id = id\n self.answer = answer\n self.opCode = opCode\n self.auth = auth\n self.trunc = trunc\n self.recDes = recDes\n self.recAv = recAv\n self.rCode = rCode\n self.queries = []\n self.answers = []\n self.authority = []\n self.additional = []", "metadata": "root.Message.__init__", "header": "['class', 'Message', ':', '___EOS___']", "index": 1493 }, { "content": " def addQuery(self, name, type=ALL_RECORDS, cls=IN):\n \"\"\"\n Add another query to this Message.\n\n @type name: C{str}\n @param name: The name to query.\n\n @type type: C{int}\n @param type: Query type\n\n @type cls: C{int}\n @param cls: Query class\n \"\"\"\n self.queries.append(Query(name, type, cls))", "metadata": "root.Message.addQuery", "header": "['class', 'Message', ':', '___EOS___']", "index": 1510 }, { "content": " def encode(self, strio):\n compDict = {}\n body_tmp = StringIO.StringIO()\n for q in self.queries:\n q.encode(body_tmp, compDict)\n for q in self.answers:\n q.encode(body_tmp, compDict)\n for q in self.authority:\n q.encode(body_tmp, compDict)\n for q in self.additional:\n q.encode(body_tmp, compDict)\n body = body_tmp.getvalue()\n size = len(body) + self.headerSize\n if self.maxSize and size > self.maxSize:\n self.trunc = 1\n body = body[:self.maxSize - self.headerSize]\n byte3 = (( ( self.answer & 1 ) << 7 )\n | ((self.opCode & 0xf ) << 3 )\n | ((self.auth & 1 ) << 2 )\n | ((self.trunc & 1 ) << 1 )\n | ( self.recDes & 1 ) )\n byte4 = ( ( (self.recAv & 1 ) << 7 )\n | (self.rCode & 0xf ) )\n\n strio.write(struct.pack(self.headerFmt, self.id, byte3, byte4,\n len(self.queries), len(self.answers),\n len(self.authority), len(self.additional)))\n strio.write(body)", "metadata": "root.Message.encode", "header": "['class', 'Message', ':', '___EOS___']", "index": 1526 }, { "content": " def decode(self, strio, length=None):\n self.maxSize = 0\n header = readPrecisely(strio, self.headerSize)\n r = struct.unpack(self.headerFmt, header)\n self.id, byte3, byte4, nqueries, nans, nns, nadd = r\n self.answer = ( byte3 >> 7 ) & 1\n self.opCode = ( byte3 >> 3 ) & 0xf\n self.auth = ( byte3 >> 2 ) & 1\n self.trunc = ( byte3 >> 1 ) & 1\n self.recDes = byte3 & 1\n self.recAv = ( byte4 >> 7 ) & 1\n self.rCode = byte4 & 0xf\n\n self.queries = []\n for i in range(nqueries):\n q = Query()\n try:\n q.decode(strio)\n except EOFError:\n return\n self.queries.append(q)\n\n items = ((self.answers, nans), (self.authority, nns), (self.additional, nadd))\n for (l, n) in items:\n self.parseRecords(l, n, strio)", "metadata": "root.Message.decode", "header": "['class', 'Message', ':', '___EOS___']", "index": 1556 }, { "content": " def parseRecords(self, list, num, strio):\n for i in range(num):\n header = RRHeader()\n try:\n header.decode(strio)\n except EOFError:\n return\n t = self.lookupRecordType(header.type)\n if not t:\n continue\n header.payload = t(ttl=header.ttl)\n try:\n header.payload.decode(strio, header.rdlength)\n except EOFError:\n return\n list.append(header)", "metadata": "root.Message.parseRecords", "header": "['class', 'Message', ':', '___EOS___']", "index": 1583 }, { "content": " def lookupRecordType(self, type):\n \"\"\"\n Retrieve the L{IRecord} implementation for the given record type.\n\n @param type: A record type, such as L{A} or L{NS}.\n @type type: C{int}\n\n @return: An object which implements L{IRecord} or C{None} if none\n can be found for the given type.\n @rtype: L{types.ClassType}\n \"\"\"\n return self._recordTypes.get(type, None)", "metadata": "root.Message.lookupRecordType", "header": "['class', 'Message', ':', '___EOS___']", "index": 1615 }, { "content": " def toStr(self):\n strio = StringIO.StringIO()\n self.encode(strio)\n return strio.getvalue()", "metadata": "root.Message.toStr", "header": "['class', 'Message', ':', '___EOS___']", "index": 1629 }, { "content": " def fromStr(self, str):\n strio = StringIO.StringIO(str)\n self.decode(strio)", "metadata": "root.Message.fromStr", "header": "['class', 'Message', ':', '___EOS___']", "index": 1635 }, { "content": "class DNSMixin(object):\n \"\"\"\n DNS protocol mixin shared by UDP and TCP implementations.\n\n @ivar _reactor: A L{IReactorTime} and L{IReactorUDP} provider which will\n be used to issue DNS queries and manage request timeouts.\n \"\"\"\n id = None\n liveMessages = None\n\n\n\n\n\n\n\n", "metadata": "root.DNSMixin", "header": "['module', '___EOS___']", "index": 1641 }, { "content": " def __init__(self, controller, reactor=None):\n self.controller = controller\n self.id = random.randrange(2 ** 10, 2 ** 15)\n if reactor is None:\n from twisted.internet import reactor\n self._reactor = reactor", "metadata": "root.DNSMixin.__init__", "header": "['class', 'DNSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1651 }, { "content": " def pickID(self):\n \"\"\"\n Return a unique ID for queries.\n \"\"\"\n while True:\n id = randomSource()\n if id not in self.liveMessages:\n return id", "metadata": "root.DNSMixin.pickID", "header": "['class', 'DNSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1659 }, { "content": " def callLater(self, period, func, *args):\n \"\"\"\n Wrapper around reactor.callLater, mainly for test purpose.\n \"\"\"\n return self._reactor.callLater(period, func, *args)", "metadata": "root.DNSMixin.callLater", "header": "['class', 'DNSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1669 }, { "content": " def _query(self, queries, timeout, id, writeMessage):\n \"\"\"\n Send out a message with the given queries.\n\n @type queries: C{list} of C{Query} instances\n @param queries: The queries to transmit\n\n @type timeout: C{int} or C{float}\n @param timeout: How long to wait before giving up\n\n @type id: C{int}\n @param id: Unique key for this request\n\n @type writeMessage: C{callable}\n @param writeMessage: One-parameter callback which writes the message\n\n @rtype: C{Deferred}\n @return: a C{Deferred} which will be fired with the result of the\n query, or errbacked with any errors that could happen (exceptions\n during writing of the query, timeout errors, ...).\n \"\"\"\n m = Message(id, recDes=1)\n m.queries = queries\n\n try:\n writeMessage(m)\n except:\n return defer.fail()\n\n resultDeferred = defer.Deferred()\n cancelCall = self.callLater(timeout, self._clearFailed, resultDeferred, id)\n self.liveMessages[id] = (resultDeferred, cancelCall)\n\n return resultDeferred", "metadata": "root.DNSMixin._query", "header": "['class', 'DNSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1676 }, { "content": " def _clearFailed(self, deferred, id):\n \"\"\"\n Clean the Deferred after a timeout.\n \"\"\"\n try:\n del self.liveMessages[id]\n except KeyError:\n pass\n deferred.errback(failure.Failure(DNSQueryTimeoutError(id)))", "metadata": "root.DNSMixin._clearFailed", "header": "['class', 'DNSMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1711 }, { "content": "class DNSDatagramProtocol(DNSMixin, protocol.DatagramProtocol):\n \"\"\"\n DNS protocol over UDP.\n \"\"\"\n resends = None\n\n\n\n\n\n\n\n", "metadata": "root.DNSDatagramProtocol", "header": "['module', '___EOS___']", "index": 1722 }, { "content": " def stopProtocol(self):\n \"\"\"\n Stop protocol: reset state variables.\n \"\"\"\n self.liveMessages = {}\n self.resends = {}\n self.transport = None", "metadata": "root.DNSDatagramProtocol.stopProtocol", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1728 }, { "content": " def startProtocol(self):\n \"\"\"\n Upon start, reset internal state.\n \"\"\"\n self.liveMessages = {}\n self.resends = {}", "metadata": "root.DNSDatagramProtocol.startProtocol", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1736 }, { "content": " def writeMessage(self, message, address):\n \"\"\"\n Send a message holding DNS queries.\n\n @type message: L{Message}\n \"\"\"\n self.transport.write(message.toStr(), address)", "metadata": "root.DNSDatagramProtocol.writeMessage", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1743 }, { "content": " def startListening(self):\n self._reactor.listenUDP(0, self, maxPacketSize=512)", "metadata": "root.DNSDatagramProtocol.startListening", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1751 }, { "content": " def datagramReceived(self, data, addr):\n \"\"\"\n Read a datagram, extract the message in it and trigger the associated\n Deferred.\n \"\"\"\n m = Message()\n try:\n m.fromStr(data)\n except EOFError:\n log.msg(\"Truncated packet (%d bytes) from %s\" % (len(data), addr))\n return\n except:\n # Nothing should trigger this, but since we're potentially\n # invoking a lot of different decoding methods, we might as well\n # be extra cautious. Anything that triggers this is itself\n # buggy.\n log.err(failure.Failure(), \"Unexpected decoding error\")\n return\n\n if m.id in self.liveMessages:\n d, canceller = self.liveMessages[m.id]\n del self.liveMessages[m.id]\n canceller.cancel()\n # XXX we shouldn't need this hack of catching exception on callback()\n try:\n d.callback(m)\n except:\n log.err()\n else:\n if m.id not in self.resends:\n self.controller.messageReceived(m, self, addr)", "metadata": "root.DNSDatagramProtocol.datagramReceived", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1754 }, { "content": " def removeResend(self, id):\n \"\"\"\n Mark message ID as no longer having duplication suppression.\n \"\"\"\n try:\n del self.resends[id]\n except KeyError:\n pass", "metadata": "root.DNSDatagramProtocol.removeResend", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1787 }, { "content": " def query(self, address, queries, timeout=10, id=None):\n \"\"\"\n Send out a message with the given queries.\n\n @type address: C{tuple} of C{str} and C{int}\n @param address: The address to which to send the query\n\n @type queries: C{list} of C{Query} instances\n @param queries: The queries to transmit\n\n @rtype: C{Deferred}\n \"\"\"\n if not self.transport:\n # XXX transport might not get created automatically, use callLater?\n try:\n self.startListening()\n except CannotListenError:\n return defer.fail()\n\n if id is None:\n id = self.pickID()\n else:\n self.resends[id] = 1\n\n def writeMessage(m):\n self.writeMessage(m, address)\n\n return self._query(queries, timeout, id, writeMessage)", "metadata": "root.DNSDatagramProtocol.query", "header": "['class', 'DNSDatagramProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'DatagramProtocol', ')', ':', '___EOS___']", "index": 1796 }, { "content": "class DNSProtocol(DNSMixin, protocol.Protocol):\n \"\"\"\n DNS protocol over TCP.\n \"\"\"\n length = None\n buffer = ''\n\n\n\n\n\n\n\n", "metadata": "root.DNSProtocol", "header": "['module', '___EOS___']", "index": 1826 }, { "content": " def writeMessage(self, message):\n \"\"\"\n Send a message holding DNS queries.\n\n @type message: L{Message}\n \"\"\"\n s = message.toStr()\n self.transport.write(struct.pack('!H', len(s)) + s)", "metadata": "root.DNSProtocol.writeMessage", "header": "['class', 'DNSProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'Protocol', ')', ':', '___EOS___']", "index": 1833 }, { "content": " def connectionMade(self):\n \"\"\"\n Connection is made: reset internal state, and notify the controller.\n \"\"\"\n self.liveMessages = {}\n self.controller.connectionMade(self)", "metadata": "root.DNSProtocol.connectionMade", "header": "['class', 'DNSProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'Protocol', ')', ':', '___EOS___']", "index": 1842 }, { "content": " def connectionLost(self, reason):\n \"\"\"\n Notify the controller that this protocol is no longer\n connected.\n \"\"\"\n self.controller.connectionLost(self)", "metadata": "root.DNSProtocol.connectionLost", "header": "['class', 'DNSProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'Protocol', ')', ':', '___EOS___']", "index": 1850 }, { "content": " def dataReceived(self, data):\n self.buffer += data\n\n while self.buffer:\n if self.length is None and len(self.buffer) >= 2:\n self.length = struct.unpack('!H', self.buffer[:2])[0]\n self.buffer = self.buffer[2:]\n\n if len(self.buffer) >= self.length:\n myChunk = self.buffer[:self.length]\n m = Message()\n m.fromStr(myChunk)\n\n try:\n d, canceller = self.liveMessages[m.id]\n except KeyError:\n self.controller.messageReceived(m, self)\n else:\n del self.liveMessages[m.id]\n canceller.cancel()\n # XXX we shouldn't need this hack\n try:\n d.callback(m)\n except:\n log.err()\n\n self.buffer = self.buffer[self.length:]\n self.length = None\n else:\n break", "metadata": "root.DNSProtocol.dataReceived", "header": "['class', 'DNSProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'Protocol', ')', ':', '___EOS___']", "index": 1858 }, { "content": " def query(self, queries, timeout=60):\n \"\"\"\n Send out a message with the given queries.\n\n @type queries: C{list} of C{Query} instances\n @param queries: The queries to transmit\n\n @rtype: C{Deferred}\n \"\"\"\n id = self.pickID()\n return self._query(queries, timeout, id, self.writeMessage)", "metadata": "root.DNSProtocol.query", "header": "['class', 'DNSProtocol', '(', 'DNSMixin', ',', 'protocol', '.', 'Protocol', ')', ':', '___EOS___']", "index": 1890 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "test", "-", "case", "-", "name", ":", " ", "twist", "ed", ".", "names", ".", "test", ".", "test\\u", "dns", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "200", "1", "-", "2010", " ", "Twi", "sted", " ", "Matrix", " ", "Labo", "rator", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "LICENSE", " ", "for", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "DNS", " ", "protoc", "ol", " ", "implementation", ".", "\\", "10", ";", "\\", "10", ";", "Fu", "ture", " ", "Plan", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Get", " ", "rid", " ", "of", " ", "some", " ", "toplevel", "s", ",", " ", "may", "be", ".", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "Mos", "he", " ", "Za", "dk", "a", "\\", "10", ";", "@", "author", ":", " ", "Je", "an", "-", "Paul", " ", "Cal", "der", "one", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "IE", "nco", "dable", "'_", ",_", "'", "IR", "ecor", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "A", "'_", ",_", "'", "A6", "'_", ",_", "'", "AAAA", "'_", ",_", "'", "AF", "SD", "B", "'_", ",_", "'", "CNA", "ME", "'_", ",_", "'", "DNA", "ME", "'_", ",_", "'", "HI", "NF", "O", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MAIL", "A", "'_", ",_", "'", "MAIL", "B", "'_", ",_", "'", "MB", "'_", ",_", "'", "MD", "'_", ",_", "'", "MF", "'_", ",_", "'", "MG", "'_", ",_", "'", "MIN", "FO", "'_", ",_", "'", "MR", "'_", ",_", "'", "MX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "NA", "PTR", "'_", ",_", "'", "NS", "'_", ",_", "'", "NULL", "'_", ",_", "'", "PTR", "'_", ",_", "'", "RP", "'_", ",_", "'", "SOA", "'_", ",_", "'", "SP", "F", "'_", ",_", "'", "SRV", "'_", ",_", "'", "TXT", "'_", ",_", "'", "WK", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ANY", "'_", ",_", "'", "CH", "'_", ",_", "'", "CS", "'_", ",_", "'", "HS", "'_", ",_", "'", "IN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ALL", "\\u", "RECORD", "S", "'_", ",_", "'", "AX", "FR", "'_", ",_", "'", "IX", "FR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "EF", "ORM", "AT", "'_", ",_", "'", "EN", "AME", "'_", ",_", "'", "ENO", "TI", "MP", "'_", ",_", "'", "ERE", "FU", "SED", "'_", ",_", "'", "ES", "ERVE", "R", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Record", "\\u", "A", "'_", ",_", "'", "Record", "\\u", "A6", "'_", ",_", "'", "Record", "\\u", "AAAA", "'_", ",_", "'", "Record", "\\u", "AF", "SD", "B", "'_", ",_", "'", "Record", "\\u", "CNA", "ME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Record", "\\u", "DNA", "ME", "'_", ",_", "'", "Record", "\\u", "HI", "NF", "O", "'_", ",_", "'", "Record", "\\u", "MB", "'_", ",_", "'", "Record", "\\u", "MD", "'_", ",_", "'", "Record", "\\u", "MF", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Record", "\\u", "MG", "'_", ",_", "'", "Record", "\\u", "MIN", "FO", "'_", ",_", "'", "Record", "\\u", "MR", "'_", ",_", "'", "Record", "\\u", "MX", "'_", ",_", "'", "Record", "\\u", "NA", "PTR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Record", "\\u", "NS", "'_", ",_", "'", "Record", "\\u", "NULL", "'_", ",_", "'", "Record", "\\u", "PTR", "'_", ",_", "'", "Record", "\\u", "RP", "'_", ",_", "'", "Record", "\\u", "SOA", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Record", "\\u", "SP", "F", "'_", ",_", "'", "Record", "\\u", "SRV", "'_", ",_", "'", "Record", "\\u", "TXT", "'_", ",_", "'", "Record", "\\u", "WK", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "QUE", "RY", "\\u", "CLASSE", "S", "'_", ",_", "'", "QUE", "RY", "\\u", "TYPES", "'_", ",_", "'", "REV", "\\u", "CLASSE", "S", "'_", ",_", "'", "REV", "\\u", "TYPES", "'_", ",_", "'", "EXT", "\\u", "QUE", "RIE", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Char", "str", "'_", ",_", "'", "Messag", "e", "'_", ",_", "'", "Name", "'_", ",_", "'", "Query", "'_", ",_", "'", "RR", "Head", "er", "'_", ",_", "'", "Simple", "Record", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DNS", "Data", "gram", "Proto", "col", "'_", ",_", "'", "DNS", "Mix", "in", "'_", ",_", "'", "DNS", "Proto", "col", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "OK", "'_", ",_", "'", "OP", "\\u", "INVE", "RSE", "'_", ",_", "'", "OP", "\\u", "NOTIF", "Y", "'_", ",_", "'", "OP", "\\u", "QUE", "RY", "'_", ",_", "'", "OP", "\\u", "STATUS", "'_", ",_", "'", "OP", "\\u", "UPDATE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PORT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Author", "ita", "tiv", "e", "Doma", "in", "Error", "'_", ",_", "'", "DNS", "Query", "Time", "out", "Error", "'_", ",_", "'", "Doma", "in", "Error", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "System", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "struct_", ",_", "random_", ",_", "types_", ",_", "socket_", "\\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_", "c", "String", "IO_", "as_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "AF", "\\u", "INE", "T6", "_", "=_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "zope_", "._", "interface_", "import_", "implements_", ",_", "Interface_", ",_", "Attribute_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Twi", "sted", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "twisted_", "._", "internet_", "import_", "protocol_", ",_", "defer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "internet_", "._", "error_", "import_", "Cann", "ot", "Listen", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "python_", "import_", "log_", ",_", "failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "python_", "import_", "util_", "as_", "tpu", "til_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "python_", "import_", "rand", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "PORT_", "=_", "53_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "A_", ",_", "NS_", ",_", "MD", "_", ",_", "MF", "_", ",_", "CNA", "ME_", ",_", "SOA", "_", ",_", "MB_", ",_", "MG", "_", ",_", "MR", "_", ",_", "NULL_", ",_", "WK", "S_", ",_", "PTR", "_", ",_", "HI", "NF", "O_", ",_", "MIN", "FO", "_", ",_", "MX", "_", ",_", "TXT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "RP", "_", ",_", "AF", "SD", "B_", ")_", "=_", "range_", "(_", "1_", ",_", "19_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "AAAA", "_", "=_", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SRV", "_", "=_", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NA", "PTR", "_", "=_", "35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A6", "_", "=_", "38_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DNA", "ME_", "=_", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SP", "F_", "=_", "99_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "QUE", "RY", "\\u", "TYPES_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "A_", ":_", "'", "A", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NS_", ":_", "'", "NS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MD", "_", ":_", "'", "MD", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MF", "_", ":_", "'", "MF", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "CNA", "ME_", ":_", "'", "CNA", "ME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "SOA", "_", ":_", "'", "SOA", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MB_", ":_", "'", "MB", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MG", "_", ":_", "'", "MG", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MR", "_", ":_", "'", "MR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NULL_", ":_", "'", "NULL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "WK", "S_", ":_", "'", "WK", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PTR", "_", ":_", "'", "PTR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HI", "NF", "O_", ":_", "'", "HI", "NF", "O", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MIN", "FO", "_", ":_", "'", "MIN", "FO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MX", "_", ":_", "'", "MX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "TXT", "_", ":_", "'", "TXT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "RP", "_", ":_", "'", "RP", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "AF", "SD", "B_", ":_", "'", "AF", "SD", "B", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", "9", " ", "through", " ", "2", "7", "?", " ", " ", "Eh", ",", " ", "I", "'", "ll", " ", "get", " ", "to", " ", "'", "em", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "AAAA", "_", ":_", "'", "AAAA", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "SRV", "_", ":_", "'", "SRV", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NA", "PTR", "_", ":_", "'", "NA", "PTR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "A6", "_", ":_", "'", "A6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "DNA", "ME_", ":_", "'", "DNA", "ME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "SP", "F_", ":_", "'", "SP", "F", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "IX", "FR", "_", ",_", "AX", "FR", "_", ",_", "MAIL", "B_", ",_", "MAIL", "A_", ",_", "ALL", "\\u", "RECORD", "S_", "=_", "range_", "(_", "251_", ",_", "256_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Extend", "ed", "\"", " ", "querie", "s", " ", "(", "He", "y", ",", " ", "half", " ", "of", " ", "these", " ", "are", " ", "depre", "cated", ",", " ", "good", " ", "job", ")_", "\\u\\u\\uNL\\u\\u\\u_", "EXT", "\\u", "QUE", "RIE", "S_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "IX", "FR", "_", ":_", "'", "IX", "FR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "AX", "FR", "_", ":_", "'", "AX", "FR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MAIL", "B_", ":_", "'", "MAIL", "B", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MAIL", "A_", ":_", "'", "MAIL", "A", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ALL", "\\u", "RECORD", "S_", ":_", "'", "ALL", "\\u", "RECORD", "S", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "REV", "\\u", "TYPES_", "=_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "v_", ",_", "k_", ")_", "for_", "(_", "k_", ",_", "v_", ")_", "in_", "QUE", "RY", "\\u", "TYPES_", "._", "items_", "(_", ")_", "+_", "EXT", "\\u", "QUE", "RIE", "S_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "IN_", ",_", "CS_", ",_", "CH_", ",_", "HS", "_", "=_", "range_", "(_", "1_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ANY_", "=_", "255_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "QUE", "RY", "\\u", "CLASSES_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "IN_", ":_", "'", "IN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "CS_", ":_", "'", "CS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "CH_", ":_", "'", "CH", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HS", "_", ":_", "'", "HS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ANY_", ":_", "'", "ANY", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REV", "\\u", "CLASSES_", "=_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "v_", ",_", "k_", ")_", "for_", "(_", "k_", ",_", "v_", ")_", "in_", "QUE", "RY", "\\u", "CLASSES_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Opcode", "s_", "\\u\\u\\uNL\\u\\u\\u_", "OP", "\\u", "QUERY_", ",_", "OP", "\\u", "INVE", "RSE", "_", ",_", "OP", "\\u", "STATUS_", "=_", "range_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OP", "\\u", "NOTIF", "Y_", "=_", "4_", "#", " ", "RF", "C", " ", "1996", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OP", "\\u", "UPDATE_", "=_", "5_", "#", " ", "RF", "C", " ", "213", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Respons", "e", " ", "Codes_", "\\u\\u\\uNL\\u\\u\\u_", "OK_", ",_", "EF", "ORM", "AT_", ",_", "ES", "ERVE", "R_", ",_", "EN", "AME_", ",_", "ENO", "TI", "MP_", ",_", "ERE", "FU", "SED", "_", "=_", "range_", "(_", "6_", ")_", "\\u\\u\\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_", "#", " ", "Backward", "s", " ", "compatibility", " ", "alias", "es", " ", "-", " ", "these", " ", "shou", "ld", " ", "be", " ", "depre", "cated", " ", "or", " ", "somet", "hing", " ", "I_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "supp", "ose", ".", " ", "-", "exa", "rk", "un_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "twisted_", "._", "names_", "._", "error_", "import_", "Doma", "in", "Error_", ",_", "Author", "ita", "tiv", "e", "Doma", "in", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "names_", "._", "error_", "import_", "DNS", "Query", "Time", "out", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\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_", "#", " ", "Kin", "ds", " ", "of", " ", "RR", "s", " ", "-", " ", "oh", " ", "my", "!", "_", "\\u\\u\\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\\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\\uNL\\u\\u\\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\\uNL\\u\\u\\u_", "\\u\\u\\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\\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\\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\\uNL\\u\\u\\u_", "#", " ", "Oh", " ", "god", ",", " ", "Record", "\\u", "TXT", " ", "how", " ", "I", " ", "hat", "e", " ", "the", "e", "._", "\\u\\u\\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\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "random", "Source_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wrapper", " ", "aro", "und", " ", "L", "{", "rand", "bytes", ".", "secure", "Random", "}", " ", "to", " ", "return", " ", "2", " ", "random", " ", "char", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "struct_", "._", "unpack_", "(_", "'", "H", "'_", ",_", "rand", "bytes_", "._", "secure", "Random_", "(_", "2_", ",_", "fallback_", "=_", "True_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "IR", "ecor", "d_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "single", " ", "entry", " ", "in", " ", "a", " ", "zone", " ", "of", " ", "authori", "ty", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "Attribute_", "(_", "\"", "An", " ", "indicat", "or", " ", "of", " ", "what", " ", "kind", " ", "of", " ", "record", " ", "this", " ", "is", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "str2", "time_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suffixes_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "S", "'_", ",_", "1_", ")_", ",_", "(_", "'", "M", "'_", ",_", "60_", ")_", ",_", "(_", "'", "H", "'_", ",_", "60_", "*_", "60_", ")_", ",_", "(_", "'", "D", "'_", ",_", "60_", "*_", "60_", "*_", "24_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "W", "'_", ",_", "60_", "*_", "60_", "*_", "24_", "*_", "7_", ")_", ",_", "(_", "'", "Y", "'_", ",_", "60_", "*_", "60_", "*_", "24_", "*_", "365_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "s_", ",_", "types_", "._", "String", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "s_", "._", "upper_", "(_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "suff", "_", ",_", "mult_", ")_", "in_", "suffixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "._", "endswith_", "(_", "suff", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "float_", "(_", "s_", "[_", ":_", "-_", "1_", "]_", ")_", "*_", "mult_", ")_", "\\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 ", " _", "s_", "=_", "int_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "Inva", "lid", " ", "time", " ", "interval", " ", "specifier", ":", " ", "\"_", "+_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "Precis", "el", "y_", "(_", "file_", ",_", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buff_", "=_", "file_", "._", "read_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "buff_", ")_", "<_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "EO", "FE", "rror_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "buff_", "\\u\\u\\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_", "IE", "nco", "dable", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Interface", " ", "for", " ", "somet", "hing", " ", "whi", "ch", " ", "can", " ", "be", " ", "encode", "d", " ", "to", " ", "and", " ", "decode", "d", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "a", " ", "file", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "IE", "nco", "dable", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Write", " ", "a", " ", "represent", "ation", " ", "of", " ", "this", " ", "object", " ", "to", " ", "the", " ", "give", "n", "\\", "10", ";", " ", " ", " ", " ", "file", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "stri", "o", ":", " ", "File", "-", "like", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "stri", "o", ":", " ", "The", " ", "stream", " ", "to", " ", "whi", "ch", " ", "to", " ", "write", " ", "bytes", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "comp", "Dict", ":", " ", "C", "{", "dict", "}", " ", "or", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "comp", "Dict", ":", " ", "A", " ", "dictionar", "y", " ", "of", " ", "back", "reference", " ", "addresse", "s", " ", "tha", "t", " ", "have", "\\", "10", ";", " ", " ", " ", " ", "have", " ", "alr", "ead", "y", " ", "bee", "n", " ", "writt", "en", " ", "to", " ", "this", " ", "stream", " ", "and", " ", "tha", "t", " ", "may", " ", "be", " ", "used", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "compress", "ion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IE", "nco", "dable", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Recon", "struct", " ", "an", " ", "object", " ", "from", " ", "data", " ", "read", " ", "from", " ", "the", " ", "give", "n", "\\", "10", ";", " ", " ", " ", " ", "file", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "stri", "o", ":", " ", "File", "-", "like", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "stri", "o", ":", " ", "The", " ", "stream", " ", "from", " ", "whi", "ch", " ", "bytes", " ", "may", " ", "be", " ", "read", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "length", ":", " ", "C", "{", "int", "}", " ", "or", " ", "C", "{", "Non", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "length", ":", " ", "The", " ", "number", " ", "of", " ", "bytes", " ", "in", " ", "this", " ", "RD", "ATA", " ", "field", ".", " ", " ", "Mos", "t", "\\", "10", ";", " ", " ", " ", " ", "implementation", "s", " ", "can", " ", "ignore", " ", "this", " ", "value", ".", " ", " ", "On", "ly", " ", "in", " ", "the", " ", "case", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "record", "s", " ", "similar", " ", "to", " ", "TXT", " ", "where", " ", "the", " ", "total", " ", "length", " ", "is", " ", "in", " ", "no", " ", "way", "\\", "10", ";", " ", " ", " ", " ", "encode", "d", " ", "in", " ", "the", " ", "data", " ", "is", " ", "it", " ", "necessar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Char", "str_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implements_", "(_", "IE", "nco", "dable", "_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Char", "str_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "string_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "string_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"%", "r", " ", "is", " ", "not", " ", "a", " ", "string", "\"_", "%_", "(_", "string_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "string_", "=_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "str_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "this", " ", "Char", "acte", "r", " ", "string", " ", "int", "o", " ", "the", " ", "appropr", "iate", " ", "byte", " ", "format", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "stri", "o", ":", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "stri", "o", ":", " ", "The", " ", "byte", " ", "represent", "ation", " ", "of", " ", "this", " ", "Char", "str", " ", "will", " ", "be", " ", "writt", "en", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "this", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string_", "=_", "self_", "._", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ind_", "=_", "len_", "(_", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "chr_", "(_", "ind_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "str_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "a", " ", "byte", " ", "string", " ", "int", "o", " ", "this", " ", "Name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "stri", "o", ":", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "stri", "o", ":", " ", "Byte", "s", " ", "will", " ", "be", " ", "read", " ", "from", " ", "this", " ", "file", " ", "unti", "l", " ", "the", " ", "full", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "decode", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", " ", "EO", "FE", "rror", ":", " ", "Rai", "sed", " ", "whe", "n", " ", "there", " ", "are", " ", "not", " ", "eno", "ugh", " ", "bytes", " ", "avail", "able", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "stri", "o", "}.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "string_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "ord_", "(_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "string_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "str_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "Char", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "string_", "==_", "other_", "._", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "str_", "(_", "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_", "._", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Char", "str_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implements_", "(_", "IE", "nco", "dable", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "class_", "Name_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "isinstance_", "(_", "name_", ",_", "types_", "._", "String", "Types_", ")_", ",_", "\"%", "r", " ", "is", " ", "not", " ", "a", " ", "string", "\"_", "%_", "(_", "name_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Name_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "this", " ", "Name", " ", "int", "o", " ", "the", " ", "appropr", "iate", " ", "byte", " ", "format", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "stri", "o", ":", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "stri", "o", ":", " ", "The", " ", "byte", " ", "represent", "ation", " ", "of", " ", "this", " ", "Name", " ", "will", " ", "be", " ", "writt", "en", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "comp", "Dict", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "comp", "Dict", ":", " ", "dictionar", "y", " ", "of", " ", "Names", " ", "tha", "t", " ", "have", " ", "alr", "ead", "y", " ", "bee", "n", " ", "encode", "d", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "who", "se", " ", "addresse", "s", " ", "may", " ", "be", " ", "back", "referenced", " ", "by", " ", "this", " ", "Name", " ", "(", "for", " ", "the", " ", "purpose", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "reduc", "ing", " ", "the", " ", "message", " ", "size", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "comp", "Dict_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "in_", "comp", "Dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stri", "o_", "._", "write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "struct_", "._", "pack_", "(_", "\"!", "H", "\"_", ",_", "0xc0", "00_", "|_", "comp", "Dict_", "[_", "name_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "comp", "Dict_", "[_", "name_", "]_", "=_", "stri", "o_", "._", "tell_", "(_", ")_", "+_", "Message_", "._", "header", "Size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ind_", "=_", "name_", "._", "find_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ind_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label_", ",_", "name_", "=_", "name_", "[_", ":_", "ind_", "]_", ",_", "name_", "[_", "ind_", "+_", "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 ", " _", "label_", ",_", "name_", "=_", "name_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ind_", "=_", "len_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "chr_", "(_", "ind_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "chr_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Name_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "a", " ", "byte", " ", "string", " ", "int", "o", " ", "this", " ", "Name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "stri", "o", ":", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "stri", "o", ":", " ", "Byte", "s", " ", "will", " ", "be", " ", "read", " ", "from", " ", "this", " ", "file", " ", "unti", "l", " ", "the", " ", "full", " ", "Name", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "decode", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", " ", "EO", "FE", "rror", ":", " ", "Rai", "sed", " ", "whe", "n", " ", "there", " ", "are", " ", "not", " ", "eno", "ugh", " ", "bytes", " ", "avail", "able", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "C", "{", "stri", "o", "}.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "off_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "ord_", "(_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "off_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stri", "o_", "._", "seek_", "(_", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "l_", ">>_", "6_", ")_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "off_", "=_", "(_", "(_", "l_", "&_", "63_", ")_", "<<_", "8_", "\\u\\u\\uNL\\u\\u\\u_", "|_", "ord_", "(_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "off_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "off_", "=_", "stri", "o_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stri", "o_", "._", "seek_", "(_", "new", "\\u", "off_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "label_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "label_", "\\u\\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_", "._", "name_", "=_", "self_", "._", "name_", "+_", "'.'_", "+_", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Name_", ":_", "\\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", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "str_", "(_", "self_", ")_", "==_", "str_", "(_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Name_", ":_", "\\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_", "(_", "str_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Name_", ":_", "\\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_", "self_", "._", "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_", "Query_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", " ", "a", " ", "single", " ", "DNS", " ", "query", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "name", ":", " ", "The", " ", "name", " ", "abo", "ut", " ", "whi", "ch", " ", "this", " ", "query", " ", "is", " ", "request", "ing", " ", "informati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "type", ":", " ", "The", " ", "query", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "cls", ":", " ", "The", " ", "query", " ", "class", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Query_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", "=_", "''_", ",_", "type_", "=_", "A_", ",_", "cls_", "=_", "IN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "The", " ", "name", " ", "abo", "ut", " ", "whi", "ch", " ", "to", " ", "request", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "type", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "type", ":", " ", "The", " ", "query", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "cls", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "cls", ":", " ", "The", " ", "query", " ", "class", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "Name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", "=_", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cls_", "=_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "\"!", "HH", "\"_", ",_", "self_", "._", "type_", ",_", "self_", "._", "cls_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buff_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", ",_", "self_", "._", "cls_", "=_", "struct_", "._", "unpack_", "(_", "\"!", "HH", "\"_", ",_", "buff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query_", ":_", "\\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_", "(_", "(_", "str_", "(_", "self_", "._", "name_", ")_", "._", "lower_", "(_", ")_", ",_", "self_", "._", "type_", ",_", "self_", "._", "cls_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "cmp", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "Query_", ")_", "and_", "cmp_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "str_", "(_", "self_", "._", "name_", ")_", "._", "lower_", "(_", ")_", ",_", "self_", "._", "type_", ",_", "self_", "._", "cls_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "str_", "(_", "other_", "._", "name_", ")_", "._", "lower_", "(_", ")_", ",_", "other_", "._", "type_", ",_", "other_", "._", "cls_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "or_", "cmp_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "other_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query_", ":_", "\\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 ", " _", "t_", "=_", "QUE", "RY", "\\u", "TYPES_", "._", "get_", "(_", "self_", "._", "type_", ",_", "EXT", "\\u", "QUE", "RIE", "S_", "._", "get_", "(_", "self_", "._", "type_", ",_", "'", "UNK", "NOW", "N", " ", "(%", "d", ")'_", "%_", "self_", "._", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "QUE", "RY", "\\u", "CLASSES_", "._", "get_", "(_", "self_", "._", "cls_", ",_", "'", "UNK", "NOW", "N", " ", "(%", "d", ")'_", "%_", "self_", "._", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'<", "Query", " ", "%", "s", " ", "%", "s", " ", "%", "s", ">'_", "%_", "(_", "self_", "._", "name_", ",_", "t_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Query_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "Query", "(%", "r", ",", " ", "%", "r", ",", " ", "%", "r", ")'_", "%_", "(_", "str_", "(_", "self_", "._", "name_", ")_", ",_", "self_", "._", "type_", ",_", "self_", "._", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "RR", "Header_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "resource", " ", "record", " ", "header", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "fmt", ":", " ", "C", "{", "str", "}", " ", "speci", "fy", "ing", " ", "the", " ", "byte", " ", "format", " ", "of", " ", "an", " ", "RR", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "name", ":", " ", "The", " ", "name", " ", "abo", "ut", " ", "whi", "ch", " ", "this", " ", "repl", "y", " ", "contain", "s", " ", "informati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "type", ":", " ", "The", " ", "query", " ", "type", " ", "of", " ", "the", " ", "original", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "cls", ":", " ", "The", " ", "query", " ", "class", " ", "of", " ", "the", " ", "original", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "time", "-", "to", "-", "live", " ", "for", " ", "this", " ", "record", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "payload", ":", " ", "An", " ", "object", " ", "tha", "t", " ", "implement", "s", " ", "the", " ", "IE", "nco", "dable", " ", "interface", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "auth", ":", " ", "Whe", "ther", " ", "this", " ", "header", " ", "is", " ", "authori", "tative", " ", "or", " ", "not", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "name", "'_", ",_", "'", "type", "'_", ",_", "'", "cls", "'_", ",_", "'", "ttl", "'_", ",_", "'", "payload", "'_", ",_", "'", "auth", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fmt_", "=_", "\"!", "HH", "IH", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ttl_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rd", "length_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d", "Response_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RR", "Header_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", "=_", "''_", ",_", "type_", "=_", "A_", ",_", "cls_", "=_", "IN_", ",_", "ttl_", "=_", "0_", ",_", "payload_", "=_", "None_", ",_", "auth_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "The", " ", "name", " ", "abo", "ut", " ", "whi", "ch", " ", "this", " ", "repl", "y", " ", "contain", "s", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "type", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "type", ":", " ", "The", " ", "query", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "cls", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "cls", ":", " ", "The", " ", "query", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "ttl", ":", " ", "Time", " ", "to", " ", "live", " ", "for", " ", "this", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "payload", ":", " ", "An", " ", "object", " ", "implement", "ing", " ", "C", "{", "IE", "nco", "dable", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "payload", ":", " ", "A", " ", "Query", " ", "Type", " ", "specific", " ", "data", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "payload_", "is_", "None_", ")_", "or_", "(_", "payload_", "._", "TYPE_", "==_", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "name_", "=_", "Name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", "=_", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cls_", "=_", "cls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "ttl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "payload_", "=_", "payload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auth_", "=_", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RR", "Header_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "self_", "._", "fmt_", ",_", "self_", "._", "type_", ",_", "self_", "._", "cls_", ",_", "self_", "._", "ttl_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "payload_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "stri", "o_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "payload_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "af", "t_", "=_", "stri", "o_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "seek_", "(_", "prefix_", "-_", "2_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "H", "'_", ",_", "af", "t_", "-_", "prefix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "seek_", "(_", "af", "t_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RR", "Header_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "struct_", "._", "calcsize_", "(_", "self_", "._", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buff_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "struct_", "._", "unpack_", "(_", "self_", "._", "fmt_", ",_", "buff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", ",_", "self_", "._", "cls_", ",_", "self_", "._", "ttl_", ",_", "self_", "._", "rd", "length_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RR", "Header_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Author", "ita", "tive_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RR", "Header_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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 ", " _", "t_", "=_", "QUE", "RY", "\\u", "TYPES_", "._", "get_", "(_", "self_", "._", "type_", ",_", "EXT", "\\u", "QUE", "RIE", "S_", "._", "get_", "(_", "self_", "._", "type_", ",_", "'", "UNK", "NOW", "N", " ", "(%", "d", ")'_", "%_", "self_", "._", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "QUE", "RY", "\\u", "CLASSES_", "._", "get_", "(_", "self_", "._", "cls_", ",_", "'", "UNK", "NOW", "N", " ", "(%", "d", ")'_", "%_", "self_", "._", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'<", "RR", " ", "name", "=", "%", "s", " ", "type", "=", "%", "s", " ", "class", "=", "%", "s", " ", "ttl", "=", "%", "ds", " ", "auth", "=", "%", "s", ">'_", "%_", "(_", "self_", "._", "name_", ",_", "t_", ",_", "c_", ",_", "self_", "._", "ttl_", ",_", "self_", "._", "auth_", "and_", "'", "Tru", "e", "'_", "or_", "'", "Fal", "se", "'_", ")_", "\\u\\u\\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_", "Simple", "Record_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "Reso", "urc", "e", " ", "Record", " ", "whi", "ch", " ", "consi", "sts", " ", "of", " ", "a", " ", "single", " ", "RF", "C", " ", "103", "5", " ", "domain", "-", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "name", ":", " ", "The", " ", "name", " ", "associate", "d", " ", "with", " ", "this", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "(_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "name", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Simple", "Record_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "Name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Record_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Record_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Record_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "._", "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_", "Record", "\\u", "NS_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "authori", "tative", " ", "nameserv", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "NS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "NS", "'_", "\\u\\u\\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_", "Record", "\\u", "MD", "_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "mail", " ", "destinat", "ion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "record", " ", "type", " ", "is", " ", "obsolete", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "L", "{", "Record", "\\u", "MX", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MD", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MD", "'_", "\\u\\u\\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_", "Record", "\\u", "MF", "_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "mail", " ", "forward", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "record", " ", "type", " ", "is", " ", "obsolete", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "L", "{", "Record", "\\u", "MX", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MF", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MF", "'_", "\\u\\u\\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_", "Record", "\\u", "CNA", "ME_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "canonical", " ", "name", " ", "for", " ", "an", " ", "alias", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "CNA", "ME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "CNA", "ME", "'_", "\\u\\u\\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_", "Record", "\\u", "MB_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "mailbo", "x", " ", "domain", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MB_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MB", "'_", "\\u\\u\\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_", "Record", "\\u", "MG", "_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "mail", " ", "group", " ", "member", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MG", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MG", "'_", "\\u\\u\\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_", "Record", "\\u", "MR", "_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "mail", " ", "rename", " ", "domain", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MR", "'_", "\\u\\u\\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_", "Record", "\\u", "PTR", "_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "domain", " ", "name", " ", "point", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "PTR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "PTR", "'_", "\\u\\u\\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_", "Record", "\\u", "DNA", "ME_", "(_", "Simple", "Record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "non", "-", "termina", "l", " ", "DNS", " ", "name", " ", "redirection", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "record", " ", "type", " ", "provide", "s", " ", "the", " ", "capab", "ilit", "y", " ", "to", " ", "map", " ", "an", " ", "entire", " ", "subtree", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "DNS", " ", "name", " ", "space", " ", "to", " ", "anot", "her", " ", "domain", ".", " ", " ", "It", " ", "differs", " ", "from", " ", "the", " ", "CNA", "ME", " ", "record", " ", "whi", "ch", "\\", "10", ";", " ", " ", " ", " ", "maps", " ", "a", " ", "single", " ", "node", " ", "of", " ", "the", " ", "name", " ", "space", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "267", "2", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "336", "3", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "DNA", "ME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "DNA", "ME", "'_", "\\u\\u\\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_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "IP", "v", "4", " ", "host", " ", "address", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "address", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "address", ":", " ", "The", " ", "pack", "ed", " ", "network", "-", "order", " ", "represent", "ation", " ", "of", " ", "the", " ", "IP", "v", "4", " ", "address", "\\", "10", ";", " ", " ", " ", " ", "associate", "d", " ", "with", " ", "this", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "address", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "address_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "address_", "=_", "'", "0.", "0.", "0.", "0", "'_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "address_", "=_", "socket_", "._", "inet", "\\u", "ato", "n_", "(_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "address_", "=_", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "self_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "address_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "'<", "A", " ", "address", "=", "%", "s", " ", "ttl", "=", "%", "s", ">'_", "%_", "(_", "self_", "._", "dot", "ted", "Quad", "_", "(_", ")_", ",_", "self_", "._", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "dot", "ted", "Quad", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "socket_", "._", "inet", "\\u", "nto", "a_", "(_", "self_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Record", "\\u", "SOA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Mark", "s", " ", "the", " ", "start", " ", "of", " ", "a", " ", "zone", " ", "of", " ", "authori", "ty", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "record", " ", "descri", "bes", " ", "parameter", "s", " ", "whi", "ch", " ", "are", " ", "shared", " ", "by", " ", "all", " ", "record", "s", " ", "within", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "partic", "ular", " ", "zone", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "mn", "ame", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "mn", "ame", ":", " ", "The", " ", "domain", "-", "name", " ", "of", " ", "the", " ", "name", " ", "server", " ", "tha", "t", " ", "was", " ", "the", " ", "original", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "primary", " ", "source", " ", "of", " ", "data", " ", "for", " ", "this", " ", "zone", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "rnam", "e", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "rnam", "e", ":", " ", "A", " ", "domain", "-", "name", " ", "whi", "ch", " ", "speci", "fie", "s", " ", "the", " ", "mailbo", "x", " ", "of", " ", "the", " ", "person", "\\", "10", ";", " ", " ", " ", " ", "responsib", "le", " ", "for", " ", "this", " ", "zone", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "serial", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "serial", ":", " ", "The", " ", "unsigned", " ", "32", " ", "bit", " ", "version", " ", "number", " ", "of", " ", "the", " ", "original", " ", "copy", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "zone", ".", " ", " ", "Zon", "e", " ", "transfers", " ", "preserve", " ", "this", " ", "value", ".", " ", " ", "Thi", "s", " ", "value", " ", "wrap", "s", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "compare", "d", " ", "usi", "ng", " ", "sequence", " ", "space", " ", "arithmetic", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "refre", "sh", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "refre", "sh", ":", " ", "A", " ", "32", " ", "bit", " ", "time", " ", "interval", " ", "bef", "ore", " ", "the", " ", "zone", " ", "shou", "ld", " ", "be", " ", "refreshe", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "minim", "um", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "minim", "um", ":", " ", "The", " ", "unsigned", " ", "32", " ", "bit", " ", "minim", "um", " ", "TTL", " ", "field", " ", "tha", "t", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "exported", " ", "with", " ", "any", " ", "RR", " ", "from", " ", "this", " ", "zone", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "expir", "e", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "expir", "e", ":", " ", "A", " ", "32", " ", "bit", " ", "time", " ", "value", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", " ", "upper", " ", "limit", " ", "on", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "time", " ", "interval", " ", "tha", "t", " ", "can", " ", "ela", "pse", " ", "bef", "ore", " ", "the", " ", "zone", " ", "is", " ", "no", " ", "long", "er", "\\", "10", ";", " ", " ", " ", " ", "authori", "tative", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "retr", "y", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "retr", "y", ":", " ", "A", " ", "32", " ", "bit", " ", "time", " ", "interval", " ", "tha", "t", " ", "shou", "ld", " ", "ela", "pse", " ", "bef", "ore", " ", "a", " ", "fail", "ed", "\\", "10", ";", " ", " ", " ", " ", "refre", "sh", " ", "shou", "ld", " ", "be", " ", "retrie", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "default", " ", "TTL", " ", "to", " ", "use", " ", "for", " ", "record", "s", " ", "serve", "d", " ", "from", " ", "this", " ", "zone", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "SOA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "serial", "'_", ",_", "'", "mn", "ame", "'_", ",_", "'", "rnam", "e", "'_", ",_", "'", "refre", "sh", "'_", ",_", "'", "expir", "e", "'_", ",_", "'", "retr", "y", "'_", ",_", "'", "minim", "um", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "(_", "'", "mn", "ame", "'_", ",_", "'", "mn", "ame", "'_", ",_", "'%", "s", "'_", ")_", ",_", "(_", "'", "rnam", "e", "'_", ",_", "'", "rnam", "e", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "serial", "'_", ",_", "'", "refre", "sh", "'_", ",_", "'", "retr", "y", "'_", ",_", "'", "expir", "e", "'_", ",_", "'", "minim", "um", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "SOA", "_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "SOA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mname_", "=_", "''_", ",_", "rname_", "=_", "''_", ",_", "serial_", "=_", "0_", ",_", "refresh_", "=_", "0_", ",_", "retry_", "=_", "0_", ",_", "expire_", "=_", "0_", ",_", "minimum_", "=_", "0_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mname_", ",_", "self_", "._", "rname_", "=_", "Name_", "(_", "mname_", ")_", ",_", "Name_", "(_", "rname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "serial_", ",_", "self_", "._", "refresh_", "=_", "str2", "time_", "(_", "serial_", ")_", ",_", "str2", "time_", "(_", "refresh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "minimum_", ",_", "self_", "._", "expire_", "=_", "str2", "time_", "(_", "minimum_", ")_", ",_", "str2", "time_", "(_", "expire_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "retry_", "=_", "str2", "time_", "(_", "retry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "SOA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mname_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rname_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "struct_", "._", "pack_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'!", "Ll", "ll", "L", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "serial_", ",_", "self_", "._", "refresh_", ",_", "self_", "._", "retry_", ",_", "self_", "._", "expire_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "minimum_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "SOA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mname_", ",_", "self_", "._", "rname_", "=_", "Name_", "(_", ")_", ",_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mname_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rname_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "struct_", "._", "unpack_", "(_", "'!", "Ll", "ll", "L", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "20_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "serial_", ",_", "self_", "._", "refresh_", ",_", "self_", "._", "retry_", ",_", "self_", "._", "expire_", ",_", "self_", "._", "minimum_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "SOA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "serial_", ",_", "self_", "._", "mname_", ",_", "self_", "._", "rname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "refresh_", ",_", "self_", "._", "expire_", ",_", "self_", "._", "retry_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Record", "\\u", "NULL_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "null", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "NULL", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "compare", "Attributes_", "=_", "(_", "'", "payload", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "NULL_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "NULL_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "payload_", "=_", "None_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "payload_", "=_", "payload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "NULL_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "self_", "._", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "NULL_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "payload_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "NULL_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "._", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Record", "\\u", "WK", "S_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "well", " ", "know", "n", " ", "service", " ", "description", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "record", " ", "type", " ", "is", " ", "obsolete", ".", " ", " ", "See", " ", "L", "{", "Record", "\\u", "SRV", "}.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "address", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "address", ":", " ", "The", " ", "pack", "ed", " ", "network", "-", "order", " ", "represent", "ation", " ", "of", " ", "the", " ", "IP", "v", "4", " ", "address", "\\", "10", ";", " ", " ", " ", " ", "associate", "d", " ", "with", " ", "this", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "protoc", "ol", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "protoc", "ol", ":", " ", "The", " ", "8", " ", "bit", " ", "IP", " ", "protoc", "ol", " ", "number", " ", "for", " ", "whi", "ch", " ", "this", " ", "service", " ", "map", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "rele", "van", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "map", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "map", ":", " ", "A", " ", "bit", "vector", " ", "indicati", "ng", " ", "the", " ", "service", "s", " ", "avail", "able", " ", "at", " ", "the", " ", "specified", "\\", "10", ";", " ", " ", " ", " ", "address", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "\"", "WK", "S", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "address", "'_", ",_", "'", "protoc", "ol", "'_", ",_", "'", "map", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "[_", "(_", "'\\u", "address", "'_", ",_", "'", "address", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "protoc", "ol", "'_", ",_", "'", "ttl", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "WK", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "address_", "=_", "property_", "(_", "lambda_", "self_", ":_", "socket_", "._", "inet", "\\u", "nto", "a_", "(_", "self_", "._", "address_", ")_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "WK", "S_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "address_", "=_", "'", "0.", "0.", "0.", "0", "'_", ",_", "protocol_", "=_", "0_", ",_", "map_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "address_", "=_", "socket_", "._", "inet", "\\u", "ato", "n_", "(_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "protocol_", ",_", "self_", "._", "map_", "=_", "protocol_", ",_", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "WK", "S_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "self_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "B", "'_", ",_", "self_", "._", "protocol_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "self_", "._", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "WK", "S_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "address_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "protocol_", "=_", "struct_", "._", "unpack_", "(_", "'!", "B", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "length_", "-_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "WK", "S_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "._", "address_", ",_", "self_", "._", "protocol_", ",_", "self_", "._", "map_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "AAAA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "IP", "v6", " ", "host", " ", "address", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "address", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "address", ":", " ", "The", " ", "pack", "ed", " ", "network", "-", "order", " ", "represent", "ation", " ", "of", " ", "the", " ", "IP", "v6", " ", "address", "\\", "10", ";", " ", " ", " ", " ", "associate", "d", " ", "with", " ", "this", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "188", "6", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "AAAA", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "AAAA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "(_", "'\\u", "address", "'_", ",_", "'", "address", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "address", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "address_", "=_", "property_", "(_", "lambda_", "self_", ":_", "socket_", "._", "inet", "\\u", "nto", "p_", "(_", "AF", "\\u", "INE", "T6", "_", ",_", "self_", "._", "address_", ")_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "AAAA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "address_", "=_", "'::'", "_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "address_", "=_", "socket_", "._", "inet", "\\u", "pto", "n_", "(_", "AF", "\\u", "INE", "T6", "_", ",_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "AAAA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "self_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "AAAA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "address_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "AAAA", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "IP", "v6", " ", "address", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "prefix", "Len", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "prefix", "Len", ":", " ", "The", " ", "length", " ", "of", " ", "the", " ", "suff", "ix", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "suff", "ix", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "suff", "ix", ":", " ", "An", " ", "IP", "v6", " ", "address", " ", "suff", "ix", " ", "in", " ", "network", " ", "order", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "prefix", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "prefix", ":", " ", "If", " ", "specified", ",", " ", "a", " ", "name", " ", "whi", "ch", " ", "will", " ", "be", " ", "used", " ", "as", " ", "a", " ", "prefix", " ", "for", " ", "other", "\\", "10", ";", " ", " ", " ", " ", "A6", " ", "record", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "bytes", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "bytes", ":", " ", "The", " ", "length", " ", "of", " ", "the", " ", "prefix", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "287", "4", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "336", "3", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "336", "4", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "A6", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "A6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "(_", "'\\u", "suff", "ix", "'_", ",_", "'", "suff", "ix", "'_", ",_", "'%", "s", "'_", ")_", ",_", "(_", "'", "prefix", "'_", ",_", "'", "prefix", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "prefix", "Len", "'_", ",_", "'", "prefix", "'_", ",_", "'", "suff", "ix", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "suffix_", "=_", "property_", "(_", "lambda_", "self_", ":_", "socket_", "._", "inet", "\\u", "nto", "p_", "(_", "AF", "\\u", "INE", "T6", "_", ",_", "self_", "._", "suffix_", ")_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "prefix", "Len_", "=_", "0_", ",_", "suffix_", "=_", "'::'", "_", ",_", "prefix_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prefix", "Len_", "=_", "prefix", "Len_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "suffix_", "=_", "socket_", "._", "inet", "\\u", "pto", "n_", "(_", "AF", "\\u", "INE", "T6", "_", ",_", "suffix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefix_", "=_", "Name_", "(_", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bytes_", "=_", "int_", "(_", "(_", "128_", "-_", "self_", "._", "prefix", "Len_", ")_", "/_", "8.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "B", "'_", ",_", "self_", "._", "prefix", "Len_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "bytes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "self_", "._", "suffix_", "[_", "-_", "self_", "._", "bytes_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "prefix", "Len_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "may", " ", "not", " ", "be", " ", "compressed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prefix_", "._", "encode_", "(_", "stri", "o_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prefix", "Len_", "=_", "struct_", "._", "unpack_", "(_", "'!", "B", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bytes_", "=_", "int_", "(_", "(_", "128_", "-_", "self_", "._", "prefix", "Len_", ")_", "/_", "8.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "bytes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "suffix_", "=_", "'\\\\", "x0", "0", "'_", "*_", "(_", "16_", "-_", "self_", "._", "bytes_", ")_", "+_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "self_", "._", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "prefix", "Len_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "prefix_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\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", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "Record", "\\u", "A6", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "prefix", "Len_", "==_", "other_", "._", "prefix", "Len_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "suffix_", "[_", "-_", "self_", "._", "bytes_", ":_", "]_", "==_", "other_", "._", "suffix_", "[_", "-_", "self_", "._", "bytes_", ":_", "]_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prefix_", "==_", "other_", "._", "prefix_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ttl_", "==_", "other_", "._", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "._", "prefix", "Len_", ",_", "self_", "._", "suffix_", "[_", "-_", "self_", "._", "bytes_", ":_", "]_", ",_", "self_", "._", "prefix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "A6", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "'<", "A6", " ", "%", "s", " ", "%", "s", " ", "(%", "d", ")", " ", "ttl", "=", "%", "s", ">'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "socket_", "._", "inet", "\\u", "nto", "p_", "(_", "AF", "\\u", "INE", "T6", "_", ",_", "self_", "._", "suffix_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prefix", "Len_", ",_", "self_", "._", "ttl_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Record", "\\u", "SRV", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "location", " ", "of", " ", "the", " ", "server", "(", "s", ")", " ", "for", " ", "a", " ", "specific", " ", "protoc", "ol", " ", "and", " ", "domain", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "priorit", "y", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "priorit", "y", ":", " ", "The", " ", "priorit", "y", " ", "of", " ", "this", " ", "target", " ", "host", ".", " ", " ", "A", " ", "client", " ", "MUS", "T", " ", "atte", "mpt", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "contact", " ", "the", " ", "target", " ", "host", " ", "with", " ", "the", " ", "lowe", "st", "-", "numbered", " ", "priorit", "y", " ", "it", " ", "can", " ", "reach", ";", "\\", "10", ";", " ", " ", " ", " ", "target", " ", "host", "s", " ", "with", " ", "the", " ", "same", " ", "priorit", "y", " ", "SHO", "UL", "D", " ", "be", " ", "trie", "d", " ", "in", " ", "an", " ", "order", " ", "defin", "ed", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "the", " ", "weight", " ", "field", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "weight", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "weight", ":", " ", "Specifie", "s", " ", "a", " ", "relative", " ", "weight", " ", "for", " ", "entri", "es", " ", "with", " ", "the", " ", "same", "\\", "10", ";", " ", " ", " ", " ", "priorit", "y", ".", " ", "Large", "r", " ", "weight", "s", " ", "SHO", "UL", "D", " ", "be", " ", "give", "n", " ", "a", " ", "proportion", "ate", "ly", " ", "higher", "\\", "10", ";", " ", " ", " ", " ", "probabilit", "y", " ", "of", " ", "bei", "ng", " ", "selecte", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "port", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "port", ":", " ", "The", " ", "port", " ", "on", " ", "this", " ", "target", " ", "host", " ", "of", " ", "this", " ", "service", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "target", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "target", ":", " ", "The", " ", "domain", " ", "name", " ", "of", " ", "the", " ", "target", " ", "host", ".", " ", " ", "There", " ", "MUS", "T", " ", "be", " ", "one", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "more", " ", "address", " ", "record", "s", " ", "for", " ", "this", " ", "name", ",", " ", "the", " ", "name", " ", "MUS", "T", " ", "NOT", " ", "be", " ", "an", " ", "alias", " ", "(", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "sense", " ", "of", " ", "RF", "C", " ", "103", "4", " ", "or", " ", "RF", "C", " ", "218", "1", ").", " ", " ", "Impl", "ement", "ors", " ", "are", " ", "urg", "ed", ",", " ", "but", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "require", "d", ",", " ", "to", " ", "return", " ", "the", " ", "address", " ", "record", "(", "s", ")", " ", "in", " ", "the", " ", "Addition", "al", " ", "Data", "\\", "10", ";", " ", " ", " ", " ", "section", ".", " ", " ", "Un", "less", " ", "and", " ", "unti", "l", " ", "permit", "ted", " ", "by", " ", "future", " ", "standard", "s", " ", "action", ",", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "compress", "ion", " ", "is", " ", "not", " ", "to", " ", "be", " ", "used", " ", "for", " ", "this", " ", "field", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "278", "2", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "SRV", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "SRV", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "priorit", "y", "'_", ",_", "'", "weight", "'_", ",_", "'", "target", "'_", ",_", "'", "port", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "'", "priorit", "y", "'_", ",_", "'", "weight", "'_", ",_", "(_", "'", "target", "'_", ",_", "'", "target", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "port", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "SRV", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "priority_", "=_", "0_", ",_", "weight_", "=_", "0_", ",_", "port_", "=_", "0_", ",_", "target_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "priority_", "=_", "int_", "(_", "priority_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "weight_", "=_", "int_", "(_", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "port_", "=_", "int_", "(_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "=_", "Name_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "SRV", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "HHH", "'_", ",_", "self_", "._", "priority_", ",_", "self_", "._", "weight_", ",_", "self_", "._", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "can", "'", "t", " ", "be", " ", "compressed_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "target_", "._", "encode_", "(_", "stri", "o_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "SRV", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "struct_", "._", "unpack_", "(_", "'!", "HHH", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "struct_", "._", "calcsize_", "(_", "'!", "HHH", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "priority_", ",_", "self_", "._", "weight_", ",_", "self_", "._", "port_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "=_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "SRV", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "._", "priority_", ",_", "self_", "._", "weight_", ",_", "self_", "._", "port_", ",_", "self_", "._", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "NA", "PTR", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "location", " ", "of", " ", "the", " ", "server", "(", "s", ")", " ", "for", " ", "a", " ", "specific", " ", "protoc", "ol", " ", "and", " ", "domain", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "order", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "order", ":", " ", "An", " ", "integ", "er", " ", "speci", "fy", "ing", " ", "the", " ", "order", " ", "in", " ", "whi", "ch", " ", "the", " ", "NA", "PTR", " ", "record", "s", "\\", "10", ";", " ", " ", " ", " ", "MUS", "T", " ", "be", " ", "process", "ed", " ", "to", " ", "ensure", " ", "the", " ", "correct", " ", "orderi", "ng", " ", "of", " ", "rule", "s", ".", " ", " ", "Lo", "w", " ", "numbers", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "process", "ed", " ", "bef", "ore", " ", "high", " ", "numbers", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "preference", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "preference", ":", " ", "An", " ", "integ", "er", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", " ", "order", " ", "in", " ", "whi", "ch", " ", "NA", "PTR", "\\", "10", ";", " ", " ", " ", " ", "record", "s", " ", "with", " ", "equal", " ", "\"", "order", "\"", " ", "values", " ", "SHO", "UL", "D", " ", "be", " ", "process", "ed", ",", " ", "low", " ", "numbers", "\\", "10", ";", " ", " ", " ", " ", "bei", "ng", " ", "process", "ed", " ", "bef", "ore", " ", "high", " ", "numbers", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "flag", ":", " ", "L", "{", "Char", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "flag", ":", " ", "A", " ", "<", "character", "-", "string", ">", " ", "contain", "ing", " ", "flags", " ", "to", " ", "control", " ", "aspect", "s", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "rew", "riti", "ng", " ", "and", " ", "interpretation", " ", "of", " ", "the", " ", "fields", " ", "in", " ", "the", " ", "record", ".", " ", " ", "Fla", "gs", "\\", "10", ";", " ", " ", " ", " ", "ares", "ingl", "e", " ", "character", "s", " ", "from", " ", "the", " ", "set", " ", "[", "A", "-", "Z", "0", "-", "9", "].", " ", " ", "The", " ", "case", " ", "of", " ", "the", " ", "alphabetic", "\\", "10", ";", " ", " ", " ", " ", "character", "s", " ", "is", " ", "not", " ", "significant", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "At", " ", "this", " ", "time", " ", "only", " ", "four", " ", "flags", ",", " ", "\"", "S", "\",", " ", "\"", "A", "\",", " ", "\"", "U", "\",", " ", "and", " ", "\"", "P", "\",", " ", "are", " ", "defin", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "service", ":", " ", "L", "{", "Char", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "service", ":", " ", "Specifie", "s", " ", "the", " ", "service", "(", "s", ")", " ", "avail", "able", " ", "down", " ", "this", " ", "rewrite", " ", "path", ".", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "may", " ", "als", "o", " ", "speci", "fy", " ", "the", " ", "partic", "ular", " ", "protoc", "ol", " ", "tha", "t", " ", "is", " ", "used", " ", "to", " ", "talk", " ", "with", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "service", ".", " ", " ", "A", " ", "protoc", "ol", " ", "MUS", "T", " ", "be", " ", "specified", " ", "if", " ", "the", " ", "flags", " ", "field", " ", "state", "s", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "NA", "PTR", " ", "is", " ", "termina", "l", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "regexp", ":", " ", "L", "{", "Char", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "regexp", ":", " ", "A", " ", "STRING", " ", "contain", "ing", " ", "a", " ", "substitution", " ", "express", "ion", " ", "tha", "t", " ", "is", " ", "applied", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "original", " ", "string", " ", "hel", "d", " ", "by", " ", "the", " ", "client", " ", "in", " ", "order", " ", "to", " ", "construct", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "next", " ", "domain", " ", "name", " ", "to", " ", "look", "up", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "replace", "ment", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "replace", "ment", ":", " ", "The", " ", "next", " ", "NAME", " ", "to", " ", "query", " ", "for", " ", "NA", "PTR", ",", " ", "SRV", ",", " ", "or", " ", "address", "\\", "10", ";", " ", " ", " ", " ", "record", "s", " ", "depend", "ing", " ", "on", " ", "the", " ", "value", " ", "of", " ", "the", " ", "flags", " ", "field", ".", " ", " ", "Thi", "s", " ", "MUS", "T", " ", "be", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "full", "y", " ", "qualified", " ", "domain", "-", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "291", "5", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "NA", "PTR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "order", "'_", ",_", "'", "preference", "'_", ",_", "'", "flags", "'_", ",_", "'", "service", "'_", ",_", "'", "regexp", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "replace", "ment", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "NA", "PTR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "'", "order", "'_", ",_", "'", "preference", "'_", ",_", "(_", "'", "flags", "'_", ",_", "'", "flags", "'_", ",_", "'%", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "service", "'_", ",_", "'", "service", "'_", ",_", "'%", "s", "'_", ")_", ",_", "(_", "'", "regexp", "'_", ",_", "'", "regexp", "'_", ",_", "'%", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "replace", "ment", "'_", ",_", "'", "replace", "ment", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "NA", "PTR", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "order_", "=_", "0_", ",_", "preference_", "=_", "0_", ",_", "flags_", "=_", "''_", ",_", "service_", "=_", "''_", ",_", "regexp_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "replacement_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "order_", "=_", "int_", "(_", "order_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "preference_", "=_", "int_", "(_", "preference_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "=_", "Char", "str_", "(_", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "=_", "Char", "str_", "(_", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "regexp_", "=_", "Char", "str_", "(_", "regexp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "replacement_", "=_", "Name_", "(_", "replacement_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "NA", "PTR", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "HH", "'_", ",_", "self_", "._", "order_", ",_", "self_", "._", "preference_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "can", "'", "t", " ", "be", " ", "compressed_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "flags_", "._", "encode_", "(_", "stri", "o_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "._", "encode_", "(_", "stri", "o_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "regexp_", "._", "encode_", "(_", "stri", "o_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "replacement_", "._", "encode_", "(_", "stri", "o_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "NA", "PTR", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "struct_", "._", "unpack_", "(_", "'!", "HH", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "struct_", "._", "calcsize_", "(_", "'!", "HH", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "order_", ",_", "self_", "._", "preference_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "=_", "Char", "str_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "=_", "Char", "str_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "regexp_", "=_", "Char", "str_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "replacement_", "=_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "regexp_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "replacement_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "NA", "PTR", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "order_", ",_", "self_", "._", "preference_", ",_", "self_", "._", "flags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "service_", ",_", "self_", "._", "regexp_", ",_", "self_", "._", "replacement_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "AF", "SD", "B_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Map", " ", "from", " ", "a", " ", "domain", " ", "name", " ", "to", " ", "the", " ", "name", " ", "of", " ", "an", " ", "AF", "S", " ", "cell", " ", "databa", "se", " ", "server", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "subt", "ype", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "subt", "ype", ":", " ", "In", " ", "the", " ", "case", " ", "of", " ", "subt", "ype", " ", "1", ",", " ", "the", " ", "host", " ", "has", " ", "an", " ", "AF", "S", " ", "version", " ", "3.0", "\\", "10", ";", " ", " ", " ", " ", "Volume", " ", "Locat", "ion", " ", "Server", " ", "for", " ", "the", " ", "named", " ", "AF", "S", " ", "cell", ".", " ", " ", "In", " ", "the", " ", "case", " ", "of", " ", "subt", "ype", "\\", "10", ";", " ", " ", " ", " ", "2", ",", " ", "the", " ", "host", " ", "has", " ", "an", " ", "authenticat", "ed", " ", "name", " ", "server", " ", "holding", " ", "the", " ", "cell", "-", "root", "\\", "10", ";", " ", " ", " ", " ", "director", "y", " ", "node", " ", "for", " ", "the", " ", "named", " ", "DC", "E", "/", "NC", "A", " ", "cell", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "host", "name", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "host", "name", ":", " ", "The", " ", "domain", " ", "name", " ", "of", " ", "a", " ", "host", " ", "tha", "t", " ", "has", " ", "a", " ", "server", " ", "for", " ", "the", " ", "cell", "\\", "10", ";", " ", " ", " ", " ", "named", " ", "by", " ", "this", " ", "record", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "118", "3", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "AF", "SD", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "AF", "SD", "B", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "subt", "ype", "'_", ",_", "'", "host", "name", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "'", "subt", "ype", "'_", ",_", "(_", "'", "host", "name", "'_", ",_", "'", "host", "name", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "AF", "SD", "B_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "subtype_", "=_", "0_", ",_", "hostname_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "subtype_", "=_", "int_", "(_", "subtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hostname_", "=_", "Name_", "(_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "AF", "SD", "B_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "H", "'_", ",_", "self_", "._", "subtype_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hostname_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "AF", "SD", "B_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "struct_", "._", "unpack_", "(_", "'!", "H", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "struct_", "._", "calcsize_", "(_", "'!", "H", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subtype_", ",_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hostname_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "AF", "SD", "B_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "._", "subtype_", ",_", "self_", "._", "hostname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "RP", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "responsib", "le", " ", "person", " ", "for", " ", "a", " ", "domain", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "mbox", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "mbox", ":", " ", "A", " ", "domain", " ", "name", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", " ", "mailbo", "x", " ", "for", " ", "the", " ", "responsib", "le", "\\", "10", ";", " ", " ", " ", " ", "person", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "txt", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "txt", ":", " ", "A", " ", "domain", " ", "name", " ", "for", " ", "whi", "ch", " ", "TXT", " ", "RR", "'", "s", " ", "exist", " ", "(", "indirect", "ion", " ", "through", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "allow", "s", " ", "informati", "on", " ", "shar", "ing", " ", "abo", "ut", " ", "the", " ", "content", "s", " ", "of", " ", "this", " ", "RP", " ", "record", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "see", ":", " ", "U", "{", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "118", "3", ".", "html", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "RP", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "RP", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "mbox", "'_", ",_", "'", "txt", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "(_", "'", "mbox", "'_", ",_", "'", "mbox", "'_", ",_", "'%", "s", "'_", ")_", ",_", "(_", "'", "txt", "'_", ",_", "'", "txt", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "RP", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mbox", "_", "=_", "''_", ",_", "txt_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mbox", "_", "=_", "Name_", "(_", "mbox", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "txt_", "=_", "Name_", "(_", "txt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "RP", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mbox", "_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "txt_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "RP", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mbox", "_", "=_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "txt_", "=_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mbox", "_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "txt_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "RP", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "._", "mbox", "_", ",_", "self_", "._", "txt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "HI", "NF", "O_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Host", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "cpu", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "cpu", ":", " ", "Specifie", "s", " ", "the", " ", "CPU", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "os", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "os", ":", " ", "Specifie", "s", " ", "the", " ", "OS", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "HI", "NF", "O_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "HI", "NF", "O", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "compare", "Attributes_", "=_", "(_", "'", "cpu", "'_", ",_", "'", "os", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "HI", "NF", "O_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "cpu_", "=_", "''_", ",_", "os_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cpu_", ",_", "self_", "._", "os_", "=_", "cpu_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "HI", "NF", "O_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "B", "'_", ",_", "len_", "(_", "self_", "._", "cpu_", ")_", ")_", "+_", "self_", "._", "cpu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "B", "'_", ",_", "len_", "(_", "self_", "._", "os_", ")_", ")_", "+_", "self_", "._", "os_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "HI", "NF", "O_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cpu_", "=_", "struct_", "._", "unpack_", "(_", "'!", "B", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cpu_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "cpu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "=_", "struct_", "._", "unpack_", "(_", "'!", "B", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "os_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "os_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "HI", "NF", "O_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "Record", "\\u", "HI", "NF", "O_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "os_", "._", "lower_", "(_", ")_", "==_", "other_", "._", "os_", "._", "lower_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cpu_", "._", "lower_", "(_", ")_", "==_", "other_", "._", "cpu_", "._", "lower_", "(_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ttl_", "==_", "other_", "._", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "HI", "NF", "O_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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_", "._", "os_", "._", "lower_", "(_", ")_", ",_", "self_", "._", "cpu_", "._", "lower_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "MIN", "FO", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Mail", "box", " ", "or", " ", "mail", " ", "list", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "experimental", " ", "record", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "rma", "il", "bx", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "rma", "il", "bx", ":", " ", "A", " ", "domain", "-", "name", " ", "whi", "ch", " ", "speci", "fie", "s", " ", "a", " ", "mailbo", "x", " ", "whi", "ch", " ", "is", " ", "responsib", "le", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "the", " ", "mailing", " ", "list", " ", "or", " ", "mailbo", "x", ".", " ", " ", "If", " ", "this", " ", "domain", " ", "name", " ", "names", " ", "the", " ", "root", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "owner", " ", "of", " ", "the", " ", "MIN", "FO", " ", "RR", " ", "is", " ", "responsib", "le", " ", "for", " ", "its", "elf", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "email", "bx", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "email", "bx", ":", " ", "A", " ", "domain", "-", "name", " ", "whi", "ch", " ", "speci", "fie", "s", " ", "a", " ", "mailbo", "x", " ", "whi", "ch", " ", "is", " ", "to", " ", "receive", "\\", "10", ";", " ", " ", " ", " ", "error", " ", "message", "s", " ", "relate", "d", " ", "to", " ", "the", " ", "mailing", " ", "list", " ", "or", " ", "mailbo", "x", " ", "specified", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "owner", " ", "of", " ", "the", " ", "MIN", "FO", " ", "record", ".", " ", " ", "If", " ", "this", " ", "domain", " ", "name", " ", "names", " ", "the", " ", "root", ",", " ", "error", "s", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "return", "ed", " ", "to", " ", "the", " ", "sender", " ", "of", " ", "the", " ", "message", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MIN", "FO", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rma", "il", "bx_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email", "bx_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MIN", "FO", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "rma", "il", "bx", "'_", ",_", "'", "email", "bx", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "(_", "'", "rma", "il", "bx", "'_", ",_", "'", "responsib", "ilit", "y", "'_", ",_", "'%", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "email", "bx", "'_", ",_", "'", "error", "s", "'_", ",_", "'%", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "MIN", "FO", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "rma", "il", "bx_", "=_", "''_", ",_", "email", "bx_", "=_", "''_", ",_", "ttl_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rma", "il", "bx_", ",_", "self_", "._", "email", "bx_", "=_", "Name_", "(_", "rma", "il", "bx_", ")_", ",_", "Name_", "(_", "email", "bx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MIN", "FO", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rma", "il", "bx_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "email", "bx_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MIN", "FO", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rma", "il", "bx_", ",_", "self_", "._", "email", "bx_", "=_", "Name_", "(_", ")_", ",_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rma", "il", "bx_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "email", "bx_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MIN", "FO", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\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_", "._", "rma", "il", "bx_", ",_", "self_", "._", "email", "bx_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Record", "\\u", "MX", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Mail", " ", "exchange", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "preference", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "preference", ":", " ", "Specifie", "s", " ", "the", " ", "preference", " ", "give", "n", " ", "to", " ", "this", " ", "RR", " ", "amo", "ng", " ", "other", "s", " ", "at", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "same", " ", "owner", ".", " ", " ", "Lower", " ", "values", " ", "are", " ", "prefer", "red", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "L", "{", "Name", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "name", ":", " ", "A", " ", "domain", "-", "name", " ", "whi", "ch", " ", "speci", "fie", "s", " ", "a", " ", "host", " ", "will", "ing", " ", "to", " ", "act", " ", "as", " ", "a", " ", "mail", "\\", "10", ";", " ", " ", " ", " ", "exchange", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "MX", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "MX", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "Attributes_", "=_", "(_", "'", "preference", "'_", ",_", "'", "name", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "(_", "'", "preference", "'_", ",_", "(_", "'", "name", "'_", ",_", "'", "name", "'_", ",_", "'%", "s", "'_", ")_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "exchange_", "=_", "property_", "(_", "exchange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MX", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "preference_", "=_", "0_", ",_", "name_", "=_", "''_", ",_", "ttl_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "preference_", ",_", "self_", "._", "name_", "=_", "int_", "(_", "preference_", ")_", ",_", "Name_", "(_", "kwargs_", "._", "get_", "(_", "'", "exchange", "'_", ",_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MX", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "H", "'_", ",_", "self_", "._", "preference_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "._", "encode_", "(_", "stri", "o_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MX", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "preference_", "=_", "struct_", "._", "unpack_", "(_", "'!", "H", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "2_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MX", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exchange_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "use", " ", "Record", "\\u", "MX", ".", "name", " ", "inst", "ead", "\"_", ",_", "Dep", "reca", "tion", "Warning_", ",_", "stacklevel_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "MX", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ")_", ":_", "\\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 ", " _", "return_", "hash_", "(_", "(_", "self_", "._", "preference_", ",_", "self_", "._", "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_", "Record", "\\u", "TXT", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Free", "form", " ", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "data", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "data", ":", " ", "Free", "form", " ", "text", " ", "whi", "ch", " ", "make", "s", " ", "up", " ", "this", " ", "record", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implements_", "(_", "IE", "nco", "dable", "_", ",_", "IR", "ecor", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TYPE_", "=_", "TXT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fancy", "basename_", "=_", "'", "TXT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Attributes_", "=_", "compare", "Attributes_", "=_", "(_", "'", "data", "'_", ",_", "'", "ttl", "'_", ")_", "\\u\\u\\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_", "[SEP]_", "class_", "Record", "\\u", "TXT", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "data_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "data_", "=_", "list_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "arg", " ", "man", " ", "python", " ", "suc", "ks", " ", "so", " ", "bad_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ttl_", "=_", "str2", "time_", "(_", "kw_", "._", "get_", "(_", "'", "ttl", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "TXT", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ",_", "comp", "Dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "d_", "in_", "self_", "._", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "B", "'_", ",_", "len_", "(_", "d_", ")_", ")_", "+_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "TXT", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "so", "Far", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "so", "Far", "_", "<_", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "struct_", "._", "unpack_", "(_", "'!", "B", "'_", ",_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "1_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "._", "append_", "(_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "L_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "so", "Far", "_", "+=_", "L_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "so", "Far", "_", "!=_", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "msg_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Decode", "d", " ", "%", "d", " ", "bytes", " ", "in", " ", "%", "s", " ", "record", ",", " ", "but", " ", "rd", "length", " ", "is", " ", "%", "d", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "so", "Far", "_", ",_", "self_", "._", "fancy", "basename_", ",_", "length_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Record", "\\u", "TXT", "_", "(_", "tpu", "til_", "._", "Fan", "cy", "Eq", "Mixin_", ",_", "tpu", "til_", "._", "Fan", "cy", "Str", "Mixin_", ")_", ":_", "\\u\\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", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "tuple_", "(_", "self_", "._", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Record", "\\u", "SP", "F_", "(_", "Record", "\\u", "TXT", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Structur", "ally", ",", " ", "free", "form", " ", "text", ".", " ", "Semantic", "ally", ",", " ", "a", " ", "policy", " ", "definit", "ion", ",", " ", "format", "ted", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "defin", "ed", " ", "in", " ", "U", "{", "rfc", " ", "440", "8", "<", "http", "://", "www", ".", "faq", "s", ".", "org", "/", "rfc", "s", "/", "rfc", "440", "8", ".", "html", ">}", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "data", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "data", ":", " ", "Free", "form", " ", "text", " ", "whi", "ch", " ", "make", "s", " ", "up", " ", "this", " ", "record", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ttl", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ttl", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "second", "s", " ", "whi", "ch", " ", "this", " ", "record", " ", "shou", "ld", " ", "be", " ", "cache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TYPE_", "=_", "SP", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fancy", "basename_", "=_", "'", "SP", "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_", "class_", "Message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "L", "{", "Messag", "e", "}", " ", "contain", "s", " ", "all", " ", "the", " ", "informati", "on", " ", "represent", "ed", " ", "by", " ", "a", " ", "single", "\\", "10", ";", " ", " ", " ", " ", "DNS", " ", "request", " ", "or", " ", "response", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "Fmt", "_", "=_", "\"!", "H2", "B4", "H", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "Size_", "=_", "struct_", "._", "calcsize_", "(_", "header", "Fmt", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Quest", "ion", ",", " ", "answer", ",", " ", "addition", "al", ",", " ", "and", " ", "nameserv", "er", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "queries_", "=_", "answers_", "=_", "add_", "=_", "ns_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "mapping", " ", "from", " ", "record", " ", "types", " ", "to", " ", "thei", "r", " ", "correspond", "ing", " ", "Record", "\\u*", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "classe", "s", ".", " ", " ", "Thi", "s", " ", "relie", "s", " ", "on", " ", "the", " ", "global", " ", "state", " ", "whi", "ch", " ", "has", " ", "bee", "n", " ", "created", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "far", " ", "in", " ", "initiali", "zin", "g", " ", "this", " ", "module", " ", "(", "so", " ", "don", "'", "t", " ", "defin", "e", " ", "Record", " ", "classe", "s", " ", "after_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "record", "Types_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "globals_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "._", "startswith_", "(_", "'", "Record", "\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "record", "Types_", "[_", "globals_", "(_", ")_", "[_", "name_", "]_", "._", "TYPE_", "]_", "=_", "globals_", "(_", ")_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clear", " ", "the", " ", "iterati", "on", " ", "variab", "le", " ", "out", " ", "of", " ", "the", " ", "class", " ", "namespace", " ", "so", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "sn", "'", "t", " ", "bec", "ome", " ", "an", " ", "attribute", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "id_", "=_", "0_", ",_", "answer_", "=_", "0_", ",_", "op", "Code_", "=_", "0_", ",_", "rec", "Des", "_", "=_", "0_", ",_", "rec", "Av", "_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "auth_", "=_", "0_", ",_", "r", "Code_", "=_", "OK_", ",_", "trunc", "_", "=_", "0_", ",_", "max", "Size_", "=_", "512_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "max", "Size_", "=_", "max", "Size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "answer_", "=_", "answer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "op", "Code_", "=_", "op", "Code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auth_", "=_", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "trunc", "_", "=_", "trunc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rec", "Des", "_", "=_", "rec", "Des", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rec", "Av", "_", "=_", "rec", "Av", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "r", "Code_", "=_", "r", "Code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queries_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "answers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "authority_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "additional_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Query_", "(_", "self_", ",_", "name_", ",_", "type_", "=_", "ALL", "\\u", "RECORD", "S_", ",_", "cls_", "=_", "IN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "anot", "her", " ", "query", " ", "to", " ", "this", " ", "Messag", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "The", " ", "name", " ", "to", " ", "query", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "type", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "type", ":", " ", "Query", " ", "type", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "cls", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "cls", ":", " ", "Query", " ", "class", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queries_", "._", "append_", "(_", "Query_", "(_", "name_", ",_", "type_", ",_", "cls_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode_", "(_", "self_", ",_", "stri", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "comp", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body", "\\u", "tmp_", "=_", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "q_", "in_", "self_", "._", "queries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "._", "encode_", "(_", "body", "\\u", "tmp_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "q_", "in_", "self_", "._", "answers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "._", "encode_", "(_", "body", "\\u", "tmp_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "q_", "in_", "self_", "._", "authority_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "._", "encode_", "(_", "body", "\\u", "tmp_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "q_", "in_", "self_", "._", "additional_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "._", "encode_", "(_", "body", "\\u", "tmp_", ",_", "comp", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "=_", "body", "\\u", "tmp_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "len_", "(_", "body_", ")_", "+_", "self_", "._", "header", "Size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "max", "Size_", "and_", "size_", ">_", "self_", "._", "max", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "trunc", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "body_", "[_", ":_", "self_", "._", "max", "Size_", "-_", "self_", "._", "header", "Size_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "byte", "3_", "=_", "(_", "(_", "(_", "self_", "._", "answer_", "&_", "1_", ")_", "<<_", "7_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "|_", "(_", "(_", "self_", "._", "op", "Code_", "&_", "0xf", "_", ")_", "<<_", "3_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "|_", "(_", "(_", "self_", "._", "auth_", "&_", "1_", ")_", "<<_", "2_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "|_", "(_", "(_", "self_", "._", "trunc", "_", "&_", "1_", ")_", "<<_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "|_", "(_", "self_", "._", "rec", "Des", "_", "&_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "byte", "4_", "=_", "(_", "(_", "(_", "self_", "._", "rec", "Av", "_", "&_", "1_", ")_", "<<_", "7_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "|_", "(_", "self_", "._", "r", "Code_", "&_", "0xf", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "self_", "._", "header", "Fmt", "_", ",_", "self_", "._", "id_", ",_", "byte", "3_", ",_", "byte", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "self_", "._", "queries_", ")_", ",_", "len_", "(_", "self_", "._", "answers_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "self_", "._", "authority_", ")_", ",_", "len_", "(_", "self_", "._", "additional_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stri", "o_", "._", "write_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode_", "(_", "self_", ",_", "stri", "o_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "max", "Size_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "=_", "read", "Precis", "el", "y_", "(_", "stri", "o_", ",_", "self_", "._", "header", "Size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "struct_", "._", "unpack_", "(_", "self_", "._", "header", "Fmt", "_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", ",_", "byte", "3_", ",_", "byte", "4_", ",_", "nq", "uer", "ies_", ",_", "nans", "_", ",_", "nn", "s_", ",_", "nad", "d_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "answer_", "=_", "(_", "byte", "3_", ">>_", "7_", ")_", "&_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "op", "Code_", "=_", "(_", "byte", "3_", ">>_", "3_", ")_", "&_", "0xf", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auth_", "=_", "(_", "byte", "3_", ">>_", "2_", ")_", "&_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "trunc", "_", "=_", "(_", "byte", "3_", ">>_", "1_", ")_", "&_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rec", "Des", "_", "=_", "byte", "3_", "&_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rec", "Av", "_", "=_", "(_", "byte", "4_", ">>_", "7_", ")_", "&_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "r", "Code_", "=_", "byte", "4_", "&_", "0xf", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "queries_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "nq", "uer", "ies_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "Query_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "EO", "FE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "queries_", "._", "append_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "=_", "(_", "(_", "self_", "._", "answers_", ",_", "nans", "_", ")_", ",_", "(_", "self_", "._", "authority_", ",_", "nn", "s_", ")_", ",_", "(_", "self_", "._", "additional_", ",_", "nad", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "l_", ",_", "n_", ")_", "in_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parse", "Records_", "(_", "l_", ",_", "n_", ",_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\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", "Records_", "(_", "self_", ",_", "list_", ",_", "num_", ",_", "stri", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "RR", "Header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "EO", "FE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "self_", "._", "look", "up", "Record", "Type_", "(_", "header_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "t_", ":_", "\\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_", "header_", "._", "payload_", "=_", "t_", "(_", "ttl_", "=_", "header_", "._", "ttl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "._", "payload_", "._", "decode_", "(_", "stri", "o_", ",_", "header_", "._", "rd", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "EO", "FE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "list_", "._", "append_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "look", "up", "Record", "Type_", "(_", "self_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Retrieve", " ", "the", " ", "L", "{", "IR", "ecor", "d", "}", " ", "implementation", " ", "for", " ", "the", " ", "give", "n", " ", "record", " ", "type", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "type", ":", " ", "A", " ", "record", " ", "type", ",", " ", "suc", "h", " ", "as", " ", "L", "{", "A", "}", " ", "or", " ", "L", "{", "NS", "}.", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "type", ":", " ", "C", "{", "int", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "An", " ", "object", " ", "whi", "ch", " ", "implement", "s", " ", "L", "{", "IR", "ecor", "d", "}", " ", "or", " ", "C", "{", "Non", "e", "}", " ", "if", " ", "none", "\\", "10", ";", " ", " ", " ", " ", "can", " ", "be", " ", "found", " ", "for", " ", "the", " ", "give", "n", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "L", "{", "types", ".", "Class", "Type", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "record", "Types_", "._", "get_", "(_", "type_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "Str_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "=_", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "encode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "stri", "o_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "from", "Str_", "(_", "self_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stri", "o_", "=_", "String", "IO_", "._", "String", "IO_", "(_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "decode_", "(_", "stri", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "DNS", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "DNS", " ", "protoc", "ol", " ", "mix", "in", " ", "shared", " ", "by", " ", "UD", "P", " ", "and", " ", "TC", "P", " ", "implementation", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "\\u", "react", "or", ":", " ", "A", " ", "L", "{", "IR", "eac", "tor", "Time", "}", " ", "and", " ", "L", "{", "IR", "eac", "tor", "UD", "P", "}", " ", "provide", "r", " ", "whi", "ch", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "used", " ", "to", " ", "issue", " ", "DNS", " ", "querie", "s", " ", "and", " ", "manage", " ", "request", " ", "timeouts", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "live", "Messages_", "=_", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "controller_", ",_", "reactor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "controller_", "=_", "controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "random_", "._", "randrange_", "(_", "2_", "**_", "10_", ",_", "2_", "**_", "15_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "reactor_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "twisted_", "._", "internet_", "import_", "reactor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "reactor_", "=_", "reactor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pick", "ID_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "unique", " ", "ID", " ", "for", " ", "querie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "random", "Source_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "id_", "not_", "in_", "self_", "._", "live", "Messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Mixin_", "(_", "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_", "call", "Later_", "(_", "self_", ",_", "period_", ",_", "func_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wrapper", " ", "aro", "und", " ", "react", "or", ".", "call", "Late", "r", ",", " ", "mainl", "y", " ", "for", " ", "test", " ", "purpose", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "reactor_", "._", "call", "Later_", "(_", "period_", ",_", "func_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "query_", "(_", "self_", ",_", "queries_", ",_", "timeout_", ",_", "id_", ",_", "write", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "out", " ", "a", " ", "message", " ", "with", " ", "the", " ", "give", "n", " ", "querie", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "querie", "s", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "Query", "}", " ", "instance", "s", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "querie", "s", ":", " ", "The", " ", "querie", "s", " ", "to", " ", "transmit", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "timeo", "ut", ":", " ", "C", "{", "int", "}", " ", "or", " ", "C", "{", "float", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "timeo", "ut", ":", " ", "Ho", "w", " ", "long", " ", "to", " ", "wait", " ", "bef", "ore", " ", "gi", "ving", " ", "up", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "id", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "id", ":", " ", "Unique", " ", "key", " ", "for", " ", "this", " ", "request", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "write", "Messag", "e", ":", " ", "C", "{", "calla", "ble", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "write", "Messag", "e", ":", " ", "One", "-", "parameter", " ", "callback", " ", "whi", "ch", " ", "writes", " ", "the", " ", "message", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Defe", "rre", "d", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "a", " ", "C", "{", "Defe", "rre", "d", "}", " ", "whi", "ch", " ", "will", " ", "be", " ", "fired", " ", "with", " ", "the", " ", "result", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "query", ",", " ", "or", " ", "errback", "ed", " ", "with", " ", "any", " ", "error", "s", " ", "tha", "t", " ", "coul", "d", " ", "happ", "en", " ", "(", "exception", "s", "\\", "10", ";", " ", " ", " ", " ", "dur", "ing", " ", "writ", "ing", " ", "of", " ", "the", " ", "query", ",", " ", "timeo", "ut", " ", "error", "s", ",", " ", "...)", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "Message_", "(_", "id_", ",_", "rec", "Des", "_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "queries_", "=_", "queries_", "\\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 ", " _", "write", "Message_", "(_", "m_", ")_", "\\u\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result", "Deferred_", "=_", "defer_", "._", "Deferred_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cancel", "Call_", "=_", "self_", "._", "call", "Later_", "(_", "timeout_", ",_", "self_", "._", "\\u", "clear", "Failed_", ",_", "result", "Deferred_", ",_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "live", "Messages_", "[_", "id_", "]_", "=_", "(_", "result", "Deferred_", ",_", "cancel", "Call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result", "Deferred_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "clear", "Failed_", "(_", "self_", ",_", "deferred_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Clean", " ", "the", " ", "Defe", "rre", "d", " ", "after", " ", "a", " ", "timeo", "ut", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "live", "Messages_", "[_", "id_", "]_", "\\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\\uDEDENT\\u\\u\\u_", "deferred_", "._", "errback", "_", "(_", "failure_", "._", "Failure_", "(_", "DNS", "Query", "Time", "out", "Error_", "(_", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "DNS", " ", "protoc", "ol", " ", "over", " ", "UD", "P", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resen", "ds_", "=_", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "stop", "Protocol_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sto", "p", " ", "protoc", "ol", ":", " ", "reset", " ", "state", " ", "variab", "les", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "live", "Messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resen", "ds_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transport_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "Protocol_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Up", "on", " ", "start", ",", " ", "reset", " ", "internal", " ", "state", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "live", "Messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resen", "ds_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "Message_", "(_", "self_", ",_", "message_", ",_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "a", " ", "message", " ", "holding", " ", "DNS", " ", "querie", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "message", ":", " ", "L", "{", "Messag", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transport_", "._", "write_", "(_", "message_", "._", "to", "Str_", "(_", ")_", ",_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "Listen", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "reactor_", "._", "listen", "UDP_", "(_", "0_", ",_", "self_", ",_", "max", "Packe", "t", "Size_", "=_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "datagram", "Received_", "(_", "self_", ",_", "data_", ",_", "addr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Read", " ", "a", " ", "datagram", ",", " ", "extract", " ", "the", " ", "message", " ", "in", " ", "it", " ", "and", " ", "trigger", " ", "the", " ", "associate", "d", "\\", "10", ";", " ", " ", " ", " ", "Defe", "rre", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "Message_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "._", "from", "Str_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "EO", "FE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "msg_", "(_", "\"", "Truncate", "d", " ", "packet", " ", "(%", "d", " ", "bytes", ")", " ", "from", " ", "%", "s", "\"_", "%_", "(_", "len_", "(_", "data_", ")_", ",_", "addr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "hing", " ", "shou", "ld", " ", "trigger", " ", "this", ",", " ", "but", " ", "sinc", "e", " ", "we", "'", "re", " ", "potenti", "ally", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inv", "oki", "ng", " ", "a", " ", "lot", " ", "of", " ", "different", " ", "deco", "ding", " ", "method", "s", ",", " ", "we", " ", "mig", "ht", " ", "as", " ", "well_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "extra", " ", "cau", "ti", "ous", ".", " ", " ", "Any", "thing", " ", "tha", "t", " ", "trigger", "s", " ", "this", " ", "is", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bug", "gy", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "err_", "(_", "failure_", "._", "Failure_", "(_", ")_", ",_", "\"", "Une", "xpe", "cte", "d", " ", "deco", "ding", " ", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "m_", "._", "id_", "in_", "self_", "._", "live", "Messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", ",_", "cancel", "ler_", "=_", "self_", "._", "live", "Messages_", "[_", "m_", "._", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "live", "Messages_", "[_", "m_", "._", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cancel", "ler_", "._", "cancel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "we", " ", "shou", "ld", "n", "'", "t", " ", "need", " ", "this", " ", "hack", " ", "of", " ", "catch", "ing", " ", "exception", " ", "on", " ", "callback", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "._", "callback_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "err_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "m_", "._", "id_", "not_", "in_", "self_", "._", "resen", "ds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "controller_", "._", "message", "Received_", "(_", "m_", ",_", "self_", ",_", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\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_", "remove", "Rese", "nd_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Mark", " ", "message", " ", "ID", " ", "as", " ", "no", " ", "long", "er", " ", "hav", "ing", " ", "duplicat", "ion", " ", "suppress", "ion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "resen", "ds_", "[_", "id_", "]_", "\\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_", "[SEP]_", "class_", "DNS", "Data", "gram", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Data", "gram", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query_", "(_", "self_", ",_", "address_", ",_", "queries_", ",_", "timeout_", "=_", "10_", ",_", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "out", " ", "a", " ", "message", " ", "with", " ", "the", " ", "give", "n", " ", "querie", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "address", ":", " ", "C", "{", "tuple", "}", " ", "of", " ", "C", "{", "str", "}", " ", "and", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "address", ":", " ", "The", " ", "address", " ", "to", " ", "whi", "ch", " ", "to", " ", "send", " ", "the", " ", "query", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "querie", "s", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "Query", "}", " ", "instance", "s", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "querie", "s", ":", " ", "The", " ", "querie", "s", " ", "to", " ", "transmit", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Defe", "rre", "d", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "transport_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "transport", " ", "mig", "ht", " ", "not", " ", "get", " ", "created", " ", "automati", "call", "y", ",", " ", "use", " ", "call", "Late", "r", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "start", "Listen", "ing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Cann", "ot", "Listen", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", ")_", "\\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_", "id_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "self_", "._", "pick", "ID_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "resen", "ds_", "[_", "id_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "Message_", "(_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write", "Message_", "(_", "m_", ",_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "query_", "(_", "queries_", ",_", "timeout_", ",_", "id_", ",_", "write", "Message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "DNS", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "DNS", " ", "protoc", "ol", " ", "over", " ", "TC", "P", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "class_", "DNS", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "write", "Message_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "a", " ", "message", " ", "holding", " ", "DNS", " ", "querie", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "message", ":", " ", "L", "{", "Messag", "e", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "message_", "._", "to", "Str_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transport_", "._", "write_", "(_", "struct_", "._", "pack_", "(_", "'!", "H", "'_", ",_", "len_", "(_", "s_", ")_", ")_", "+_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connecti", "on", "Made", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", "ion", " ", "is", " ", "made", ":", " ", "reset", " ", "internal", " ", "state", ",", " ", "and", " ", "notif", "y", " ", "the", " ", "controlle", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "live", "Messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "controller_", "._", "connecti", "on", "Made", "_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connecti", "on", "Lost", "_", "(_", "self_", ",_", "reason_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Noti", "fy", " ", "the", " ", "controlle", "r", " ", "tha", "t", " ", "this", " ", "protoc", "ol", " ", "is", " ", "no", " ", "long", "er", "\\", "10", ";", " ", " ", " ", " ", "connect", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "controller_", "._", "connecti", "on", "Lost", "_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "data", "Received_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "buffer_", "+=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "self_", "._", "buffer_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "length_", "is_", "None_", "and_", "len_", "(_", "self_", "._", "buffer_", ")_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "length_", "=_", "struct_", "._", "unpack_", "(_", "'!", "H", "'_", ",_", "self_", "._", "buffer_", "[_", ":_", "2_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "buffer_", "=_", "self_", "._", "buffer_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "buffer_", ")_", ">=_", "self_", "._", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Chunk_", "=_", "self_", "._", "buffer_", "[_", ":_", "self_", "._", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "Message_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "from", "Str_", "(_", "my", "Chunk_", ")_", "\\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 ", " ", "_", "d_", ",_", "cancel", "ler_", "=_", "self_", "._", "live", "Messages_", "[_", "m_", "._", "id_", "]_", "\\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 ", " ", "_", "self_", "._", "controller_", "._", "message", "Received_", "(_", "m_", ",_", "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 ", " ", "_", "del_", "self_", "._", "live", "Messages_", "[_", "m_", "._", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cancel", "ler_", "._", "cancel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "we", " ", "shou", "ld", "n", "'", "t", " ", "need", " ", "this", " ", "hack", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "._", "callback_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "log_", "._", "err_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "buffer_", "=_", "self_", "._", "buffer_", "[_", "self_", "._", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "length_", "=_", "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 ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Protocol_", "(_", "DNS", "Mixin_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\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_", "query_", "(_", "self_", ",_", "queries_", ",_", "timeout_", "=_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "out", " ", "a", " ", "message", " ", "with", " ", "the", " ", "give", "n", " ", "querie", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "querie", "s", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "Query", "}", " ", "instance", "s", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "querie", "s", ":", " ", "The", " ", "querie", "s", " ", "to", " ", "transmit", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "C", "{", "Defe", "rre", "d", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "self_", "._", "pick", "ID_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "query_", "(_", "queries_", ",_", "timeout_", ",_", "id_", ",_", "self_", "._", "write", "Message_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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ectors/jdbc.py
[ { "content": "#!/usr/bin/env python\n# Licensed to Cloudera, Inc. under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. Cloudera, Inc. licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport logging\n\nfrom django.utils.translation import ugettext as _\n\nfrom desktop.lib.exceptions_renderable import PopupException\nfrom desktop.lib.i18n import force_unicode\nfrom librdbms.jdbc import Jdbc, query_and_fetch\n\nfrom notebook.connectors.base import Api, QueryError, AuthenticationRequired\n\n\nLOG = logging.getLogger(__name__)\n\n\n# Cache one JDBC connection by user for not saving user credentials\nAPI_CACHE = {}\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def query_error_handler(func):\n def decorator(*args, **kwargs):\n try:\n return func(*args, **kwargs)\n except AuthenticationRequired, e:\n raise e\n except Exception, e:\n message = force_unicode(str(e))\n if 'error occurred while trying to connect to the Java server' in message:\n raise QueryError(_('%s: is the DB Proxy server running?') % message)\n else:\n raise QueryError(message)\n return decorator", "metadata": "root.query_error_handler", "header": "['module', '___EOS___']", "index": 35 }, { "content": "class JdbcApi(Api):\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.JdbcApi", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def __init__(self, user, interpreter=None):\n global API_CACHE\n Api.__init__(self, user, interpreter=interpreter)\n\n self.db = None\n self.options = interpreter['options']\n\n if self.cache_key in API_CACHE:\n self.db = API_CACHE[self.cache_key]\n elif 'password' in self.options:\n username = self.options.get('user') or user.username\n self.db = API_CACHE[self.cache_key] = Jdbc(self.options['driver'], self.options['url'], username, self.options['password'])", "metadata": "root.JdbcApi.__init__", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 52 }, { "content": " def create_session(self, lang=None, properties=None):\n global API_CACHE\n props = super(JdbcApi, self).create_session(lang, properties)\n\n properties = dict([(p['name'], p['value']) for p in properties]) if properties is not None else {}\n props['properties'] = {} # We don't store passwords\n\n if self.db is None:\n if 'password' in properties:\n user = properties.get('user') or self.options.get('user')\n props['properties'] = {'user': user}\n self.db = API_CACHE[self.cache_key] = Jdbc(self.options['driver'], self.options['url'], user, properties.pop('password'))\n\n if self.db is None:\n raise AuthenticationRequired()\n\n return props", "metadata": "root.JdbcApi.create_session", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 65 }, { "content": " @query_error_handler\n def execute(self, notebook, snippet):\n if self.db is None:\n raise AuthenticationRequired()\n\n data, description = query_and_fetch(self.db, snippet['statement'], 1000)\n has_result_set = data is not None\n\n return {\n 'sync': True,\n 'has_result_set': has_result_set,\n 'result': {\n 'has_more': False,\n 'data': data if has_result_set else [],\n 'meta': [{\n 'name': col[0],\n 'type': col[1],\n 'comment': ''\n } for col in description] if has_result_set else [],\n 'type': 'table'\n }\n }", "metadata": "root.JdbcApi.execute", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 83 }, { "content": " @query_error_handler\n def check_status(self, notebook, snippet):\n return {'status': 'available'}", "metadata": "root.JdbcApi.check_status", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 106 }, { "content": " def _fetch_result(self, cursor):\n return {}", "metadata": "root.JdbcApi._fetch_result", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 110 }, { "content": " @query_error_handler\n def fetch_result_metadata(self):\n pass", "metadata": "root.JdbcApi.fetch_result_metadata", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 113 }, { "content": " @query_error_handler\n def cancel(self, notebook, snippet):\n return {'status': 0}", "metadata": "root.JdbcApi.cancel", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 117 }, { "content": " def download(self, notebook, snippet, format):\n raise PopupException('Downloading is not supported yet')", "metadata": "root.JdbcApi.download", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 121 }, { "content": " def progress(self, snippet, logs):\n return 50", "metadata": "root.JdbcApi.progress", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 124 }, { "content": " @query_error_handler\n def close_statement(self, snippet):\n return {'status': -1}", "metadata": "root.JdbcApi.close_statement", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 127 }, { "content": " @query_error_handler\n def autocomplete(self, snippet, database=None, table=None, column=None, nested=None):\n if self.db is None:\n raise AuthenticationRequired()\n\n assist = Assist(self.db)\n response = {'status': -1}\n\n if database is None:\n response['databases'] = assist.get_databases()\n elif table is None:\n response['tables'] = assist.get_tables(database)\n else:\n columns = assist.get_columns(database, table)\n response['columns'] = [col[0] for col in columns]\n response['extended_columns'] = [{\n 'name': col[0],\n 'type': col[1],\n 'comment': col[5]\n } for col in columns]\n\n response['status'] = 0\n return response", "metadata": "root.JdbcApi.autocomplete", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 131 }, { "content": " @query_error_handler\n def get_sample_data(self, snippet, database=None, table=None, column=None):\n if self.db is None:\n raise AuthenticationRequired()\n\n assist = Assist(self.db)\n response = {'status': -1}\n\n sample_data, description = assist.get_sample_data(database, table, column)\n\n if sample_data:\n response['status'] = 0\n response['headers'] = [col[0] for col in description] if description else []\n response['rows'] = sample_data\n else:\n response['message'] = _('Failed to get sample data.')\n\n return response", "metadata": "root.JdbcApi.get_sample_data", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 155 }, { "content": " @property\n def cache_key(self):\n return '%s-%s' % (self.interpreter['name'], self.user.username)", "metadata": "root.JdbcApi.cache_key", "header": "['class', 'JdbcApi', '(', 'Api', ')', ':', '___EOS___']", "index": 174 }, { "content": "class Assist():\n\n\n\n\n", "metadata": "root.Assist", "header": "['module', '___EOS___']", "index": 179 }, { "content": " def __init__(self, db):\n self.db = db", "metadata": "root.Assist.__init__", "header": "['class', 'Assist', '(', ')', ':', '___EOS___']", "index": 181 }, { "content": " def get_databases(self):\n databases, description = query_and_fetch(self.db, 'SHOW DATABASES')\n return databases", "metadata": "root.Assist.get_databases", "header": "['class', 'Assist', '(', ')', ':', '___EOS___']", "index": 184 }, { "content": " def get_tables(self, database, table_names=[]):\n tables, description = query_and_fetch(self.db, 'SHOW TABLES')\n return tables", "metadata": "root.Assist.get_tables", "header": "['class', 'Assist', '(', ')', ':', '___EOS___']", "index": 188 }, { "content": " def get_columns(self, database, table):\n columns, description = query_and_fetch(self.db, 'SHOW COLUMNS FROM %s.%s' % (database, table))\n return columns", "metadata": "root.Assist.get_columns", "header": "['class', 'Assist', '(', ')', ':', '___EOS___']", "index": 192 }, { "content": " def get_sample_data(self, database, table, column=None):\n column = column or '*'\n return query_and_fetch(self.db, 'SELECT %s FROM %s.%s' % (column, database, table))", "metadata": "root.Assist.get_sample_data", "header": "['class', 'Assist', '(', ')', ':', '___EOS___']", "index": 196 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "to", " ", "Cloud", "era", ",", " ", "Inc", ".", " ", "under", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "more", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "with", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", ".", " ", " ", "Cloud", "era", ",", " ", "Inc", ".", " ", "license", "s", " ", "this", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "you", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "ance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "License", ".", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "ugettext_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "desktop_", "._", "lib_", "._", "exception", "s", "\\u", "render", "able_", "import_", "Pop", "up", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "desktop_", "._", "lib_", "._", "i18n_", "import_", "force", "\\u", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libr", "dbm", "s_", "._", "jdbc", "_", "import_", "J", "dbc_", ",_", "query", "\\u", "and", "\\u", "fetch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "notebook_", "._", "connectors", "_", "._", "base_", "import_", "Api_", ",_", "Query", "Error_", ",_", "Auth", "entica", "tion", "Required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOG_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cache", " ", "one", " ", "JD", "BC", " ", "connecti", "on", " ", "by", " ", "user", " ", "for", " ", "not", " ", "saving", " ", "user", " ", "credentials_", "\\u\\u\\uNL\\u\\u\\u_", "API", "\\u", "CACHE_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "query", "\\u", "error", "\\u", "handler_", "(_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "decorator_", "(_", "*_", "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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Auth", "entica", "tion", "Required_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "e_", "\\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 ", " _", "message_", "=_", "force", "\\u", "unicode_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "error", " ", "occur", "red", " ", "whi", "le", " ", "try", "ing", " ", "to", " ", "connect", " ", "to", " ", "the", " ", "Ja", "va", " ", "server", "'_", "in_", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Query", "Error_", "(_", "\\u_", "(_", "'%", "s", ":", " ", "is", " ", "the", " ", "DB", " ", "Pro", "xy", " ", "server", " ", "runn", "ing", "?'_", ")_", "%_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Query", "Error_", "(_", "message_", ")_", "\\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_", "decorator_", "\\u\\u\\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_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\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_", ",_", "user_", ",_", "interpreter_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "API", "\\u", "CACHE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Api_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "user_", ",_", "interpreter_", "=_", "interpreter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "=_", "interpreter_", "[_", "'", "options", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "cache", "\\u", "key_", "in_", "API", "\\u", "CACHE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "API", "\\u", "CACHE_", "[_", "self_", "._", "cache", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "password", "'_", "in_", "self_", "._", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "self_", "._", "options_", "._", "get_", "(_", "'", "user", "'_", ")_", "or_", "user_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "=_", "API", "\\u", "CACHE_", "[_", "self_", "._", "cache", "\\u", "key_", "]_", "=_", "J", "dbc_", "(_", "self_", "._", "options_", "[_", "'", "driver", "'_", "]_", ",_", "self_", "._", "options_", "[_", "'", "url", "'_", "]_", ",_", "username_", ",_", "self_", "._", "options_", "[_", "'", "password", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\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", "session_", "(_", "self_", ",_", "lang_", "=_", "None_", ",_", "properties_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "API", "\\u", "CACHE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "props_", "=_", "super_", "(_", "J", "dbc", "Api_", ",_", "self_", ")_", "._", "create", "\\u", "session_", "(_", "lang_", ",_", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "properties_", "=_", "dict_", "(_", "[_", "(_", "p_", "[_", "'", "name", "'_", "]_", ",_", "p_", "[_", "'", "value", "'_", "]_", ")_", "for_", "p_", "in_", "properties_", "]_", ")_", "if_", "properties_", "is_", "not_", "None_", "else_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "props_", "[_", "'", "proper", "ties", "'_", "]_", "=_", "{_", "}_", "#", " ", "We", " ", "don", "'", "t", " ", "store", " ", "passwords", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "db_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "password", "'_", "in_", "properties_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "properties_", "._", "get_", "(_", "'", "user", "'_", ")_", "or_", "self_", "._", "options_", "._", "get_", "(_", "'", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "props_", "[_", "'", "proper", "ties", "'_", "]_", "=_", "{_", "'", "user", "'_", ":_", "user_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "=_", "API", "\\u", "CACHE_", "[_", "self_", "._", "cache", "\\u", "key_", "]_", "=_", "J", "dbc_", "(_", "self_", "._", "options_", "[_", "'", "driver", "'_", "]_", ",_", "self_", "._", "options_", "[_", "'", "url", "'_", "]_", ",_", "user_", ",_", "properties_", "._", "pop_", "(_", "'", "password", "'_", ")_", ")_", "\\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_", "._", "db_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Auth", "entica", "tion", "Required_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "props_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "notebook_", ",_", "snippet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "db_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Auth", "entica", "tion", "Required_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", ",_", "description_", "=_", "query", "\\u", "and", "\\u", "fetch_", "(_", "self_", "._", "db_", ",_", "snippet_", "[_", "'", "statem", "ent", "'_", "]_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "result", "\\u", "set_", "=_", "data_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sync", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "has", "\\u", "result", "\\u", "set", "'_", ":_", "has", "\\u", "result", "\\u", "set_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "result", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "has", "\\u", "more", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data", "'_", ":_", "data_", "if_", "has", "\\u", "result", "\\u", "set_", "else_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "meta", "'_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "col_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "col_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "'_", ":_", "''_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "for_", "col_", "in_", "description_", "]_", "if_", "has", "\\u", "result", "\\u", "set_", "else_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "table", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "check", "\\u", "status_", "(_", "self_", ",_", "notebook_", ",_", "snippet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "status", "'_", ":_", "'", "avail", "able", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fetch", "\\u", "result_", "(_", "self_", ",_", "cursor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "fetch", "\\u", "result", "\\u", "metadata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cancel_", "(_", "self_", ",_", "notebook_", ",_", "snippet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "status", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "download_", "(_", "self_", ",_", "notebook_", ",_", "snippet_", ",_", "format_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pop", "up", "Exception_", "(_", "'", "Down", "load", "ing", " ", "is", " ", "not", " ", "support", "ed", " ", "ye", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "progress_", "(_", "self_", ",_", "snippet_", ",_", "logs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "close", "\\u", "statement_", "(_", "self_", ",_", "snippet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "status", "'_", ":_", "-_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "autocomplete", "_", "(_", "self_", ",_", "snippet_", ",_", "database_", "=_", "None_", ",_", "table_", "=_", "None_", ",_", "column_", "=_", "None_", ",_", "nested_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "db_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Auth", "entica", "tion", "Required_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assist", "_", "=_", "Assi", "st_", "(_", "self_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "{_", "'", "status", "'_", ":_", "-_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "database_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "[_", "'", "databa", "ses", "'_", "]_", "=_", "assist", "_", "._", "get", "\\u", "databases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "table_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "[_", "'", "tables", "'_", "]_", "=_", "assist", "_", "._", "get", "\\u", "tables_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "columns_", "=_", "assist", "_", "._", "get", "\\u", "columns_", "(_", "database_", ",_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "[_", "'", "column", "s", "'_", "]_", "=_", "[_", "col_", "[_", "0_", "]_", "for_", "col_", "in_", "columns_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "[_", "'", "extend", "ed", "\\u", "column", "s", "'_", "]_", "=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "col_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "col_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "'_", ":_", "col_", "[_", "5_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "for_", "col_", "in_", "columns_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "[_", "'", "status", "'_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "query", "\\u", "error", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "sample", "\\u", "data_", "(_", "self_", ",_", "snippet_", ",_", "database_", "=_", "None_", ",_", "table_", "=_", "None_", ",_", "column_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "db_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Auth", "entica", "tion", "Required_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assist", "_", "=_", "Assi", "st_", "(_", "self_", "._", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "{_", "'", "status", "'_", ":_", "-_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sample", "\\u", "data_", ",_", "description_", "=_", "assist", "_", "._", "get", "\\u", "sample", "\\u", "data_", "(_", "database_", ",_", "table_", ",_", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sample", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "[_", "'", "status", "'_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "[_", "'", "header", "s", "'_", "]_", "=_", "[_", "col_", "[_", "0_", "]_", "for_", "col_", "in_", "description_", "]_", "if_", "description_", "else_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "[_", "'", "rows", "'_", "]_", "=_", "sample", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "[_", "'", "message", "'_", "]_", "=_", "\\u_", "(_", "'", "Fail", "ed", " ", "to", " ", "get", " ", "sample", " ", "data", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "J", "dbc", "Api_", "(_", "Api_", ")_", ":_", "\\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_", "cache", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "-%", "s", "'_", "%_", "(_", "self_", "._", "interpreter_", "[_", "'", "name", "'_", "]_", ",_", "self_", "._", "user_", "._", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Assi", "st_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Assi", "st_", "(_", ")_", ":_", "\\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_", ",_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Assi", "st_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "databases_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "databases_", ",_", "description_", "=_", "query", "\\u", "and", "\\u", "fetch_", "(_", "self_", "._", "db_", ",_", "'", "SHOW", " ", "DATA", "BASE", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "databases_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Assi", "st_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "tables_", "(_", "self_", ",_", "database_", ",_", "table", "\\u", "names_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tables_", ",_", "description_", "=_", "query", "\\u", "and", "\\u", "fetch_", "(_", "self_", "._", "db_", ",_", "'", "SHOW", " ", "TABLES", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Assi", "st_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "columns_", "(_", "self_", ",_", "database_", ",_", "table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "columns_", ",_", "description_", "=_", "query", "\\u", "and", "\\u", "fetch_", "(_", "self_", "._", "db_", ",_", "'", "SHOW", " ", "COL", "UM", "NS", " ", "FROM", " ", "%", "s", ".", "%", "s", "'_", "%_", "(_", "database_", ",_", "table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Assi", "st_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sample", "\\u", "data_", "(_", "self_", ",_", "database_", ",_", "table_", ",_", "column_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "column_", "=_", "column_", "or_", "'*'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "query", "\\u", "and", "\\u", "fetch_", "(_", "self_", "._", "db_", ",_", "'", "SELECT", " ", "%", "s", " ", "FROM", " ", "%", "s", ".", "%", "s", "'_", "%_", "(_", "column_", ",_", "database_", ",_", "table_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
graphite-project/carbon/bin/carbon-client.py
[ { "content": " def lineReceived(self, line):\n #log.msg(\"[DEBUG] lineReceived(): %s\" % line)\n try:\n (metric, value, timestamp) = line.split()\n datapoint = (float(timestamp), float(value))\n assert datapoint[1] == datapoint[1] # filter out NaNs\n client_manager.sendDatapoint(metric, datapoint)\n except ValueError:\n log.err(None, 'Dropping invalid line: %s' % line)", "metadata": "root.StdinMetricsReader.lineReceived", "header": "['class', 'StdinMetricsReader', '(', 'LineReceiver', ')', ':', '___EOS___']", "index": 105 } ]
[]
[]
0
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Std", "in", "Met", "ric", "s", "Reader_", "(_", "Line", "Receiver_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "line", "Received_", "(_", "self_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "msg", "(\"", "[", "DEBU", "G", "]", " ", "line", "Receive", "d", "():", " ", "%", "s", "\"", " ", "%", " ", "line", ")_", "\\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 ", " _", "(_", "metric_", ",_", "value_", ",_", "timestamp_", ")_", "=_", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datapoint", "_", "=_", "(_", "float_", "(_", "timestamp_", ")_", ",_", "float_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "datapoint", "_", "[_", "1_", "]_", "==_", "datapoint", "_", "[_", "1_", "]_", "#", " ", "filter", " ", "out", " ", "Na", "Ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client", "\\u", "manager_", "._", "send", "Data", "point_", "(_", "metric_", ",_", "datapoint", "_", ")_", "\\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 ", " _", "log_", "._", "err_", "(_", "None_", ",_", "'", "Dropp", "ing", " ", "invalid", " ", "line", ":", " ", "%", "s", "'_", "%_", "line_", ")_", "\\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 ]
Comparison of constants
mne-tools/mne-python/mne/externals/tempita/__init__.py
[ { "content": " def _interpret_code(self, code, ns, out, defs):\n # __traceback_hide__ = True\n name, pos = code[0], code[1]\n if name == 'py':\n self._exec(code[2], ns, pos)\n elif name == 'continue':\n raise _TemplateContinue()\n elif name == 'break':\n raise _TemplateBreak()\n elif name == 'for':\n vars, expr, content = code[2], code[3], code[4]\n expr = self._eval(expr, ns, pos)\n self._interpret_for(vars, expr, content, ns, out, defs)\n elif name == 'cond':\n parts = code[2:]\n self._interpret_if(parts, ns, out, defs)\n elif name == 'expr':\n parts = code[2].split('|')\n base = self._eval(parts[0], ns, pos)\n for part in parts[1:]:\n func = self._eval(part, ns, pos)\n base = func(base)\n out.append(self._repr(base, pos))\n elif name == 'default':\n var, expr = code[2], code[3]\n if var not in ns:\n result = self._eval(expr, ns, pos)\n ns[var] = result\n elif name == 'inherit':\n expr = code[2]\n value = self._eval(expr, ns, pos)\n defs['__inherit__'] = value\n elif name == 'def':\n name = code[2]\n signature = code[3]\n parts = code[4]\n ns[name] = defs[name] = TemplateDef(\n self, name, signature, body=parts, ns=ns, pos=pos)\n elif name == 'comment':\n return\n else:\n assert 0, \"Unknown code: %r\" % name", "metadata": "root.Template._interpret_code", "header": "['class', 'Template', '(', 'object', ')', ':', '___EOS___']", "index": 218 } ]
[]
[]
0
true
[ "[CLS]_", "Compari", "son_", "of_", "constants_", "[SEP]_", "class_", "Template_", "(_", "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", "interpret", "\\u", "code_", "(_", "self_", ",_", "code_", ",_", "ns_", ",_", "out_", ",_", "defs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "\\u\\u", "traceback", "\\u", "hide", "\\u\\u", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", ",_", "pos_", "=_", "code_", "[_", "0_", "]_", ",_", "code_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "==_", "'", "py", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "exec_", "(_", "code_", "[_", "2_", "]_", ",_", "ns_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "continue", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u", "Templa", "te", "Continu", "e_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "break", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u", "Templa", "te", "Break", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "for", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vars_", ",_", "expr_", ",_", "content_", "=_", "code_", "[_", "2_", "]_", ",_", "code_", "[_", "3_", "]_", ",_", "code_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expr_", "=_", "self_", "._", "\\u", "eval_", "(_", "expr_", ",_", "ns_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "interpret", "\\u", "for_", "(_", "vars_", ",_", "expr_", ",_", "content_", ",_", "ns_", ",_", "out_", ",_", "defs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "cond", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parts_", "=_", "code_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "interpret", "\\u", "if_", "(_", "parts_", ",_", "ns_", ",_", "out_", ",_", "defs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "expr", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parts_", "=_", "code_", "[_", "2_", "]_", "._", "split_", "(_", "'|'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base_", "=_", "self_", "._", "\\u", "eval_", "(_", "parts_", "[_", "0_", "]_", ",_", "ns_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "part_", "in_", "parts_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func_", "=_", "self_", "._", "\\u", "eval_", "(_", "part_", ",_", "ns_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base_", "=_", "func_", "(_", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "._", "append_", "(_", "self_", "._", "\\u", "repr_", "(_", "base_", ",_", "pos_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "default", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", ",_", "expr_", "=_", "code_", "[_", "2_", "]_", ",_", "code_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "var_", "not_", "in_", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "eval_", "(_", "expr_", ",_", "ns_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "[_", "var_", "]_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "inherit", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expr_", "=_", "code_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "\\u", "eval_", "(_", "expr_", ",_", "ns_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defs_", "[_", "'\\u", "\\u", "inherit", "\\u\\u'_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "def", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "code_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signature_", "=_", "code_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parts_", "=_", "code_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "[_", "name_", "]_", "=_", "defs_", "[_", "name_", "]_", "=_", "Templa", "te", "Def_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "name_", ",_", "signature_", ",_", "body_", "=_", "parts_", ",_", "ns_", "=_", "ns_", ",_", "pos_", "=_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "==_", "'", "comment", "'_", ":_", "\\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_", "0_", ",_", "\"", "Un", "know", "n", " ", "code", ":", " ", "%", "r", "\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
facebook/sparts/sparts/vservice.py
[ { "content": "# Copyright (c) 2014, Facebook, Inc. All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n#\n\"\"\"vservice defines the base service class, `VService`\n\nVService can be used directly, for example with `VService.initFromCLI()`,\nor it can be subclassed and used similarly.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport copy\nimport functools\nimport logging\nimport re\nimport signal\nimport sys\nimport threading\nimport time\n\nfrom argparse import ArgumentParser\nfrom .compat import OrderedDict, captureWarnings\n\nfrom sparts import vtask\nfrom .deps import HAS_PSUTIL, HAS_DAEMONIZE\nfrom .sparts import _SpartsObject, option\n\nfrom sparts import daemon\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VService(_SpartsObject):\n \"\"\"Core class for implementing services.\"\"\"\n DEFAULT_LOGLEVEL = 'DEBUG'\n DEFAULT_LOGFILE = None\n DEFAULT_PID = lambda cls: '/var/run/%s.pid' % cls.__name__\n REGISTER_SIGNAL_HANDLERS = True\n TASKS = []\n VERSION = ''\n _name = None\n dryrun = option(action='store_true', help='Run in \"dryrun\" mode')\n level = option(default=DEFAULT_LOGLEVEL, help='Log Level [%(default)s]')\n logfile = option(default=lambda cls: cls.DEFAULT_LOGFILE,\n help='Log to this file instead of stderr. None or \"\" '\n 'logs to stderr [%(default)s]')\n\n register_tasks = option(name='tasks', default=None,\n metavar='TASK', nargs='*',\n help='Tasks to run. Pass without args to see the '\n 'list. If not passed, all tasks will be '\n 'started')\n\n if HAS_DAEMONIZE:\n daemon = option(\n action='store_true',\n help='Start as a daemon using PIDFILE',\n )\n pidfile = option(\n default=DEFAULT_PID,\n help='Daemon pid file path [%(default)s]',\n metavar='PIDFILE',\n )\n kill = option(\n action='store_true',\n help='Kill the currently running daemon for PIDFILE',\n )\n status = option(\n action='store_true',\n help='Output whether the daemon for PIDFILE is running',\n )\n\n if HAS_PSUTIL:\n runit_install = option(action='store_true',\n help='Install this service under runit.')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.VService", "header": "['module', '___EOS___']", "index": 33 }, { "content": " def __init__(self, ns):\n super(VService, self).__init__()\n self.logger = logging.getLogger(self.name)\n\n # Option initialization\n self.options = ns\n self.initLogging()\n\n # Control variables\n self._stop = False\n self._restart = False\n\n # Initialize Tasks\n self.tasks = vtask.Tasks()\n # Register tasks from global instance\n for t in vtask.REGISTERED:\n self.tasks.register(t)\n\n # Register additional tasks from service declaration\n for t in self.TASKS:\n self.tasks.register(t)\n\n # Register warnings API\n self.warnings = OrderedDict()\n self.warning_id = 0\n\n # Register exported values API\n self.exported_values = {}\n\n # Set start_time for aliveSince() calls\n self.start_time = time.time()", "metadata": "root.VService.__init__", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 77 }, { "content": " def initService(self):\n \"\"\"Override this to do any service-specific initialization\"\"\"", "metadata": "root.VService.initService", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 109 }, { "content": " @classmethod\n def _loptName(cls, name):\n return '--' + name.replace('_', '-')", "metadata": "root.VService._loptName", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 112 }, { "content": " def preprocessOptions(self):\n \"\"\"Processes \"action\" oriented options.\"\"\"\n if self.getOption('runit_install'):\n self._install()\n\n if HAS_DAEMONIZE:\n # Act on the --status if present.\n if self.status:\n if daemon.status(pidfile=self.pidfile, logger=self.logger):\n sys.exit(0)\n else:\n sys.exit(1)\n\n # Act on the --kill flag if present.\n if self.kill:\n if daemon.kill(pidfile=self.pidfile, logger=self.logger):\n sys.exit(0)\n else:\n sys.exit(1)\n\n if self.options.tasks == []:\n print(\"Available Tasks:\")\n for t in self.tasks:\n print(\" - %s\" % t.__name__)\n sys.exit(1)", "metadata": "root.VService.preprocessOptions", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 116 }, { "content": " def _createTasks(self):\n all_tasks = set(self.tasks)\n\n selected_tasks = self.options.tasks\n if selected_tasks is None:\n selected_tasks = [t.__name__ for t in all_tasks]\n\n # Determine which tasks need to be unregistered based on the\n # selected tasks.\n unregister_tasks = [t for t in all_tasks\n if t.__name__ not in selected_tasks]\n\n # Unregister non-selected tasks\n for t in unregister_tasks:\n self.tasks.unregister(t)\n\n # Actually create the tasks\n self.tasks.create(self)\n\n # Call service initialization hook after tasks have been instantiated,\n # but before they've been initialized.\n self.initService()\n\n # Initialize the tasks\n self.tasks.init()", "metadata": "root.VService._createTasks", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 142 }, { "content": " def _handleShutdownSignals(self, signum, frame):\n assert signum in (signal.SIGINT, signal.SIGTERM)\n self.logger.info('signal -%d received', signum)\n self.shutdown()", "metadata": "root.VService._handleShutdownSignals", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 168 }, { "content": " def _startTasks(self):\n # TODO: Should this be somewhere else?\n if self.REGISTER_SIGNAL_HANDLERS:\n # Things seem to fail more gracefully if we trigger the stop\n # out of band (with a signal handler) instead of catching the\n # KeyboardInterrupt...\n signal.signal(signal.SIGINT, self._handleShutdownSignals)\n signal.signal(signal.SIGTERM, self._handleShutdownSignals)\n\n self.tasks.start()\n self.logger.debug(\"All tasks started\")", "metadata": "root.VService._startTasks", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 173 }, { "content": " def getTask(self, name):\n \"\"\"Returns a task for the given class `name` or type, or None.\"\"\"\n return self.tasks.get(name)", "metadata": "root.VService.getTask", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 185 }, { "content": " def requireTask(self, name):\n \"\"\"Returns a task for the given class `name` or type, or throws.\"\"\"\n return self.tasks.require(name)", "metadata": "root.VService.requireTask", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 189 }, { "content": " def shutdown(self):\n \"\"\"Request a graceful shutdown. Does not block.\"\"\"\n self.logger.info(\"Received graceful shutdown request\")\n self.stop()", "metadata": "root.VService.shutdown", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 193 }, { "content": " def restart(self):\n \"\"\"Request a graceful restart. Does not block.\"\"\"\n self.logger.info(\"Received graceful restart request\")\n self._restart = True\n self.stop()", "metadata": "root.VService.restart", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 198 }, { "content": " def stop(self):\n self._stop = True", "metadata": "root.VService.stop", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 204 }, { "content": " def _wait(self):\n try:\n self.logger.debug('VService Active. Awaiting graceful shutdown.')\n\n # If there are no remaining tasks (or this service has no tasks)\n # just sleep until ^C is pressed\n while not self._stop:\n time.sleep(0.1)\n except KeyboardInterrupt:\n self.logger.info('KeyboardInterrupt Received! Stopping Tasks...')\n\n for t in reversed(self.tasks):\n t.stop()\n\n try:\n self.logger.info('Waiting for tasks to shutdown gracefully...')\n for t in reversed(self.tasks):\n self.logger.debug('Waiting for %s to stop...', t)\n t.join()\n except KeyboardInterrupt:\n self.logger.warning('Abandon all hope ye who enter here')", "metadata": "root.VService._wait", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 207 }, { "content": " def join(self):\n \"\"\"Blocks until a stop is requested, waits for all tasks to shutdown\"\"\"\n while not self._stop:\n time.sleep(0.1)\n for t in reversed(self.tasks):\n t.join()", "metadata": "root.VService.join", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 229 }, { "content": " @classmethod\n def initFromCLI(cls, name=None):\n \"\"\"Starts this service, processing command line arguments.\"\"\"\n ap = cls._buildArgumentParser()\n ns = ap.parse_args()\n instance = cls.initFromOptions(ns, name=name)\n return instance", "metadata": "root.VService.initFromCLI", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 236 }, { "content": " @classmethod\n def initFromOptions(cls, ns, name=None):\n \"\"\"Starts this service, arguments from `ns`\"\"\"\n instance = cls(ns)\n if name is not None:\n instance.name = name\n instance.preprocessOptions()\n\n if HAS_DAEMONIZE and ns.daemon:\n daemon.daemonize(\n command=functools.partial(cls._runloop, instance),\n name=instance.name,\n pidfile=ns.pidfile,\n logger=instance.logger,\n )\n\n else:\n return cls._runloop(instance)", "metadata": "root.VService.initFromOptions", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 244 }, { "content": " @classmethod\n def _runloop(cls, instance):\n while not instance._stop:\n try:\n instance._createTasks()\n instance._startTasks()\n except Exception:\n instance.logger.exception(\"Unexpected Exception during init\")\n instance.shutdown()\n\n instance._wait()\n\n if instance._restart:\n instance = cls(instance.options)\n\n instance.logger.info(\"Instance shut down gracefully\")", "metadata": "root.VService._runloop", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 263 }, { "content": " def startBG(self):\n \"\"\"Starts this service in the background\n\n Returns a thread that will join() on graceful shutdown.\"\"\"\n self._createTasks()\n self._startTasks()\n t = threading.Thread(target=self._wait)\n t.start()\n return t", "metadata": "root.VService.startBG", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 280 }, { "content": " @property\n def name(self):\n if self._name is None:\n self._name = self.__class__.__name__\n return self._name", "metadata": "root.VService.name", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 290 }, { "content": " @name.setter\n def name(self, value):\n self._name = value", "metadata": "root.VService.name", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 296 }, { "content": " def initLogging(self):\n \"\"\"Basic stderr logging. Override this to do something else.\"\"\"\n if self.logfile:\n logging.basicConfig(level=self.loglevel, filename=self.logfile)\n else:\n logging.basicConfig(level=self.loglevel, stream=sys.stderr)\n\n captureWarnings(True)", "metadata": "root.VService.initLogging", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 300 }, { "content": " @classmethod\n def _makeArgumentParser(cls):\n \"\"\"Create an argparse.ArgumentParser instance.\n\n Override this method if you already have an ArgumentParser instance to use\n or you simply want to specify some of the optional arguments to\n argparse.ArgumentParser.__init__\n (e.g. \"fromfile_prefix_chars\" or \"conflict_handler\"...)\n \"\"\"\n return ArgumentParser()", "metadata": "root.VService._makeArgumentParser", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 309 }, { "content": " @classmethod\n def _buildArgumentParser(cls):\n ap = cls._makeArgumentParser()\n cls._addArguments(ap)\n\n all_tasks = vtask.Tasks()\n all_tasks.register_all(cls.TASKS)\n all_tasks.register_all(vtask.REGISTERED)\n for t in all_tasks:\n # TODO: Add each tasks' arguments to an argument group\n t._addArguments(ap)\n\n return ap", "metadata": "root.VService._buildArgumentParser", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 320 }, { "content": " @property\n def loglevel(self):\n # TODO: Deprecate this after proting args to proper option()s\n return getattr(logging, self.options.level)", "metadata": "root.VService.loglevel", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 334 }, { "content": " def getOption(self, name, default=None):\n return getattr(self.options, name, default)", "metadata": "root.VService.getOption", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 339 }, { "content": " def setOption(self, name, value):\n setattr(self.options, name, value)", "metadata": "root.VService.setOption", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 342 }, { "content": " def getOptions(self):\n return self.options.__dict__", "metadata": "root.VService.getOptions", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 345 }, { "content": " def _install(self):\n if not HAS_PSUTIL:\n raise NotImplementedError(\"You need psutil installed to install \"\n \"under runit\")\n import sparts.runit\n sparts.runit.install(self.name)\n sys.exit(0)", "metadata": "root.VService._install", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 348 }, { "content": " def getChildren(self):\n return dict((t.name, t) for t in self.tasks)", "metadata": "root.VService.getChildren", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 356 }, { "content": " def getWarnings(self):\n return self.warnings", "metadata": "root.VService.getWarnings", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 359 }, { "content": " def registerWarning(self, message):\n wid = self.warning_id\n self.warning_id += 1\n self.warnings[wid] = message\n return wid", "metadata": "root.VService.registerWarning", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 362 }, { "content": " def clearWarnings(self):\n self.warnings = OrderedDict()", "metadata": "root.VService.clearWarnings", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 368 }, { "content": " def clearWarning(self, id):\n if id not in self.warnings:\n return False\n del self.warnings[id]\n return True", "metadata": "root.VService.clearWarning", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 371 }, { "content": " def getExportedValue(self, name):\n return self.exported_values.get(name, '')", "metadata": "root.VService.getExportedValue", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 377 }, { "content": " def setExportedValue(self, name, value):\n if value is None:\n del self.exported_values[name]\n else:\n self.exported_values[name] = value", "metadata": "root.VService.setExportedValue", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 380 }, { "content": " def getExportedValues(self):\n return copy.copy(self.exported_values)", "metadata": "root.VService.getExportedValues", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 386 }, { "content": " def getRegexExportedValues(self, regex):\n matcher = re.compile(regex)\n keys = [key for key in self.exported_values.keys()\n if matcher.match(key) is not None]\n return self.getSelectedExportedValues(keys)", "metadata": "root.VService.getRegexExportedValues", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 389 }, { "content": " def getSelectedExportedValues(self, keys):\n return dict([(key, self.getExportedValue(key))\n for key in keys])", "metadata": "root.VService.getSelectedExportedValues", "header": "['class', 'VService', '(', '_SpartsObject', ')', ':', '___EOS___']", "index": 395 } ]
[]
[]
0
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2014", ",", " ", "Face", "book", ",", " ", "Inc", ".", " ", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "source", " ", "code", " ", "is", " ", "license", "d", " ", "under", " ", "the", " ", "BS", "D", "-", "style", " ", "license", " ", "found", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LICENSE", " ", "file", " ", "in", " ", "the", " ", "root", " ", "director", "y", " ", "of", " ", "this", " ", "source", " ", "tree", ".", " ", "An", " ", "addition", "al", " ", "grant_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "pate", "nt", " ", "rights", " ", "can", " ", "be", " ", "found", " ", "in", " ", "the", " ", "PAT", "ENT", "S", " ", "file", " ", "in", " ", "the", " ", "same", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "vse", "rvice", " ", "defin", "es", " ", "the", " ", "base", " ", "service", " ", "class", ",", " ", "`", "VS", "ervice", "`", "\\", "10", ";", "\\", "10", ";", "VS", "ervice", " ", "can", " ", "be", " ", "used", " ", "direct", "ly", ",", " ", "for", " ", "example", " ", "with", " ", "`", "VS", "ervice", ".", "init", "Fro", "m", "CLI", "()`", ",", "\\", "10", ";", "or", " ", "it", " ", "can", " ", "be", " ", "subclass", "ed", " ", "and", " ", "used", " ", "similar", "ly", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "argparse_", "import_", "Arg", "ument", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "compat_", "import_", "Order", "ed", "Dict_", ",_", "captur", "e", "Warnings", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "spar", "ts_", "import_", "vta", "sk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "deps_", "import_", "HAS", "\\u", "PS", "UTIL", "_", ",_", "HAS", "\\u", "DA", "EMO", "NI", "ZE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "spar", "ts_", "import_", "\\u", "Spar", "ts", "Object_", ",_", "option_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "spar", "ts_", "import_", "daemon_", "\\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_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Core", " ", "class", " ", "for", " ", "implement", "ing", " ", "service", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "LOG", "LEVEL_", "=_", "'", "DEBU", "G", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "LOG", "FILE_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "PID_", "=_", "lambda_", "cls_", ":_", "'/", "var", "/", "run", "/", "%", "s", ".", "pid", "'_", "%_", "cls_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REGISTER", "\\u", "SIGN", "AL", "\\u", "HANDLER", "S_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TASK", "S_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VERSION_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dryrun_", "=_", "option_", "(_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "'", "Run", " ", "in", " ", "\"", "dry", "run", "\"", " ", "mode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "=_", "option_", "(_", "default_", "=_", "DEF", "AUL", "T", "\\u", "LOG", "LEVEL_", ",_", "help_", "=_", "'", "Log", " ", "Leve", "l", " ", "[", "%", "(", "default", ")", "s", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logfile_", "=_", "option_", "(_", "default_", "=_", "lambda_", "cls_", ":_", "cls_", "._", "DEF", "AUL", "T", "\\u", "LOG", "FILE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Log", " ", "to", " ", "this", " ", "file", " ", "inst", "ead", " ", "of", " ", "std", "err", ".", " ", " ", "Non", "e", " ", "or", " ", "\"\"", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logs", " ", "to", " ", "std", "err", " ", "[", "%", "(", "default", ")", "s", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "register", "\\u", "tasks_", "=_", "option_", "(_", "name_", "=_", "'", "task", "s", "'_", ",_", "default_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metavar_", "=_", "'", "TASK", "'_", ",_", "nargs_", "=_", "'*'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Task", "s", " ", "to", " ", "run", ".", " ", " ", "Pass", " ", "with", "out", " ", "args", " ", "to", " ", "see", " ", "the", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", ".", " ", "If", " ", "not", " ", "pass", "ed", ",", " ", "all", " ", "task", "s", " ", "will", " ", "be", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "HAS", "\\u", "DA", "EMO", "NI", "ZE", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "daemon_", "=_", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Start", " ", "as", " ", "a", " ", "daemon", " ", "usi", "ng", " ", "PID", "FILE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pidfile_", "=_", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "DEF", "AUL", "T", "\\u", "PID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Da", "emo", "n", " ", "pid", " ", "file", " ", "path", " ", "[", "%", "(", "default", ")", "s", "]'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metavar_", "=_", "'", "PID", "FILE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kill_", "=_", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Kill", " ", "the", " ", "currentl", "y", " ", "runn", "ing", " ", "daemon", " ", "for", " ", "PID", "FILE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Output", " ", "whe", "ther", " ", "the", " ", "daemon", " ", "for", " ", "PID", "FILE", " ", "is", " ", "runn", "ing", "'_", ",_", "\\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_", "HAS", "\\u", "PS", "UTIL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "runi", "t", "\\u", "install_", "=_", "option_", "(_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Install", " ", "this", " ", "service", " ", "under", " ", "runi", "t", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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_", ",_", "ns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "VS", "ervice", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Optio", "n", " ", "initialization", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "options_", "=_", "ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "init", "Logging_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Control", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "stop_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "restart_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "Tasks_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "tasks_", "=_", "vta", "sk_", "._", "Tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Register", " ", "task", "s", " ", "from", " ", "global", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "vta", "sk_", "._", "REGISTER", "ED_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tasks_", "._", "register_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "addition", "al", " ", "task", "s", " ", "from", " ", "service", " ", "declaration_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "self_", "._", "TASK", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tasks_", "._", "register_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "warn", "ings", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "warnings_", "=_", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "warn", "ing", "\\u", "id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "exported", " ", "values", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "exported", "\\u", "values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "start", "\\u", "time", " ", "for", " ", "alive", "Sin", "ce", "()", " ", "calls_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "Service_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Override", " ", "this", " ", "to", " ", "do", " ", "any", " ", "service", "-", "specific", " ", "initialization", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "lop", "t", "Name_", "(_", "cls_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'--'_", "+_", "name_", "._", "replace_", "(_", "'\\u'_", ",_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "preproc", "ess", "Options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Processe", "s", " ", "\"", "action", "\"", " ", "orient", "ed", " ", "options", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "get", "Option_", "(_", "'", "runi", "t", "\\u", "install", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "install_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "HAS", "\\u", "DA", "EMO", "NI", "ZE", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Act", " ", "on", " ", "the", " ", "--", "status", " ", "if", " ", "presen", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "status_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "daemon_", "._", "status_", "(_", "pidfile_", "=_", "self_", "._", "pidfile_", ",_", "logger_", "=_", "self_", "._", "logger_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "exit_", "(_", "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 ", " ", "_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Act", " ", "on", " ", "the", " ", "--", "kill", " ", "flag", " ", "if", " ", "presen", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "kill_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "daemon_", "._", "kill_", "(_", "pidfile_", "=_", "self_", "._", "pidfile_", ",_", "logger_", "=_", "self_", "._", "logger_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "exit_", "(_", "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 ", " ", "_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "options_", "._", "tasks_", "==_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Avail", "able", " ", "Task", "s", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "self_", "._", "tasks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", " ", "-", " ", "%", "s", "\"_", "%_", "t_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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", "create", "Tasks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "tasks_", "=_", "set_", "(_", "self_", "._", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "selecte", "d\\u", "tasks_", "=_", "self_", "._", "options_", "._", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selecte", "d\\u", "tasks_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selecte", "d\\u", "tasks_", "=_", "[_", "t_", "._", "\\u\\u", "name\\u\\u_", "for_", "t_", "in_", "all", "\\u", "tasks_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "whi", "ch", " ", "task", "s", " ", "need", " ", "to", " ", "be", " ", "unregister", "ed", " ", "based", " ", "on", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "selecte", "d", " ", "task", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "unregister", "\\u", "tasks_", "=_", "[_", "t_", "for_", "t_", "in_", "all", "\\u", "tasks_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "t_", "._", "\\u\\u", "name\\u\\u_", "not_", "in_", "selecte", "d\\u", "tasks_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unregister", " ", "non", "-", "selecte", "d", " ", "tasks_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "unregister", "\\u", "tasks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tasks_", "._", "unregister_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Actual", "ly", " ", "create", " ", "the", " ", "tasks_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "tasks_", "._", "create_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Call", " ", "service", " ", "initialization", " ", "hook", " ", "after", " ", "task", "s", " ", "have", " ", "bee", "n", " ", "instantiate", "d", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "bef", "ore", " ", "the", "y", "'", "ve", " ", "bee", "n", " ", "initialize", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "init", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "the", " ", "tasks_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "tasks_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "handle", "Shut", "down", "Signals_", "(_", "self_", ",_", "signum_", ",_", "frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "signum_", "in_", "(_", "signal_", "._", "SIGINT_", ",_", "signal_", "._", "SIGTERM_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "info_", "(_", "'", "signal", " ", "-%", "d", " ", "receive", "d", "'_", ",_", "signum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shutdown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "start", "Tasks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Sho", "ul", "d", " ", "this", " ", "be", " ", "some", "where", " ", "else", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "REGISTER", "\\u", "SIGN", "AL", "\\u", "HANDLER", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thin", "gs", " ", "see", "m", " ", "to", " ", "fail", " ", "more", " ", "graceful", "ly", " ", "if", " ", "we", " ", "trigger", " ", "the", " ", "stop_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "out", " ", "of", " ", "band", " ", "(", "with", " ", "a", " ", "signal", " ", "handler", ")", " ", "inst", "ead", " ", "of", " ", "catch", "ing", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Key", "board", "Interr", "upt", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signal_", "._", "signal_", "(_", "signal_", "._", "SIGINT_", ",_", "self_", "._", "\\u", "handle", "Shut", "down", "Signals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signal_", "._", "signal_", "(_", "signal_", "._", "SIGTERM_", ",_", "self_", "._", "\\u", "handle", "Shut", "down", "Signals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "tasks_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "All", " ", "task", "s", " ", "start", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Task_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "task", " ", "for", " ", "the", " ", "give", "n", " ", "class", " ", "`", "name", "`", " ", "or", " ", "type", ",", " ", "or", " ", "Non", "e", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "tasks_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "require", "Task_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "task", " ", "for", " ", "the", " ", "give", "n", " ", "class", " ", "`", "name", "`", " ", "or", " ", "type", ",", " ", "or", " ", "throw", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "tasks_", "._", "require_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shutdown_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Request", " ", "a", " ", "graceful", " ", "shut", "down", ".", " ", " ", "Do", "es", " ", "not", " ", "block", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "info_", "(_", "\"", "Receive", "d", " ", "graceful", " ", "shut", "down", " ", "request", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "restart_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Request", " ", "a", " ", "graceful", " ", "restart", ".", " ", " ", "Do", "es", " ", "not", " ", "block", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "info_", "(_", "\"", "Receive", "d", " ", "graceful", " ", "restart", " ", "request", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "restart_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "stop_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "wait_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "'", "VS", "ervice", " ", "Activ", "e", ".", " ", " ", "Await", "ing", " ", "graceful", " ", "shut", "down", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "there", " ", "are", " ", "no", " ", "rema", "inin", "g", " ", "task", "s", " ", "(", "or", " ", "this", " ", "service", " ", "has", " ", "no", " ", "task", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "sleep", " ", "unti", "l", " ", "^", "C", " ", "is", " ", "pressed_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "not_", "self_", "._", "\\u", "stop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Key", "board", "Interr", "upt", " ", "Receive", "d", "!", " ", " ", "Stopp", "ing", " ", "Task", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "reversed_", "(_", "self_", "._", "tasks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "stop_", "(_", ")_", "\\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 ", " _", "self_", "._", "logger_", "._", "info_", "(_", "'", "Wait", "ing", " ", "for", " ", "task", "s", " ", "to", " ", "shut", "down", " ", "graceful", "ly", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "reversed_", "(_", "self_", "._", "tasks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "'", "Wait", "ing", " ", "for", " ", "%", "s", " ", "to", " ", "stop", "...'_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "warning_", "(_", "'", "Ab", "ando", "n", " ", "all", " ", "hop", "e", " ", "ye", " ", "who", " ", "enter", " ", "here", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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_", "join_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Block", "s", " ", "unti", "l", " ", "a", " ", "stop", " ", "is", " ", "request", "ed", ",", " ", "waits", " ", "for", " ", "all", " ", "task", "s", " ", "to", " ", "shut", "down", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "\\u", "stop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "reversed_", "(_", "self_", "._", "tasks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "init", "Fro", "m", "CLI_", "(_", "cls_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Start", "s", " ", "this", " ", "service", ",", " ", "process", "ing", " ", "command", " ", "line", " ", "argu", "ment", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ap_", "=_", "cls_", "._", "\\u", "build", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "=_", "ap_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "=_", "cls_", "._", "init", "Fro", "m", "Options_", "(_", "ns_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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_", "init", "Fro", "m", "Options_", "(_", "cls_", ",_", "ns_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Start", "s", " ", "this", " ", "service", ",", " ", "argu", "ment", "s", " ", "from", " ", "`", "ns", "`\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "=_", "cls_", "(_", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance_", "._", "preproc", "ess", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "HAS", "\\u", "DA", "EMO", "NI", "ZE", "_", "and_", "ns_", "._", "daemon_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "daemon_", "._", "daemon", "ize_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "functools_", "._", "partial_", "(_", "cls_", "._", "\\u", "run", "loop_", ",_", "instance_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "instance_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pidfile_", "=_", "ns_", "._", "pidfile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "instance_", "._", "logger_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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_", "cls_", "._", "\\u", "run", "loop_", "(_", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "run", "loop_", "(_", "cls_", ",_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "not_", "instance_", "._", "\\u", "stop_", ":_", "\\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 ", " _", "instance_", "._", "\\u", "create", "Tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "._", "\\u", "start", "Tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "._", "logger_", "._", "exception_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "Except", "ion", " ", "dur", "ing", " ", "init", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "._", "shutdown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance_", "._", "\\u", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "instance_", "._", "\\u", "restart_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "=_", "cls_", "(_", "instance_", "._", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance_", "._", "logger_", "._", "info_", "(_", "\"", "Insta", "nce", " ", "shut", " ", "down", " ", "graceful", "ly", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "BG", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Start", "s", " ", "this", " ", "service", " ", "in", " ", "the", " ", "background", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "thread", " ", "tha", "t", " ", "will", " ", "join", "()", " ", "on", " ", "graceful", " ", "shut", "down", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "create", "Tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "start", "Tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u", "wait_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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 ", " _", "if_", "self_", "._", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "name_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "name_", "._", "setter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "name_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "name_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "Logging_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Basic", " ", "std", "err", " ", "logg", "ing", ".", " ", " ", "Override", " ", "this", " ", "to", " ", "do", " ", "somet", "hing", " ", "else", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logfile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "basic", "Config_", "(_", "level_", "=_", "self_", "._", "loglevel_", ",_", "filename_", "=_", "self_", "._", "logfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "basic", "Config_", "(_", "level_", "=_", "self_", "._", "loglevel_", ",_", "stream_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "captur", "e", "Warnings", "_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "make", "Arg", "ument", "Parser_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "an", " ", "argp", "arse", ".", "Arg", "ument", "Parser", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "this", " ", "method", " ", "if", " ", "you", " ", "alr", "ead", "y", " ", "have", " ", "an", " ", "Arg", "ument", "Parser", " ", "instance", " ", "to", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "you", " ", "simp", "ly", " ", "want", " ", "to", " ", "speci", "fy", " ", "some", " ", "of", " ", "the", " ", "option", "al", " ", "argu", "ment", "s", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "argp", "arse", ".", "Arg", "ument", "Parser", ".\\u", "\\u", "init", "\\u\\u", "\\", "10", ";", " ", " ", " ", " ", "(", "e", ".", "g", ".", " ", "\"", "from", "file", "\\u", "prefix", "\\u", "char", "s", "\"", " ", "or", " ", "\"", "confl", "ict", "\\u", "handler", "\"...", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "build", "Arg", "ument", "Parser_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ap_", "=_", "cls_", "._", "\\u", "make", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u", "add", "Arguments_", "(_", "ap_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "all", "\\u", "tasks_", "=_", "vta", "sk_", "._", "Tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "tasks_", "._", "register", "\\u", "all_", "(_", "cls_", "._", "TASK", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "tasks_", "._", "register", "\\u", "all_", "(_", "vta", "sk_", "._", "REGISTER", "ED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "all", "\\u", "tasks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Add", " ", "each", " ", "task", "s", "'", " ", "argu", "ment", "s", " ", "to", " ", "an", " ", "argu", "ment", " ", "group_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "\\u", "add", "Arguments_", "(_", "ap_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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_", "loglevel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Dep", "reca", "te", " ", "this", " ", "after", " ", "prot", "ing", " ", "args", " ", "to", " ", "proper", " ", "option", "()", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "logging_", ",_", "self_", "._", "options_", "._", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Option_", "(_", "self_", ",_", "name_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", "._", "options_", ",_", "name_", ",_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Option_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "self_", "._", "options_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "options_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "install_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "HAS", "\\u", "PS", "UTIL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"", "You", " ", "need", " ", "psu", "til", " ", "install", "ed", " ", "to", " ", "install", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "under", " ", "runi", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "spar", "ts_", "._", "runi", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spar", "ts_", "._", "runi", "t_", "._", "install_", "(_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Children_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "(_", "(_", "t_", "._", "name_", ",_", "t_", ")_", "for_", "t_", "in_", "self_", "._", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Warnings", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "register", "Warning_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wid_", "=_", "self_", "._", "warn", "ing", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "warn", "ing", "\\u", "id_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "warnings_", "[_", "wid_", "]_", "=_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "wid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "Warnings", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "warnings_", "=_", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "Warning_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "id_", "not_", "in_", "self_", "._", "warnings_", ":_", "\\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_", "del_", "self_", "._", "warnings_", "[_", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Exporte", "d", "Value_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "exported", "\\u", "values_", "._", "get_", "(_", "name_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Exporte", "d", "Value_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "exported", "\\u", "values_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "exported", "\\u", "values_", "[_", "name_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "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", "Exporte", "d", "Values_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "copy_", "._", "copy_", "(_", "self_", "._", "exported", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Rege", "x", "Exporte", "d", "Values_", "(_", "self_", ",_", "regex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matcher_", "=_", "re_", "._", "compile_", "(_", "regex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "[_", "key_", "for_", "key_", "in_", "self_", "._", "exported", "\\u", "values_", "._", "keys_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "matcher_", "._", "match_", "(_", "key_", ")_", "is_", "not_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "Select", "ed", "Exporte", "d", "Values_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VS", "ervice", "_", "(_", "\\u", "Spar", "ts", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Select", "ed", "Exporte", "d", "Values_", "(_", "self_", ",_", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "(_", "[_", "(_", "key_", ",_", "self_", "._", "get", "Exporte", "d", "Value_", "(_", "key_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", "in_", "keys_", "]_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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