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 |
---|---|---|---|---|---|---|---|---|
Unreachable code | cobrateam/flask-mongoalchemy/examples/books_collection/run.py | [
{
"content": "# -*- coding: utf-8 -*-\n\n# Copyright 2010 flask-mongoalchemy authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\nfrom collection import app\n\nif __name__ == '__main__':\n app.run()\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"utf",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"2010",
" ",
"fla",
"sk",
"-",
"mongo",
"alchemy",
" ",
"author",
"s",
".",
" ",
"All",
" ",
"rights",
" ",
"reserve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Us",
"e",
" ",
"of",
" ",
"this",
" ",
"source",
" ",
"code",
" ",
"is",
" ",
"govern",
"ed",
" ",
"by",
" ",
"a",
" ",
"BS",
"D",
"-",
"style_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"license",
" ",
"tha",
"t",
" ",
"can",
" ",
"be",
" ",
"found",
" ",
"in",
" ",
"the",
" ",
"LICENSE",
" ",
"file",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"collection_",
"import_",
"app_",
"\\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 ",
" _",
"app_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Deprecated slice method | PythonProgramming/Beginning-Game-Development-with-Python-and-Pygame/gameobjects/vector2.py | [
{
"content": " def __getitem__(self, index):\n \"\"\"Gets a component as though the vector were a list.\"\"\"\n try:\n return self._v[index]\n except IndexError:\n raise IndexError(\"There are 2 values in this object, index should be 0 or 1\")",
"metadata": "root.Vector2.__getitem__",
"header": "['class', 'Vector2', '(', 'object', ')', ':', '___EOS___']",
"index": 128
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Dep",
"reca",
"ted_",
"slice_",
"method_",
"[SEP]_",
"class_",
"Vector2",
"_",
"(_",
"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_",
",_",
"index_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Get",
"s",
" ",
"a",
" ",
"component",
" ",
"as",
" ",
"tho",
"ugh",
" ",
"the",
" ",
"vector",
" ",
"wer",
"e",
" ",
"a",
" ",
"list",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"v_",
"[_",
"index_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Index",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Index",
"Error_",
"(_",
"\"",
"There",
" ",
"are",
" ",
"2",
" ",
"values",
" ",
"in",
" ",
"this",
" ",
"object",
",",
" ",
"index",
" ",
"shou",
"ld",
" ",
"be",
" ",
"0",
" ",
"or",
" ",
"1",
"\"_",
")_",
"\\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
] |
Unused local variable | cloudera/hue/desktop/core/ext-py/django-extensions-1.5.0/django_extensions/templatetags/highlighting.py | [
{
"content": " def render(self, context):\n code = self.nodelist.render(context).strip()\n lexer = get_lexer_by_name(self.language.resolve(context))\n formatter = HtmlFormatter(linenos=False)\n html = \"\"\n if self.name:\n name = self.name.resolve(context)\n html = '<div class=\"predesc\"><span>%s</span></div>' % (name)\n return html + pyghighlight(code, lexer, formatter)",
"metadata": "root.CodeNode.render",
"header": "['class', 'CodeNode', '(', 'Node', ')', ':', '___EOS___']",
"index": 61
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Code",
"Node_",
"(_",
"Node_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"render_",
"(_",
"self_",
",_",
"context_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"code_",
"=_",
"self_",
"._",
"nodelist_",
"._",
"render_",
"(_",
"context_",
")_",
"._",
"strip_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lexer_",
"=_",
"get",
"\\u",
"lexer",
"\\u",
"by",
"\\u",
"name_",
"(_",
"self_",
"._",
"language_",
"._",
"resolve_",
"(_",
"context_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"formatter_",
"=_",
"Ht",
"ml",
"Formatter_",
"(_",
"linen",
"os_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"html_",
"=_",
"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"name_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"self_",
"._",
"name_",
"._",
"resolve_",
"(_",
"context_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"html_",
"=_",
"'<",
"div",
" ",
"class",
"=\"",
"prede",
"sc",
"\">",
"<",
"span",
">",
"%",
"s",
"</",
"span",
"><",
"/",
"div",
">'_",
"%_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"html_",
"+_",
"pyg",
"highlight_",
"(_",
"code_",
",_",
"lexer_",
",_",
"formatter_",
")_",
"\\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
] |
Unused local variable | cloudera/hue/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Util/number.py | [
{
"content": "def getStrongPrime(N, e=0, false_positive_prob=1e-6, randfunc=None):\n \"\"\"getStrongPrime(N:int, e:int, false_positive_prob:float, randfunc:callable):long\n Return a random strong N-bit prime number.\n In this context p is a strong prime if p-1 and p+1 have at\n least one large prime factor.\n N should be a multiple of 128 and > 512.\n\n If e is provided the returned prime p-1 will be coprime to e\n and thus suitable for RSA where e is the public exponent.\n\n The optional false_positive_prob is the statistical probability\n that true is returned even though it is not (pseudo-prime).\n It defaults to 1e-6 (less than 1:1000000).\n Note that the real probability of a false-positive is far less. This is\n just the mathematically provable limit.\n\n randfunc should take a single int parameter and return that\n many random bytes as a string.\n If randfunc is omitted, then Random.new().read is used.\n \"\"\"\n # This function was implemented following the\n # instructions found in the paper:\n # \"FAST GENERATION OF RANDOM, STRONG RSA PRIMES\"\n # by Robert D. Silverman\n # RSA Laboratories\n # May 17, 1997\n # which by the time of writing could be freely downloaded here:\n # http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.17.2713&rep=rep1&type=pdf\n\n # Use the accelerator if available\n if _fastmath is not None:\n return _fastmath.getStrongPrime(long(N), long(e), false_positive_prob,\n randfunc)\n\n if (N < 512) or ((N % 128) != 0):\n raise ValueError (\"bits must be multiple of 128 and > 512\")\n\n rabin_miller_rounds = int(math.ceil(-math.log(false_positive_prob)/math.log(4)))\n\n # calculate range for X\n # lower_bound = sqrt(2) * 2^{511 + 128*x}\n # upper_bound = 2^{512 + 128*x} - 1\n x = (N - 512) >> 7;\n # We need to approximate the sqrt(2) in the lower_bound by an integer\n # expression because floating point math overflows with these numbers\n lower_bound = divmod(14142135623730950489L * (2L ** (511 + 128*x)),\n 10000000000000000000L)[0]\n upper_bound = (1L << (512 + 128*x)) - 1\n # Randomly choose X in calculated range\n X = getRandomRange (lower_bound, upper_bound, randfunc)\n\n # generate p1 and p2\n p = [0, 0]\n for i in (0, 1):\n # randomly choose 101-bit y\n y = getRandomNBitInteger (101, randfunc)\n # initialize the field for sieving\n field = [0] * 5 * len (sieve_base)\n # sieve the field\n for prime in sieve_base:\n offset = y % prime\n for j in xrange ((prime - offset) % prime, len (field), prime):\n field[j] = 1\n\n # look for suitable p[i] starting at y\n result = 0\n for j in range(len(field)):\n composite = field[j]\n # look for next canidate\n if composite:\n continue\n tmp = y + j\n result = _rabinMillerTest (tmp, rabin_miller_rounds)\n if result > 0:\n p[i] = tmp\n break\n if result == 0:\n raise RuntimeError (\"Couln't find prime in field. \"\n \"Developer: Increase field_size\")\n\n # Calculate R\n # R = (p2^{-1} mod p1) * p2 - (p1^{-1} mod p2) * p1\n tmp1 = inverse (p[1], p[0]) * p[1] # (p2^-1 mod p1)*p2\n tmp2 = inverse (p[0], p[1]) * p[0] # (p1^-1 mod p2)*p1\n R = tmp1 - tmp2 # (p2^-1 mod p1)*p2 - (p1^-1 mod p2)*p1\n\n # search for final prime number starting by Y0\n # Y0 = X + (R - X mod p1p2)\n increment = p[0] * p[1]\n X = X + (R - (X % increment))\n while 1:\n is_possible_prime = 1\n # first check candidate against sieve_base\n for prime in sieve_base:\n if (X % prime) == 0:\n is_possible_prime = 0\n break\n # if e is given make sure that e and X-1 are coprime\n # this is not necessarily a strong prime criterion but useful when\n # creating them for RSA where the p-1 and q-1 should be coprime to\n # the public exponent e\n if e and is_possible_prime:\n if e & 1:\n if GCD (e, X-1) != 1:\n is_possible_prime = 0\n else:\n if GCD (e, divmod((X-1),2)[0]) != 1:\n is_possible_prime = 0\n\n # do some Rabin-Miller-Tests\n if is_possible_prime:\n result = _rabinMillerTest (X, rabin_miller_rounds)\n if result > 0:\n break\n X += increment\n\t\t# abort when X has more bits than requested\n\t\t# TODO: maybe we shouldn't abort but rather start over.\n if X >= 1L << N:\n raise RuntimeError (\"Couln't find prime in field. \"\n \"Developer: Increase field_size\")\n return X",
"metadata": "root.getStrongPrime",
"header": "['module', '___EOS___']",
"index": 232
}
] | [] | [] | 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_",
"get",
"Strong",
"Prime",
"_",
"(_",
"N_",
",_",
"e_",
"=_",
"0_",
",_",
"fal",
"se",
"\\u",
"posit",
"ive",
"\\u",
"prob_",
"=_",
"1e-6_",
",_",
"rand",
"func_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"get",
"Strong",
"Prime",
"(",
"N",
":",
"int",
",",
" ",
"e",
":",
"int",
",",
" ",
"fal",
"se",
"\\u",
"posit",
"ive",
"\\u",
"prob",
":",
"float",
",",
" ",
"rand",
"func",
":",
"calla",
"ble",
"):",
"long",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
"random",
" ",
"strong",
" ",
"N",
"-",
"bit",
" ",
"prim",
"e",
" ",
"number",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"In",
" ",
"this",
" ",
"context",
" ",
"p",
" ",
"is",
" ",
"a",
" ",
"strong",
" ",
"prim",
"e",
" ",
"if",
" ",
"p",
"-1",
" ",
"and",
" ",
"p",
"+",
"1",
" ",
"have",
" ",
"at",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"leas",
"t",
" ",
"one",
" ",
"large",
" ",
"prim",
"e",
" ",
"factor",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"N",
" ",
"shou",
"ld",
" ",
"be",
" ",
"a",
" ",
"multiple",
" ",
"of",
" ",
"128",
" ",
"and",
" ",
">",
" ",
"512",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"e",
" ",
"is",
" ",
"provided",
" ",
"the",
" ",
"return",
"ed",
" ",
"prim",
"e",
" ",
"p",
"-1",
" ",
"will",
" ",
"be",
" ",
"cop",
"rime",
" ",
"to",
" ",
"e",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"and",
" ",
"thu",
"s",
" ",
"suit",
"able",
" ",
"for",
" ",
"RSA",
" ",
"where",
" ",
"e",
" ",
"is",
" ",
"the",
" ",
"public",
" ",
"expon",
"ent",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"option",
"al",
" ",
"fal",
"se",
"\\u",
"posit",
"ive",
"\\u",
"prob",
" ",
"is",
" ",
"the",
" ",
"statistic",
"al",
" ",
"probabilit",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"tha",
"t",
" ",
"true",
" ",
"is",
" ",
"return",
"ed",
" ",
"even",
" ",
"tho",
"ugh",
" ",
"it",
" ",
"is",
" ",
"not",
" ",
"(",
"pseudo",
"-",
"prim",
"e",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"It",
" ",
"default",
"s",
" ",
"to",
" ",
"1e-",
"6",
" ",
"(",
"less",
" ",
"than",
" ",
"1",
":",
"1000000",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"e",
" ",
"tha",
"t",
" ",
"the",
" ",
"real",
" ",
"probabilit",
"y",
" ",
"of",
" ",
"a",
" ",
"fal",
"se",
"-",
"posit",
"ive",
" ",
"is",
" ",
"far",
" ",
"less",
".",
" ",
"Thi",
"s",
" ",
"is",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"just",
" ",
"the",
" ",
"mathe",
"matical",
"ly",
" ",
"prov",
"able",
" ",
"limit",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rand",
"func",
" ",
"shou",
"ld",
" ",
"take",
" ",
"a",
" ",
"single",
" ",
"int",
" ",
"parameter",
" ",
"and",
" ",
"return",
" ",
"tha",
"t",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"many",
" ",
"random",
" ",
"bytes",
" ",
"as",
" ",
"a",
" ",
"string",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"rand",
"func",
" ",
"is",
" ",
"omit",
"ted",
",",
" ",
"then",
" ",
"Random",
".",
"new",
"()",
".",
"read",
" ",
"is",
" ",
"used",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"function",
" ",
"was",
" ",
"implemented",
" ",
"follow",
"ing",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"instruct",
"ion",
"s",
" ",
"found",
" ",
"in",
" ",
"the",
" ",
"pape",
"r",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"\"",
"FAST",
" ",
"GENERAT",
"ION",
" ",
"OF",
" ",
"RANDOM",
",",
" ",
"STR",
"ONG",
" ",
"RSA",
" ",
"PRIM",
"ES",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"by",
" ",
"Robert",
" ",
"D",
".",
" ",
"Sil",
"ver",
"man_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"RSA",
" ",
"Labo",
"rator",
"ies_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"Ma",
"y",
" ",
"1",
"7",
",",
" ",
"1997",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"whi",
"ch",
" ",
"by",
" ",
"the",
" ",
"time",
" ",
"of",
" ",
"writ",
"ing",
" ",
"coul",
"d",
" ",
"be",
" ",
"free",
"ly",
" ",
"download",
"ed",
" ",
"here",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"http",
"://",
"cite",
"see",
"rx",
".",
"ist",
".",
"psu",
".",
"edu",
"/",
"view",
"doc",
"/",
"download",
"?",
"doi",
"=",
"10.1",
".1",
".1",
"7.2",
"713",
"&",
"rep",
"=",
"rep",
"1",
"&",
"type",
"=",
"pdf_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Us",
"e",
" ",
"the",
" ",
"accelerator",
" ",
"if",
" ",
"available_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"\\u",
"fast",
"math_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u",
"fast",
"math_",
"._",
"get",
"Strong",
"Prime",
"_",
"(_",
"long_",
"(_",
"N_",
")_",
",_",
"long_",
"(_",
"e_",
")_",
",_",
"fal",
"se",
"\\u",
"posit",
"ive",
"\\u",
"prob_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"rand",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"N_",
"<_",
"512_",
")_",
"or_",
"(_",
"(_",
"N_",
"%_",
"128_",
")_",
"!=_",
"0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"\"",
"bits",
" ",
"must",
" ",
"be",
" ",
"multiple",
" ",
"of",
" ",
"128",
" ",
"and",
" ",
">",
" ",
"512",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"rab",
"in",
"\\u",
"mill",
"er",
"\\u",
"rounds_",
"=_",
"int_",
"(_",
"math_",
"._",
"ceil_",
"(_",
"-_",
"math_",
"._",
"log_",
"(_",
"fal",
"se",
"\\u",
"posit",
"ive",
"\\u",
"prob_",
")_",
"/_",
"math_",
"._",
"log_",
"(_",
"4_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"calcul",
"ate",
" ",
"range",
" ",
"for",
" ",
"X_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"lower",
"\\u",
"bound",
" ",
"=",
" ",
"sqrt",
"(",
"2",
")",
" ",
"*",
" ",
"2",
"^",
"{",
"511",
" ",
"+",
" ",
"128",
"*",
"x",
"}_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"upper",
"\\u",
"bound",
" ",
"=",
" ",
"2",
"^",
"{",
"512",
" ",
"+",
" ",
"128",
"*",
"x",
"}",
" ",
"-",
" ",
"1_",
"\\u\\u\\uNL\\u\\u\\u_",
"x_",
"=_",
"(_",
"N_",
"-_",
"512_",
")_",
">>_",
"7_",
";_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"We",
" ",
"need",
" ",
"to",
" ",
"approximate",
" ",
"the",
" ",
"sqrt",
"(",
"2",
")",
" ",
"in",
" ",
"the",
" ",
"lower",
"\\u",
"bound",
" ",
"by",
" ",
"an",
" ",
"integer_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"express",
"ion",
" ",
"bec",
"aus",
"e",
" ",
"float",
"ing",
" ",
"point",
" ",
"math",
" ",
"overflow",
"s",
" ",
"with",
" ",
"these",
" ",
"numbers_",
"\\u\\u\\uNL\\u\\u\\u_",
"lower",
"\\u",
"bound_",
"=_",
"divmod_",
"(_",
"141",
"421",
"356",
"237",
"309",
"504",
"89_",
"L_",
"*_",
"(_",
"2_",
"L_",
"**_",
"(_",
"511",
"_",
"+_",
"128_",
"*_",
"x_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"100000000000",
"00000000",
"_",
"L_",
")_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"upper",
"\\u",
"bound_",
"=_",
"(_",
"1_",
"L_",
"<<_",
"(_",
"512_",
"+_",
"128_",
"*_",
"x_",
")_",
")_",
"-_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Random",
"ly",
" ",
"choose",
" ",
"X",
" ",
"in",
" ",
"calculated",
" ",
"range_",
"\\u\\u\\uNL\\u\\u\\u_",
"X_",
"=_",
"get",
"Random",
"Range_",
"(_",
"lower",
"\\u",
"bound_",
",_",
"upper",
"\\u",
"bound_",
",_",
"rand",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"generat",
"e",
" ",
"p1",
" ",
"and",
" ",
"p2_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"=_",
"[_",
"0_",
",_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"(_",
"0_",
",_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"random",
"ly",
" ",
"choose",
" ",
"101",
"-",
"bit",
" ",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"y_",
"=_",
"get",
"Random",
"NB",
"it",
"Integer_",
"(_",
"101_",
",_",
"rand",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"initialize",
" ",
"the",
" ",
"field",
" ",
"for",
" ",
"sie",
"ving",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"field_",
"=_",
"[_",
"0_",
"]_",
"*_",
"5_",
"*_",
"len_",
"(_",
"sieve",
"\\u",
"base_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"sieve",
" ",
"the",
" ",
"field_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"prime_",
"in_",
"sieve",
"\\u",
"base_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"offset_",
"=_",
"y_",
"%_",
"prime_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"j_",
"in_",
"xrange_",
"(_",
"(_",
"prime_",
"-_",
"offset_",
")_",
"%_",
"prime_",
",_",
"len_",
"(_",
"field_",
")_",
",_",
"prime_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"field_",
"[_",
"j_",
"]_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"look",
" ",
"for",
" ",
"suit",
"able",
" ",
"p",
"[",
"i",
"]",
" ",
"startin",
"g",
" ",
"at",
" ",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"result_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"j_",
"in_",
"range_",
"(_",
"len_",
"(_",
"field_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"composite_",
"=_",
"field_",
"[_",
"j_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"look",
" ",
"for",
" ",
"next",
" ",
"can",
"idat",
"e_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"composite_",
":_",
"\\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_",
"tmp_",
"=_",
"y_",
"+_",
"j_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"=_",
"\\u",
"rab",
"in",
"Mill",
"er",
"Test_",
"(_",
"tmp_",
",_",
"rab",
"in",
"\\u",
"mill",
"er",
"\\u",
"rounds_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"result_",
">_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"p_",
"[_",
"i_",
"]_",
"=_",
"tmp_",
"\\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_",
"result_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"\"",
"Cou",
"ln",
"'",
"t",
" ",
"find",
" ",
"prim",
"e",
" ",
"in",
" ",
"field",
".",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Dev",
"elope",
"r",
":",
" ",
"Increase",
" ",
"field",
"\\u",
"size",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Calculat",
"e",
" ",
"R_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"R",
" ",
"=",
" ",
"(",
"p2",
"^",
"{-",
"1",
"}",
" ",
"mod",
" ",
"p1",
")",
" ",
"*",
" ",
"p2",
" ",
"-",
" ",
"(",
"p1",
"^",
"{-",
"1",
"}",
" ",
"mod",
" ",
"p2",
")",
" ",
"*",
" ",
"p1_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"tmp1",
"_",
"=_",
"inverse_",
"(_",
"p_",
"[_",
"1_",
"]_",
",_",
"p_",
"[_",
"0_",
"]_",
")_",
"*_",
"p_",
"[_",
"1_",
"]_",
"#",
" ",
"(",
"p2",
"^",
"-1",
" ",
"mod",
" ",
"p1",
")*",
"p2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tmp2_",
"=_",
"inverse_",
"(_",
"p_",
"[_",
"0_",
"]_",
",_",
"p_",
"[_",
"1_",
"]_",
")_",
"*_",
"p_",
"[_",
"0_",
"]_",
"#",
" ",
"(",
"p1",
"^",
"-1",
" ",
"mod",
" ",
"p2",
")*",
"p1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"R_",
"=_",
"tmp1",
"_",
"-_",
"tmp2_",
"#",
" ",
"(",
"p2",
"^",
"-1",
" ",
"mod",
" ",
"p1",
")*",
"p2",
" ",
"-",
" ",
"(",
"p1",
"^",
"-1",
" ",
"mod",
" ",
"p2",
")*",
"p1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"search",
" ",
"for",
" ",
"final",
" ",
"prim",
"e",
" ",
"number",
" ",
"startin",
"g",
" ",
"by",
" ",
"Y",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"Y",
"0",
" ",
"=",
" ",
"X",
" ",
"+",
" ",
"(",
"R",
" ",
"-",
" ",
"X",
" ",
"mod",
" ",
"p1",
"p2",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"increment_",
"=_",
"p_",
"[_",
"0_",
"]_",
"*_",
"p_",
"[_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"X_",
"=_",
"X_",
"+_",
"(_",
"R_",
"-_",
"(_",
"X_",
"%_",
"increment_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"is",
"\\u",
"possib",
"le",
"\\u",
"prime_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"first",
" ",
"check",
" ",
"candidate",
" ",
"against",
" ",
"sieve",
"\\u",
"base_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"prime_",
"in_",
"sieve",
"\\u",
"base_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"X_",
"%_",
"prime_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"is",
"\\u",
"possib",
"le",
"\\u",
"prime_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"if",
" ",
"e",
" ",
"is",
" ",
"give",
"n",
" ",
"make",
" ",
"sure",
" ",
"tha",
"t",
" ",
"e",
" ",
"and",
" ",
"X",
"-1",
" ",
"are",
" ",
"cop",
"rime",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"this",
" ",
"is",
" ",
"not",
" ",
"necessar",
"il",
"y",
" ",
"a",
" ",
"strong",
" ",
"prim",
"e",
" ",
"criterio",
"n",
" ",
"but",
" ",
"usef",
"ul",
" ",
"when_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"creati",
"ng",
" ",
"them",
" ",
"for",
" ",
"RSA",
" ",
"where",
" ",
"the",
" ",
"p",
"-1",
" ",
"and",
" ",
"q",
"-1",
" ",
"shou",
"ld",
" ",
"be",
" ",
"cop",
"rime",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"public",
" ",
"expon",
"ent",
" ",
"e_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"e_",
"and_",
"is",
"\\u",
"possib",
"le",
"\\u",
"prime_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"e_",
"&_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"GC",
"D_",
"(_",
"e_",
",_",
"X_",
"-_",
"1_",
")_",
"!=_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"is",
"\\u",
"possib",
"le",
"\\u",
"prime_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"GC",
"D_",
"(_",
"e_",
",_",
"divmod_",
"(_",
"(_",
"X_",
"-_",
"1_",
")_",
",_",
"2_",
")_",
"[_",
"0_",
"]_",
")_",
"!=_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"is",
"\\u",
"possib",
"le",
"\\u",
"prime_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"do",
" ",
"some",
" ",
"Ra",
"bin",
"-",
"Mill",
"er",
"-",
"Tests_",
"\\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_",
"is",
"\\u",
"possib",
"le",
"\\u",
"prime_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"=_",
"\\u",
"rab",
"in",
"Mill",
"er",
"Test_",
"(_",
"X_",
",_",
"rab",
"in",
"\\u",
"mill",
"er",
"\\u",
"rounds_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"result_",
">_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"X_",
"+=_",
"increment_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"abort",
" ",
"whe",
"n",
" ",
"X",
" ",
"has",
" ",
"more",
" ",
"bits",
" ",
"than",
" ",
"requested_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
":",
" ",
"may",
"be",
" ",
"we",
" ",
"shou",
"ld",
"n",
"'",
"t",
" ",
"abort",
" ",
"but",
" ",
"rat",
"her",
" ",
"start",
" ",
"over",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"X_",
">=_",
"1_",
"L_",
"<<_",
"N_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"\"",
"Cou",
"ln",
"'",
"t",
" ",
"find",
" ",
"prim",
"e",
" ",
"in",
" ",
"field",
".",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Dev",
"elope",
"r",
":",
" ",
"Increase",
" ",
"field",
"\\u",
"size",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"X_",
"\\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,
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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
] |
Unused import | AppScale/appscale/AppServer/lib/django-1.4/django/contrib/staticfiles/finders.py | [
{
"content": "import os\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.core.files.storage import default_storage, Storage, FileSystemStorage\nfrom django.utils.datastructures import SortedDict\nfrom django.utils.functional import empty, memoize, LazyObject\nfrom django.utils.importlib import import_module\nfrom django.utils._os import safe_join\n\nfrom django.contrib.staticfiles import utils\nfrom django.contrib.staticfiles.storage import AppStaticStorage\n\n_finders = SortedDict()\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nget_finder = memoize(_get_finder, _finders, 1)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class BaseFinder(object):\n \"\"\"\n A base file finder to be used for custom staticfiles finder classes.\n \"\"\"\n",
"metadata": "root.BaseFinder",
"header": "['module', '___EOS___']",
"index": 15
},
{
"content": " def find(self, path, all=False):\n \"\"\"\n Given a relative file path this ought to find an\n absolute file path.\n\n If the ``all`` parameter is ``False`` (default) only\n the first found file path will be returned; if set\n to ``True`` a list of all found files paths is returned.\n \"\"\"\n raise NotImplementedError()",
"metadata": "root.BaseFinder.find",
"header": "['class', 'BaseFinder', '(', 'object', ')', ':', '___EOS___']",
"index": 19
},
{
"content": " def list(self, ignore_patterns):\n \"\"\"\n Given an optional list of paths to ignore, this should return\n a two item iterable consisting of the relative path and storage\n instance.\n \"\"\"\n raise NotImplementedError()",
"metadata": "root.BaseFinder.list",
"header": "['class', 'BaseFinder', '(', 'object', ')', ':', '___EOS___']",
"index": 30
},
{
"content": "class FileSystemFinder(BaseFinder):\n \"\"\"\n A static files finder that uses the ``STATICFILES_DIRS`` setting\n to locate files.\n \"\"\"\n\n\n",
"metadata": "root.FileSystemFinder",
"header": "['module', '___EOS___']",
"index": 39
},
{
"content": " def __init__(self, apps=None, *args, **kwargs):\n # List of locations with static files\n self.locations = []\n # Maps dir paths to an appropriate storage instance\n self.storages = SortedDict()\n if not isinstance(settings.STATICFILES_DIRS, (list, tuple)):\n raise ImproperlyConfigured(\n \"Your STATICFILES_DIRS setting is not a tuple or list; \"\n \"perhaps you forgot a trailing comma?\")\n for root in settings.STATICFILES_DIRS:\n if isinstance(root, (list, tuple)):\n prefix, root = root\n else:\n prefix = ''\n if os.path.abspath(settings.STATIC_ROOT) == os.path.abspath(root):\n raise ImproperlyConfigured(\n \"The STATICFILES_DIRS setting should \"\n \"not contain the STATIC_ROOT setting\")\n if (prefix, root) not in self.locations:\n self.locations.append((prefix, root))\n for prefix, root in self.locations:\n filesystem_storage = FileSystemStorage(location=root)\n filesystem_storage.prefix = prefix\n self.storages[root] = filesystem_storage\n super(FileSystemFinder, self).__init__(*args, **kwargs)",
"metadata": "root.FileSystemFinder.__init__",
"header": "['class', 'FileSystemFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 44
},
{
"content": " def find(self, path, all=False):\n \"\"\"\n Looks for files in the extra locations\n as defined in ``STATICFILES_DIRS``.\n \"\"\"\n matches = []\n for prefix, root in self.locations:\n matched_path = self.find_location(root, path, prefix)\n if matched_path:\n if not all:\n return matched_path\n matches.append(matched_path)\n return matches",
"metadata": "root.FileSystemFinder.find",
"header": "['class', 'FileSystemFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 70
},
{
"content": " def find_location(self, root, path, prefix=None):\n \"\"\"\n Finds a requested static file in a location, returning the found\n absolute path (or ``None`` if no match).\n \"\"\"\n if prefix:\n prefix = '%s%s' % (prefix, os.sep)\n if not path.startswith(prefix):\n return None\n path = path[len(prefix):]\n path = safe_join(root, path)\n if os.path.exists(path):\n return path",
"metadata": "root.FileSystemFinder.find_location",
"header": "['class', 'FileSystemFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 84
},
{
"content": " def list(self, ignore_patterns):\n \"\"\"\n List all files in all locations.\n \"\"\"\n for prefix, root in self.locations:\n storage = self.storages[root]\n for path in utils.get_files(storage, ignore_patterns):\n yield path, storage",
"metadata": "root.FileSystemFinder.list",
"header": "['class', 'FileSystemFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 98
},
{
"content": "class AppDirectoriesFinder(BaseFinder):\n \"\"\"\n A static files finder that looks in the directory of each app as\n specified in the source_dir attribute of the given storage class.\n \"\"\"\n storage_class = AppStaticStorage\n\n\n\n",
"metadata": "root.AppDirectoriesFinder",
"header": "['module', '___EOS___']",
"index": 108
},
{
"content": " def __init__(self, apps=None, *args, **kwargs):\n # The list of apps that are handled\n self.apps = []\n # Mapping of app module paths to storage instances\n self.storages = SortedDict()\n if apps is None:\n apps = settings.INSTALLED_APPS\n for app in apps:\n app_storage = self.storage_class(app)\n if os.path.isdir(app_storage.location):\n self.storages[app] = app_storage\n if app not in self.apps:\n self.apps.append(app)\n super(AppDirectoriesFinder, self).__init__(*args, **kwargs)",
"metadata": "root.AppDirectoriesFinder.__init__",
"header": "['class', 'AppDirectoriesFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 115
},
{
"content": " def list(self, ignore_patterns):\n \"\"\"\n List all files in all app storages.\n \"\"\"\n for storage in self.storages.itervalues():\n if storage.exists(''): # check if storage location exists\n for path in utils.get_files(storage, ignore_patterns):\n yield path, storage",
"metadata": "root.AppDirectoriesFinder.list",
"header": "['class', 'AppDirectoriesFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 130
},
{
"content": " def find(self, path, all=False):\n \"\"\"\n Looks for files in the app directories.\n \"\"\"\n matches = []\n for app in self.apps:\n match = self.find_in_app(app, path)\n if match:\n if not all:\n return match\n matches.append(match)\n return matches",
"metadata": "root.AppDirectoriesFinder.find",
"header": "['class', 'AppDirectoriesFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 139
},
{
"content": " def find_in_app(self, app, path):\n \"\"\"\n Find a requested static file in an app's static locations.\n \"\"\"\n storage = self.storages.get(app, None)\n if storage:\n if storage.prefix:\n prefix = '%s%s' % (storage.prefix, os.sep)\n if not path.startswith(prefix):\n return None\n path = path[len(prefix):]\n # only try to find a file if the source dir actually exists\n if storage.exists(path):\n matched_path = storage.path(path)\n if matched_path:\n return matched_path",
"metadata": "root.AppDirectoriesFinder.find_in_app",
"header": "['class', 'AppDirectoriesFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 152
},
{
"content": "class BaseStorageFinder(BaseFinder):\n \"\"\"\n A base static files finder to be used to extended\n with an own storage class.\n \"\"\"\n storage = None\n\n\n",
"metadata": "root.BaseStorageFinder",
"header": "['module', '___EOS___']",
"index": 170
},
{
"content": " def __init__(self, storage=None, *args, **kwargs):\n if storage is not None:\n self.storage = storage\n if self.storage is None:\n raise ImproperlyConfigured(\"The staticfiles storage finder %r \"\n \"doesn't have a storage class \"\n \"assigned.\" % self.__class__)\n # Make sure we have an storage instance here.\n if not isinstance(self.storage, (Storage, LazyObject)):\n self.storage = self.storage()\n super(BaseStorageFinder, self).__init__(*args, **kwargs)",
"metadata": "root.BaseStorageFinder.__init__",
"header": "['class', 'BaseStorageFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 177
},
{
"content": " def find(self, path, all=False):\n \"\"\"\n Looks for files in the default file storage, if it's local.\n \"\"\"\n try:\n self.storage.path('')\n except NotImplementedError:\n pass\n else:\n if self.storage.exists(path):\n match = self.storage.path(path)\n if all:\n match = [match]\n return match\n return []",
"metadata": "root.BaseStorageFinder.find",
"header": "['class', 'BaseStorageFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 189
},
{
"content": " def list(self, ignore_patterns):\n \"\"\"\n List all files of the storage.\n \"\"\"\n for path in utils.get_files(self.storage, ignore_patterns):\n yield path, self.storage",
"metadata": "root.BaseStorageFinder.list",
"header": "['class', 'BaseStorageFinder', '(', 'BaseFinder', ')', ':', '___EOS___']",
"index": 205
},
{
"content": "class DefaultStorageFinder(BaseStorageFinder):\n \"\"\"\n A static files finder that uses the default storage backend.\n \"\"\"\n storage = default_storage\n",
"metadata": "root.DefaultStorageFinder",
"header": "['module', '___EOS___']",
"index": 213
},
{
"content": " def __init__(self, *args, **kwargs):\n super(DefaultStorageFinder, self).__init__(*args, **kwargs)\n base_location = getattr(self.storage, 'base_location', empty)\n if not base_location:\n raise ImproperlyConfigured(\"The storage backend of the \"\n \"staticfiles finder %r doesn't have \"\n \"a valid location.\" % self.__class__)",
"metadata": "root.DefaultStorageFinder.__init__",
"header": "['class', 'DefaultStorageFinder', '(', 'BaseStorageFinder', ')', ':', '___EOS___']",
"index": 219
},
{
"content": "def find(path, all=False):\n \"\"\"\n Find a static file with the given path using all enabled finders.\n\n If ``all`` is ``False`` (default), return the first matching\n absolute path (or ``None`` if no match). Otherwise return a list.\n \"\"\"\n matches = []\n for finder in get_finders():\n result = finder.find(path, all=all)\n if not all and result:\n return result\n if not isinstance(result, (list, tuple)):\n result = [result]\n matches.extend(result)\n if matches:\n return matches\n # No match.\n return all and [] or None",
"metadata": "root.find",
"header": "['module', '___EOS___']",
"index": 228
},
{
"content": "def get_finders():\n for finder_path in settings.STATICFILES_FINDERS:\n yield get_finder(finder_path)",
"metadata": "root.get_finders",
"header": "['module', '___EOS___']",
"index": 249
},
{
"content": "def _get_finder(import_path):\n \"\"\"\n Imports the staticfiles finder class described by import_path, where\n import_path is the full Python path to the class.\n \"\"\"\n module, attr = import_path.rsplit('.', 1)\n try:\n mod = import_module(module)\n except ImportError, e:\n raise ImproperlyConfigured('Error importing module %s: \"%s\"' %\n (module, e))\n try:\n Finder = getattr(mod, attr)\n except AttributeError:\n raise ImproperlyConfigured('Module \"%s\" does not define a \"%s\" '\n 'class.' % (module, attr))\n if not issubclass(Finder, BaseFinder):\n raise ImproperlyConfigured('Finder \"%s\" is not a subclass of \"%s\"' %\n (Finder, BaseFinder))\n return Finder()",
"metadata": "root._get_finder",
"header": "['module', '___EOS___']",
"index": 254
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"conf_",
"import_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"exceptions_",
"import_",
"Impro",
"perl",
"y",
"Configured_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"files_",
"._",
"storage_",
"import_",
"default",
"\\u",
"storage_",
",_",
"Storage_",
",_",
"File",
"System",
"Storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"._",
"datastr",
"ucture",
"s_",
"import_",
"Sorte",
"d",
"Dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"._",
"functional_",
"import_",
"empty_",
",_",
"memoize_",
",_",
"La",
"zy",
"Object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"._",
"importlib_",
"import_",
"import",
"\\u",
"module_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"._",
"\\u",
"os_",
"import_",
"safe",
"\\u",
"join_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"static",
"files_",
"import_",
"utils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"static",
"files_",
"._",
"storage_",
"import_",
"App",
"Static",
"Storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"finde",
"rs_",
"=_",
"Sorte",
"d",
"Dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"get",
"\\u",
"finder_",
"=_",
"memoize_",
"(_",
"\\u",
"get",
"\\u",
"finder_",
",_",
"\\u",
"finde",
"rs_",
",_",
"1_",
")_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Base",
"Finder_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"base",
" ",
"file",
" ",
"finde",
"r",
" ",
"to",
" ",
"be",
" ",
"used",
" ",
"for",
" ",
"custom",
" ",
"static",
"files",
" ",
"finde",
"r",
" ",
"classe",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Finder_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"find_",
"(_",
"self_",
",_",
"path_",
",_",
"all_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Give",
"n",
" ",
"a",
" ",
"relative",
" ",
"file",
" ",
"path",
" ",
"this",
" ",
"ou",
"ght",
" ",
"to",
" ",
"find",
" ",
"an",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"abs",
"olute",
" ",
"file",
" ",
"path",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"the",
" ",
"``",
"all",
"``",
" ",
"parameter",
" ",
"is",
" ",
"``",
"Fal",
"se",
"``",
" ",
"(",
"default",
")",
" ",
"only",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"first",
" ",
"found",
" ",
"file",
" ",
"path",
" ",
"will",
" ",
"be",
" ",
"return",
"ed",
";",
" ",
"if",
" ",
"set",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"``",
"Tru",
"e",
"``",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"all",
" ",
"found",
" ",
"files",
" ",
"path",
"s",
" ",
"is",
" ",
"return",
"ed",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Finder_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"list_",
"(_",
"self_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Give",
"n",
" ",
"an",
" ",
"option",
"al",
" ",
"list",
" ",
"of",
" ",
"path",
"s",
" ",
"to",
" ",
"ignore",
",",
" ",
"this",
" ",
"shou",
"ld",
" ",
"return",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"a",
" ",
"two",
" ",
"item",
" ",
"iterable",
" ",
"consi",
"stin",
"g",
" ",
"of",
" ",
"the",
" ",
"relative",
" ",
"path",
" ",
"and",
" ",
"storage",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"instance",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"File",
"System",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"static",
" ",
"files",
" ",
"finde",
"r",
" ",
"tha",
"t",
" ",
"use",
"s",
" ",
"the",
" ",
"``",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"DIR",
"S",
"``",
" ",
"setti",
"ng",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"locat",
"e",
" ",
"files",
".",
"\\",
"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_",
"[SEP]_",
"class_",
"File",
"System",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"apps_",
"=_",
"None_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"List",
" ",
"of",
" ",
"location",
"s",
" ",
"with",
" ",
"static",
" ",
"files_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"locations_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Map",
"s",
" ",
"dir",
" ",
"path",
"s",
" ",
"to",
" ",
"an",
" ",
"appropr",
"iate",
" ",
"storage",
" ",
"instance_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"storage",
"s_",
"=_",
"Sorte",
"d",
"Dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"isinstance_",
"(_",
"settings_",
"._",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"DIRS_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"You",
"r",
" ",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"DIR",
"S",
" ",
"setti",
"ng",
" ",
"is",
" ",
"not",
" ",
"a",
" ",
"tuple",
" ",
"or",
" ",
"list",
";",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"per",
"hap",
"s",
" ",
"you",
" ",
"forgo",
"t",
" ",
"a",
" ",
"trail",
"ing",
" ",
"comma",
"?\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"root_",
"in_",
"settings_",
"._",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"DIRS_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"root_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"prefix_",
",_",
"root_",
"=_",
"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 ",
" _",
"prefix_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"os_",
"._",
"path_",
"._",
"abspath_",
"(_",
"settings_",
"._",
"STATI",
"C",
"\\u",
"ROOT_",
")_",
"==_",
"os_",
"._",
"path_",
"._",
"abspath_",
"(_",
"root_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"The",
" ",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"DIR",
"S",
" ",
"setti",
"ng",
" ",
"shou",
"ld",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"not",
" ",
"contain",
" ",
"the",
" ",
"STATI",
"C",
"\\u",
"ROO",
"T",
" ",
"setti",
"ng",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"prefix_",
",_",
"root_",
")_",
"not_",
"in_",
"self_",
"._",
"locations_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"locations_",
"._",
"append_",
"(_",
"(_",
"prefix_",
",_",
"root_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"prefix_",
",_",
"root_",
"in_",
"self_",
"._",
"locations_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"filesystem",
"\\u",
"storage_",
"=_",
"File",
"System",
"Storage_",
"(_",
"location_",
"=_",
"root_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"filesystem",
"\\u",
"storage_",
"._",
"prefix_",
"=_",
"prefix_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"storage",
"s_",
"[_",
"root_",
"]_",
"=_",
"filesystem",
"\\u",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"super_",
"(_",
"File",
"System",
"Finder_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"File",
"System",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"find_",
"(_",
"self_",
",_",
"path_",
",_",
"all_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Look",
"s",
" ",
"for",
" ",
"files",
" ",
"in",
" ",
"the",
" ",
"extra",
" ",
"location",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"as",
" ",
"defin",
"ed",
" ",
"in",
" ",
"``",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"DIR",
"S",
"``.",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"matches_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"prefix_",
",_",
"root_",
"in_",
"self_",
"._",
"locations_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"matche",
"d\\u",
"path_",
"=_",
"self_",
"._",
"find",
"\\u",
"location_",
"(_",
"root_",
",_",
"path_",
",_",
"prefix_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"matche",
"d\\u",
"path_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"all_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"matche",
"d\\u",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"matches_",
"._",
"append_",
"(_",
"matche",
"d\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"matches_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"File",
"System",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"find",
"\\u",
"location_",
"(_",
"self_",
",_",
"root_",
",_",
"path_",
",_",
"prefix_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Fin",
"ds",
" ",
"a",
" ",
"request",
"ed",
" ",
"static",
" ",
"file",
" ",
"in",
" ",
"a",
" ",
"location",
",",
" ",
"return",
"ing",
" ",
"the",
" ",
"found",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"abs",
"olute",
" ",
"path",
" ",
"(",
"or",
" ",
"``",
"Non",
"e",
"``",
" ",
"if",
" ",
"no",
" ",
"match",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"prefix_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"prefix_",
"=_",
"'%",
"s",
"%",
"s",
"'_",
"%_",
"(_",
"prefix_",
",_",
"os_",
"._",
"sep_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"path_",
"._",
"startswith_",
"(_",
"prefix_",
")_",
":_",
"\\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_",
"path_",
"=_",
"path_",
"[_",
"len_",
"(_",
"prefix_",
")_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"path_",
"=_",
"safe",
"\\u",
"join_",
"(_",
"root_",
",_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"os_",
"._",
"path_",
"._",
"exists_",
"(_",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"File",
"System",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"list_",
"(_",
"self_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"List",
" ",
"all",
" ",
"files",
" ",
"in",
" ",
"all",
" ",
"location",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"prefix_",
",_",
"root_",
"in_",
"self_",
"._",
"locations_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"storage_",
"=_",
"self_",
"._",
"storage",
"s_",
"[_",
"root_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"path_",
"in_",
"utils_",
"._",
"get",
"\\u",
"files_",
"(_",
"storage_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"path_",
",_",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"App",
"Director",
"ies",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"static",
" ",
"files",
" ",
"finde",
"r",
" ",
"tha",
"t",
" ",
"look",
"s",
" ",
"in",
" ",
"the",
" ",
"director",
"y",
" ",
"of",
" ",
"each",
" ",
"app",
" ",
"as",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"specified",
" ",
"in",
" ",
"the",
" ",
"source",
"\\u",
"dir",
" ",
"attribute",
" ",
"of",
" ",
"the",
" ",
"give",
"n",
" ",
"storage",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"storage",
"\\u",
"class_",
"=_",
"App",
"Static",
"Storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"App",
"Director",
"ies",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"apps_",
"=_",
"None_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"list",
" ",
"of",
" ",
"apps",
" ",
"tha",
"t",
" ",
"are",
" ",
"handled_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"apps_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Map",
"ping",
" ",
"of",
" ",
"app",
" ",
"module",
" ",
"path",
"s",
" ",
"to",
" ",
"storage",
" ",
"instances_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"storage",
"s_",
"=_",
"Sorte",
"d",
"Dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"apps_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"apps_",
"=_",
"settings_",
"._",
"INSTALLE",
"D",
"\\u",
"APPS_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"app_",
"in_",
"apps_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app",
"\\u",
"storage_",
"=_",
"self_",
"._",
"storage",
"\\u",
"class_",
"(_",
"app_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"os_",
"._",
"path_",
"._",
"isdir_",
"(_",
"app",
"\\u",
"storage_",
"._",
"location_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"storage",
"s_",
"[_",
"app_",
"]_",
"=_",
"app",
"\\u",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"app_",
"not_",
"in_",
"self_",
"._",
"apps_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"apps_",
"._",
"append_",
"(_",
"app_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"super_",
"(_",
"App",
"Director",
"ies",
"Finder_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"App",
"Director",
"ies",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"list_",
"(_",
"self_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"List",
" ",
"all",
" ",
"files",
" ",
"in",
" ",
"all",
" ",
"app",
" ",
"storage",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"storage_",
"in_",
"self_",
"._",
"storage",
"s_",
"._",
"itervalues_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"storage_",
"._",
"exists_",
"(_",
"''_",
")_",
":_",
"#",
" ",
"check",
" ",
"if",
" ",
"storage",
" ",
"location",
" ",
"exists_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"path_",
"in_",
"utils_",
"._",
"get",
"\\u",
"files_",
"(_",
"storage_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"yield_",
"path_",
",_",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"App",
"Director",
"ies",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\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_",
"find_",
"(_",
"self_",
",_",
"path_",
",_",
"all_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Look",
"s",
" ",
"for",
" ",
"files",
" ",
"in",
" ",
"the",
" ",
"app",
" ",
"director",
"ies",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"matches_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"app_",
"in_",
"self_",
"._",
"apps_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"match_",
"=_",
"self_",
"._",
"find",
"\\u",
"in",
"\\u",
"app_",
"(_",
"app_",
",_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"match_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"all_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"match_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"matches_",
"._",
"append_",
"(_",
"match_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"matches_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"App",
"Director",
"ies",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"find",
"\\u",
"in",
"\\u",
"app_",
"(_",
"self_",
",_",
"app_",
",_",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Fin",
"d",
" ",
"a",
" ",
"request",
"ed",
" ",
"static",
" ",
"file",
" ",
"in",
" ",
"an",
" ",
"app",
"'",
"s",
" ",
"static",
" ",
"location",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"storage_",
"=_",
"self_",
"._",
"storage",
"s_",
"._",
"get_",
"(_",
"app_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"storage_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"storage_",
"._",
"prefix_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"prefix_",
"=_",
"'%",
"s",
"%",
"s",
"'_",
"%_",
"(_",
"storage_",
"._",
"prefix_",
",_",
"os_",
"._",
"sep_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"path_",
"._",
"startswith_",
"(_",
"prefix_",
")_",
":_",
"\\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_",
"path_",
"=_",
"path_",
"[_",
"len_",
"(_",
"prefix_",
")_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"only",
" ",
"try",
" ",
"to",
" ",
"find",
" ",
"a",
" ",
"file",
" ",
"if",
" ",
"the",
" ",
"source",
" ",
"dir",
" ",
"actual",
"ly",
" ",
"exists_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"storage_",
"._",
"exists_",
"(_",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"matche",
"d\\u",
"path_",
"=_",
"storage_",
"._",
"path_",
"(_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"matche",
"d\\u",
"path_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"matche",
"d\\u",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\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_",
"Base",
"Stor",
"age",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"base",
" ",
"static",
" ",
"files",
" ",
"finde",
"r",
" ",
"to",
" ",
"be",
" ",
"used",
" ",
"to",
" ",
"extend",
"ed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"with",
" ",
"an",
" ",
"own",
" ",
"storage",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"storage_",
"=_",
"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_",
"[SEP]_",
"class_",
"Base",
"Stor",
"age",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"storage_",
"=_",
"None_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"storage_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"storage_",
"=_",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"storage_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"\"",
"The",
" ",
"static",
"files",
" ",
"storage",
" ",
"finde",
"r",
" ",
"%",
"r",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"doe",
"sn",
"'",
"t",
" ",
"have",
" ",
"a",
" ",
"storage",
" ",
"class",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"assign",
"ed",
".\"_",
"%_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Make",
" ",
"sure",
" ",
"we",
" ",
"have",
" ",
"an",
" ",
"storage",
" ",
"instance",
" ",
"here",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"isinstance_",
"(_",
"self_",
"._",
"storage_",
",_",
"(_",
"Storage_",
",_",
"La",
"zy",
"Object_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"storage_",
"=_",
"self_",
"._",
"storage_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"super_",
"(_",
"Base",
"Stor",
"age",
"Finder_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Stor",
"age",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"find_",
"(_",
"self_",
",_",
"path_",
",_",
"all_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Look",
"s",
" ",
"for",
" ",
"files",
" ",
"in",
" ",
"the",
" ",
"default",
" ",
"file",
" ",
"storage",
",",
" ",
"if",
" ",
"it",
"'",
"s",
" ",
"local",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"storage_",
"._",
"path_",
"(_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"storage_",
"._",
"exists_",
"(_",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"match_",
"=_",
"self_",
"._",
"storage_",
"._",
"path_",
"(_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"all_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"match_",
"=_",
"[_",
"match_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"match_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Stor",
"age",
"Finder_",
"(_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"list_",
"(_",
"self_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"List",
" ",
"all",
" ",
"files",
" ",
"of",
" ",
"the",
" ",
"storage",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"path_",
"in_",
"utils_",
"._",
"get",
"\\u",
"files_",
"(_",
"self_",
"._",
"storage_",
",_",
"ignore",
"\\u",
"patterns_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"path_",
",_",
"self_",
"._",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Default",
"Stor",
"age",
"Finder_",
"(_",
"Base",
"Stor",
"age",
"Finder_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"static",
" ",
"files",
" ",
"finde",
"r",
" ",
"tha",
"t",
" ",
"use",
"s",
" ",
"the",
" ",
"default",
" ",
"storage",
" ",
"back",
"end",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"storage_",
"=_",
"default",
"\\u",
"storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Default",
"Stor",
"age",
"Finder_",
"(_",
"Base",
"Stor",
"age",
"Finder_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Default",
"Stor",
"age",
"Finder_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"location_",
"=_",
"getattr_",
"(_",
"self_",
"._",
"storage_",
",_",
"'",
"base",
"\\u",
"location",
"'_",
",_",
"empty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"base",
"\\u",
"location_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"\"",
"The",
" ",
"storage",
" ",
"back",
"end",
" ",
"of",
" ",
"the",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"static",
"files",
" ",
"finde",
"r",
" ",
"%",
"r",
" ",
"doe",
"sn",
"'",
"t",
" ",
"have",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"a",
" ",
"valid",
" ",
"location",
".\"_",
"%_",
"self_",
"._",
"\\u\\u",
"class\\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_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"find_",
"(_",
"path_",
",_",
"all_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Fin",
"d",
" ",
"a",
" ",
"static",
" ",
"file",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
" ",
"path",
" ",
"usi",
"ng",
" ",
"all",
" ",
"enable",
"d",
" ",
"finde",
"rs",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"``",
"all",
"``",
" ",
"is",
" ",
"``",
"Fal",
"se",
"``",
" ",
"(",
"default",
"),",
" ",
"return",
" ",
"the",
" ",
"first",
" ",
"matchi",
"ng",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"abs",
"olute",
" ",
"path",
" ",
"(",
"or",
" ",
"``",
"Non",
"e",
"``",
" ",
"if",
" ",
"no",
" ",
"match",
").",
" ",
"Ot",
"her",
"wis",
"e",
" ",
"return",
" ",
"a",
" ",
"list",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"matches_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"finder_",
"in_",
"get",
"\\u",
"finde",
"rs_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"=_",
"finder_",
"._",
"find_",
"(_",
"path_",
",_",
"all_",
"=_",
"all_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"all_",
"and_",
"result_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"isinstance_",
"(_",
"result_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"=_",
"[_",
"result_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"matches_",
"._",
"extend_",
"(_",
"result_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"matches_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"matches_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"No",
" ",
"match",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"all_",
"and_",
"[_",
"]_",
"or_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"finde",
"rs_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"finde",
"r",
"\\u",
"path_",
"in_",
"settings_",
"._",
"STATI",
"CF",
"ILE",
"S",
"\\u",
"FIND",
"ERS_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"get",
"\\u",
"finder_",
"(_",
"finde",
"r",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"finder_",
"(_",
"import",
"\\u",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Imports",
" ",
"the",
" ",
"static",
"files",
" ",
"finde",
"r",
" ",
"class",
" ",
"descri",
"bed",
" ",
"by",
" ",
"import",
"\\u",
"path",
",",
" ",
"where",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"import",
"\\u",
"path",
" ",
"is",
" ",
"the",
" ",
"full",
" ",
"Pyth",
"on",
" ",
"path",
" ",
"to",
" ",
"the",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"module_",
",_",
"attr_",
"=_",
"import",
"\\u",
"path_",
"._",
"rsplit_",
"(_",
"'.'_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mod_",
"=_",
"import",
"\\u",
"module_",
"(_",
"module_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
",_",
"e_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"'",
"Error",
" ",
"import",
"ing",
" ",
"module",
" ",
"%",
"s",
":",
" ",
"\"%",
"s",
"\"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"module_",
",_",
"e_",
")_",
")_",
"\\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 ",
" _",
"Finder_",
"=_",
"getattr_",
"(_",
"mod_",
",_",
"attr_",
")_",
"\\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 ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"'",
"Modul",
"e",
" ",
"\"%",
"s",
"\"",
" ",
"doe",
"s",
" ",
"not",
" ",
"defin",
"e",
" ",
"a",
" ",
"\"%",
"s",
"\"",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"class",
".'_",
"%_",
"(_",
"module_",
",_",
"attr_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"issubclass_",
"(_",
"Finder_",
",_",
"Base",
"Finder_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"'",
"Fin",
"der",
" ",
"\"%",
"s",
"\"",
" ",
"is",
" ",
"not",
" ",
"a",
" ",
"subclass",
" ",
"of",
" ",
"\"%",
"s",
"\"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"Finder_",
",_",
"Base",
"Finder_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"Finder_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | django/django/django/contrib/gis/db/models/sql/conversion.py | [
{
"content": "\"\"\"\nThis module holds simple classes to convert geospatial values from the\ndatabase.\n\"\"\"\nfrom __future__ import unicode_literals\n\nfrom decimal import Decimal\n\nfrom django.contrib.gis.db.models.fields import GeoSelectFormatMixin\nfrom django.contrib.gis.geometry.backend import Geometry\nfrom django.contrib.gis.measure import Area, Distance\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class BaseField(object):\n empty_strings_allowed = True\n\n",
"metadata": "root.BaseField",
"header": "['module', '___EOS___']",
"index": 13
},
{
"content": " def get_db_converters(self, connection):\n return [self.from_db_value]",
"metadata": "root.BaseField.get_db_converters",
"header": "['class', 'BaseField', '(', 'object', ')', ':', '___EOS___']",
"index": 16
},
{
"content": " def select_format(self, compiler, sql, params):\n return sql, params",
"metadata": "root.BaseField.select_format",
"header": "['class', 'BaseField', '(', 'object', ')', ':', '___EOS___']",
"index": 19
},
{
"content": "class AreaField(BaseField):\n \"Wrapper for Area values.\"\n\n",
"metadata": "root.AreaField",
"header": "['module', '___EOS___']",
"index": 23
},
{
"content": " def __init__(self, area_att=None):\n self.area_att = area_att",
"metadata": "root.AreaField.__init__",
"header": "['class', 'AreaField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 25
},
{
"content": " def from_db_value(self, value, expression, connection, context):\n if connection.features.interprets_empty_strings_as_nulls and value == '':\n value = None\n # If the database returns a Decimal, convert it to a float as expected\n # by the Python geometric objects.\n if isinstance(value, Decimal):\n value = float(value)\n # If the units are known, convert value into area measure.\n if value is not None and self.area_att:\n value = Area(**{self.area_att: value})\n return value",
"metadata": "root.AreaField.from_db_value",
"header": "['class', 'AreaField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 28
},
{
"content": " def get_internal_type(self):\n return 'AreaField'",
"metadata": "root.AreaField.get_internal_type",
"header": "['class', 'AreaField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 40
},
{
"content": "class DistanceField(BaseField):\n \"Wrapper for Distance values.\"\n\n",
"metadata": "root.DistanceField",
"header": "['module', '___EOS___']",
"index": 44
},
{
"content": " def __init__(self, distance_att):\n self.distance_att = distance_att",
"metadata": "root.DistanceField.__init__",
"header": "['class', 'DistanceField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 46
},
{
"content": " def from_db_value(self, value, expression, connection, context):\n if value is not None:\n value = Distance(**{self.distance_att: value})\n return value",
"metadata": "root.DistanceField.from_db_value",
"header": "['class', 'DistanceField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 49
},
{
"content": " def get_internal_type(self):\n return 'DistanceField'",
"metadata": "root.DistanceField.get_internal_type",
"header": "['class', 'DistanceField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 54
},
{
"content": "class GeomField(GeoSelectFormatMixin, BaseField):\n \"\"\"\n Wrapper for Geometry values. It is a lightweight alternative to\n using GeometryField (which requires an SQL query upon instantiation).\n \"\"\"\n # Hacky marker for get_db_converters()\n geom_type = None\n\n",
"metadata": "root.GeomField",
"header": "['module', '___EOS___']",
"index": 58
},
{
"content": " def from_db_value(self, value, expression, connection, context):\n if value is not None:\n value = Geometry(value)\n return value",
"metadata": "root.GeomField.from_db_value",
"header": "['class', 'GeomField', '(', 'GeoSelectFormatMixin', ',', 'BaseField', ')', ':', '___EOS___']",
"index": 66
},
{
"content": " def get_internal_type(self):\n return 'GeometryField'",
"metadata": "root.GeomField.get_internal_type",
"header": "['class', 'GeomField', '(', 'GeoSelectFormatMixin', ',', 'BaseField', ')', ':', '___EOS___']",
"index": 71
},
{
"content": "class GMLField(BaseField):\n \"\"\"\n Wrapper for GML to be used by Oracle to ensure Database.LOB conversion.\n \"\"\"\n\n",
"metadata": "root.GMLField",
"header": "['module', '___EOS___']",
"index": 75
},
{
"content": " def get_internal_type(self):\n return 'GMLField'",
"metadata": "root.GMLField.get_internal_type",
"header": "['class', 'GMLField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 80
},
{
"content": " def from_db_value(self, value, expression, connection, context):\n return value",
"metadata": "root.GMLField.from_db_value",
"header": "['class', 'GMLField', '(', 'BaseField', ')', ':', '___EOS___']",
"index": 83
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Thi",
"s",
" ",
"module",
" ",
"hold",
"s",
" ",
"simple",
" ",
"classe",
"s",
" ",
"to",
" ",
"convert",
" ",
"geos",
"pati",
"al",
" ",
"values",
" ",
"from",
" ",
"the",
"\\",
"10",
";",
"databa",
"se",
".",
"\\",
"10",
";\"\"\"_",
"\\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_",
"from_",
"decimal_",
"import_",
"Decimal_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"gis_",
"._",
"db_",
"._",
"models_",
"._",
"fields_",
"import_",
"Geo",
"Select",
"Format",
"Mixin_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"gis_",
"._",
"geometry_",
"._",
"backend_",
"import_",
"Geometry_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"gis_",
"._",
"measure_",
"import_",
"Area_",
",_",
"Distance_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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",
"Field_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"empty",
"\\u",
"string",
"s",
"\\u",
"allowed_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Field_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"get",
"\\u",
"db",
"\\u",
"converters_",
"(_",
"self_",
",_",
"connection_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"[_",
"self_",
"._",
"from",
"\\u",
"db",
"\\u",
"value_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Field_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"select",
"\\u",
"format_",
"(_",
"self_",
",_",
"compiler_",
",_",
"sql_",
",_",
"params_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"sql_",
",_",
"params_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Area",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Wrapper",
" ",
"for",
" ",
"Area",
" ",
"values",
".\"_",
"\\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_",
"Area",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"area",
"\\u",
"att_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"area",
"\\u",
"att_",
"=_",
"area",
"\\u",
"att_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Area",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"from",
"\\u",
"db",
"\\u",
"value_",
"(_",
"self_",
",_",
"value_",
",_",
"expression_",
",_",
"connection_",
",_",
"context_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"connection_",
"._",
"features_",
"._",
"interpret",
"s",
"\\u",
"empty",
"\\u",
"string",
"s",
"\\u",
"as",
"\\u",
"null",
"s_",
"and_",
"value_",
"==_",
"''_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"the",
" ",
"databa",
"se",
" ",
"return",
"s",
" ",
"a",
" ",
"Deci",
"mal",
",",
" ",
"convert",
" ",
"it",
" ",
"to",
" ",
"a",
" ",
"float",
" ",
"as",
" ",
"expected_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"by",
" ",
"the",
" ",
"Pyth",
"on",
" ",
"geometric",
" ",
"object",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"value_",
",_",
"Decimal_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"float_",
"(_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"the",
" ",
"unit",
"s",
" ",
"are",
" ",
"know",
"n",
",",
" ",
"convert",
" ",
"value",
" ",
"int",
"o",
" ",
"area",
" ",
"measure",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"value_",
"is_",
"not_",
"None_",
"and_",
"self_",
"._",
"area",
"\\u",
"att_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"Area_",
"(_",
"**_",
"{_",
"self_",
"._",
"area",
"\\u",
"att_",
":_",
"value_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Area",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"internal",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"'",
"Area",
"Field",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Distan",
"ce",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Wrapper",
" ",
"for",
" ",
"Distan",
"ce",
" ",
"values",
".\"_",
"\\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_",
"Distan",
"ce",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"distance",
"\\u",
"att_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"distance",
"\\u",
"att_",
"=_",
"distance",
"\\u",
"att_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Distan",
"ce",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"from",
"\\u",
"db",
"\\u",
"value_",
"(_",
"self_",
",_",
"value_",
",_",
"expression_",
",_",
"connection_",
",_",
"context_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"value_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"Distance_",
"(_",
"**_",
"{_",
"self_",
"._",
"distance",
"\\u",
"att_",
":_",
"value_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Distan",
"ce",
"Field_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"internal",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"'",
"Distan",
"ce",
"Field",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Geo",
"m",
"Field_",
"(_",
"Geo",
"Select",
"Format",
"Mixin_",
",_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Wrapper",
" ",
"for",
" ",
"Geometr",
"y",
" ",
"values",
".",
" ",
" ",
"It",
" ",
"is",
" ",
"a",
" ",
"light",
"weight",
" ",
"alternative",
" ",
"to",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"usi",
"ng",
" ",
"Geometr",
"y",
"Field",
" ",
"(",
"whi",
"ch",
" ",
"require",
"s",
" ",
"an",
" ",
"SQL",
" ",
"query",
" ",
"upo",
"n",
" ",
"instantiation",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Hack",
"y",
" ",
"marker",
" ",
"for",
" ",
"get",
"\\u",
"db",
"\\u",
"converter",
"s",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"geom",
"\\u",
"type_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Geo",
"m",
"Field_",
"(_",
"Geo",
"Select",
"Format",
"Mixin_",
",_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"from",
"\\u",
"db",
"\\u",
"value_",
"(_",
"self_",
",_",
"value_",
",_",
"expression_",
",_",
"connection_",
",_",
"context_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"value_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"Geometry_",
"(_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Geo",
"m",
"Field_",
"(_",
"Geo",
"Select",
"Format",
"Mixin_",
",_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"internal",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"'",
"Geometr",
"y",
"Field",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"GM",
"LF",
"ield_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Wrapper",
" ",
"for",
" ",
"GM",
"L",
" ",
"to",
" ",
"be",
" ",
"used",
" ",
"by",
" ",
"Ora",
"cle",
" ",
"to",
" ",
"ensure",
" ",
"Databa",
"se",
".",
"LO",
"B",
" ",
"conve",
"rsi",
"on",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"GM",
"LF",
"ield_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"get",
"\\u",
"internal",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"'",
"GM",
"LF",
"iel",
"d",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"GM",
"LF",
"ield_",
"(_",
"Base",
"Field_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"from",
"\\u",
"db",
"\\u",
"value_",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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
] |
Imprecise assert | dimagi/commcare-hq/corehq/ex-submodules/couchforms/tests/test_devicelogs.py | [
{
"content": " def assert_force_close_entries(self):\n self.assertEqual(ForceCloseEntry.objects.count(), 1)\n force_closure = ForceCloseEntry.objects.first()\n\n self.assert_properties_equal(force_closure, (\n ('domain', 'test-domain'),\n ('app_id', '36c0bdd028d14a52cbff95bb1bfd0962'),\n ('version_number', 15),\n ('user_id', 'ahelis3q3s0c33ms8r5is7yrei7t02m8'),\n ('type', 'forceclose'),\n ('android_version', '6.0.1'),\n ('device_model', 'Nexus 5X'),\n ('session_readable', ''),\n ('session_serialized', 'AAAAAA=='),\n ))\n self.assertEqual(force_closure.date.isoformat(), '2016-03-15T07:52:04.573000')\n self.assertIsNotNone(force_closure.xform_id)\n self.assertIsNotNone(force_closure.server_date)\n self.assertIn(\"java.lang.Exception: exception_text\", force_closure.msg)",
"metadata": "root.DeviceLogTest.assert_force_close_entries",
"header": "['class', 'DeviceLogTest', '(', 'TestCase', ',', 'TestFileMixin', ')', ':', '___EOS___']",
"index": 89
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Dev",
"ice",
"Log",
"Test_",
"(_",
"Test",
"Case_",
",_",
"Test",
"File",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"assert",
"\\u",
"force",
"\\u",
"close",
"\\u",
"entries_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Equal_",
"(_",
"Force",
"Clos",
"e",
"Entry_",
"._",
"objects_",
"._",
"count_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"force",
"\\u",
"closure_",
"=_",
"Force",
"Clos",
"e",
"Entry_",
"._",
"objects_",
"._",
"first_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"\\u",
"proper",
"ties",
"\\u",
"equal_",
"(_",
"force",
"\\u",
"closure_",
",_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"domain",
"'_",
",_",
"'",
"test",
"-",
"domain",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"app",
"\\u",
"id",
"'_",
",_",
"'",
"3",
"6c",
"0b",
"dd",
"028",
"d1",
"4a",
"5",
"2c",
"bf",
"f9",
"5b",
"b1",
"bf",
"d0",
"962",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"version",
"\\u",
"number",
"'_",
",_",
"15_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"user",
"\\u",
"id",
"'_",
",_",
"'",
"ahe",
"lis",
"3",
"q",
"3",
"s0",
"c3",
"3",
"ms",
"8",
"r",
"5",
"is",
"7",
"yre",
"i",
"7",
"t0",
"2m",
"8",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"type",
"'_",
",_",
"'",
"force",
"close",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"android",
"\\u",
"version",
"'_",
",_",
"'",
"6.0",
".1",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"device",
"\\u",
"model",
"'_",
",_",
"'",
"Nexus",
" ",
"5",
"X",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"session",
"\\u",
"reada",
"ble",
"'_",
",_",
"''_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"session",
"\\u",
"serialize",
"d",
"'_",
",_",
"'",
"AAAAAA",
"=='",
"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"force",
"\\u",
"closure_",
"._",
"date_",
"._",
"isoformat_",
"(_",
")_",
",_",
"'",
"2016",
"-0",
"3",
"-1",
"5",
"T",
"0",
"7",
":",
"5",
"2",
":",
"04",
".5",
"730",
"00",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Is",
"Not",
"None_",
"(_",
"force",
"\\u",
"closure_",
"._",
"xform",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Is",
"Not",
"None_",
"(_",
"force",
"\\u",
"closure_",
"._",
"server",
"\\u",
"date_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"In_",
"(_",
"\"",
"java",
".",
"lang",
".",
"Except",
"ion",
":",
" ",
"exception",
"\\u",
"text",
"\"_",
",_",
"force",
"\\u",
"closure_",
"._",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Except block handles 'BaseException' | cloudera/hue/desktop/core/ext-py/Paste-2.0.1/paste/util/ip4.py | [
{
"content": " def _parseMask(self,addr,mask):\n naddr, naddrlen = _parseAddr(addr)\n naddr <<= (4-naddrlen)*8\n try:\n if not mask:\n masklen = 0\n else:\n masklen = int(mask)\n if not 0 <= masklen <= 32:\n raise ValueError\n except ValueError:\n try:\n mask = _parseAddr(mask,False)\n except ValueError:\n raise ValueError(\"Mask isn't parseable.\")\n remaining = 0\n masklen = 0\n if not mask:\n masklen = 0\n else:\n while not (mask&1):\n remaining += 1\n while (mask&1):\n mask >>= 1\n masklen += 1\n if remaining+masklen != 32:\n raise ValueError(\"Mask isn't a proper host mask.\")\n naddr1 = naddr & (((1<<masklen)-1)<<(32-masklen))\n naddr2 = naddr1 + (1<<(32-masklen)) - 1\n return (naddr1,naddr2)",
"metadata": "root.IP4Range._parseMask",
"header": "['class', 'IP4Range', '(', 'intset', '.', 'IntSet', ')', ':', '___EOS___']",
"index": 120
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"IP",
"4",
"Range_",
"(_",
"ints",
"et_",
"._",
"Int",
"Set_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"parse",
"Mask_",
"(_",
"self_",
",_",
"addr_",
",_",
"mask_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"nad",
"dr_",
",_",
"nad",
"dr",
"len_",
"=_",
"\\u",
"parse",
"Addr_",
"(_",
"addr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"nad",
"dr_",
"<<",
"=_",
"(_",
"4_",
"-_",
"nad",
"dr",
"len_",
")_",
"*_",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"mask_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mask",
"len_",
"=_",
"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 ",
" _",
"mask",
"len_",
"=_",
"int_",
"(_",
"mask_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"0_",
"<=_",
"mask",
"len_",
"<=_",
"32_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\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 ",
" _",
"mask_",
"=_",
"\\u",
"parse",
"Addr_",
"(_",
"mask_",
",_",
"False_",
")_",
"\\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_",
"(_",
"\"",
"Mask",
" ",
"isn",
"'",
"t",
" ",
"parse",
"able",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"remaining_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mask",
"len_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"mask_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mask",
"len_",
"=_",
"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 ",
" _",
"while_",
"not_",
"(_",
"mask_",
"&_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"remaining_",
"+=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"while_",
"(_",
"mask_",
"&_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"mask_",
">>",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mask",
"len_",
"+=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"remaining_",
"+_",
"mask",
"len_",
"!=_",
"32_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"raise_",
"Value",
"Error_",
"(_",
"\"",
"Mask",
" ",
"isn",
"'",
"t",
" ",
"a",
" ",
"proper",
" ",
"host",
" ",
"mask",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"nad",
"dr",
"1_",
"=_",
"nad",
"dr_",
"&_",
"(_",
"(_",
"(_",
"1_",
"<<_",
"mask",
"len_",
")_",
"-_",
"1_",
")_",
"<<_",
"(_",
"32_",
"-_",
"mask",
"len_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"nad",
"dr",
"2_",
"=_",
"nad",
"dr",
"1_",
"+_",
"(_",
"1_",
"<<_",
"(_",
"32_",
"-_",
"mask",
"len_",
")_",
")_",
"-_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"(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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | llazzaro/django-scheduler/schedule/feeds/ical.py | [
{
"content": " def item_last_modified(self, item):\n pass",
"metadata": "root.ICalendarFeed.item_last_modified",
"header": "['class', 'ICalendarFeed', '(', 'object', ')', ':', '___EOS___']",
"index": 59
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"IC",
"alen",
"dar",
"Feed_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"item",
"\\u",
"last",
"\\u",
"modified_",
"(_",
"self_",
",_",
"item_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
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 | google/simian/src/simian/client/client.py | [
{
"content": " def UploadFile(self, file_path, file_type, _open=open):\n \"\"\"Uploads a given log file to the server.\n\n Args:\n file_path: str, path of log file to upload.\n file_type: str, type of file being uploaded, like 'log'.\n _open: func, optional, default builtin open, to open file_path.\n \"\"\"\n if os.path.isfile(file_path):\n logging.debug('UploadFile uploading file: %s', file_path)\n file_handle = _open(file_path, 'r')\n file_name = os.path.basename(file_path)\n url = '/uploadfile/%s/%s' % (file_type, file_name)\n try:\n self.Do('PUT', url, file_handle)\n finally:\n file_handle.close()\n else:\n logging.error('UploadFile file not found: %s', file_path)",
"metadata": "root.SimianClient.UploadFile",
"header": "['class', 'SimianClient', '(', 'HttpsAuthClient', ')', ':', '___EOS___']",
"index": 1630
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Sim",
"ian",
"Client_",
"(_",
"Http",
"s",
"Auth",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"Upload",
"File_",
"(_",
"self_",
",_",
"file",
"\\u",
"path_",
",_",
"file",
"\\u",
"type_",
",_",
"\\u",
"open_",
"=_",
"open_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Upload",
"s",
" ",
"a",
" ",
"give",
"n",
" ",
"log",
" ",
"file",
" ",
"to",
" ",
"the",
" ",
"server",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Arg",
"s",
":",
"\\",
"10",
";",
" ",
" ",
"file",
"\\u",
"path",
":",
" ",
"str",
",",
" ",
"path",
" ",
"of",
" ",
"log",
" ",
"file",
" ",
"to",
" ",
"upload",
".",
"\\",
"10",
";",
" ",
" ",
"file",
"\\u",
"type",
":",
" ",
"str",
",",
" ",
"type",
" ",
"of",
" ",
"file",
" ",
"bei",
"ng",
" ",
"uploade",
"d",
",",
" ",
"like",
" ",
"'",
"log",
"'.",
"\\",
"10",
";",
" ",
" ",
"\\u",
"open",
":",
" ",
"func",
",",
" ",
"option",
"al",
",",
" ",
"default",
" ",
"bui",
"lti",
"n",
" ",
"open",
",",
" ",
"to",
" ",
"open",
" ",
"file",
"\\u",
"path",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"os_",
"._",
"path_",
"._",
"isfile_",
"(_",
"file",
"\\u",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logging_",
"._",
"debug_",
"(_",
"'",
"Upload",
"File",
" ",
"upload",
"ing",
" ",
"file",
":",
" ",
"%",
"s",
"'_",
",_",
"file",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"file",
"\\u",
"handle_",
"=_",
"\\u",
"open_",
"(_",
"file",
"\\u",
"path_",
",_",
"'",
"r",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"file",
"\\u",
"name_",
"=_",
"os_",
"._",
"path_",
"._",
"basename_",
"(_",
"file",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"url_",
"=_",
"'/",
"upload",
"file",
"/",
"%",
"s",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"file",
"\\u",
"type_",
",_",
"file",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"Do",
"_",
"(_",
"'",
"PU",
"T",
"'_",
",_",
"url_",
",_",
"file",
"\\u",
"handle_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"finally_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"file",
"\\u",
"handle_",
"._",
"close_",
"(_",
")_",
"\\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 ",
" _",
"logging_",
"._",
"error_",
"(_",
"'",
"Upload",
"File",
" ",
"file",
" ",
"not",
" ",
"found",
":",
" ",
"%",
"s",
"'_",
",_",
"file",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
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| [
{
"content": "#------------------------------------------------------------------------------\n# Copyright (c) 2013, Nucleic Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#------------------------------------------------------------------------------\nimport sys\n\nfrom atom.api import Atom, Float, Int, Str, Typed, Value, set_default\n\nfrom enaml.qt.QtCore import Qt, QRect, QPoint\nfrom enaml.qt.QtGui import QFrame, QImage, QPainter\n\n# Make sure the resources get registered.\nfrom . import dock_resources\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class QGuideRose(QFrame):\n \"\"\" A custom QFrame which implements a collection of docking guides.\n\n This widget must always be used as an independent top-level window.\n The dock area which uses the rose should manually set the geometry\n of the widget before showing it.\n\n \"\"\"\n class Guide(object):\n \"\"\" An enum class for identifying guide locations.\n\n \"\"\"\n #: No relevant guide.\n NoGuide = 0\n\n #: The north border guide.\n BorderNorth = 1\n\n #: The east border guide.\n BorderEast = 2\n\n #: The south border guide.\n BorderSouth = 3\n\n #: The west border guide.\n BorderWest = 4\n\n #: The north compass guide.\n CompassNorth = 5\n\n #: The east compass guide.\n CompassEast = 6\n\n #: The south compass guide.\n CompassSouth = 7\n\n #: The west compass guide.\n CompassWest = 8\n\n #: The center compass guide.\n CompassCenter = 9\n\n #: The extended compass north guide.\n CompassExNorth = 10\n\n #: The extended compass east guide.\n CompassExEast = 11\n\n #: The extended compass south guide.\n CompassExSouth = 12\n\n #: The extended compass west guide.\n CompassExWest = 13\n\n #: The vertical split guide.\n SplitVertical = 14\n\n #: The horizontal split guide.\n SplitHorizontal = 15\n\n #: The area center guide.\n AreaCenter = 16\n\n #: The extended border north guide.\n BorderExNorth = 17\n\n #: The extended border east guide.\n BorderExEast = 18\n\n #: The extended border south guide.\n BorderExSouth = 19\n\n #: The extended border west guide.\n BorderExWest = 20\n\n class Mode(object):\n \"\"\" An enum class for defining the mode for the guide rose.\n\n A mode is an or'd combination of flags which dictate which parts\n of the guide rose are active on the screen. The modes related to\n the centerpiece should be considered mutually exclusive.\n\n \"\"\"\n #: Nothing will be shown.\n NoMode = 0x0\n\n #: Show the border guides.\n Border = 0x1\n\n #: Show the standard compass as the centerpiece.\n Compass = 0x2\n\n #: Show the extended compass as the centerpiece.\n CompassEx = 0x4\n\n #: Show the horizontal split guide as the centerpiece.\n SplitHorizontal = 0x8\n\n #: Show the vertical split guide as the centerpiece.\n SplitVertical = 0x10\n\n #: Show the vertical area center as the centerpiece.\n AreaCenter = 0x20\n\n\n #--------------------------------------------------------------------------\n # Private API\n #--------------------------------------------------------------------------\n\n #--------------------------------------------------------------------------\n # Public API\n #--------------------------------------------------------------------------\n\n\n\n\n\n\n #--------------------------------------------------------------------------\n # Reimplementations\n #--------------------------------------------------------------------------\n",
"metadata": "root.QGuideRose",
"header": "['module', '___EOS___']",
"index": 18
},
{
"content": " def __init__(self):\n \"\"\" Initialize a QGuideRose.\n\n \"\"\"\n super(QGuideRose, self).__init__()\n # On Mac, setting the translucent background does not cause the\n # frame shadow to be hidden; it must be explicitly hidden. Mac\n # also requires the window to be a tooltip in order to be raised\n # above the rubber band in the Z-order. On Windows, the tooltip\n # leaves a dropshadow on Qt >= 4.8 whereas tool does not.\n if sys.platform == 'darwin':\n self.setAttribute(Qt.WA_MacNoShadow, True)\n flags = Qt.ToolTip\n else:\n flags = Qt.Tool\n self.setAttribute(Qt.WA_TranslucentBackground, True)\n flags |= Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint\n self.setWindowFlags(flags)\n self._mode = self.Mode.NoMode\n self._center_point = QPoint()\n self._border_guide = BorderGuide()\n self._compass_guide = CompassGuide()\n self._compass_ex_guide = CompassExGuide()\n self._vsplit_guide = SplitVerticalGuide()\n self._hsplit_guide = SplitHorizontalGuide()\n self._area_guide = AreaCenterGuide()",
"metadata": "root.QGuideRose.__init__",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 122
},
{
"content": " def _layoutGuides(self):\n \"\"\" Layout the guides based on the current widget geometry.\n\n \"\"\"\n self._border_guide.layout(self.rect())\n self._compass_guide.layout(self._center_point)\n self._compass_ex_guide.layout(self._center_point)\n self._vsplit_guide.layout(self._center_point)\n self._hsplit_guide.layout(self._center_point)\n self._area_guide.layout(self._center_point)",
"metadata": "root.QGuideRose._layoutGuides",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 152
},
{
"content": " def centerPoint(self):\n \"\"\" Get the center point of the guide rose.\n\n Returns\n -------\n result : QPoint\n The location that will be used as the center of the portion\n of the rose with a configurable location.\n\n \"\"\"\n return self._center_point",
"metadata": "root.QGuideRose.centerPoint",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 166
},
{
"content": " def setCenterPoint(self, pos):\n \"\"\" Set the center point of the guide rose.\n\n Parameters\n ----------\n pos : QPoint\n The location that will be used as the center of the portion\n of the rose with a configurable location.\n\n \"\"\"\n if pos != self._center_point:\n self._center_point = pos\n self._layoutGuides()\n self.update()",
"metadata": "root.QGuideRose.setCenterPoint",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 178
},
{
"content": " def mode(self):\n \"\"\" Get the mode of the guide rose.\n\n Returns\n -------\n result : GuideMode\n The guide mode applied to the guide rose.\n\n \"\"\"\n return self._mode",
"metadata": "root.QGuideRose.mode",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 193
},
{
"content": " def setMode(self, mode):\n \"\"\" Set the mode of the guide rose.\n\n Parameters\n ----------\n mode : GuideMode\n An or'd combination of mode flags for the guide rose.\n\n \"\"\"\n if mode != self._mode:\n self._mode = mode\n self.update()",
"metadata": "root.QGuideRose.setMode",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 204
},
{
"content": " def mouseOver(self, pos):\n \"\"\" Update the guide pads based on the mouse position.\n\n This current mode of the guide rose is used to determine which\n of the guide pads to should be updated.\n\n Parameters\n ----------\n pos : QPoint\n The position of the mouse expressed in local coordinates.\n\n \"\"\"\n self._border_guide.mouse_over(pos)\n self._compass_guide.mouse_over(pos)\n self._compass_ex_guide.mouse_over(pos)\n self._vsplit_guide.mouse_over(pos)\n self._hsplit_guide.mouse_over(pos)\n self._area_guide.mouse_over(pos)\n self.update()",
"metadata": "root.QGuideRose.mouseOver",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 217
},
{
"content": " def guideAt(self, pos, mode=None):\n \"\"\" Get the guide which lies underneath a given position.\n\n Parameters\n ----------\n pos : QPoint\n The position of interest, expressed local coordinates.\n\n mode : QGuideRose.Mode, optional\n The mode to use for hit testing. If not provided, the\n current mode for the guide rose is used.\n\n Returns\n -------\n result : QGuideRose.Guide\n The enum value for the guide under the mouse position.\n\n \"\"\"\n Guide = self.Guide\n Mode = self.Mode\n mode = mode if mode is not None else self._mode\n if mode & Mode.Border:\n g = self._border_guide.guide_at(pos)\n if g != Guide.NoGuide:\n return g\n if mode & Mode.Compass:\n g = self._compass_guide.guide_at(pos)\n if g != Guide.NoGuide:\n return g\n elif mode & Mode.CompassEx:\n g = self._compass_ex_guide.guide_at(pos)\n if g != Guide.NoGuide:\n return g\n elif mode & Mode.SplitHorizontal:\n g = self._hsplit_guide.guide_at(pos)\n if g != Guide.NoGuide:\n return g\n elif mode & Mode.SplitVertical:\n g = self._vsplit_guide.guide_at(pos)\n if g != Guide.NoGuide:\n return g\n elif mode & Mode.AreaCenter:\n g = self._area_guide.guide_at(pos)\n if g != Guide.NoGuide:\n return g\n return Guide.NoGuide",
"metadata": "root.QGuideRose.guideAt",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 237
},
{
"content": " def resizeEvent(self, event):\n \"\"\" Handle the resize event for the rose.\n\n This handler will relayout the guides on a resize.\n\n \"\"\"\n self._layoutGuides()",
"metadata": "root.QGuideRose.resizeEvent",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 287
},
{
"content": " def paintEvent(self, event):\n \"\"\" Handle the paint event for the rose.\n\n This handler will redraw all of the guides for the rose.\n\n \"\"\"\n super(QGuideRose, self).paintEvent(event)\n painter = QPainter(self)\n Mode = self.Mode\n mode = self._mode\n if mode & Mode.Border:\n self._border_guide.paint(painter)\n if mode & Mode.Compass:\n self._compass_guide.paint(painter)\n elif mode & Mode.CompassEx:\n self._compass_ex_guide.paint(painter)\n elif mode & Mode.SplitHorizontal:\n self._hsplit_guide.paint(painter)\n elif mode & Mode.SplitVertical:\n self._vsplit_guide.paint(painter)\n elif mode & Mode.AreaCenter:\n self._area_guide.paint(painter)",
"metadata": "root.QGuideRose.paintEvent",
"header": "['class', 'QGuideRose', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 295
},
{
"content": "class GuideImage(Atom):\n \"\"\" A class which manages the painting of a guide image.\n\n \"\"\"\n #: The default alpha value for guide transparency.\n TRANSPARENT = 0.60\n\n #: The default alpha value for no guide transparency.\n OPAQUE = 1.0\n\n #: The QImage to use when painting the guide.\n image = Typed(QImage, factory=lambda: QImage())\n\n #: The QRect specifying where to draw the image.\n rect = Typed(QRect, factory=lambda: QRect())\n\n #: The opacity to use when drawing the image.\n opacity = Float(TRANSPARENT)\n\n #: A cache of QImage instances for the loaded guide images.\n _images = {}\n\n\n\n\n\n",
"metadata": "root.GuideImage",
"header": "['module', '___EOS___']",
"index": 319
},
{
"content": " @classmethod\n def load_image(cls, name):\n \"\"\" Load the guide image for the given name into a QImage.\n\n This function is hard-coded to return the named .png image from\n the ./dockguides directory located alongside this file. It is not\n a generic image loading routine.\n\n \"\"\"\n image = cls._images.get(name)\n if image is None:\n image = QImage(':dock_images/%s.png' % name)\n cls._images[name] = image\n return image",
"metadata": "root.GuideImage.load_image",
"header": "['class', 'GuideImage', '(', 'Atom', ')', ':', '___EOS___']",
"index": 341
},
{
"content": " def __init__(self, name):\n \"\"\" Initialize a GuideImage.\n\n Parameters\n ----------\n name : string\n The name of the image to load for the guide.\n\n \"\"\"\n self.image = self.load_image(name)",
"metadata": "root.GuideImage.__init__",
"header": "['class', 'GuideImage', '(', 'Atom', ')', ':', '___EOS___']",
"index": 356
},
{
"content": " def opacify(self):\n \"\"\" Make the guide image opaque.\n\n \"\"\"\n self.opacity = self.OPAQUE",
"metadata": "root.GuideImage.opacify",
"header": "['class', 'GuideImage', '(', 'Atom', ')', ':', '___EOS___']",
"index": 367
},
{
"content": " def transparentize(self):\n \"\"\" Make the guide image transparent.\n\n \"\"\"\n self.opacity = self.TRANSPARENT",
"metadata": "root.GuideImage.transparentize",
"header": "['class', 'GuideImage', '(', 'Atom', ')', ':', '___EOS___']",
"index": 373
},
{
"content": " def contains(self, point):\n \"\"\" Test whether the image contains a point.\n\n Parameters\n ----------\n rect : QPoint\n The rect to test for containment.\n\n Returns\n -------\n result : bool\n True if the image contains the point, False otherwise.\n\n \"\"\"\n return self.rect.contains(point)",
"metadata": "root.GuideImage.contains",
"header": "['class', 'GuideImage', '(', 'Atom', ')', ':', '___EOS___']",
"index": 379
},
{
"content": " def paint(self, painter):\n \"\"\" Paint the image using the given painter.\n\n Parameters\n ----------\n painter : QPainter\n An active QPainter to use for drawing the image. If the\n image is a null image, painting will be skipped.\n\n \"\"\"\n image = self.image\n if image.isNull():\n return\n painter.save()\n painter.setOpacity(self.opacity)\n painter.drawImage(self.rect, image)\n painter.restore()",
"metadata": "root.GuideImage.paint",
"header": "['class', 'GuideImage', '(', 'Atom', ')', ':', '___EOS___']",
"index": 395
},
{
"content": "class GuideHandler(Atom):\n \"\"\" A base class for defining guide handlers.\n\n \"\"\"\n #: The last guide hit during a mouseover.\n _last_guide = Typed(GuideImage)\n\n\n\n\n",
"metadata": "root.GuideHandler",
"header": "['module', '___EOS___']",
"index": 414
},
{
"content": " def iterguides(self):\n \"\"\" Iterate the guides managed by this handler.\n\n Returns\n -------\n result : iterable\n An iterable of (Guide, GuideImage) pairs which are the\n guides managed by the handler.\n\n \"\"\"\n raise NotImplementedError",
"metadata": "root.GuideHandler.iterguides",
"header": "['class', 'GuideHandler', '(', 'Atom', ')', ':', '___EOS___']",
"index": 421
},
{
"content": " def iterboxes(self):\n \"\"\" Iterate the boxes which lie under the guides.\n\n Returns\n -------\n result : iterable\n An iterable of GuideImage instances which are the boxes\n to be painted under the guides.\n\n \"\"\"\n raise NotImplementedError",
"metadata": "root.GuideHandler.iterboxes",
"header": "['class', 'GuideHandler', '(', 'Atom', ')', ':', '___EOS___']",
"index": 433
},
{
"content": " def guide_at(self, pos):\n \"\"\" Get the guide under the given mouse position.\n\n Parameters\n ----------\n pos : QPoint\n The point of interest, expressed in layout coordinates.\n\n Returns\n -------\n result : Guide\n The enum value for the guide at the given position.\n\n \"\"\"\n for enum, guide in self.iterguides():\n if guide.contains(pos):\n return enum\n return QGuideRose.Guide.NoGuide",
"metadata": "root.GuideHandler.guide_at",
"header": "['class', 'GuideHandler', '(', 'Atom', ')', ':', '___EOS___']",
"index": 445
},
{
"content": " def mouse_over(self, pos):\n \"\"\" Perform a mouse over of the guides.\n\n Parameters\n ----------\n pos : QPoint\n The position of interest expressed in layout coordinates.\n\n \"\"\"\n for ignored, guide in self.iterguides():\n if guide.contains(pos):\n last = self._last_guide\n if last is not None and last is not guide:\n last.transparentize()\n guide.opacify()\n self._last_guide = guide\n break\n else:\n if self._last_guide is not None:\n self._last_guide.transparentize()",
"metadata": "root.GuideHandler.mouse_over",
"header": "['class', 'GuideHandler', '(', 'Atom', ')', ':', '___EOS___']",
"index": 464
},
{
"content": " def paint(self, painter):\n \"\"\" Paint the guides using the supplied painter.\n\n Parameters\n ----------\n painter : QPainter\n The painter to use to paint the guides.\n\n \"\"\"\n for box in self.iterboxes():\n box.paint(painter)\n for ignored, guide in self.iterguides():\n guide.paint(painter)",
"metadata": "root.GuideHandler.paint",
"header": "['class', 'GuideHandler', '(', 'Atom', ')', ':', '___EOS___']",
"index": 485
},
{
"content": "class BorderGuide(GuideHandler):\n \"\"\" A guide handler which manages the border guide.\n\n \"\"\"\n _guides = Value(factory=lambda: {\n QGuideRose.Guide.BorderNorth: GuideImage('thin_horizontal'),\n QGuideRose.Guide.BorderExNorth: GuideImage('bar_horizontal'),\n QGuideRose.Guide.BorderEast: GuideImage('thin_vertical'),\n QGuideRose.Guide.BorderExEast: GuideImage('bar_vertical'),\n QGuideRose.Guide.BorderSouth: GuideImage('thin_horizontal'),\n QGuideRose.Guide.BorderExSouth: GuideImage('bar_horizontal'),\n QGuideRose.Guide.BorderWest: GuideImage('thin_vertical'),\n QGuideRose.Guide.BorderExWest: GuideImage('bar_vertical'),\n })\n\n _boxes = Value(factory=lambda: {\n QGuideRose.Guide.BorderNorth: GuideImage('guide_box'),\n QGuideRose.Guide.BorderEast: GuideImage('guide_box'),\n QGuideRose.Guide.BorderSouth: GuideImage('guide_box'),\n QGuideRose.Guide.BorderWest: GuideImage('guide_box'),\n })\n\n\n",
"metadata": "root.BorderGuide",
"header": "['module', '___EOS___']",
"index": 500
},
{
"content": " def iterguides(self):\n \"\"\" Iterate the guides managed by the handler.\n\n Returns\n -------\n result : iterable\n An iterable of (Guide, GuideImage) pairs which are the\n guides managed by the handler.\n\n \"\"\"\n return self._guides.iteritems()",
"metadata": "root.BorderGuide.iterguides",
"header": "['class', 'BorderGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 522
},
{
"content": " def iterboxes(self):\n \"\"\" Iterate the boxes which lie under the guides.\n\n Returns\n -------\n result : iterable\n An iterable of GuideImage instances which are the boxes\n to be painted under the guides.\n\n \"\"\"\n return self._boxes.itervalues()",
"metadata": "root.BorderGuide.iterboxes",
"header": "['class', 'BorderGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 534
},
{
"content": " def layout(self, rect):\n \"\"\" Layout the guides for the given rect.\n\n Parameters\n ----------\n rect : QRect\n The rectangle in which to layout the border guides.\n\n \"\"\"\n boxes = self._boxes\n guides = self._guides\n w = rect.width()\n h = rect.height()\n cx = rect.left() + w / 2\n cy = rect.top() + h / 2\n Guide = QGuideRose.Guide\n guides[Guide.BorderNorth].rect = QRect(cx - 15, 27, 31, 19)\n guides[Guide.BorderExNorth].rect = QRect(cx - 15, 15, 31, 10)\n boxes[Guide.BorderNorth].rect = QRect(cx - 20, 10, 41, 41)\n guides[Guide.BorderEast].rect = QRect(w - 45, cy - 15, 19, 31)\n guides[Guide.BorderExEast].rect = QRect(w - 24, cy - 15, 10, 31)\n boxes[Guide.BorderEast].rect = QRect(w - 50, cy - 20, 41, 41)\n guides[Guide.BorderSouth].rect = QRect(cx - 15, h - 45, 31, 19)\n guides[Guide.BorderExSouth].rect = QRect(cx - 15, h - 24, 31, 10)\n boxes[Guide.BorderSouth].rect = QRect(cx - 20, h - 50, 41, 41)\n guides[Guide.BorderWest].rect = QRect(27, cy - 15, 19, 31)\n guides[Guide.BorderExWest].rect = QRect(15, cy - 15, 10, 31)\n boxes[Guide.BorderWest].rect = QRect(10, cy - 20, 41, 41)",
"metadata": "root.BorderGuide.layout",
"header": "['class', 'BorderGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 546
},
{
"content": "class CompassGuide(GuideHandler):\n \"\"\" A guide handler which manages the standard compass guide.\n\n \"\"\"\n _guides = Value(factory=lambda: {\n QGuideRose.Guide.CompassNorth: GuideImage('arrow_north'),\n QGuideRose.Guide.CompassEast: GuideImage('arrow_east'),\n QGuideRose.Guide.CompassSouth: GuideImage('arrow_south'),\n QGuideRose.Guide.CompassWest: GuideImage('arrow_west'),\n QGuideRose.Guide.CompassCenter: GuideImage('center'),\n })\n\n _box = Value(factory=lambda: GuideImage('cross_box'))\n\n\n",
"metadata": "root.CompassGuide",
"header": "['module', '___EOS___']",
"index": 576
},
{
"content": " def iterguides(self):\n \"\"\" Iterate the guides for the compass.\n\n Returns\n -------\n result : generator\n A generator which yields 2-tuples of (enum, guide) for\n the relevant guides in the compass.\n\n \"\"\"\n return self._guides.iteritems()",
"metadata": "root.CompassGuide.iterguides",
"header": "['class', 'CompassGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 590
},
{
"content": " def iterboxes(self):\n \"\"\" Iterate the boxes which lie under the guides.\n\n Returns\n -------\n result : iterable\n An iterable of GuideImage instances which are the boxes\n to be painted under the guides.\n\n \"\"\"\n yield self._box",
"metadata": "root.CompassGuide.iterboxes",
"header": "['class', 'CompassGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 602
},
{
"content": " def layout(self, pos):\n \"\"\" Layout the guides for the given position.\n\n Parameters\n ----------\n pos : QPoint\n The center point of the compass.\n\n \"\"\"\n x = pos.x()\n y = pos.y()\n Guide = QGuideRose.Guide\n guides = self._guides\n guides[Guide.CompassNorth].rect = QRect(x - 15, y - 50, 31, 31)\n guides[Guide.CompassEast].rect = QRect(x + 20, y - 15, 31, 31)\n guides[Guide.CompassSouth].rect = QRect(x - 15, y + 20, 31, 31)\n guides[Guide.CompassWest].rect = QRect(x - 50, y - 15, 31, 31)\n guides[Guide.CompassCenter].rect = QRect(x - 15, y - 15, 31, 31)\n self._box.rect = QRect(x - 55, y - 55, 111, 111)",
"metadata": "root.CompassGuide.layout",
"header": "['class', 'CompassGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 614
},
{
"content": "class CompassExGuide(GuideHandler):\n \"\"\" A class which renders the extended compass guide.\n\n \"\"\"\n _guides = Value(factory=lambda: {\n QGuideRose.Guide.CompassNorth: GuideImage('arrow_north'),\n QGuideRose.Guide.CompassEast: GuideImage('arrow_east'),\n QGuideRose.Guide.CompassSouth: GuideImage('arrow_south'),\n QGuideRose.Guide.CompassWest: GuideImage('arrow_west'),\n QGuideRose.Guide.CompassCenter: GuideImage('center'),\n QGuideRose.Guide.CompassExNorth: GuideImage('bar_horizontal'),\n QGuideRose.Guide.CompassExEast: GuideImage('bar_vertical'),\n QGuideRose.Guide.CompassExSouth: GuideImage('bar_horizontal'),\n QGuideRose.Guide.CompassExWest: GuideImage('bar_vertical'),\n })\n\n _box = Value(factory=lambda: GuideImage('cross_ex_box'))\n\n\n",
"metadata": "root.CompassExGuide",
"header": "['module', '___EOS___']",
"index": 635
},
{
"content": " def iterguides(self):\n \"\"\" Iterate the guides for the extented compass.\n\n Returns\n -------\n result : generator\n A generator which yields 2-tuples of (enum, guide) for\n the relevant guides in the compass.\n\n \"\"\"\n return self._guides.iteritems()",
"metadata": "root.CompassExGuide.iterguides",
"header": "['class', 'CompassExGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 653
},
{
"content": " def iterboxes(self):\n \"\"\" Iterate the boxes which lie under the guides.\n\n Returns\n -------\n result : iterable\n An iterable of GuideImage instances which are the boxes\n to be painted under the guides.\n\n \"\"\"\n yield self._box",
"metadata": "root.CompassExGuide.iterboxes",
"header": "['class', 'CompassExGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 665
},
{
"content": " def layout(self, pos):\n \"\"\" Layout the guides for the extended compass.\n\n Parameters\n ----------\n pos : QPoint\n The center point of the compass.\n\n \"\"\"\n x = pos.x()\n y = pos.y()\n Guide = QGuideRose.Guide\n guides = self._guides\n guides[Guide.CompassNorth].rect = QRect(x - 15, y - 64, 31, 31)\n guides[Guide.CompassEast].rect = QRect(x + 34, y - 15, 31, 31)\n guides[Guide.CompassSouth].rect = QRect(x - 15, y + 34, 31, 31)\n guides[Guide.CompassWest].rect = QRect(x - 64, y - 15, 31, 31)\n guides[Guide.CompassCenter].rect = QRect(x - 15, y - 15, 31, 31)\n guides[Guide.CompassExNorth].rect = QRect(x - 15, y - 29, 31, 10)\n guides[Guide.CompassExEast].rect = QRect(x + 20, y - 15, 10, 31)\n guides[Guide.CompassExSouth].rect = QRect(x - 15, y + 20, 31, 10)\n guides[Guide.CompassExWest].rect = QRect(x - 29, y - 15, 10, 31)\n self._box.rect = QRect(x - 69, y - 69, 139, 139)",
"metadata": "root.CompassExGuide.layout",
"header": "['class', 'CompassExGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 677
},
{
"content": "class SingleGuide(GuideHandler):\n \"\"\" A base class for defining a single guide.\n\n \"\"\"\n guide_enum = Int(QGuideRose.Guide.NoGuide)\n\n image_name = Str('')\n\n _box = Value(factory=lambda: GuideImage('guide_box'))\n\n _guide = Typed(GuideImage)\n\n\n\n",
"metadata": "root.SingleGuide",
"header": "['module', '___EOS___']",
"index": 702
},
{
"content": " def _default__guide(self):\n \"\"\" The default value handler for the '_guide' attribute.\n\n \"\"\"\n return GuideImage(self.image_name)",
"metadata": "root.SingleGuide._default__guide",
"header": "['class', 'SingleGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 714
},
{
"content": " def iterguides(self):\n \"\"\" Iterate the guides for the compass.\n\n Returns\n -------\n result : generator\n A generator which yields 2-tuples of (enum, guide) for\n the relevant guides in the compass.\n\n \"\"\"\n yield (self.guide_enum, self._guide)",
"metadata": "root.SingleGuide.iterguides",
"header": "['class', 'SingleGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 720
},
{
"content": " def iterboxes(self):\n \"\"\" Iterate the boxes which lie under the guides.\n\n Returns\n -------\n result : iterable\n An iterable of GuideImage instances which are the boxes\n to be painted under the guides.\n\n \"\"\"\n yield self._box",
"metadata": "root.SingleGuide.iterboxes",
"header": "['class', 'SingleGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 732
},
{
"content": " def layout(self, pos):\n \"\"\" Layout the guides for the given position.\n\n Parameters\n ----------\n pos : QPoint\n The center point of the guide.\n\n \"\"\"\n x = pos.x()\n y = pos.y()\n self._guide.rect = QRect(x - 15, y - 15, 31, 31)\n self._box.rect = QRect(x - 20, y - 20, 41, 41)",
"metadata": "root.SingleGuide.layout",
"header": "['class', 'SingleGuide', '(', 'GuideHandler', ')', ':', '___EOS___']",
"index": 744
},
{
"content": "class SplitHorizontalGuide(SingleGuide):\n \"\"\" A single guide which uses the horizontal split image.\n\n \"\"\"\n guide_enum = set_default(QGuideRose.Guide.SplitHorizontal)\n\n image_name = set_default('split_horizontal')",
"metadata": "root.SplitHorizontalGuide",
"header": "['module', '___EOS___']",
"index": 759
},
{
"content": "class SplitVerticalGuide(SingleGuide):\n \"\"\" A single guide which uses the vertical split image.\n\n \"\"\"\n guide_enum = set_default(QGuideRose.Guide.SplitVertical)\n\n image_name = set_default('split_vertical')",
"metadata": "root.SplitVerticalGuide",
"header": "['module', '___EOS___']",
"index": 768
},
{
"content": "class AreaCenterGuide(SingleGuide):\n \"\"\" A single guide which uses the area center image.\n\n \"\"\"\n guide_enum = set_default(QGuideRose.Guide.AreaCenter)\n\n image_name = set_default('center')",
"metadata": "root.AreaCenterGuide",
"header": "['module', '___EOS___']",
"index": 777
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"-------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"2013",
",",
" ",
"Nucle",
"ic",
" ",
"Dev",
"elo",
"pme",
"nt",
" ",
"Tea",
"m",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Distribut",
"ed",
" ",
"under",
" ",
"the",
" ",
"term",
"s",
" ",
"of",
" ",
"the",
" ",
"Modifie",
"d",
" ",
"BS",
"D",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"full",
" ",
"license",
" ",
"is",
" ",
"in",
" ",
"the",
" ",
"file",
" ",
"COPY",
"ING",
".",
"txt",
",",
" ",
"distributed",
" ",
"with",
" ",
"this",
" ",
"software",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"-------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"atom_",
"._",
"api_",
"import_",
"Atom_",
",_",
"Float_",
",_",
"Int_",
",_",
"Str_",
",_",
"Type",
"d_",
",_",
"Value_",
",_",
"set\\u",
"default_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"ena",
"ml_",
"._",
"qt_",
"._",
"Qt",
"Core_",
"import_",
"Qt_",
",_",
"QR",
"ect_",
",_",
"QP",
"oint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"ena",
"ml_",
"._",
"qt_",
"._",
"Qt",
"Gui_",
"import_",
"QF",
"rame_",
",_",
"QI",
"mage_",
",_",
"QP",
"aint",
"er_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Make",
" ",
"sure",
" ",
"the",
" ",
"resource",
"s",
" ",
"get",
" ",
"register",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"import_",
"dock",
"\\u",
"resources_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"custom",
" ",
"QF",
"rame",
" ",
"whi",
"ch",
" ",
"implement",
"s",
" ",
"a",
" ",
"collection",
" ",
"of",
" ",
"dock",
"ing",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"widget",
" ",
"must",
" ",
"alw",
"ay",
"s",
" ",
"be",
" ",
"used",
" ",
"as",
" ",
"an",
" ",
"independent",
" ",
"top",
"-",
"level",
" ",
"window",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"dock",
" ",
"area",
" ",
"whi",
"ch",
" ",
"use",
"s",
" ",
"the",
" ",
"rose",
" ",
"shou",
"ld",
" ",
"manu",
"ally",
" ",
"set",
" ",
"the",
" ",
"geom",
"etry",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"the",
" ",
"widget",
" ",
"bef",
"ore",
" ",
"showin",
"g",
" ",
"it",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"class_",
"Guide",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"An",
" ",
"enum",
" ",
"class",
" ",
"for",
" ",
"identify",
"ing",
" ",
"guide",
" ",
"location",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
":",
" ",
"No",
" ",
"rele",
"van",
"t",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"No",
"Guide",
"_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"north",
" ",
"border",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"North",
"_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"east",
" ",
"border",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"Eas",
"t_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"south",
" ",
"border",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"South",
"_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"west",
" ",
"border",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"West",
"_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"north",
" ",
"compass",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"North",
"_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"east",
" ",
"compass",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Eas",
"t_",
"=_",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"south",
" ",
"compass",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"South",
"_",
"=_",
"7_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"west",
" ",
"compass",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"West",
"_",
"=_",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"center",
" ",
"compass",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Center_",
"=_",
"9_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"compass",
" ",
"north",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Ex",
"North",
"_",
"=_",
"10_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"compass",
" ",
"east",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Ex",
"Eas",
"t_",
"=_",
"11_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"compass",
" ",
"south",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Ex",
"South",
"_",
"=_",
"12_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"compass",
" ",
"west",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Ex",
"West",
"_",
"=_",
"13_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"vertical",
" ",
"split",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Split",
"Vertica",
"l_",
"=_",
"14_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"horizon",
"tal",
" ",
"split",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Split",
"Horizontal_",
"=_",
"15_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"area",
" ",
"center",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Area",
"Center_",
"=_",
"16_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"border",
" ",
"north",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"Ex",
"North",
"_",
"=_",
"17_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"border",
" ",
"east",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"Ex",
"Eas",
"t_",
"=_",
"18_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"border",
" ",
"south",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"Ex",
"South",
"_",
"=_",
"19_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"extend",
"ed",
" ",
"border",
" ",
"west",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"Ex",
"West",
"_",
"=_",
"20_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Mode_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"An",
" ",
"enum",
" ",
"class",
" ",
"for",
" ",
"defini",
"ng",
" ",
"the",
" ",
"mode",
" ",
"for",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"mode",
" ",
"is",
" ",
"an",
" ",
"or",
"'",
"d",
" ",
"combinat",
"ion",
" ",
"of",
" ",
"flags",
" ",
"whi",
"ch",
" ",
"dict",
"ate",
" ",
"whi",
"ch",
" ",
"part",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"rose",
" ",
"are",
" ",
"active",
" ",
"on",
" ",
"the",
" ",
"screen",
".",
" ",
"The",
" ",
"mode",
"s",
" ",
"relate",
"d",
" ",
"to",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"center",
"piece",
" ",
"shou",
"ld",
" ",
"be",
" ",
"consider",
"ed",
" ",
"mutual",
"ly",
" ",
"exclu",
"sive",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
":",
" ",
"Not",
"hing",
" ",
"will",
" ",
"be",
" ",
"shown",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"No",
"Mode_",
"=_",
"0x0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"Show",
" ",
"the",
" ",
"border",
" ",
"guide",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Border",
"_",
"=_",
"0x1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"Show",
" ",
"the",
" ",
"standard",
" ",
"compass",
" ",
"as",
" ",
"the",
" ",
"center",
"piece",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss_",
"=_",
"0x2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"Show",
" ",
"the",
" ",
"extend",
"ed",
" ",
"compass",
" ",
"as",
" ",
"the",
" ",
"center",
"piece",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Compa",
"ss",
"Ex_",
"=_",
"0x4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"Show",
" ",
"the",
" ",
"horizon",
"tal",
" ",
"split",
" ",
"guide",
" ",
"as",
" ",
"the",
" ",
"center",
"piece",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Split",
"Horizontal_",
"=_",
"0x8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"Show",
" ",
"the",
" ",
"vertical",
" ",
"split",
" ",
"guide",
" ",
"as",
" ",
"the",
" ",
"center",
"piece",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Split",
"Vertica",
"l_",
"=_",
"0x10_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"Show",
" ",
"the",
" ",
"vertical",
" ",
"area",
" ",
"center",
" ",
"as",
" ",
"the",
" ",
"center",
"piece",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"Area",
"Center_",
"=_",
"0x20_",
"\\u\\u\\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",
" ",
"API_",
"\\u\\u\\uNL\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Public",
" ",
"API_",
"\\u\\u\\uNL\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"#",
" ",
"Rei",
"mple",
"menta",
"tions_",
"\\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_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\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_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Initializ",
"e",
" ",
"a",
" ",
"QG",
"uid",
"e",
"Rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"QG",
"uid",
"e",
"Rose",
"_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"On",
" ",
"Mac",
",",
" ",
"setti",
"ng",
" ",
"the",
" ",
"transl",
"uce",
"nt",
" ",
"background",
" ",
"doe",
"s",
" ",
"not",
" ",
"caus",
"e",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"frame",
" ",
"shadow",
" ",
"to",
" ",
"be",
" ",
"hidden",
";",
" ",
"it",
" ",
"must",
" ",
"be",
" ",
"explicit",
"ly",
" ",
"hidden",
".",
" ",
"Mac",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"als",
"o",
" ",
"require",
"s",
" ",
"the",
" ",
"window",
" ",
"to",
" ",
"be",
" ",
"a",
" ",
"toolt",
"ip",
" ",
"in",
" ",
"order",
" ",
"to",
" ",
"be",
" ",
"raised_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"above",
" ",
"the",
" ",
"rub",
"ber",
" ",
"band",
" ",
"in",
" ",
"the",
" ",
"Z",
"-",
"order",
".",
" ",
"On",
" ",
"Window",
"s",
",",
" ",
"the",
" ",
"tooltip_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"lea",
"ves",
" ",
"a",
" ",
"drops",
"had",
"ow",
" ",
"on",
" ",
"Qt",
" ",
">=",
" ",
"4.8",
" ",
"where",
"as",
" ",
"tool",
" ",
"doe",
"s",
" ",
"not",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"sys_",
"._",
"platform_",
"==_",
"'",
"dar",
"win",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"set",
"Attribute_",
"(_",
"Qt_",
"._",
"WA",
"\\u",
"Mac",
"No",
"Shadow_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"flags_",
"=_",
"Qt_",
"._",
"Tool",
"Tip_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"flags_",
"=_",
"Qt_",
"._",
"Tool_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"set",
"Attribute_",
"(_",
"Qt_",
"._",
"WA",
"\\u",
"Trans",
"luc",
"ent",
"Background_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"flags_",
"|=_",
"Qt_",
"._",
"Window",
"Sta",
"ys",
"On",
"Top",
"Hint_",
"|_",
"Qt_",
"._",
"Frame",
"less",
"Window",
"Hint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"set",
"Window",
"Flags_",
"(_",
"flags_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"mode_",
"=_",
"self_",
"._",
"Mode_",
"._",
"No",
"Mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
"=_",
"QP",
"oint_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"border",
"\\u",
"guide_",
"=_",
"Border",
"Guide",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"guide_",
"=_",
"Compa",
"ss",
"Guide",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"ex",
"\\u",
"guide_",
"=_",
"Compa",
"ss",
"Ex",
"Guide",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"vsp",
"lit",
"\\u",
"guide_",
"=_",
"Split",
"Vertica",
"l",
"Guide",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"hsp",
"lit",
"\\u",
"guide_",
"=_",
"Split",
"Horiz",
"onta",
"l",
"Guide",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"area",
"\\u",
"guide_",
"=_",
"Area",
"Center",
"Guide",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"layout",
"Guide",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Lay",
"out",
" ",
"the",
" ",
"guide",
"s",
" ",
"based",
" ",
"on",
" ",
"the",
" ",
"current",
" ",
"widget",
" ",
"geom",
"etry",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"border",
"\\u",
"guide_",
"._",
"layout_",
"(_",
"self_",
"._",
"rect_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"guide_",
"._",
"layout_",
"(_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"ex",
"\\u",
"guide_",
"._",
"layout_",
"(_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"vsp",
"lit",
"\\u",
"guide_",
"._",
"layout_",
"(_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"hsp",
"lit",
"\\u",
"guide_",
"._",
"layout_",
"(_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"area",
"\\u",
"guide_",
"._",
"layout_",
"(_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"center",
"Point_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
" ",
"the",
" ",
"center",
" ",
"point",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"location",
" ",
"tha",
"t",
" ",
"will",
" ",
"be",
" ",
"used",
" ",
"as",
" ",
"the",
" ",
"center",
" ",
"of",
" ",
"the",
" ",
"porti",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"the",
" ",
"rose",
" ",
"with",
" ",
"a",
" ",
"configurable",
" ",
"location",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"set",
"Center",
"Point_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Set",
" ",
"the",
" ",
"center",
" ",
"point",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"location",
" ",
"tha",
"t",
" ",
"will",
" ",
"be",
" ",
"used",
" ",
"as",
" ",
"the",
" ",
"center",
" ",
"of",
" ",
"the",
" ",
"porti",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"the",
" ",
"rose",
" ",
"with",
" ",
"a",
" ",
"configurable",
" ",
"location",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"pos_",
"!=_",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"center",
"\\u",
"point_",
"=_",
"pos_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"layout",
"Guide",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"update_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mode_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
" ",
"the",
" ",
"mode",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"Guide",
"Mode",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"guide",
" ",
"mode",
" ",
"applied",
" ",
"to",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"set",
"Mode_",
"(_",
"self_",
",_",
"mode_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Set",
" ",
"the",
" ",
"mode",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"mode",
" ",
":",
" ",
"Guide",
"Mode",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"or",
"'",
"d",
" ",
"combinat",
"ion",
" ",
"of",
" ",
"mode",
" ",
"flags",
" ",
"for",
" ",
"the",
" ",
"guide",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"mode_",
"!=_",
"self_",
"._",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"mode_",
"=_",
"mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"update_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mouse",
"Over",
"_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Update",
" ",
"the",
" ",
"guide",
" ",
"pads",
" ",
"based",
" ",
"on",
" ",
"the",
" ",
"mouse",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"current",
" ",
"mode",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"rose",
" ",
"is",
" ",
"used",
" ",
"to",
" ",
"dete",
"rmin",
"e",
" ",
"whi",
"ch",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"the",
" ",
"guide",
" ",
"pads",
" ",
"to",
" ",
"shou",
"ld",
" ",
"be",
" ",
"update",
"d",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"position",
" ",
"of",
" ",
"the",
" ",
"mouse",
" ",
"express",
"ed",
" ",
"in",
" ",
"local",
" ",
"coordinate",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"border",
"\\u",
"guide_",
"._",
"mouse",
"\\u",
"over_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"guide_",
"._",
"mouse",
"\\u",
"over_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"ex",
"\\u",
"guide_",
"._",
"mouse",
"\\u",
"over_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"vsp",
"lit",
"\\u",
"guide_",
"._",
"mouse",
"\\u",
"over_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"hsp",
"lit",
"\\u",
"guide_",
"._",
"mouse",
"\\u",
"over_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"area",
"\\u",
"guide_",
"._",
"mouse",
"\\u",
"over_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"update_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"guide",
"At_",
"(_",
"self_",
",_",
"pos_",
",_",
"mode_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
" ",
"the",
" ",
"guide",
" ",
"whi",
"ch",
" ",
"lies",
" ",
"under",
"nea",
"th",
" ",
"a",
" ",
"give",
"n",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"position",
" ",
"of",
" ",
"interest",
",",
" ",
"express",
"ed",
" ",
"local",
" ",
"coordinate",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"mode",
" ",
":",
" ",
"QG",
"uid",
"e",
"Rose",
".",
"Mode",
",",
" ",
"option",
"al",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"mode",
" ",
"to",
" ",
"use",
" ",
"for",
" ",
"hit",
" ",
"testi",
"ng",
".",
" ",
"If",
" ",
"not",
" ",
"provided",
",",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"current",
" ",
"mode",
" ",
"for",
" ",
"the",
" ",
"guide",
" ",
"rose",
" ",
"is",
" ",
"used",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"QG",
"uid",
"e",
"Rose",
".",
"Guide",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"enum",
" ",
"value",
" ",
"for",
" ",
"the",
" ",
"guide",
" ",
"under",
" ",
"the",
" ",
"mouse",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Guide",
"_",
"=_",
"self_",
"._",
"Guide",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Mode_",
"=_",
"self_",
"._",
"Mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mode_",
"=_",
"mode_",
"if_",
"mode_",
"is_",
"not_",
"None_",
"else_",
"self_",
"._",
"\\u",
"mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"mode_",
"&_",
"Mode_",
"._",
"Border",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"g_",
"=_",
"self_",
"._",
"\\u",
"border",
"\\u",
"guide_",
"._",
"guide",
"\\u",
"at_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"!=_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"mode_",
"&_",
"Mode_",
"._",
"Compa",
"ss_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"g_",
"=_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"guide_",
"._",
"guide",
"\\u",
"at_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"!=_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Compa",
"ss",
"Ex_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"g_",
"=_",
"self_",
"._",
"\\u",
"compass",
"\\u",
"ex",
"\\u",
"guide_",
"._",
"guide",
"\\u",
"at_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"!=_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Split",
"Horizontal_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"g_",
"=_",
"self_",
"._",
"\\u",
"hsp",
"lit",
"\\u",
"guide_",
"._",
"guide",
"\\u",
"at_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"!=_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Split",
"Vertica",
"l_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"g_",
"=_",
"self_",
"._",
"\\u",
"vsp",
"lit",
"\\u",
"guide_",
"._",
"guide",
"\\u",
"at_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"!=_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Area",
"Center_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"g_",
"=_",
"self_",
"._",
"\\u",
"area",
"\\u",
"guide_",
"._",
"guide",
"\\u",
"at_",
"(_",
"pos_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"!=_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"resiz",
"e",
"Event_",
"(_",
"self_",
",_",
"event_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Handle",
" ",
"the",
" ",
"resiz",
"e",
" ",
"event",
" ",
"for",
" ",
"the",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"handler",
" ",
"will",
" ",
"relay",
"out",
" ",
"the",
" ",
"guide",
"s",
" ",
"on",
" ",
"a",
" ",
"resiz",
"e",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"layout",
"Guide",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"QG",
"uid",
"e",
"Rose",
"_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"pain",
"t",
"Event_",
"(_",
"self_",
",_",
"event_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Handle",
" ",
"the",
" ",
"pain",
"t",
" ",
"event",
" ",
"for",
" ",
"the",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"handler",
" ",
"will",
" ",
"redraw",
" ",
"all",
" ",
"of",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"rose",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"QG",
"uid",
"e",
"Rose",
"_",
",_",
"self_",
")_",
"._",
"pain",
"t",
"Event_",
"(_",
"event_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"painter_",
"=_",
"QP",
"aint",
"er_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Mode_",
"=_",
"self_",
"._",
"Mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mode_",
"=_",
"self_",
"._",
"\\u",
"mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"mode_",
"&_",
"Mode_",
"._",
"Border",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"border",
"\\u",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"mode_",
"&_",
"Mode_",
"._",
"Compa",
"ss_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"compass",
"\\u",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Compa",
"ss",
"Ex_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"compass",
"\\u",
"ex",
"\\u",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Split",
"Horizontal_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"hsp",
"lit",
"\\u",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Split",
"Vertica",
"l_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"vsp",
"lit",
"\\u",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"mode_",
"&_",
"Mode_",
"._",
"Area",
"Center_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"area",
"\\u",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"class",
" ",
"whi",
"ch",
" ",
"manage",
"s",
" ",
"the",
" ",
"pain",
"ting",
" ",
"of",
" ",
"a",
" ",
"guide",
" ",
"image",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"default",
" ",
"alpha",
" ",
"value",
" ",
"for",
" ",
"guide",
" ",
"transparency",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"TRANSP",
"ARE",
"NT_",
"=_",
"0.60",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"default",
" ",
"alpha",
" ",
"value",
" ",
"for",
" ",
"no",
" ",
"guide",
" ",
"transparency",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"OP",
"AQ",
"UE",
"_",
"=_",
"1.0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"QI",
"mage",
" ",
"to",
" ",
"use",
" ",
"whe",
"n",
" ",
"pain",
"ting",
" ",
"the",
" ",
"guide",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"image_",
"=_",
"Type",
"d_",
"(_",
"QI",
"mage_",
",_",
"factory_",
"=_",
"lambda_",
":_",
"QI",
"mage_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"QR",
"ect",
" ",
"speci",
"fy",
"ing",
" ",
"where",
" ",
"to",
" ",
"draw",
" ",
"the",
" ",
"image",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"rect_",
"=_",
"Type",
"d_",
"(_",
"QR",
"ect_",
",_",
"factory_",
"=_",
"lambda_",
":_",
"QR",
"ect_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"opa",
"city",
" ",
"to",
" ",
"use",
" ",
"whe",
"n",
" ",
"drawing",
" ",
"the",
" ",
"image",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"opacity_",
"=_",
"Float_",
"(_",
"TRANSP",
"ARE",
"NT_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
":",
" ",
"A",
" ",
"cache",
" ",
"of",
" ",
"QI",
"mage",
" ",
"instance",
"s",
" ",
"for",
" ",
"the",
" ",
"load",
"ed",
" ",
"guide",
" ",
"images",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"images_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"classmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"load",
"\\u",
"image_",
"(_",
"cls_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Load",
" ",
"the",
" ",
"guide",
" ",
"image",
" ",
"for",
" ",
"the",
" ",
"give",
"n",
" ",
"name",
" ",
"int",
"o",
" ",
"a",
" ",
"QI",
"mage",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"function",
" ",
"is",
" ",
"hard",
"-",
"code",
"d",
" ",
"to",
" ",
"return",
" ",
"the",
" ",
"named",
" ",
".",
"png",
" ",
"image",
" ",
"from",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"./",
"dock",
"guide",
"s",
" ",
"director",
"y",
" ",
"located",
" ",
"along",
"side",
" ",
"this",
" ",
"file",
".",
" ",
"It",
" ",
"is",
" ",
"not",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"a",
" ",
"gener",
"ic",
" ",
"image",
" ",
"load",
"ing",
" ",
"routin",
"e",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"image_",
"=_",
"cls_",
"._",
"\\u",
"images_",
"._",
"get_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"image_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"image_",
"=_",
"QI",
"mage_",
"(_",
"':",
"dock",
"\\u",
"images",
"/",
"%",
"s",
".",
"png",
"'_",
"%_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cls_",
"._",
"\\u",
"images_",
"[_",
"name_",
"]_",
"=_",
"image_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"image_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\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_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Initializ",
"e",
" ",
"a",
" ",
"Guide",
"Image",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"name",
" ",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"image",
" ",
"to",
" ",
"load",
" ",
"for",
" ",
"the",
" ",
"guide",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"image_",
"=_",
"self_",
"._",
"load",
"\\u",
"image_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"opa",
"cif",
"y_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Make",
" ",
"the",
" ",
"guide",
" ",
"image",
" ",
"opaque",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"opacity_",
"=_",
"self_",
"._",
"OP",
"AQ",
"UE",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"transp",
"arent",
"ize_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Make",
" ",
"the",
" ",
"guide",
" ",
"image",
" ",
"transp",
"arent",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"opacity_",
"=_",
"self_",
"._",
"TRANSP",
"ARE",
"NT_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"contains_",
"(_",
"self_",
",_",
"point_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Test",
" ",
"whe",
"ther",
" ",
"the",
" ",
"image",
" ",
"contain",
"s",
" ",
"a",
" ",
"point",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rect",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"rect",
" ",
"to",
" ",
"test",
" ",
"for",
" ",
"contain",
"ment",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"bool",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Tru",
"e",
" ",
"if",
" ",
"the",
" ",
"image",
" ",
"contain",
"s",
" ",
"the",
" ",
"point",
",",
" ",
"Fal",
"se",
" ",
"other",
"wis",
"e",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"rect_",
"._",
"contains_",
"(_",
"point_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Image_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"paint_",
"(_",
"self_",
",_",
"painter_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Paint",
" ",
"the",
" ",
"image",
" ",
"usi",
"ng",
" ",
"the",
" ",
"give",
"n",
" ",
"painte",
"r",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"painte",
"r",
" ",
":",
" ",
"QP",
"aint",
"er",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"active",
" ",
"QP",
"aint",
"er",
" ",
"to",
" ",
"use",
" ",
"for",
" ",
"drawing",
" ",
"the",
" ",
"image",
".",
" ",
"If",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"image",
" ",
"is",
" ",
"a",
" ",
"null",
" ",
"image",
",",
" ",
"pain",
"ting",
" ",
"will",
" ",
"be",
" ",
"skip",
"ped",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"image_",
"=_",
"self_",
"._",
"image_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"image_",
"._",
"is",
"Null_",
"(_",
")_",
":_",
"\\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_",
"painter_",
"._",
"save_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"painter_",
"._",
"set",
"Opa",
"city_",
"(_",
"self_",
"._",
"opacity_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"painter_",
"._",
"draw",
"Image_",
"(_",
"self_",
"._",
"rect_",
",_",
"image_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"painter_",
"._",
"restore_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Guide",
"Handler_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"base",
" ",
"class",
" ",
"for",
" ",
"defini",
"ng",
" ",
"guide",
" ",
"handler",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
":",
" ",
"The",
" ",
"last",
" ",
"guide",
" ",
"hit",
" ",
"dur",
"ing",
" ",
"a",
" ",
"mouse",
"over",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"last",
"\\u",
"guide_",
"=_",
"Type",
"d_",
"(_",
"Guide",
"Image_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Guide",
"Handler_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"iter",
"guide",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"guide",
"s",
" ",
"manage",
"d",
" ",
"by",
" ",
"this",
" ",
"handler",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"(",
"Guide",
",",
" ",
"Guide",
"Image",
")",
" ",
"pair",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"guide",
"s",
" ",
"manage",
"d",
" ",
"by",
" ",
"the",
" ",
"handler",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Handler_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iter",
"boxes_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"box",
"es",
" ",
"whi",
"ch",
" ",
"lie",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"Guide",
"Image",
" ",
"instance",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
" ",
"box",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"be",
" ",
"painte",
"d",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Handler_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"guide",
"\\u",
"at_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
" ",
"the",
" ",
"guide",
" ",
"under",
" ",
"the",
" ",
"give",
"n",
" ",
"mouse",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"point",
" ",
"of",
" ",
"interest",
",",
" ",
"express",
"ed",
" ",
"in",
" ",
"layout",
" ",
"coordinate",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"Guide",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"enum",
" ",
"value",
" ",
"for",
" ",
"the",
" ",
"guide",
" ",
"at",
" ",
"the",
" ",
"give",
"n",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"enum_",
",_",
"guide_",
"in_",
"self_",
"._",
"iter",
"guide",
"s_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"guide_",
"._",
"contains_",
"(_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"enum_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Handler_",
"(_",
"Atom_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mouse",
"\\u",
"over_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Perform",
" ",
"a",
" ",
"mouse",
" ",
"over",
" ",
"of",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"position",
" ",
"of",
" ",
"interest",
" ",
"express",
"ed",
" ",
"in",
" ",
"layout",
" ",
"coordinate",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"ignored_",
",_",
"guide_",
"in_",
"self_",
"._",
"iter",
"guide",
"s_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"guide_",
"._",
"contains_",
"(_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"last_",
"=_",
"self_",
"._",
"\\u",
"last",
"\\u",
"guide_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"last_",
"is_",
"not_",
"None_",
"and_",
"last_",
"is_",
"not_",
"guide_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"last_",
"._",
"transp",
"arent",
"ize_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"guide_",
"._",
"opa",
"cif",
"y_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"last",
"\\u",
"guide_",
"=_",
"guide_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"\\u",
"last",
"\\u",
"guide_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"last",
"\\u",
"guide_",
"._",
"transp",
"arent",
"ize_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Guide",
"Handler_",
"(_",
"Atom_",
")_",
":_",
"\\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_",
"paint_",
"(_",
"self_",
",_",
"painter_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Paint",
" ",
"the",
" ",
"guide",
"s",
" ",
"usi",
"ng",
" ",
"the",
" ",
"supplie",
"d",
" ",
"painte",
"r",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"painte",
"r",
" ",
":",
" ",
"QP",
"aint",
"er",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"painte",
"r",
" ",
"to",
" ",
"use",
" ",
"to",
" ",
"pain",
"t",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"box_",
"in_",
"self_",
"._",
"iter",
"boxes_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"box_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"ignored_",
",_",
"guide_",
"in_",
"self_",
"._",
"iter",
"guide",
"s_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"guide_",
"._",
"paint_",
"(_",
"painter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Border",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"guide",
" ",
"handler",
" ",
"whi",
"ch",
" ",
"manage",
"s",
" ",
"the",
" ",
"border",
" ",
"guide",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"guide",
"s_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"North",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"thin",
"\\u",
"horizon",
"tal",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"Ex",
"North",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"horizon",
"tal",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"Eas",
"t_",
":_",
"Guide",
"Image_",
"(_",
"'",
"thin",
"\\u",
"vertical",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"Ex",
"Eas",
"t_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"vertical",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"South",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"thin",
"\\u",
"horizon",
"tal",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"Ex",
"South",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"horizon",
"tal",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"West",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"thin",
"\\u",
"vertical",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"Ex",
"West",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"vertical",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"boxes_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"North",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"guide",
"\\u",
"box",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"Eas",
"t_",
":_",
"Guide",
"Image_",
"(_",
"'",
"guide",
"\\u",
"box",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"South",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"guide",
"\\u",
"box",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Border",
"West",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"guide",
"\\u",
"box",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Border",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"iter",
"guide",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"guide",
"s",
" ",
"manage",
"d",
" ",
"by",
" ",
"the",
" ",
"handler",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"(",
"Guide",
",",
" ",
"Guide",
"Image",
")",
" ",
"pair",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"guide",
"s",
" ",
"manage",
"d",
" ",
"by",
" ",
"the",
" ",
"handler",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"guide",
"s_",
"._",
"iteritems_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Border",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iter",
"boxes_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"box",
"es",
" ",
"whi",
"ch",
" ",
"lie",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"Guide",
"Image",
" ",
"instance",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
" ",
"box",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"be",
" ",
"painte",
"d",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"boxes_",
"._",
"itervalues_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Border",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"layout_",
"(_",
"self_",
",_",
"rect_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Lay",
"out",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"give",
"n",
" ",
"rect",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rect",
" ",
":",
" ",
"QR",
"ect",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"rectangle",
" ",
"in",
" ",
"whi",
"ch",
" ",
"to",
" ",
"layout",
" ",
"the",
" ",
"border",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boxes_",
"=_",
"self_",
"._",
"\\u",
"boxes_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"=_",
"self_",
"._",
"\\u",
"guide",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"w_",
"=_",
"rect_",
"._",
"width_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"h_",
"=_",
"rect_",
"._",
"height_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cx_",
"=_",
"rect_",
"._",
"left_",
"(_",
")_",
"+_",
"w_",
"/_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cy_",
"=_",
"rect_",
"._",
"top_",
"(_",
")_",
"+_",
"h_",
"/_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Guide",
"_",
"=_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"North",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"cx_",
"-_",
"15_",
",_",
"27_",
",_",
"31_",
",_",
"19_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"Ex",
"North",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"cx_",
"-_",
"15_",
",_",
"15_",
",_",
"31_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boxes_",
"[_",
"Guide",
"_",
"._",
"Border",
"North",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"cx_",
"-_",
"20_",
",_",
"10_",
",_",
"41_",
",_",
"41_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"Eas",
"t_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"w_",
"-_",
"45_",
",_",
"cy_",
"-_",
"15_",
",_",
"19_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"Ex",
"Eas",
"t_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"w_",
"-_",
"24_",
",_",
"cy_",
"-_",
"15_",
",_",
"10_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boxes_",
"[_",
"Guide",
"_",
"._",
"Border",
"Eas",
"t_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"w_",
"-_",
"50_",
",_",
"cy_",
"-_",
"20_",
",_",
"41_",
",_",
"41_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"South",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"cx_",
"-_",
"15_",
",_",
"h_",
"-_",
"45_",
",_",
"31_",
",_",
"19_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"Ex",
"South",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"cx_",
"-_",
"15_",
",_",
"h_",
"-_",
"24_",
",_",
"31_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boxes_",
"[_",
"Guide",
"_",
"._",
"Border",
"South",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"cx_",
"-_",
"20_",
",_",
"h_",
"-_",
"50_",
",_",
"41_",
",_",
"41_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"West",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"27_",
",_",
"cy_",
"-_",
"15_",
",_",
"19_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Border",
"Ex",
"West",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"15_",
",_",
"cy_",
"-_",
"15_",
",_",
"10_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boxes_",
"[_",
"Guide",
"_",
"._",
"Border",
"West",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"10_",
",_",
"cy_",
"-_",
"20_",
",_",
"41_",
",_",
"41_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Compa",
"ss",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"guide",
" ",
"handler",
" ",
"whi",
"ch",
" ",
"manage",
"s",
" ",
"the",
" ",
"standard",
" ",
"compass",
" ",
"guide",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"guide",
"s_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"North",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"north",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Eas",
"t_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"east",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"South",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"south",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"West",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"west",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Center_",
":_",
"Guide",
"Image_",
"(_",
"'",
"center",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"box_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"Guide",
"Image_",
"(_",
"'",
"cross",
"\\u",
"box",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Compa",
"ss",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"iter",
"guide",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"generat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"generat",
"or",
" ",
"whi",
"ch",
" ",
"yield",
"s",
" ",
"2",
"-",
"tuple",
"s",
" ",
"of",
" ",
"(",
"enum",
",",
" ",
"guide",
")",
" ",
"for",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"rele",
"van",
"t",
" ",
"guide",
"s",
" ",
"in",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"guide",
"s_",
"._",
"iteritems_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Compa",
"ss",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iter",
"boxes_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"box",
"es",
" ",
"whi",
"ch",
" ",
"lie",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"Guide",
"Image",
" ",
"instance",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
" ",
"box",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"be",
" ",
"painte",
"d",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"self_",
"._",
"\\u",
"box_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Compa",
"ss",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"layout_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Lay",
"out",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"give",
"n",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"center",
" ",
"point",
" ",
"of",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x_",
"=_",
"pos_",
"._",
"x_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y_",
"=_",
"pos_",
"._",
"y_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Guide",
"_",
"=_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"=_",
"self_",
"._",
"\\u",
"guide",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"North",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"-_",
"50_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Eas",
"t_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"+_",
"20_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"South",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"+_",
"20_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"West",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"50_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Center_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"box_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"55_",
",_",
"y_",
"-_",
"55_",
",_",
"111_",
",_",
"111_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Compa",
"ss",
"Ex",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"class",
" ",
"whi",
"ch",
" ",
"render",
"s",
" ",
"the",
" ",
"extend",
"ed",
" ",
"compass",
" ",
"guide",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"guide",
"s_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"North",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"north",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Eas",
"t_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"east",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"South",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"south",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"West",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"arrow",
"\\u",
"west",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Center_",
":_",
"Guide",
"Image_",
"(_",
"'",
"center",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"North",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"horizon",
"tal",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"Eas",
"t_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"vertical",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"South",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"horizon",
"tal",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"West",
"_",
":_",
"Guide",
"Image_",
"(_",
"'",
"bar",
"\\u",
"vertical",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"box_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"Guide",
"Image_",
"(_",
"'",
"cross",
"\\u",
"ex",
"\\u",
"box",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Compa",
"ss",
"Ex",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"iter",
"guide",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"extent",
"ed",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"generat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"generat",
"or",
" ",
"whi",
"ch",
" ",
"yield",
"s",
" ",
"2",
"-",
"tuple",
"s",
" ",
"of",
" ",
"(",
"enum",
",",
" ",
"guide",
")",
" ",
"for",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"rele",
"van",
"t",
" ",
"guide",
"s",
" ",
"in",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"guide",
"s_",
"._",
"iteritems_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Compa",
"ss",
"Ex",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iter",
"boxes_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"box",
"es",
" ",
"whi",
"ch",
" ",
"lie",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"Guide",
"Image",
" ",
"instance",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
" ",
"box",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"be",
" ",
"painte",
"d",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"self_",
"._",
"\\u",
"box_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Compa",
"ss",
"Ex",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"layout_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Lay",
"out",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"extend",
"ed",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"center",
" ",
"point",
" ",
"of",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x_",
"=_",
"pos_",
"._",
"x_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y_",
"=_",
"pos_",
"._",
"y_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Guide",
"_",
"=_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"=_",
"self_",
"._",
"\\u",
"guide",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"North",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"-_",
"64_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Eas",
"t_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"+_",
"34_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"South",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"+_",
"34_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"West",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"64_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Center_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"North",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"-_",
"29_",
",_",
"31_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"Eas",
"t_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"+_",
"20_",
",_",
"y_",
"-_",
"15_",
",_",
"10_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"South",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"+_",
"20_",
",_",
"31_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"s_",
"[_",
"Guide",
"_",
"._",
"Compa",
"ss",
"Ex",
"West",
"_",
"]_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"29_",
",_",
"y_",
"-_",
"15_",
",_",
"10_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"box_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"69_",
",_",
"y_",
"-_",
"69_",
",_",
"139_",
",_",
"139_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Sing",
"le",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"base",
" ",
"class",
" ",
"for",
" ",
"defini",
"ng",
" ",
"a",
" ",
"single",
" ",
"guide",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"\\u",
"enum_",
"=_",
"Int_",
"(_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"No",
"Guide",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"image",
"\\u",
"name_",
"=_",
"Str_",
"(_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"box_",
"=_",
"Value_",
"(_",
"factory_",
"=_",
"lambda_",
":_",
"Guide",
"Image_",
"(_",
"'",
"guide",
"\\u",
"box",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"guide_",
"=_",
"Type",
"d_",
"(_",
"Guide",
"Image_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Sing",
"le",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u",
"default",
"\\u\\u",
"guide_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"The",
" ",
"default",
" ",
"value",
" ",
"handler",
" ",
"for",
" ",
"the",
" ",
"'\\u",
"guide",
"'",
" ",
"attribute",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Guide",
"Image_",
"(_",
"self_",
"._",
"image",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sing",
"le",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iter",
"guide",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"generat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"generat",
"or",
" ",
"whi",
"ch",
" ",
"yield",
"s",
" ",
"2",
"-",
"tuple",
"s",
" ",
"of",
" ",
"(",
"enum",
",",
" ",
"guide",
")",
" ",
"for",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"rele",
"van",
"t",
" ",
"guide",
"s",
" ",
"in",
" ",
"the",
" ",
"compass",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"(_",
"self_",
"._",
"guide",
"\\u",
"enum_",
",_",
"self_",
"._",
"\\u",
"guide_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sing",
"le",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iter",
"boxes_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Iterat",
"e",
" ",
"the",
" ",
"box",
"es",
" ",
"whi",
"ch",
" ",
"lie",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"result",
" ",
":",
" ",
"iterable",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"iterable",
" ",
"of",
" ",
"Guide",
"Image",
" ",
"instance",
"s",
" ",
"whi",
"ch",
" ",
"are",
" ",
"the",
" ",
"box",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"be",
" ",
"painte",
"d",
" ",
"under",
" ",
"the",
" ",
"guide",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"self_",
"._",
"\\u",
"box_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sing",
"le",
"Guide",
"_",
"(_",
"Guide",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"layout_",
"(_",
"self_",
",_",
"pos_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Lay",
"out",
" ",
"the",
" ",
"guide",
"s",
" ",
"for",
" ",
"the",
" ",
"give",
"n",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pos",
" ",
":",
" ",
"QP",
"oint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"center",
" ",
"point",
" ",
"of",
" ",
"the",
" ",
"guide",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x_",
"=_",
"pos_",
"._",
"x_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y_",
"=_",
"pos_",
"._",
"y_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"guide_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"15_",
",_",
"y_",
"-_",
"15_",
",_",
"31_",
",_",
"31_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"box_",
"._",
"rect_",
"=_",
"QR",
"ect_",
"(_",
"x_",
"-_",
"20_",
",_",
"y_",
"-_",
"20_",
",_",
"41_",
",_",
"41_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Split",
"Horiz",
"onta",
"l",
"Guide",
"_",
"(_",
"Sing",
"le",
"Guide",
"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"single",
" ",
"guide",
" ",
"whi",
"ch",
" ",
"use",
"s",
" ",
"the",
" ",
"horizon",
"tal",
" ",
"split",
" ",
"image",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"\\u",
"enum_",
"=_",
"set\\u",
"default_",
"(_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Split",
"Horizontal_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"image",
"\\u",
"name_",
"=_",
"set\\u",
"default_",
"(_",
"'",
"split",
"\\u",
"horizon",
"tal",
"'_",
")_",
"\\u\\u\\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_",
"Split",
"Vertica",
"l",
"Guide",
"_",
"(_",
"Sing",
"le",
"Guide",
"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"single",
" ",
"guide",
" ",
"whi",
"ch",
" ",
"use",
"s",
" ",
"the",
" ",
"vertical",
" ",
"split",
" ",
"image",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"\\u",
"enum_",
"=_",
"set\\u",
"default_",
"(_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Split",
"Vertica",
"l_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"image",
"\\u",
"name_",
"=_",
"set\\u",
"default_",
"(_",
"'",
"split",
"\\u",
"vertical",
"'_",
")_",
"\\u\\u\\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_",
"Area",
"Center",
"Guide",
"_",
"(_",
"Sing",
"le",
"Guide",
"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"A",
" ",
"single",
" ",
"guide",
" ",
"whi",
"ch",
" ",
"use",
"s",
" ",
"the",
" ",
"area",
" ",
"center",
" ",
"image",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"guide",
"\\u",
"enum_",
"=_",
"set\\u",
"default_",
"(_",
"QG",
"uid",
"e",
"Rose",
"_",
"._",
"Guide",
"_",
"._",
"Area",
"Center_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"image",
"\\u",
"name_",
"=_",
"set\\u",
"default_",
"(_",
"'",
"center",
"'_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Variable defined multiple times | enthought/mayavi/mayavi/action/save_load.py | [
{
"content": " def perform(self, event):\n \"\"\" Performs the action. \"\"\"\n wildcard = 'Python files (*.py)|*.py'\n parent = self.window.control\n dialog = FileDialog(parent=parent,\n title='Open Python file',\n action='open', wildcard=wildcard\n )\n if dialog.open() == OK:\n if not isfile(dialog.path):\n error(\"File '%s' does not exist\"%dialog.path, parent)\n return\n\n # Get the globals.\n # The following code is taken from scripts/mayavi2.py.\n g = sys.modules['__main__'].__dict__\n if 'mayavi' not in g:\n mv = get_imayavi(self.window)\n g['mayavi'] = mv\n g['engine'] = mv.engine\n g['__file__'] = dialog.path\n # Do execfile\n try:\n # If we don't pass globals twice we get NameErrors and nope,\n # using exec open(script_name).read() does not fix it.\n exec(compile(\n open(dialog.path).read(), dialog.path, 'exec'), g, g\n )\n except Exception as msg:\n exception(str(msg))",
"metadata": "root.RunScript.perform",
"header": "['class', 'RunScript', '(', 'Action', ')', ':', '___EOS___']",
"index": 91
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Run",
"Script_",
"(_",
"Action_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"perform_",
"(_",
"self_",
",_",
"event_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Perform",
"s",
" ",
"the",
" ",
"action",
".",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"wildcard_",
"=_",
"'",
"Pyth",
"on",
" ",
"files",
" ",
"(*",
".",
"py",
")|",
"*.",
"py",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"window_",
"._",
"control_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dialog_",
"=_",
"File",
"Dialog_",
"(_",
"parent_",
"=_",
"parent_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"title_",
"=_",
"'",
"Open",
" ",
"Pyth",
"on",
" ",
"file",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'",
"open",
"'_",
",_",
"wildcard_",
"=_",
"wildcard_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"dialog_",
"._",
"open_",
"(_",
")_",
"==_",
"OK_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"isfile_",
"(_",
"dialog_",
"._",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"error_",
"(_",
"\"",
"File",
" ",
"'%",
"s",
"'",
" ",
"doe",
"s",
" ",
"not",
" ",
"exist",
"\"_",
"%_",
"dialog_",
"._",
"path_",
",_",
"parent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Get",
" ",
"the",
" ",
"globals",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"follow",
"ing",
" ",
"code",
" ",
"is",
" ",
"take",
"n",
" ",
"from",
" ",
"scripts",
"/",
"maya",
"vi",
"2",
".",
"py",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"g_",
"=_",
"sys_",
"._",
"modules_",
"[_",
"'\\u",
"\\u",
"main",
"\\u\\u'_",
"]_",
"._",
"\\u\\u",
"dict\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"'",
"maya",
"vi",
"'_",
"not_",
"in_",
"g_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mv_",
"=_",
"get",
"\\u",
"ima",
"ya",
"vi_",
"(_",
"self_",
"._",
"window_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"g_",
"[_",
"'",
"maya",
"vi",
"'_",
"]_",
"=_",
"mv_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"g_",
"[_",
"'",
"eng",
"ine",
"'_",
"]_",
"=_",
"mv_",
"._",
"engine_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"g_",
"[_",
"'\\u",
"\\u",
"file",
"\\u\\u'_",
"]_",
"=_",
"dialog_",
"._",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Do",
" ",
"execfile",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"we",
" ",
"don",
"'",
"t",
" ",
"pass",
" ",
"globals",
" ",
"twi",
"ce",
" ",
"we",
" ",
"get",
" ",
"Name",
"Error",
"s",
" ",
"and",
" ",
"nop",
"e",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"usi",
"ng",
" ",
"exec",
" ",
"open",
"(",
"script",
"\\u",
"name",
").",
"read",
"()",
" ",
"doe",
"s",
" ",
"not",
" ",
"fix",
" ",
"it",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"exec_",
"(_",
"compile_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"open_",
"(_",
"dialog_",
"._",
"path_",
")_",
"._",
"read_",
"(_",
")_",
",_",
"dialog_",
"._",
"path_",
",_",
"'",
"exec",
"'_",
")_",
",_",
"g_",
",_",
"g_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Exception_",
"as_",
"msg_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"exception_",
"(_",
"str_",
"(_",
"msg_",
")_",
")_"
] |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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
] |
Except block handles 'BaseException' | ipython/ipython-py3k/IPython/lib/inputhook.py | [
{
"content": " def enable_gtk(self, app=None):\n \"\"\"Enable event loop integration with PyGTK.\n\n Parameters\n ----------\n app : ignored\n Ignored, it's only a placeholder to keep the call signature of all\n gui activation methods consistent, which simplifies the logic of\n supporting magics.\n\n Notes\n -----\n This methods sets the PyOS_InputHook for PyGTK, which allows\n the PyGTK to integrate with terminal based applications like\n IPython.\n \"\"\"\n import gtk\n try:\n gtk.set_interactive(True)\n self._current_gui = GUI_GTK\n except AttributeError:\n # For older versions of gtk, use our own ctypes version\n from IPython.lib.inputhookgtk import inputhook_gtk\n self.set_inputhook(inputhook_gtk)\n self._current_gui = GUI_GTK",
"metadata": "root.InputHookManager.enable_gtk",
"header": "['class', 'InputHookManager', '(', 'object', ')', ':', '___EOS___']",
"index": 222
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Inp",
"ut",
"Hook",
"Manager_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"enable",
"\\u",
"gtk_",
"(_",
"self_",
",_",
"app_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Enable",
" ",
"event",
" ",
"loop",
" ",
"integrati",
"on",
" ",
"with",
" ",
"Py",
"GTK",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"app",
" ",
":",
" ",
"ignore",
"d",
"\\",
"10",
";",
" ",
" ",
" ",
"Ignor",
"ed",
",",
" ",
"it",
"'",
"s",
" ",
"only",
" ",
"a",
" ",
"placehold",
"er",
" ",
"to",
" ",
"keep",
" ",
"the",
" ",
"call",
" ",
"signa",
"ture",
" ",
"of",
" ",
"all",
"\\",
"10",
";",
" ",
" ",
" ",
"gui",
" ",
"activation",
" ",
"method",
"s",
" ",
"consistent",
",",
" ",
"whi",
"ch",
" ",
"simpli",
"fie",
"s",
" ",
"the",
" ",
"logic",
" ",
"of",
"\\",
"10",
";",
" ",
" ",
" ",
"support",
"ing",
" ",
"magic",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-----",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"method",
"s",
" ",
"sets",
" ",
"the",
" ",
"Py",
"OS",
"\\u",
"Inp",
"ut",
"Hook",
" ",
"for",
" ",
"Py",
"GTK",
",",
" ",
"whi",
"ch",
" ",
"allow",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"Py",
"GTK",
" ",
"to",
" ",
"integrate",
" ",
"with",
" ",
"termina",
"l",
" ",
"based",
" ",
"applica",
"tion",
"s",
" ",
"like",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"IP",
"yth",
"on",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"gtk_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"gtk_",
"._",
"set\\u",
"interactive_",
"(_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"current",
"\\u",
"gui_",
"=_",
"GU",
"I",
"\\u",
"GTK",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"For",
" ",
"older",
" ",
"version",
"s",
" ",
"of",
" ",
"gtk",
",",
" ",
"use",
" ",
"our",
" ",
"own",
" ",
"ctype",
"s",
" ",
"version_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"IP",
"ython_",
"._",
"lib_",
"._",
"input",
"hook",
"gtk_",
"import_",
"input",
"hook",
"\\u",
"gtk_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"set\\u",
"input",
"hook_",
"(_",
"input",
"hook",
"\\u",
"gtk_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"current",
"\\u",
"gui_",
"=_",
"GU",
"I",
"\\u",
"GTK",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | bennylope/django-addendum/addendum/templatetags/addendum_tags.py | [
{
"content": "class SnippetNode(template.Node):\n\n safe = None\n template = None\n language = None\n\n",
"metadata": "root.SnippetNode",
"header": "['module', '___EOS___']",
"index": 63
}
] | [] | [] | 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_",
"class_",
"Snippet",
"Node_",
"(_",
"template_",
"._",
"Node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"safe_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"template_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"language_",
"=_",
"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_"
] | [
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
] |
Unused import | felix-lang/fbuild/lib/fbuild/config/c/win32.py | [
{
"content": "import fbuild\nimport fbuild.builders.c\nimport fbuild.config.c as c\nimport fbuild.temp\n\n# ------------------------------------------------------------------------------\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class windows_h(c.Test):\n header = c.header_test('windows.h')\n\n",
"metadata": "root.windows_h",
"header": "['module', '___EOS___']",
"index": 7
},
{
"content": " @c.cacheproperty\n def LoadLibrary(self):\n # try to get a shared compiler\n shared = fbuild.builders.c.guess_shared(self.ctx)\n\n lib_code = '''\n #ifdef __cplusplus\n extern \"C\" {\n #endif\n int fred(int argc, char** argv) { return 0; }\n #ifdef __cplusplus\n }\n #endif\n '''\n\n exe_code = '''\n #include <windows.h>\n #include <stdlib.h>\n\n int main(int argc,char** argv) {\n HMODULE lib = LoadLibrary(%s);\n void *fred;\n if(!lib) return 1;\n fred = (void*)GetProcAddress(lib,\"fred\");\n if(!fred) return 1;\n return 0;\n }\n '''\n\n self.ctx.logger.check(\"checking LoadLibrary in 'windows.h'\")\n\n with fbuild.temp.tempfile(lib_code, self.builder.src_suffix) as lib_src:\n try:\n obj = shared.uncached_compile(lib_src, quieter=1)\n lib = shared.uncached_link_lib(lib_src.parent / 'temp', [obj],\n quieter=1)\n except fbuild.ExecutionError:\n pass\n else:\n if self.builder.try_run(exe_code % lib, quieter=1):\n self.ctx.logger.passed()\n return c.Function('HMODULE', 'char*')\n\n self.ctx.logger.failed()\n return None",
"metadata": "root.windows_h.LoadLibrary",
"header": "['class', 'windows_h', '(', 'c', '.', 'Test', ')', ':', '___EOS___']",
"index": 10
},
{
"content": " def GetProcAddress(self):\n if self.LoadLibrary:\n return c.Function('void*', 'HMODULE', 'char*')",
"metadata": "root.windows_h.GetProcAddress",
"header": "['class', 'windows_h', '(', 'c', '.', 'Test', ')', ':', '___EOS___']",
"index": 56
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"fb",
"uild",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"fb",
"uild",
"_",
"._",
"builders_",
"._",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"fb",
"uild",
"_",
"._",
"config_",
"._",
"c_",
"as_",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"fb",
"uild",
"_",
"._",
"temp_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"--------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"windows",
"\\u",
"h_",
"(_",
"c_",
"._",
"Test_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"header_",
"=_",
"c_",
"._",
"header",
"\\u",
"test_",
"(_",
"'",
"windows",
".",
"h",
"'_",
")_",
"\\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_",
"windows",
"\\u",
"h_",
"(_",
"c_",
"._",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"c_",
"._",
"cache",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"Load",
"Library_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"try",
" ",
"to",
" ",
"get",
" ",
"a",
" ",
"shared",
" ",
"compiler_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"shared_",
"=_",
"fb",
"uild",
"_",
"._",
"builders_",
"._",
"c_",
"._",
"guess",
"\\u",
"shared_",
"(_",
"self_",
"._",
"ctx_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"lib",
"\\u",
"code_",
"=_",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"#",
"ifdef",
" ",
"\\u\\u",
"cpl",
"usp",
"lus",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"extern",
" ",
"\"",
"C",
"\"",
" ",
"{",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"#",
"endi",
"f",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"int",
" ",
"fre",
"d",
"(",
"int",
" ",
"argc",
",",
" ",
"char",
"**",
" ",
"argv",
")",
" ",
"{",
" ",
"return",
" ",
"0",
";",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"#",
"ifdef",
" ",
"\\u\\u",
"cpl",
"usp",
"lus",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"#",
"endi",
"f",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"exe",
"\\u",
"code_",
"=_",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"#",
"include",
" ",
"<",
"windows",
".",
"h",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"#",
"include",
" ",
"<",
"stdlib",
".",
"h",
">",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"int",
" ",
"main",
"(",
"int",
" ",
"argc",
",",
"char",
"**",
" ",
"argv",
")",
" ",
"{",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"HM",
"OD",
"UL",
"E",
" ",
"lib",
" ",
"=",
" ",
"Load",
"Libr",
"ary",
"(%",
"s",
");",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"voi",
"d",
" ",
"*",
"fre",
"d",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"if",
"(!",
"lib",
")",
" ",
"return",
" ",
"1",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"fre",
"d",
" ",
"=",
" ",
"(",
"voi",
"d",
"*)",
"Get",
"Proc",
"Address",
"(",
"lib",
",\"",
"fre",
"d",
"\");",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"if",
"(!",
"fre",
"d",
")",
" ",
"return",
" ",
"1",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"return",
" ",
"0",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"ctx_",
"._",
"logger_",
"._",
"check_",
"(_",
"\"",
"checking",
" ",
"Load",
"Libr",
"ary",
" ",
"in",
" ",
"'",
"windows",
".",
"h",
"'\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"with_",
"fb",
"uild",
"_",
"._",
"temp_",
"._",
"tempfile_",
"(_",
"lib",
"\\u",
"code_",
",_",
"self_",
"._",
"builder_",
"._",
"src",
"\\u",
"suffix_",
")_",
"as_",
"lib",
"\\u",
"src_",
":_",
"\\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 ",
" _",
"obj_",
"=_",
"shared_",
"._",
"unca",
"ched",
"\\u",
"compile_",
"(_",
"lib",
"\\u",
"src_",
",_",
"quie",
"ter_",
"=_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lib_",
"=_",
"shared_",
"._",
"unca",
"ched",
"\\u",
"link",
"\\u",
"lib_",
"(_",
"lib",
"\\u",
"src_",
"._",
"parent_",
"/_",
"'",
"temp",
"'_",
",_",
"[_",
"obj_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"quie",
"ter_",
"=_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"fb",
"uild",
"_",
"._",
"Execut",
"ion",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"builder_",
"._",
"try",
"\\u",
"run_",
"(_",
"exe",
"\\u",
"code_",
"%_",
"lib_",
",_",
"quie",
"ter_",
"=_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"ctx_",
"._",
"logger_",
"._",
"passed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"c_",
"._",
"Function_",
"(_",
"'",
"HM",
"OD",
"UL",
"E",
"'_",
",_",
"'",
"char",
"*'_",
")_",
"\\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_",
"._",
"ctx_",
"._",
"logger_",
"._",
"failed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"windows",
"\\u",
"h_",
"(_",
"c_",
"._",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"Get",
"Proc",
"Address_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"Load",
"Library_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"c_",
"._",
"Function_",
"(_",
"'",
"voi",
"d",
"*'_",
",_",
"'",
"HM",
"OD",
"UL",
"E",
"'_",
",_",
"'",
"char",
"*'_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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' | pyinvoke/invoke/invoke/executor.py | [
{
"content": " def execute(self, *tasks):\n \"\"\"\n Execute one or more ``tasks`` in sequence.\n\n :param tasks:\n An all-purpose iterable of \"tasks to execute\", each member of which\n may take one of the following forms:\n\n **A string** naming a task from the Executor's `.Collection`. This\n name may contain dotted syntax appropriate for calling namespaced\n tasks, e.g. ``subcollection.taskname``. Such tasks are executed\n without arguments.\n\n **A two-tuple** whose first element is a task name string (as\n above) and whose second element is a dict suitable for use as\n ``**kwargs`` when calling the named task. E.g.::\n\n [\n ('task1', {}),\n ('task2', {'arg1': 'val1'}),\n ...\n ]\n\n is equivalent, roughly, to::\n\n task1()\n task2(arg1='val1')\n\n **A `.ParserContext`** instance, whose ``.name`` attribute is used\n as the task name and whose ``.as_kwargs`` attribute is used as the\n task kwargs (again following the above specifications).\n\n .. note::\n When called without any arguments at all (i.e. when ``*tasks``\n is empty), the default task from ``self.collection`` is used\n instead, if defined.\n\n :returns:\n A dict mapping task objects to their return values.\n\n This dict may include pre- and post-tasks if any were executed. For\n example, in a collection with a ``build`` task depending on another\n task named ``setup``, executing ``build`` will result in a dict\n with two keys, one for ``build`` and one for ``setup``.\n \"\"\"\n # Normalize input\n debug(\"Examining top level tasks {0!r}\".format([x for x in tasks]))\n calls = self.normalize(tasks)\n debug(\"Tasks (now Calls) with kwargs: {0!r}\".format(calls))\n # Obtain copy of directly-given tasks since they should sometimes\n # behave differently\n direct = list(calls)\n # Expand pre/post tasks & then dedupe the entire run.\n # Load config at this point to get latest value of dedupe option\n config = self.config.clone()\n expanded = self.expand_calls(calls, config)\n # Get some good value for dedupe option, even if config doesn't have\n # the tree we expect. (This is a concession to testing.)\n try:\n dedupe = config.tasks.dedupe\n except AttributeError:\n dedupe = True\n # Actual deduping here\n calls = self.dedupe(expanded) if dedupe else expanded\n # Execute\n results = {}\n for call in calls:\n autoprint = call in direct and call.autoprint\n args = call.args\n debug(\"Executing {0!r}\".format(call))\n if call.contextualized:\n args = (call.context,) + args\n result = call.task(*args, **call.kwargs)\n if autoprint:\n print(result)\n # TODO: handle the non-dedupe case / the same-task-different-args\n # case, wherein one task obj maps to >1 result.\n results[call.task] = result\n return results",
"metadata": "root.Executor.execute",
"header": "['class', 'Executor', '(', 'object', ')', ':', '___EOS___']",
"index": 41
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Executor_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"execute_",
"(_",
"self_",
",_",
"*_",
"tasks_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Execut",
"e",
" ",
"one",
" ",
"or",
" ",
"more",
" ",
"``",
"task",
"s",
"``",
" ",
"in",
" ",
"sequence",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"task",
"s",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"all",
"-",
"purpose",
" ",
"iterable",
" ",
"of",
" ",
"\"",
"task",
"s",
" ",
"to",
" ",
"execute",
"\",",
" ",
"each",
" ",
"member",
" ",
"of",
" ",
"whi",
"ch",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"may",
" ",
"take",
" ",
"one",
" ",
"of",
" ",
"the",
" ",
"follow",
"ing",
" ",
"forms",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"**",
"A",
" ",
"string",
"**",
" ",
"nami",
"ng",
" ",
"a",
" ",
"task",
" ",
"from",
" ",
"the",
" ",
"Execut",
"or",
"'",
"s",
" ",
"`.",
"Collecti",
"on",
"`.",
" ",
"Thi",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"name",
" ",
"may",
" ",
"contain",
" ",
"dot",
"ted",
" ",
"synta",
"x",
" ",
"appropr",
"iate",
" ",
"for",
" ",
"calling",
" ",
"namespace",
"d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"task",
"s",
",",
" ",
"e",
".",
"g",
".",
" ",
"``",
"subco",
"lle",
"ction",
".",
"task",
"name",
"``.",
" ",
"Suc",
"h",
" ",
"task",
"s",
" ",
"are",
" ",
"executed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"with",
"out",
" ",
"argu",
"ment",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"**",
"A",
" ",
"two",
"-",
"tuple",
"**",
" ",
"who",
"se",
" ",
"first",
" ",
"element",
" ",
"is",
" ",
"a",
" ",
"task",
" ",
"name",
" ",
"string",
" ",
"(",
"as",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"above",
")",
" ",
"and",
" ",
"who",
"se",
" ",
"second",
" ",
"element",
" ",
"is",
" ",
"a",
" ",
"dict",
" ",
"suit",
"able",
" ",
"for",
" ",
"use",
" ",
"as",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"**",
"kwarg",
"s",
"``",
" ",
"whe",
"n",
" ",
"calling",
" ",
"the",
" ",
"named",
" ",
"task",
".",
" ",
"E",
".",
"g",
".:",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"[",
"\\",
"10",
";",
" ",
" ",
"('",
"task",
"1",
"',",
" ",
"{})",
",",
"\\",
"10",
";",
" ",
" ",
"('",
"task",
"2",
"',",
" ",
"{",
"'",
"arg",
"1",
"':",
" ",
"'",
"val",
"1",
"'})",
",",
"\\",
"10",
";",
" ",
" ",
"...",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"]",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"is",
" ",
"equivalent",
",",
" ",
"rough",
"ly",
",",
" ",
"to",
"::",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"task",
"1",
"()",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"task",
"2",
"(",
"arg",
"1",
"='",
"val",
"1",
"')",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"**",
"A",
" ",
"`.",
"Parser",
"Context",
"`",
"**",
" ",
"instance",
",",
" ",
"who",
"se",
" ",
"``.",
"name",
"``",
" ",
"attribute",
" ",
"is",
" ",
"used",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"as",
" ",
"the",
" ",
"task",
" ",
"name",
" ",
"and",
" ",
"who",
"se",
" ",
"``.",
"as",
"\\u",
"kwarg",
"s",
"``",
" ",
"attribute",
" ",
"is",
" ",
"used",
" ",
"as",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"task",
" ",
"kwarg",
"s",
" ",
"(",
"again",
" ",
"follow",
"ing",
" ",
"the",
" ",
"above",
" ",
"specifica",
"tion",
"s",
").",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"..",
" ",
"note",
"::",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Whe",
"n",
" ",
"call",
"ed",
" ",
"with",
"out",
" ",
"any",
" ",
"argu",
"ment",
"s",
" ",
"at",
" ",
"all",
" ",
"(",
"i",
".",
"e",
".",
" ",
"whe",
"n",
" ",
"``",
"*",
"task",
"s",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"is",
" ",
"empty",
"),",
" ",
"the",
" ",
"default",
" ",
"task",
" ",
"from",
" ",
"``",
"self",
".",
"collection",
"``",
" ",
"is",
" ",
"used",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"inst",
"ead",
",",
" ",
"if",
" ",
"defin",
"ed",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
"s",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"dict",
" ",
"mapping",
" ",
"task",
" ",
"object",
"s",
" ",
"to",
" ",
"thei",
"r",
" ",
"return",
" ",
"values",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"dict",
" ",
"may",
" ",
"include",
" ",
"pre",
"-",
" ",
"and",
" ",
"post",
"-",
"task",
"s",
" ",
"if",
" ",
"any",
" ",
"wer",
"e",
" ",
"executed",
".",
" ",
"For",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"example",
",",
" ",
"in",
" ",
"a",
" ",
"collection",
" ",
"with",
" ",
"a",
" ",
"``",
"build",
"``",
" ",
"task",
" ",
"depend",
"ing",
" ",
"on",
" ",
"anot",
"her",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"task",
" ",
"named",
" ",
"``",
"setup",
"``",
",",
" ",
"executi",
"ng",
" ",
"``",
"build",
"``",
" ",
"will",
" ",
"result",
" ",
"in",
" ",
"a",
" ",
"dict",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"with",
" ",
"two",
" ",
"keys",
",",
" ",
"one",
" ",
"for",
" ",
"``",
"build",
"``",
" ",
"and",
" ",
"one",
" ",
"for",
" ",
"``",
"setup",
"``.",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Normalize",
" ",
"input_",
"\\u\\u\\uNL\\u\\u\\u_",
"debug_",
"(_",
"\"",
"Exam",
"inin",
"g",
" ",
"top",
" ",
"level",
" ",
"task",
"s",
" ",
"{",
"0",
"!",
"r",
"}\"_",
"._",
"format_",
"(_",
"[_",
"x_",
"for_",
"x_",
"in_",
"tasks_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"calls_",
"=_",
"self_",
"._",
"normalize_",
"(_",
"tasks_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"debug_",
"(_",
"\"",
"Task",
"s",
" ",
"(",
"now",
" ",
"Calls",
")",
" ",
"with",
" ",
"kwarg",
"s",
":",
" ",
"{",
"0",
"!",
"r",
"}\"_",
"._",
"format_",
"(_",
"calls_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Obtain",
" ",
"copy",
" ",
"of",
" ",
"direct",
"ly",
"-",
"give",
"n",
" ",
"task",
"s",
" ",
"sinc",
"e",
" ",
"the",
"y",
" ",
"shou",
"ld",
" ",
"somet",
"imes_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"behave",
" ",
"different",
"ly_",
"\\u\\u\\uNL\\u\\u\\u_",
"direct_",
"=_",
"list_",
"(_",
"calls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Expand",
" ",
"pre",
"/",
"post",
" ",
"task",
"s",
" ",
"&",
" ",
"then",
" ",
"dedup",
"e",
" ",
"the",
" ",
"entire",
" ",
"run",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Load",
" ",
"config",
" ",
"at",
" ",
"this",
" ",
"point",
" ",
"to",
" ",
"get",
" ",
"late",
"st",
" ",
"value",
" ",
"of",
" ",
"dedup",
"e",
" ",
"option_",
"\\u\\u\\uNL\\u\\u\\u_",
"config_",
"=_",
"self_",
"._",
"config_",
"._",
"clone_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expanded_",
"=_",
"self_",
"._",
"expand",
"\\u",
"calls_",
"(_",
"calls_",
",_",
"config_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Get",
" ",
"some",
" ",
"good",
" ",
"value",
" ",
"for",
" ",
"dedup",
"e",
" ",
"option",
",",
" ",
"even",
" ",
"if",
" ",
"config",
" ",
"doe",
"sn",
"'",
"t",
" ",
"have_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"tree",
" ",
"we",
" ",
"expect",
".",
" ",
"(",
"Thi",
"s",
" ",
"is",
" ",
"a",
" ",
"conce",
"ssion",
" ",
"to",
" ",
"testi",
"ng",
".)",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"dedup",
"e_",
"=_",
"config_",
"._",
"tasks_",
"._",
"dedup",
"e_",
"\\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 ",
" _",
"dedup",
"e_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Actual",
" ",
"dedup",
"ing",
" ",
"here_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"calls_",
"=_",
"self_",
"._",
"dedup",
"e_",
"(_",
"expanded_",
")_",
"if_",
"dedup",
"e_",
"else_",
"expanded_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Execute_",
"\\u\\u\\uNL\\u\\u\\u_",
"results_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"call_",
"in_",
"calls_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"autop",
"rint_",
"=_",
"call_",
"in_",
"direct_",
"and_",
"call_",
"._",
"autop",
"rint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"args_",
"=_",
"call_",
"._",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"debug_",
"(_",
"\"",
"Execut",
"ing",
" ",
"{",
"0",
"!",
"r",
"}\"_",
"._",
"format_",
"(_",
"call_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"call_",
"._",
"context",
"uali",
"zed_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"=_",
"(_",
"call_",
"._",
"context_",
",_",
")_",
"+_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"result_",
"=_",
"call_",
"._",
"task_",
"(_",
"*_",
"args_",
",_",
"**_",
"call_",
"._",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"autop",
"rint_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"result_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
":",
" ",
"handle",
" ",
"the",
" ",
"non",
"-",
"dedup",
"e",
" ",
"case",
" ",
"/",
" ",
"the",
" ",
"same",
"-",
"task",
"-",
"different",
"-",
"args_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"case",
",",
" ",
"where",
"in",
" ",
"one",
" ",
"task",
" ",
"obj",
" ",
"maps",
" ",
"to",
" ",
">",
"1",
" ",
"result",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"results_",
"[_",
"call_",
"._",
"task_",
"]_",
"=_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"results_",
"\\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,
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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
] |
Unused import | onefinestay/nameko/docs/examples/http_exceptions.py | [
{
"content": "import json\nfrom nameko.web.handlers import HttpRequestHandler\nfrom werkzeug.wrappers import Response\nfrom nameko.exceptions import safe_for_serialization\n\n\n\n\n\n\n\n\nhttp = HttpEntrypoint.decorator\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class HttpError(Exception):\n error_code = 'BAD_REQUEST'\n status_code = 400",
"metadata": "root.HttpError",
"header": "['module', '___EOS___']",
"index": 6
},
{
"content": "class InvalidArgumentsError(HttpError):\n error_code = 'INVALID_ARGUMENTS'",
"metadata": "root.InvalidArgumentsError",
"header": "['module', '___EOS___']",
"index": 11
},
{
"content": "class HttpEntrypoint(HttpRequestHandler):",
"metadata": "root.HttpEntrypoint",
"header": "['module', '___EOS___']",
"index": 15
},
{
"content": " def response_from_exception(self, exc):\n if isinstance(exc, HttpError):\n response = Response(\n json.dumps({\n 'error': exc.error_code,\n 'message': safe_for_serialization(exc),\n }),\n status=exc.status_code,\n mimetype='application/json'\n )\n return response\n return HttpRequestHandler.response_from_exception(self, exc)",
"metadata": "root.HttpEntrypoint.response_from_exception",
"header": "['class', 'HttpEntrypoint', '(', 'HttpRequestHandler', ')', ':', '___EOS___']",
"index": 16
},
{
"content": "class Service(object):\n name = \"http_service\"\n",
"metadata": "root.Service",
"header": "['module', '___EOS___']",
"index": 33
},
{
"content": " @http('GET', '/custom_exception')\n def custom_exception(self, request):\n raise InvalidArgumentsError(\"Argument `foo` is required.\")",
"metadata": "root.Service.custom_exception",
"header": "['class', 'Service', '(', 'object', ')', ':', '___EOS___']",
"index": 36
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"json_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"name",
"ko",
"_",
"._",
"web_",
"._",
"handlers_",
"import_",
"Http",
"Request",
"Handler_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"werkzeug_",
"._",
"wrappers_",
"import_",
"Response_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"name",
"ko",
"_",
"._",
"exceptions_",
"import_",
"safe",
"\\u",
"for",
"\\u",
"serialization_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"http_",
"=_",
"Http",
"Entr",
"ypo",
"int_",
"._",
"decorator_",
"\\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_",
"Http",
"Error_",
"(_",
"Exception_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"error",
"\\u",
"code_",
"=_",
"'",
"BAD",
"\\u",
"REQUEST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"status",
"\\u",
"code_",
"=_",
"400_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Inva",
"lid",
"Arg",
"ument",
"s",
"Error_",
"(_",
"Http",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"error",
"\\u",
"code_",
"=_",
"'",
"INVALID",
"\\u",
"ARGUMENT",
"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_",
"class_",
"Http",
"Entr",
"ypo",
"int_",
"(_",
"Http",
"Request",
"Handler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Http",
"Entr",
"ypo",
"int_",
"(_",
"Http",
"Request",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"response",
"\\u",
"from",
"\\u",
"exception_",
"(_",
"self_",
",_",
"exc_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"exc_",
",_",
"Http",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"response_",
"=_",
"Response_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"json_",
"._",
"dumps_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"error",
"'_",
":_",
"exc_",
"._",
"error",
"\\u",
"code_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"message",
"'_",
":_",
"safe",
"\\u",
"for",
"\\u",
"serialization_",
"(_",
"exc_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"status_",
"=_",
"exc_",
"._",
"status",
"\\u",
"code_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mimetype_",
"=_",
"'",
"applica",
"tion",
"/",
"json",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"response_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"Http",
"Request",
"Handler_",
"._",
"response",
"\\u",
"from",
"\\u",
"exception_",
"(_",
"self_",
",_",
"exc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Service_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"\"",
"http",
"\\u",
"service",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Service_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"http_",
"(_",
"'",
"GET",
"'_",
",_",
"'/",
"custom",
"\\u",
"exception",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"custom",
"\\u",
"exception_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Inva",
"lid",
"Arg",
"ument",
"s",
"Error_",
"(_",
"\"",
"Arg",
"ument",
" ",
"`",
"foo",
"`",
" ",
"is",
" ",
"require",
"d",
".\"_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | circuits/circuits/tests/web/test_dispatcher.py | [
{
"content": "#!/usr/bin/env python\n\nfrom circuits.web import Controller\nfrom circuits.web.client import Client, request\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class Root(Controller):\n\n\n",
"metadata": "root.Root",
"header": "['module', '___EOS___']",
"index": 6
},
{
"content": " def __init__(self, *args, **kwargs):\n super(Root, self).__init__(*args, **kwargs)\n self += Leaf()",
"metadata": "root.Root.__init__",
"header": "['class', 'Root', '(', 'Controller', ')', ':', '___EOS___']",
"index": 8
},
{
"content": " def index(self):\n return \"Hello World!\"",
"metadata": "root.Root.index",
"header": "['class', 'Root', '(', 'Controller', ')', ':', '___EOS___']",
"index": 12
},
{
"content": " def name(self):\n return \"Earth\"",
"metadata": "root.Root.name",
"header": "['class', 'Root', '(', 'Controller', ')', ':', '___EOS___']",
"index": 15
},
{
"content": "class Leaf(Controller):\n\n channel = \"/world/country/region\"\n\n",
"metadata": "root.Leaf",
"header": "['module', '___EOS___']",
"index": 19
},
{
"content": " def index(self):\n return \"Hello cities!\"",
"metadata": "root.Leaf.index",
"header": "['class', 'Leaf', '(', 'Controller', ')', ':', '___EOS___']",
"index": 23
},
{
"content": " def city(self):\n return \"Hello City!\"",
"metadata": "root.Leaf.city",
"header": "['class', 'Leaf', '(', 'Controller', ')', ':', '___EOS___']",
"index": 26
},
{
"content": "def make_request(webapp, path):\n client = Client()\n client.start()\n\n client.fire(request(\"GET\", path))\n while client.response is None:\n pass\n\n client.stop()\n\n response = client.response\n s = response.read()\n return response.status, s",
"metadata": "root.make_request",
"header": "['module', '___EOS___']",
"index": 30
},
{
"content": "def test_root(webapp):\n status, content = make_request(webapp, webapp.server.http.base)\n\n assert status == 200\n assert content == b\"Hello World!\"",
"metadata": "root.test_root",
"header": "['module', '___EOS___']",
"index": 45
},
{
"content": "def test_root_name(webapp):\n status, content = make_request(webapp, \"%s/name\" % webapp.server.http.base)\n\n assert status == 200\n assert content == b\"Earth\"",
"metadata": "root.test_root_name",
"header": "['module', '___EOS___']",
"index": 52
},
{
"content": "def test_leaf(webapp):\n status, content = make_request(\n webapp, \"%s/world/country/region\" % webapp.server.http.base)\n\n assert status == 200\n assert content == b\"Hello cities!\"",
"metadata": "root.test_leaf",
"header": "['module', '___EOS___']",
"index": 59
},
{
"content": "def test_city(webapp):\n status, content = make_request(\n webapp, \"%s/world/country/region/city\" % webapp.server.http.base)\n\n assert status == 200\n assert content == b\"Hello City!\"",
"metadata": "root.test_city",
"header": "['module', '___EOS___']",
"index": 67
}
] | [] | [] | 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_",
"from_",
"circuit",
"s_",
"._",
"web_",
"import_",
"Controller_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"circuit",
"s_",
"._",
"web_",
"._",
"client_",
"import_",
"Client_",
",_",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"Root_",
"(_",
"Controller_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"(_",
"Controller_",
")_",
":_",
"\\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_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Root_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"+=_",
"Leaf_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Root_",
"(_",
"Controller_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"index_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"",
"Hell",
"o",
" ",
"Wor",
"ld",
"!\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Root_",
"(_",
"Controller_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"",
"Ear",
"th",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Leaf_",
"(_",
"Controller_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"channel_",
"=_",
"\"/",
"world",
"/",
"countr",
"y",
"/",
"region",
"\"_",
"\\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_",
"Leaf_",
"(_",
"Controller_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"index_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"",
"Hell",
"o",
" ",
"citi",
"es",
"!\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Leaf_",
"(_",
"Controller_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"city_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"",
"Hell",
"o",
" ",
"Cit",
"y",
"!\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"make",
"\\u",
"request_",
"(_",
"webapp_",
",_",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"client_",
"=_",
"Client_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"client_",
"._",
"start_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"client_",
"._",
"fire_",
"(_",
"request_",
"(_",
"\"",
"GET",
"\"_",
",_",
"path_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"client_",
"._",
"response_",
"is_",
"None_",
":_",
"\\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_",
"._",
"stop_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"response_",
"=_",
"client_",
"._",
"response_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s_",
"=_",
"response_",
"._",
"read_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"response_",
"._",
"status_",
",_",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"root_",
"(_",
"webapp_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"status_",
",_",
"content_",
"=_",
"make",
"\\u",
"request_",
"(_",
"webapp_",
",_",
"webapp_",
"._",
"server_",
"._",
"http_",
"._",
"base_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"status_",
"==_",
"200_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"content_",
"==_",
"b",
"\"",
"Hell",
"o",
" ",
"Wor",
"ld",
"!\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"root",
"\\u",
"name_",
"(_",
"webapp_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"status_",
",_",
"content_",
"=_",
"make",
"\\u",
"request_",
"(_",
"webapp_",
",_",
"\"%",
"s",
"/",
"name",
"\"_",
"%_",
"webapp_",
"._",
"server_",
"._",
"http_",
"._",
"base_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"status_",
"==_",
"200_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"content_",
"==_",
"b",
"\"",
"Ear",
"th",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"leaf_",
"(_",
"webapp_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"status_",
",_",
"content_",
"=_",
"make",
"\\u",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"webapp_",
",_",
"\"%",
"s",
"/",
"world",
"/",
"countr",
"y",
"/",
"region",
"\"_",
"%_",
"webapp_",
"._",
"server_",
"._",
"http_",
"._",
"base_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"status_",
"==_",
"200_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"content_",
"==_",
"b",
"\"",
"Hell",
"o",
" ",
"citi",
"es",
"!\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"city_",
"(_",
"webapp_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"status_",
",_",
"content_",
"=_",
"make",
"\\u",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"webapp_",
",_",
"\"%",
"s",
"/",
"world",
"/",
"countr",
"y",
"/",
"region",
"/",
"city",
"\"_",
"%_",
"webapp_",
"._",
"server_",
"._",
"http_",
"._",
"base_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"status_",
"==_",
"200_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"content_",
"==_",
"b",
"\"",
"Hell",
"o",
" ",
"Cit",
"y",
"!\"_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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' | gunthercox/ChatterBot/tests/storage_adapter_tests/test_jsondb_adapter.py | [
{
"content": " def setUp(self):\n \"\"\"\n Instantiate the adapter.\n \"\"\"\n from random import randint\n\n # Generate a random name for the database\n database_name = str(randint(0, 9000))\n\n self.adapter = JsonDatabaseAdapter(database=database_name)",
"metadata": "root.JsonAdapterTestCase.setUp",
"header": "['class', 'JsonAdapterTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 7
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Module_",
"is_",
"imported_",
"with_",
"'",
"import",
"'_",
"and_",
"'",
"import",
" ",
"from",
"'_",
"[SEP]_",
"class_",
"Js",
"on",
"Adapt",
"er",
"Test",
"Case_",
"(_",
"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 ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Instantiate",
" ",
"the",
" ",
"adapter",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"random_",
"import_",
"randint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Generate",
" ",
"a",
" ",
"random",
" ",
"name",
" ",
"for",
" ",
"the",
" ",
"database_",
"\\u\\u\\uNL\\u\\u\\u_",
"databa",
"se",
"\\u",
"name_",
"=_",
"str_",
"(_",
"randint_",
"(_",
"0_",
",_",
"9000",
"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"adapter_",
"=_",
"Js",
"on",
"Databa",
"se",
"Adapter_",
"(_",
"database_",
"=_",
"databa",
"se",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\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
] |
Variable defined multiple times | Julian/jsonschema/jsonschema/tests/test_validators.py | [
{
"content": " def test_additionalProperties(self):\n instance = {\"bar\": \"bar\", \"foo\": 2}\n schema = {\n \"additionalProperties\" : {\"type\": \"integer\", \"minimum\": 5}\n }\n\n validator = Draft3Validator(schema)\n errors = validator.iter_errors(instance)\n e1, e2 = sorted_errors(errors)\n\n self.assertEqual(e1.path, deque([\"bar\"]))\n self.assertEqual(e2.path, deque([\"foo\"]))\n\n self.assertEqual(e1.validator, \"type\")\n self.assertEqual(e2.validator, \"minimum\")",
"metadata": "root.TestValidationErrorDetails.test_additionalProperties",
"header": "['class', 'TestValidationErrorDetails', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# TODO: These really need unit tests for each individual validator, rather', '___NL___', '# than just these higher level tests.', '___NL___', '___EOS___']",
"index": 527
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Test",
"Validat",
"ion",
"Error",
"Details_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
":",
" ",
"The",
"se",
" ",
"reall",
"y",
" ",
"need",
" ",
"unit",
" ",
"tests",
" ",
"for",
" ",
"each",
" ",
"individual",
" ",
"validator",
",",
" ",
"rat",
"her_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"than",
" ",
"just",
" ",
"these",
" ",
"higher",
" ",
"level",
" ",
"tests",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"addition",
"al",
"Properties_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"instance_",
"=_",
"{_",
"\"",
"bar",
"\"_",
":_",
"\"",
"bar",
"\"_",
",_",
"\"",
"foo",
"\"_",
":_",
"2_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"schema_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"addition",
"al",
"Proper",
"ties",
"\"_",
":_",
"{_",
"\"",
"type",
"\"_",
":_",
"\"",
"integ",
"er",
"\"_",
",_",
"\"",
"minim",
"um",
"\"_",
":_",
"5_",
"}_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"validator_",
"=_",
"Dra",
"ft",
"3",
"Validator_",
"(_",
"schema_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"errors_",
"=_",
"validator_",
"._",
"iter",
"\\u",
"errors_",
"(_",
"instance_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"e1_",
",_",
"e2_",
"=_",
"sorte",
"d\\u",
"errors_",
"(_",
"errors_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"e1_",
"._",
"path_",
",_",
"deque_",
"(_",
"[_",
"\"",
"bar",
"\"_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"e2_",
"._",
"path_",
",_",
"deque_",
"(_",
"[_",
"\"",
"foo",
"\"_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"e1_",
"._",
"validator_",
",_",
"\"",
"type",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"e2_",
"._",
"validator_",
",_",
"\"",
"minim",
"um",
"\"_",
")_",
"\\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
] |
Unused import | enthought/pyface/examples/menu_manager.py | [
{
"content": "#------------------------------------------------------------------------------\n# Copyright (c) 2005, Enthought, Inc.\n# All rights reserved.\n#\n# This software is provided without warranty under the terms of the BSD\n# license included in enthought/LICENSE.txt and may be redistributed only\n# under the conditions described in the aforementioned license. The license\n# is also available online at http://www.enthought.com/licenses/BSD.txt\n# Thanks for using Enthought open source!\n#\n# Author: Enthought, Inc.\n# Description: <Enthought pyface package component>\n#------------------------------------------------------------------------------\nfrom __future__ import print_function\n\n# Standard library imports.\nimport os, sys\n\n# Put the Enthought library on the Python path.\nsys.path.append(os.path.abspath(r'..\\..\\..'))\n\n# Local imports.\nfrom pyface.action.api import Action\nfrom pyface.action.api import Group, MenuManager, Separator\n\n\nfile_menu = MenuManager(\n Group(\n Action(name='New Project...'),\n Action(name='Open Project...'),\n\n id = 'OpenGroup',\n ),\n\n Group(\n Action(name='Close Project'),\n Action(name='Close Active Editor'),\n\n id = 'CloseGroup'\n ),\n\n Group(\n Action(name='Export to HTML...'),\n Action(name='Print...'),\n\n id = 'ExportGroup'\n ),\n\n Group(\n Action(name='Exit'),\n\n id = 'ExitGroup'\n ),\n)\nfile_menu.dump()\n\n###############################################################################\n\nfile_menu = MenuManager(\n Action(name='New Project...'),\n Action(name='Open Project...'),\n\n Separator(),\n\n Action(name='Close Project'),\n Action(name='Close Active Editor'),\n\n Separator(),\n\n Action(name='Export to HTML...'),\n Action(name='Print...'),\n\n Separator(),\n\n Action(name='Exit'),\n)\nfile_menu.dump()\n\n###############################################################################\n\n\n\n\n\n\n\n\n\n\n\nfile_menu = MenuManager(\n open_project,\n\n Separator(),\n\n close_project,\n close_active_editor,\n\n Separator(),\n\n export_to_html,\n printit,\n\n Separator(),\n\n exit,\n)\nfile_menu.dump()\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def new_project():\n print('new project')",
"metadata": "root.new_project",
"header": "['module', '___EOS___']",
"index": 82
},
{
"content": "def open_project():\n print('open project')",
"metadata": "root.open_project",
"header": "['module', '___EOS___']",
"index": 85
},
{
"content": "def close_project():\n print('close project')",
"metadata": "root.close_project",
"header": "['module', '___EOS___']",
"index": 88
},
{
"content": "def close_active_editor():\n print('close active editor')",
"metadata": "root.close_active_editor",
"header": "['module', '___EOS___']",
"index": 91
},
{
"content": "def export_to_html():\n print('export to html')",
"metadata": "root.export_to_html",
"header": "['module', '___EOS___']",
"index": 94
},
{
"content": "def printit():\n print('print')",
"metadata": "root.printit",
"header": "['module', '___EOS___']",
"index": 97
},
{
"content": "def exit():\n print('exit')",
"metadata": "root.exit",
"header": "['module', '___EOS___']",
"index": 100
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"-------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"2005",
",",
" ",
"Ent",
"hou",
"ght",
",",
" ",
"Inc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"rights",
" ",
"reserve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"software",
" ",
"is",
" ",
"provided",
" ",
"with",
"out",
" ",
"warr",
"ant",
"y",
" ",
"under",
" ",
"the",
" ",
"term",
"s",
" ",
"of",
" ",
"the",
" ",
"BS",
"D_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"license",
" ",
"include",
"d",
" ",
"in",
" ",
"enth",
"ou",
"ght",
"/",
"LICENSE",
".",
"txt",
" ",
"and",
" ",
"may",
" ",
"be",
" ",
"redis",
"tribut",
"ed",
" ",
"only_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"under",
" ",
"the",
" ",
"condition",
"s",
" ",
"descri",
"bed",
" ",
"in",
" ",
"the",
" ",
"af",
"ore",
"mentioned",
" ",
"license",
".",
" ",
" ",
"The",
" ",
"license_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"is",
" ",
"als",
"o",
" ",
"avail",
"able",
" ",
"onli",
"ne",
" ",
"at",
" ",
"http",
"://",
"www",
".",
"enth",
"ou",
"ght",
".",
"com",
"/",
"license",
"s",
"/",
"BS",
"D",
".",
"txt_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thanks",
" ",
"for",
" ",
"usi",
"ng",
" ",
"Ent",
"hou",
"ght",
" ",
"open",
" ",
"source",
"!",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Author",
":",
" ",
"Ent",
"hou",
"ght",
",",
" ",
"Inc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Descripti",
"on",
":",
" ",
"<",
"Ent",
"hou",
"ght",
" ",
"pyf",
"ace",
" ",
"package",
" ",
"component",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"-------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"print",
"\\u",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Standard",
" ",
"librar",
"y",
" ",
"import",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"os_",
",_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Put",
" ",
"the",
" ",
"Ent",
"hou",
"ght",
" ",
"librar",
"y",
" ",
"on",
" ",
"the",
" ",
"Pyth",
"on",
" ",
"path",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"sys_",
"._",
"path_",
"._",
"append_",
"(_",
"os_",
"._",
"path_",
"._",
"abspath_",
"(_",
"r",
"'..",
"\\\\.",
".\\\\",
"..'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Local",
" ",
"import",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"pyf",
"ace_",
"._",
"action_",
"._",
"api_",
"import_",
"Action_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pyf",
"ace_",
"._",
"action_",
"._",
"api_",
"import_",
"Group_",
",_",
"Menu",
"Manager_",
",_",
"Separator_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"file",
"\\u",
"menu_",
"=_",
"Menu",
"Manager_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Group_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"New",
" ",
"Project",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Open",
" ",
"Project",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"id_",
"=_",
"'",
"Open",
"Group",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Group_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Clos",
"e",
" ",
"Project",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Clos",
"e",
" ",
"Activ",
"e",
" ",
"Edit",
"or",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"id_",
"=_",
"'",
"Clos",
"e",
"Group",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Group_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Export",
" ",
"to",
" ",
"HTM",
"L",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Print",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"id_",
"=_",
"'",
"Export",
"Group",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Group_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Exi",
"t",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"id_",
"=_",
"'",
"Exi",
"t",
"Group",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"file",
"\\u",
"menu_",
"._",
"dump_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"file",
"\\u",
"menu_",
"=_",
"Menu",
"Manager_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"New",
" ",
"Project",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Open",
" ",
"Project",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Separator_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Clos",
"e",
" ",
"Project",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Clos",
"e",
" ",
"Activ",
"e",
" ",
"Edit",
"or",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Separator_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Export",
" ",
"to",
" ",
"HTM",
"L",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Print",
"...'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Separator_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Action_",
"(_",
"name_",
"=_",
"'",
"Exi",
"t",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"file",
"\\u",
"menu_",
"._",
"dump_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"file",
"\\u",
"menu_",
"=_",
"Menu",
"Manager_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"open",
"\\u",
"project_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Separator_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"close",
"\\u",
"project_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"close",
"\\u",
"active",
"\\u",
"editor_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Separator_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"export",
"\\u",
"to",
"\\u",
"html_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"print",
"it_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Separator_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"exit_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"file",
"\\u",
"menu_",
"._",
"dump_",
"(_",
")_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"new",
"\\u",
"project_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"new",
" ",
"project",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"open",
"\\u",
"project_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"open",
" ",
"project",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"close",
"\\u",
"project_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"close",
" ",
"project",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"close",
"\\u",
"active",
"\\u",
"editor_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"close",
" ",
"active",
" ",
"editor",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"export",
"\\u",
"to",
"\\u",
"html_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"export",
" ",
"to",
" ",
"html",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"print",
"it_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"print",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"exit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\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,
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,
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,
4,
2,
2,
2,
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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | gbeced/pyalgotrade/testcases/returns_analyzer_test.py | [
{
"content": "# PyAlgoTrade\n#\n# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"\n.. moduleauthor:: Gabriel Martin Becedillas Ruiz <[email protected]>\n\"\"\"\n\nimport datetime\n\nimport common\nimport strategy_test\nimport position_test\n\nfrom pyalgotrade.barfeed import yahoofeed\nfrom pyalgotrade.barfeed import csvfeed\nfrom pyalgotrade.stratanalyzer import returns\nfrom pyalgotrade import broker\nfrom pyalgotrade import marketsession\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TimeWeightedReturnsTestCase(common.TestCase):\n\n",
"metadata": "root.TimeWeightedReturnsTestCase",
"header": "['module', '___EOS___']",
"index": 33
},
{
"content": " def testNullPortfolio(self):\n retTracker = returns.TimeWeightedReturns(0)\n self.assertEqual(retTracker.getCumulativeReturns(), 0)",
"metadata": "root.TimeWeightedReturnsTestCase.testNullPortfolio",
"header": "['class', 'TimeWeightedReturnsTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 34
},
{
"content": " def testNoUpdates(self):\n retTracker = returns.TimeWeightedReturns(10)\n self.assertEqual(retTracker.getCumulativeReturns(), 0)",
"metadata": "root.TimeWeightedReturnsTestCase.testNoUpdates",
"header": "['class', 'TimeWeightedReturnsTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 38
},
{
"content": " def testInvestopedia(self):\n # http://www.investopedia.com/exam-guide/cfa-level-1/quantitative-methods/discounted-cash-flow-time-weighted-return.asp\n retTracker = returns.TimeWeightedReturns(200000)\n retTracker.update(196500) # March 31, 2004\n self.assertEquals(round(retTracker.getLastPeriodReturns(), 4), -0.0175)\n retTracker.update(200000) # June 30, 2004\n self.assertEquals(round(retTracker.getLastPeriodReturns(), 4), 0.0178)\n retTracker.deposit(20000)\n retTracker.update(222000) # July 30, 2004\n self.assertEquals(round(retTracker.getLastPeriodReturns(), 2), 0.01)\n retTracker.update(243000) # Sept. 30, 2004\n self.assertEquals(round(retTracker.getLastPeriodReturns(), 4), 0.0946)\n retTracker.deposit(2000)\n retTracker.update(250000) # Dec. 31, 2004\n self.assertEquals(round(retTracker.getLastPeriodReturns(), 4), 0.0206)\n self.assertEquals(round(retTracker.getCumulativeReturns(), 6), 0.128288)",
"metadata": "root.TimeWeightedReturnsTestCase.testInvestopedia",
"header": "['class', 'TimeWeightedReturnsTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 42
},
{
"content": "class PosTrackerTestCase(common.TestCase):\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.PosTrackerTestCase",
"header": "['module', '___EOS___']",
"index": 60
},
{
"content": " def testBuyAndSellBreakEven(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n posTracker.sell(1, 10)\n # self.assertEqual(posTracker.getCash(), 0)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getReturn(), 0)",
"metadata": "root.PosTrackerTestCase.testBuyAndSellBreakEven",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 61
},
{
"content": " def testBuyAndSellBreakEvenWithCommission(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n # self.assertEqual(posTracker.getCash(), 0)\n posTracker.buy(1, 10, 0.01)\n # self.assertEqual(posTracker.getCash(), -10.01)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n posTracker.sell(1, 10.02, 0.01)\n # self.assertEqual(round(posTracker.getCash(), 2), 0)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n # We need to round to avoid floating point errors.\n # The same issue can be reproduced with this piece of code:\n # a = 10.02 - 10\n # b = 0.02\n # print a - b\n # print a - b == 0\n self.assertEqual(posTracker.getPosition(), 0)\n self.assertEqual(round(posTracker.getPnL(), 2), 0)\n self.assertEqual(round(posTracker.getReturn(), 2), 0)",
"metadata": "root.PosTrackerTestCase.testBuyAndSellBreakEvenWithCommission",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 71
},
{
"content": " def testBuyAndSellWin(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n posTracker.sell(1, 11)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), 1)\n self.assertTrue(posTracker.getReturn() == 0.1)",
"metadata": "root.PosTrackerTestCase.testBuyAndSellWin",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 90
},
{
"content": " def testBuyAndSellInTwoTrades(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(2, 10)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n posTracker.sell(1, 11)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n self.assertEqual(posTracker.getPnL(), 1)\n self.assertEqual(posTracker.getReturn(), 0.05)\n posTracker.sell(1, 12)\n self.assertEqual(posTracker.getPnL(), 3)\n self.assertEqual(posTracker.getReturn(), 3/20.0)",
"metadata": "root.PosTrackerTestCase.testBuyAndSellInTwoTrades",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 99
},
{
"content": " def testBuyAndSellMultipleEvals(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(2, 10)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getPnL(price=9), -2)\n self.assertEqual(posTracker.getPnL(price=10), 0)\n self.assertEqual(posTracker.getPnL(price=11), 2)\n self.assertEqual(posTracker.getReturn(10), 0)\n\n self.assertEqual(posTracker.getPnL(price=11), 2)\n self.assertEqual(round(posTracker.getReturn(11), 2), 0.1)\n\n self.assertEqual(posTracker.getPnL(price=20), 20)\n self.assertEqual(posTracker.getReturn(20), 1)\n\n posTracker.sell(1, 11)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n self.assertEqual(posTracker.getPnL(price=11), 2)\n self.assertEqual(posTracker.getReturn(11), 0.1)\n\n posTracker.sell(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), 1)\n self.assertEqual(posTracker.getReturn(11), 0.05)",
"metadata": "root.PosTrackerTestCase.testBuyAndSellMultipleEvals",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 111
},
{
"content": " def testSellAndBuyWin(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.sell(1, 13)\n self.assertEqual(posTracker.getAvgPrice(), 13)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getPnL(price=10), 3)\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), 3)\n self.assertEqual(round(posTracker.getReturn(), 9), round(0.23076923076923, 9))",
"metadata": "root.PosTrackerTestCase.testSellAndBuyWin",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 137
},
{
"content": " def testSellAndBuyMultipleEvals(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.sell(2, 11)\n self.assertEqual(posTracker.getAvgPrice(), 11)\n self.assertEqual(posTracker.getPnL(price=10), 2)\n self.assertEqual(posTracker.getPnL(price=11), 0)\n self.assertEqual(posTracker.getPnL(price=12), -2)\n self.assertEqual(posTracker.getReturn(11), 0)\n\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 11)\n self.assertEqual(posTracker.getPnL(price=11), 1)\n self.assertEqual(round(posTracker.getReturn(11), 9), round(0.045454545, 9))\n\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), 2)\n self.assertEqual(posTracker.getPnL(price=100), 2)\n self.assertEqual(round(posTracker.getReturn(), 9), round(0.090909091, 9))",
"metadata": "root.PosTrackerTestCase.testSellAndBuyMultipleEvals",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 148
},
{
"content": " def testBuySellBuy(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n self.assertEqual(posTracker.getPnL(price=9), -1)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getPnL(price=10), 0)\n self.assertEqual(posTracker.getPnL(price=11), 1)\n self.assertEqual(posTracker.getReturn(), 0)\n self.assertEqual(posTracker.getReturn(13), 0.3)\n\n # Closing the long position and short selling 1 @ $13.\n # The cost basis for the new position is $13.\n posTracker.sell(2, 13)\n self.assertEqual(posTracker.getAvgPrice(), 13)\n self.assertEqual(posTracker.getPnL(), 3)\n self.assertEqual(round(posTracker.getReturn(), 8), 0.23076923)\n\n posTracker.buy(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), 6)\n self.assertEqual(round(posTracker.getReturn(), 9), round(0.46153846153846, 9))",
"metadata": "root.PosTrackerTestCase.testBuySellBuy",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 168
},
{
"content": " def testSellBuySell(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.sell(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getReturn(), 0)\n self.assertEqual(posTracker.getPnL(price=13), -3)\n self.assertEqual(posTracker.getReturn(13), -0.3)\n\n # Closing the short position and going long 1 @ $13.\n # The cost basis for the new position is $13.\n posTracker.buy(2, 13)\n self.assertEqual(posTracker.getAvgPrice(), 13)\n self.assertEqual(posTracker.getPnL(), -3)\n self.assertEqual(round(posTracker.getReturn(), 9), round(-0.23076923076923, 9))\n\n posTracker.sell(1, 10)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), -6)\n self.assertEqual(round(posTracker.getReturn(), 9), round(-0.46153846153846, 9))",
"metadata": "root.PosTrackerTestCase.testSellBuySell",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 191
},
{
"content": " def testBuyAndSellBreakEvenWithCommision(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(1, 10, 0.5)\n self.assertEqual(posTracker.getAvgPrice(), 10)\n posTracker.sell(1, 11, 0.5)\n self.assertEqual(posTracker.getPnL(includeCommissions=False), 1)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getReturn(includeCommissions=False), 0.1)\n self.assertEqual(posTracker.getReturn(), 0)",
"metadata": "root.PosTrackerTestCase.testBuyAndSellBreakEvenWithCommision",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 212
},
{
"content": " def testSeparateAndCombined(self):\n posA = returns.PositionTracker(broker.IntegerTraits())\n posA.buy(11, 10)\n posA.sell(11, 30)\n self.assertEqual(posA.getPnL(), 20*11)\n self.assertEqual(posA.getReturn(), 2)\n\n posB = returns.PositionTracker(broker.IntegerTraits())\n posB.sell(100, 1.1)\n posB.buy(100, 1)\n self.assertEqual(round(posB.getPnL(), 2), 100*0.1)\n self.assertEqual(round(posB.getReturn(), 2), 0.09)\n\n combinedPos = returns.PositionTracker(broker.IntegerTraits())\n combinedPos.buy(11, 10)\n combinedPos.sell(11, 30)\n combinedPos.sell(100, 1.1)\n combinedPos.buy(100, 1)\n self.assertEqual(round(combinedPos.getReturn(), 6), 2.090909)\n # The return of the combined position is less than the two returns combined\n # because when the second position gets opened the amount of cash not invested is greater\n # than that of posB alone.\n self.assertLess(round(combinedPos.getReturn(), 6), ((1+posA.getReturn())*(1+posB.getReturn())-1))",
"metadata": "root.PosTrackerTestCase.testSeparateAndCombined",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 222
},
{
"content": " def testProfitReturnsAndCost(self):\n posTracker = returns.PositionTracker(broker.IntegerTraits())\n posTracker.buy(10, 1)\n self.assertEqual(posTracker.getPnL(), 0)\n self.assertEqual(posTracker.getAvgPrice(), 1)\n self.assertEqual(posTracker.getCommissions(), 0)\n # self.assertEqual(posTracker.getCash(), -10)\n\n posTracker.buy(20, 1, 10)\n self.assertEqual(posTracker.getPnL(), -10)\n self.assertEqual(posTracker.getAvgPrice(), 1)\n self.assertEqual(posTracker.getCommissions(), 10)\n # self.assertEqual(posTracker.getCash(), -40)\n\n posTracker.sell(30, 1)\n self.assertEqual(posTracker.getAvgPrice(), 0)\n self.assertEqual(posTracker.getPnL(), -10)\n # self.assertEqual(posTracker.getCash(), -10)\n self.assertEqual(posTracker.getCommissions(), 10)\n self.assertEqual(posTracker.getReturn(), -10/30.0)\n\n posTracker.buy(10, 1)\n self.assertEqual(posTracker.getPnL(), -10)\n self.assertEqual(posTracker.getAvgPrice(), 1)",
"metadata": "root.PosTrackerTestCase.testProfitReturnsAndCost",
"header": "['class', 'PosTrackerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 246
},
{
"content": "class AnalyzerTestCase(common.TestCase):\n TestInstrument = \"any\"\n\n\n\n\n\n\n\n\n",
"metadata": "root.AnalyzerTestCase",
"header": "['module', '___EOS___']",
"index": 272
},
{
"content": " def testOneBarReturn(self):\n initialCash = 1000\n barFeed = yahoofeed.Feed()\n barFeed.setBarFilter(csvfeed.DateRangeFilter(datetime.datetime(2001, 12, 07), datetime.datetime(2001, 12, 07)))\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = strategy_test.TestStrategy(barFeed, initialCash)\n\n # 2001-12-07,15.74,15.95,15.55,15.91,42463200,15.56\n # Manually place the orders to get them filled on the first (and only) bar.\n order = strat.getBroker().createMarketOrder(broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1, False) # Open: 15.74\n strat.getBroker().submitOrder(order)\n order = strat.getBroker().createMarketOrder(broker.Order.Action.SELL, AnalyzerTestCase.TestInstrument, 1, True) # Close: 15.91\n strat.getBroker().submitOrder(order)\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertTrue(strat.getBroker().getCash() == initialCash + (15.91 - 15.74))\n\n finalValue = 1000 - 15.74 + 15.91\n rets = (finalValue - initialCash) / float(initialCash)\n self.assertEqual(stratAnalyzer.getReturns()[-1], rets)",
"metadata": "root.AnalyzerTestCase.testOneBarReturn",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 275
},
{
"content": " def testTwoBarReturns_OpenOpen(self):\n initialCash = 15.61\n barFeed = yahoofeed.Feed()\n barFeed.setBarFilter(csvfeed.DateRangeFilter(datetime.datetime(2001, 12, 06), datetime.datetime(2001, 12, 07)))\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = strategy_test.TestStrategy(barFeed, initialCash)\n\n # 2001-12-06,15.61,16.03,15.50,15.90,66944900,15.55\n # 2001-12-07,15.74,15.95,15.55,15.91,42463200,15.56\n # Manually place the entry order, to get it filled on the first bar.\n order = strat.getBroker().createMarketOrder(broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1, False) # Open: 15.61\n strat.getBroker().submitOrder(order)\n strat.addOrder(datetime.datetime(2001, 12, 06), strat.getBroker().createMarketOrder, broker.Order.Action.SELL, AnalyzerTestCase.TestInstrument, 1, False) # Open: 15.74\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertTrue(strat.getBroker().getCash() == initialCash + (15.74 - 15.61))\n # First day returns: Open vs Close\n self.assertTrue(stratAnalyzer.getReturns()[0] == (15.90 - 15.61) / 15.61)\n # Second day returns: Open vs Prev. day's close\n self.assertTrue(stratAnalyzer.getReturns()[1] == (15.74 - 15.90) / 15.90)",
"metadata": "root.AnalyzerTestCase.testTwoBarReturns_OpenOpen",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 298
},
{
"content": " def testTwoBarReturns_OpenClose(self):\n initialCash = 15.61\n barFeed = yahoofeed.Feed()\n barFeed.setBarFilter(csvfeed.DateRangeFilter(datetime.datetime(2001, 12, 06), datetime.datetime(2001, 12, 07)))\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = strategy_test.TestStrategy(barFeed, initialCash)\n\n # 2001-12-06,15.61,16.03,15.50,15.90,66944900,15.55\n # 2001-12-07,15.74,15.95,15.55,15.91,42463200,15.56\n # Manually place the entry order, to get it filled on the first bar.\n order = strat.getBroker().createMarketOrder(broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1, False) # Open: 15.61\n strat.getBroker().submitOrder(order)\n strat.addOrder(datetime.datetime(2001, 12, 06), strat.getBroker().createMarketOrder, broker.Order.Action.SELL, AnalyzerTestCase.TestInstrument, 1, True) # Close: 15.91\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertTrue(strat.getBroker().getCash() == initialCash + (15.91 - 15.61))\n # First day returns: Open vs Close\n self.assertTrue(stratAnalyzer.getReturns()[0] == (15.90 - 15.61) / 15.61)\n # Second day returns: Close vs Prev. day's close\n self.assertTrue(stratAnalyzer.getReturns()[1] == (15.91 - 15.90) / 15.90)",
"metadata": "root.AnalyzerTestCase.testTwoBarReturns_OpenClose",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 321
},
{
"content": " def testTwoBarReturns_CloseOpen(self):\n initialCash = 15.9\n barFeed = yahoofeed.Feed()\n barFeed.setBarFilter(csvfeed.DateRangeFilter(datetime.datetime(2001, 12, 06), datetime.datetime(2001, 12, 07)))\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = strategy_test.TestStrategy(barFeed, initialCash)\n\n # 2001-12-06,15.61,16.03,15.50,15.90,66944900,15.55\n # 2001-12-07,15.74,15.95,15.55,15.91,42463200,15.56\n # Manually place the entry order, to get it filled on the first bar.\n order = strat.getBroker().createMarketOrder(broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1, True) # Close: 15.90\n strat.getBroker().submitOrder(order)\n strat.addOrder(datetime.datetime(2001, 12, 06), strat.getBroker().createMarketOrder, broker.Order.Action.SELL, AnalyzerTestCase.TestInstrument, 1, False) # Open: 15.74\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertTrue(strat.getBroker().getCash() == initialCash + (15.74 - 15.90))\n # First day returns: 0\n self.assertTrue(stratAnalyzer.getReturns()[0] == 0)\n # Second day returns: Open vs Prev. day's close\n self.assertTrue(stratAnalyzer.getReturns()[1] == (15.74 - 15.90) / 15.90)",
"metadata": "root.AnalyzerTestCase.testTwoBarReturns_CloseOpen",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 344
},
{
"content": " def testTwoBarReturns_CloseClose(self):\n initialCash = 15.90\n barFeed = yahoofeed.Feed()\n barFeed.setBarFilter(csvfeed.DateRangeFilter(datetime.datetime(2001, 12, 06), datetime.datetime(2001, 12, 07)))\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = strategy_test.TestStrategy(barFeed, initialCash)\n\n # 2001-12-06,15.61,16.03,15.50,15.90,66944900,15.55\n # 2001-12-07,15.74,15.95,15.55,15.91,42463200,15.56\n # Manually place the entry order, to get it filled on the first bar.\n order = strat.getBroker().createMarketOrder(broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1, True) # Close: 15.90\n strat.getBroker().submitOrder(order)\n strat.addOrder(datetime.datetime(2001, 12, 06), strat.getBroker().createMarketOrder, broker.Order.Action.SELL, AnalyzerTestCase.TestInstrument, 1, True) # Close: 15.91\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertTrue(strat.getBroker().getCash() == initialCash + (15.91 - 15.90))\n # First day returns: 0\n self.assertTrue(stratAnalyzer.getReturns()[0] == 0)\n # Second day returns: Open vs Prev. day's close\n self.assertTrue(stratAnalyzer.getReturns()[1] == (15.91 - 15.90) / 15.90)",
"metadata": "root.AnalyzerTestCase.testTwoBarReturns_CloseClose",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 367
},
{
"content": " def testCumulativeReturn(self):\n initialCash = 33.06\n barFeed = yahoofeed.Feed()\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = position_test.TestStrategy(barFeed, AnalyzerTestCase.TestInstrument, initialCash)\n\n strat.addPosEntry(datetime.datetime(2001, 1, 12), strat.enterLong, AnalyzerTestCase.TestInstrument, 1) # 33.06\n strat.addPosExitMarket(datetime.datetime(2001, 11, 27)) # 14.32\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertTrue(round(strat.getBroker().getCash(), 2) == round(initialCash + (14.32 - 33.06), 2))\n self.assertTrue(round(33.06 * (1 + stratAnalyzer.getCumulativeReturns()[-1]), 2) == 14.32)",
"metadata": "root.AnalyzerTestCase.testCumulativeReturn",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 390
},
{
"content": " def testGoogle2011(self):\n initialValue = 1000000\n barFeed = yahoofeed.Feed()\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"goog-2011-yahoofinance.csv\"))\n\n strat = strategy_test.TestStrategy(barFeed, initialValue)\n order = strat.getBroker().createMarketOrder(broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1654, True) # 2011-01-03 close: 604.35\n strat.getBroker().submitOrder(order)\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n finalValue = strat.getBroker().getEquity()\n\n self.assertEqual(round(stratAnalyzer.getCumulativeReturns()[-1], 4), round((finalValue - initialValue) / float(initialValue), 4))",
"metadata": "root.AnalyzerTestCase.testGoogle2011",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 405
},
{
"content": " def testMultipleInstrumentsInterleaved(self):\n barFeed = yahoofeed.Feed()\n barFeed.addBarsFromCSV(\"spy\", common.get_data_file_path(\"spy-2010-yahoofinance.csv\"), marketsession.NYSE.getTimezone())\n barFeed.addBarsFromCSV(\"nikkei\", common.get_data_file_path(\"nikkei-2010-yahoofinance.csv\"), marketsession.TSE.getTimezone())\n\n strat = strategy_test.TestStrategy(barFeed, 1000)\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n\n strat.marketOrder(\"spy\", 1)\n strat.run()\n # The cumulative return should be the same if we load nikkei or not.\n self.assertEqual(round(stratAnalyzer.getCumulativeReturns()[-1], 5), 0.01338)",
"metadata": "root.AnalyzerTestCase.testMultipleInstrumentsInterleaved",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 421
},
{
"content": " def testFirstBar(self):\n initialCash = 1000\n barFeed = yahoofeed.Feed()\n barFeed.addBarsFromCSV(AnalyzerTestCase.TestInstrument, common.get_data_file_path(\"orcl-2001-yahoofinance.csv\"))\n strat = strategy_test.TestStrategy(barFeed, initialCash)\n\n strat.addOrder(datetime.datetime(2001, 01, 02), strat.getBroker().createMarketOrder, broker.Order.Action.BUY, AnalyzerTestCase.TestInstrument, 1, False) # 2001-01-03 Open: 25.25 Close: 32.00\n\n stratAnalyzer = returns.Returns()\n strat.attachAnalyzer(stratAnalyzer)\n strat.run()\n self.assertEqual(stratAnalyzer.getReturns()[0], 0)\n self.assertEqual(stratAnalyzer.getReturns()[1], (32.00 - 25.25) / 1000)\n\n # Check date times.\n datetimes = barFeed[AnalyzerTestCase.TestInstrument].getDateTimes()\n for i in [0, -1]:\n self.assertEqual(stratAnalyzer.getReturns().getDateTimes()[i], datetimes[i])\n self.assertEqual(stratAnalyzer.getCumulativeReturns().getDateTimes()[i], datetimes[i])",
"metadata": "root.AnalyzerTestCase.testFirstBar",
"header": "['class', 'AnalyzerTestCase', '(', 'common', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 435
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"Py",
"Algo",
"Trade",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"2011",
"-",
"201",
"5",
" ",
"Gab",
"rie",
"l",
" ",
"Mart",
"in",
" ",
"Be",
"ced",
"illa",
"s",
" ",
"Ru",
"iz_",
"\\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_",
"\"\"\"",
"\\",
"10",
";",
"..",
" ",
"module",
"author",
"::",
" ",
"Gab",
"rie",
"l",
" ",
"Mart",
"in",
" ",
"Be",
"ced",
"illa",
"s",
" ",
"Ru",
"iz",
" ",
"<",
"gab",
"rie",
"l",
".",
"bec",
"edi",
"lla",
"s",
"@",
"gma",
"il",
".",
"com",
">",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"datetime_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"common_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"strat",
"eg",
"y",
"\\u",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"position",
"\\u",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"pya",
"lg",
"otr",
"ade_",
"._",
"bar",
"feed_",
"import_",
"ya",
"hoo",
"feed_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pya",
"lg",
"otr",
"ade_",
"._",
"bar",
"feed_",
"import_",
"csv",
"feed_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pya",
"lg",
"otr",
"ade_",
"._",
"strat",
"analyzer_",
"import_",
"returns_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pya",
"lg",
"otr",
"ade_",
"import_",
"broker_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pya",
"lg",
"otr",
"ade_",
"import_",
"markets",
"ession",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Time",
"Weig",
"hte",
"d",
"Return",
"s",
"Test",
"Case_",
"(_",
"common_",
"._",
"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_",
"Time",
"Weig",
"hte",
"d",
"Return",
"s",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test",
"Null",
"Port",
"folio",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ret",
"Tracker_",
"=_",
"returns_",
"._",
"Time",
"Weig",
"hte",
"d",
"Return",
"s_",
"(_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Time",
"Weig",
"hte",
"d",
"Return",
"s",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"No",
"Update",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ret",
"Tracker_",
"=_",
"returns_",
"._",
"Time",
"Weig",
"hte",
"d",
"Return",
"s_",
"(_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Time",
"Weig",
"hte",
"d",
"Return",
"s",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Invest",
"ope",
"dia_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"http",
"://",
"www",
".",
"inves",
"tope",
"dia",
".",
"com",
"/",
"exam",
"-",
"guide",
"/",
"cfa",
"-",
"level",
"-1",
"/",
"quanti",
"tative",
"-",
"method",
"s",
"/",
"discou",
"nte",
"d",
"-",
"cash",
"-",
"flow",
"-",
"time",
"-",
"weight",
"ed",
"-",
"return",
".",
"asp",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ret",
"Tracker_",
"=_",
"returns_",
"._",
"Time",
"Weig",
"hte",
"d",
"Return",
"s_",
"(_",
"200000",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"update_",
"(_",
"196",
"500_",
")_",
"#",
" ",
"March",
" ",
"3",
"1",
",",
" ",
"2004",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"round_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Las",
"t",
"Period",
"Return",
"s_",
"(_",
")_",
",_",
"4_",
")_",
",_",
"-_",
"0.01",
"75_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"update_",
"(_",
"200000",
"_",
")_",
"#",
" ",
"Jun",
"e",
" ",
"30",
",",
" ",
"2004",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"round_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Las",
"t",
"Period",
"Return",
"s_",
"(_",
")_",
",_",
"4_",
")_",
",_",
"0.01",
"78_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"deposit_",
"(_",
"20000_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"update_",
"(_",
"222",
"000_",
")_",
"#",
" ",
"Ju",
"ly",
" ",
"30",
",",
" ",
"2004",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"round_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Las",
"t",
"Period",
"Return",
"s_",
"(_",
")_",
",_",
"2_",
")_",
",_",
"0.01_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"update_",
"(_",
"243",
"000_",
")_",
"#",
" ",
"Sept",
".",
" ",
"30",
",",
" ",
"2004",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"round_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Las",
"t",
"Period",
"Return",
"s_",
"(_",
")_",
",_",
"4_",
")_",
",_",
"0.09",
"46_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"deposit_",
"(_",
"2000_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ret",
"Tracker_",
"._",
"update_",
"(_",
"25000",
"0_",
")_",
"#",
" ",
"De",
"c",
".",
" ",
"3",
"1",
",",
" ",
"2004",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"round_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Las",
"t",
"Period",
"Return",
"s_",
"(_",
")_",
",_",
"4_",
")_",
",_",
"0.02",
"06_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"round_",
"(_",
"ret",
"Tracker_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
",_",
"6_",
")_",
",_",
"0.12",
"828",
"8_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test",
"Bu",
"y",
"And",
"Sell",
"Break",
"Even",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"0",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Bu",
"y",
"And",
"Sell",
"Break",
"Even",
"With",
"Commi",
"ssion_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"0",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
",_",
"0.01_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"-1",
"0.01",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"10.",
"02_",
",_",
"0.01_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"round",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"2",
"),",
" ",
"0",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"We",
" ",
"need",
" ",
"to",
" ",
"round",
" ",
"to",
" ",
"avoid",
" ",
"float",
"ing",
" ",
"point",
" ",
"error",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"same",
" ",
"issue",
" ",
"can",
" ",
"be",
" ",
"reproduce",
"d",
" ",
"with",
" ",
"this",
" ",
"piece",
" ",
"of",
" ",
"code",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"=",
" ",
"10.",
"02",
" ",
"-",
" ",
"10_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"b",
" ",
"=",
" ",
"0.02_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"print",
" ",
"a",
" ",
"-",
" ",
"b_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"print",
" ",
"a",
" ",
"-",
" ",
"b",
" ",
"==",
" ",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Position_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"2_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"2_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Bu",
"y",
"And",
"Sell",
"Win_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
"==_",
"0.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Bu",
"y",
"And",
"Sell",
"In",
"Tw",
"o",
"Trade",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"2_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"0.05_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"12_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"3_",
"/_",
"20.0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Bu",
"y",
"And",
"Sell",
"Multipl",
"e",
"Eval",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"2_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"9_",
")_",
",_",
"-_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"10_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"11_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"10_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"11_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"11_",
")_",
",_",
"2_",
")_",
",_",
"0.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"20_",
")_",
",_",
"20_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"20_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"11_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"11_",
")_",
",_",
"0.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"11_",
")_",
",_",
"0.05_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Sell",
"And",
"Bu",
"y",
"Win_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"13_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"13_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"10_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"9_",
")_",
",_",
"round_",
"(_",
"0.23",
"076",
"923",
"076",
"923",
"_",
",_",
"9_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Sell",
"And",
"Bu",
"y",
"Multipl",
"e",
"Eval",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"2_",
",_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"10_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"11_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"12_",
")_",
",_",
"-_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"11_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"11_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"11_",
")_",
",_",
"9_",
")_",
",_",
"round_",
"(_",
"0.04",
"545",
"454",
"5_",
",_",
"9_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"100_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"9_",
")_",
",_",
"round_",
"(_",
"0.09",
"090",
"909",
"1_",
",_",
"9_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Bu",
"y",
"Sell",
"Bu",
"y_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"9_",
")_",
",_",
"-_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"10_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"11_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"13_",
")_",
",_",
"0.3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clos",
"ing",
" ",
"the",
" ",
"long",
" ",
"position",
" ",
"and",
" ",
"short",
" ",
"sell",
"ing",
" ",
"1",
" ",
"@",
" ",
"$",
"13.",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"cost",
" ",
"basi",
"s",
" ",
"for",
" ",
"the",
" ",
"new",
" ",
"position",
" ",
"is",
" ",
"$",
"13.",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"2_",
",_",
"13_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"13_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"8_",
")_",
",_",
"0.23",
"076",
"923",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"6_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"9_",
")_",
",_",
"round_",
"(_",
"0.46",
"153",
"846",
"153",
"846",
"_",
",_",
"9_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Sell",
"Bu",
"y",
"Sell",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"price_",
"=_",
"13_",
")_",
",_",
"-_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"13_",
")_",
",_",
"-_",
"0.3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clos",
"ing",
" ",
"the",
" ",
"short",
" ",
"position",
" ",
"and",
" ",
"goi",
"ng",
" ",
"long",
" ",
"1",
" ",
"@",
" ",
"$",
"13.",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"cost",
" ",
"basi",
"s",
" ",
"for",
" ",
"the",
" ",
"new",
" ",
"position",
" ",
"is",
" ",
"$",
"13.",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"2_",
",_",
"13_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"13_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"-_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"9_",
")_",
",_",
"round_",
"(_",
"-_",
"0.23",
"076",
"923",
"076",
"923",
"_",
",_",
"9_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"-_",
"6_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"9_",
")_",
",_",
"round_",
"(_",
"-_",
"0.46",
"153",
"846",
"153",
"846",
"_",
",_",
"9_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Bu",
"y",
"And",
"Sell",
"Break",
"Even",
"With",
"Commi",
"sion_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"1_",
",_",
"10_",
",_",
"0.5_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"1_",
",_",
"11_",
",_",
"0.5_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
"include",
"Commi",
"ssion",
"s_",
"=_",
"False_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
"include",
"Commi",
"ssion",
"s_",
"=_",
"False_",
")_",
",_",
"0.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Separate",
"And",
"Combine",
"d_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"A_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"A_",
"._",
"buy",
"_",
"(_",
"11_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"A_",
"._",
"sell",
"_",
"(_",
"11_",
",_",
"30_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"A_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"20_",
"*_",
"11_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"A_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"B_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"B_",
"._",
"sell",
"_",
"(_",
"100_",
",_",
"1.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"B_",
"._",
"buy",
"_",
"(_",
"100_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"B_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"2_",
")_",
",_",
"100_",
"*_",
"0.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"pos",
"B_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"2_",
")_",
",_",
"0.09",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"combin",
"ed",
"Pos_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"combin",
"ed",
"Pos_",
"._",
"buy",
"_",
"(_",
"11_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"combin",
"ed",
"Pos_",
"._",
"sell",
"_",
"(_",
"11_",
",_",
"30_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"combin",
"ed",
"Pos_",
"._",
"sell",
"_",
"(_",
"100_",
",_",
"1.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"combin",
"ed",
"Pos_",
"._",
"buy",
"_",
"(_",
"100_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"combin",
"ed",
"Pos_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"6_",
")_",
",_",
"2.0",
"9090",
"9_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"return",
" ",
"of",
" ",
"the",
" ",
"combin",
"ed",
" ",
"position",
" ",
"is",
" ",
"less",
" ",
"than",
" ",
"the",
" ",
"two",
" ",
"return",
"s",
" ",
"combined_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"bec",
"aus",
"e",
" ",
"whe",
"n",
" ",
"the",
" ",
"second",
" ",
"position",
" ",
"gets",
" ",
"opene",
"d",
" ",
"the",
" ",
"amo",
"unt",
" ",
"of",
" ",
"cash",
" ",
"not",
" ",
"inves",
"ted",
" ",
"is",
" ",
"greater_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"than",
" ",
"tha",
"t",
" ",
"of",
" ",
"pos",
"B",
" ",
"alo",
"ne",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Less_",
"(_",
"round_",
"(_",
"combin",
"ed",
"Pos_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"6_",
")_",
",_",
"(_",
"(_",
"1_",
"+_",
"pos",
"A_",
"._",
"get",
"Return_",
"(_",
")_",
")_",
"*_",
"(_",
"1_",
"+_",
"pos",
"B_",
"._",
"get",
"Return_",
"(_",
")_",
")_",
"-_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pos",
"Track",
"er",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Profi",
"t",
"Return",
"s",
"And",
"Cost_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos",
"Tracker_",
"=_",
"returns_",
"._",
"Position",
"Tracker_",
"(_",
"broker_",
"._",
"Integer",
"Trait",
"s_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"10_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Commi",
"ssion",
"s_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"-1",
"0",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"20_",
",_",
"1_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"-_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Commi",
"ssion",
"s_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"-",
"40",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"sell",
"_",
"(_",
"30_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"-_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"self",
".",
"assert",
"Equal",
"(",
"pos",
"Track",
"er",
".",
"get",
"Cas",
"h",
"()",
",",
" ",
"-1",
"0",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Commi",
"ssion",
"s_",
"(_",
")_",
",_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Return_",
"(_",
")_",
",_",
"-_",
"10_",
"/_",
"30.0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pos",
"Tracker_",
"._",
"buy",
"_",
"(_",
"10_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Pn",
"L_",
"(_",
")_",
",_",
"-_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"pos",
"Tracker_",
"._",
"get",
"Av",
"g",
"Price_",
"(_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"Test",
"Instrument_",
"=_",
"\"",
"any",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"test",
"One",
"Bar",
"Return_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"1000_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"set",
"Bar",
"Filter_",
"(_",
"csv",
"feed_",
"._",
"Date",
"Range",
"Filter_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"7_",
")_",
",_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"7_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"7",
",",
"15.",
"7",
"4",
",",
"15.",
"9",
"5",
",",
"15.",
"5",
"5",
",",
"15.",
"9",
"1",
",",
"424",
"632",
"00",
",",
"15.",
"56_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Manu",
"ally",
" ",
"place",
" ",
"the",
" ",
"order",
"s",
" ",
"to",
" ",
"get",
" ",
"them",
" ",
"filled",
" ",
"on",
" ",
"the",
" ",
"first",
" ",
"(",
"and",
" ",
"only",
")",
" ",
"bar",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"False_",
")_",
"#",
" ",
"Open",
":",
" ",
"15.",
"74_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"SEL",
"L_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"True_",
")_",
"#",
" ",
"Clos",
"e",
":",
" ",
"15.",
"91_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Cas",
"h_",
"(_",
")_",
"==_",
"initial",
"Cas",
"h_",
"+_",
"(_",
"15.",
"91_",
"-_",
"15.",
"74_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"final",
"Value_",
"=_",
"1000_",
"-_",
"15.",
"74_",
"+_",
"15.",
"91_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rets",
"_",
"=_",
"(_",
"final",
"Value_",
"-_",
"initial",
"Cas",
"h_",
")_",
"/_",
"float_",
"(_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"-_",
"1_",
"]_",
",_",
"rets",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Tw",
"o",
"Bar",
"Return",
"s",
"\\u",
"Open",
"Open_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"15.",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"set",
"Bar",
"Filter_",
"(_",
"csv",
"feed_",
"._",
"Date",
"Range",
"Filter_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"7_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"6",
",",
"15.",
"6",
"1",
",",
"16.",
"03",
",",
"15.",
"50",
",",
"15.",
"90",
",",
"669",
"449",
"00",
",",
"15.",
"55_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"7",
",",
"15.",
"7",
"4",
",",
"15.",
"9",
"5",
",",
"15.",
"5",
"5",
",",
"15.",
"9",
"1",
",",
"424",
"632",
"00",
",",
"15.",
"56_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Manu",
"ally",
" ",
"place",
" ",
"the",
" ",
"entry",
" ",
"order",
",",
" ",
"to",
" ",
"get",
" ",
"it",
" ",
"filled",
" ",
"on",
" ",
"the",
" ",
"first",
" ",
"bar",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"False_",
")_",
"#",
" ",
"Open",
":",
" ",
"15.",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Order_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
",_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"SEL",
"L_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"False_",
")_",
"#",
" ",
"Open",
":",
" ",
"15.",
"74_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Cas",
"h_",
"(_",
")_",
"==_",
"initial",
"Cas",
"h_",
"+_",
"(_",
"15.",
"74_",
"-_",
"15.",
"61_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fi",
"rst",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"Open",
" ",
"vs",
" ",
"Close_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"0_",
"]_",
"==_",
"(_",
"15.",
"90_",
"-_",
"15.",
"61_",
")_",
"/_",
"15.",
"61_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Second",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"Open",
" ",
"vs",
" ",
"Prev",
".",
" ",
"day",
"'",
"s",
" ",
"close_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"1_",
"]_",
"==_",
"(_",
"15.",
"74_",
"-_",
"15.",
"90_",
")_",
"/_",
"15.",
"90_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Tw",
"o",
"Bar",
"Return",
"s",
"\\u",
"Open",
"Close_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"15.",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"set",
"Bar",
"Filter_",
"(_",
"csv",
"feed_",
"._",
"Date",
"Range",
"Filter_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"7_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"6",
",",
"15.",
"6",
"1",
",",
"16.",
"03",
",",
"15.",
"50",
",",
"15.",
"90",
",",
"669",
"449",
"00",
",",
"15.",
"55_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"7",
",",
"15.",
"7",
"4",
",",
"15.",
"9",
"5",
",",
"15.",
"5",
"5",
",",
"15.",
"9",
"1",
",",
"424",
"632",
"00",
",",
"15.",
"56_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Manu",
"ally",
" ",
"place",
" ",
"the",
" ",
"entry",
" ",
"order",
",",
" ",
"to",
" ",
"get",
" ",
"it",
" ",
"filled",
" ",
"on",
" ",
"the",
" ",
"first",
" ",
"bar",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"False_",
")_",
"#",
" ",
"Open",
":",
" ",
"15.",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Order_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
",_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"SEL",
"L_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"True_",
")_",
"#",
" ",
"Clos",
"e",
":",
" ",
"15.",
"91_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Cas",
"h_",
"(_",
")_",
"==_",
"initial",
"Cas",
"h_",
"+_",
"(_",
"15.",
"91_",
"-_",
"15.",
"61_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fi",
"rst",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"Open",
" ",
"vs",
" ",
"Close_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"0_",
"]_",
"==_",
"(_",
"15.",
"90_",
"-_",
"15.",
"61_",
")_",
"/_",
"15.",
"61_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Second",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"Clos",
"e",
" ",
"vs",
" ",
"Prev",
".",
" ",
"day",
"'",
"s",
" ",
"close_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"1_",
"]_",
"==_",
"(_",
"15.",
"91_",
"-_",
"15.",
"90_",
")_",
"/_",
"15.",
"90_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Tw",
"o",
"Bar",
"Return",
"s",
"\\u",
"Clos",
"e",
"Open_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"15.",
"9_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"set",
"Bar",
"Filter_",
"(_",
"csv",
"feed_",
"._",
"Date",
"Range",
"Filter_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"7_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"6",
",",
"15.",
"6",
"1",
",",
"16.",
"03",
",",
"15.",
"50",
",",
"15.",
"90",
",",
"669",
"449",
"00",
",",
"15.",
"55_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"7",
",",
"15.",
"7",
"4",
",",
"15.",
"9",
"5",
",",
"15.",
"5",
"5",
",",
"15.",
"9",
"1",
",",
"424",
"632",
"00",
",",
"15.",
"56_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Manu",
"ally",
" ",
"place",
" ",
"the",
" ",
"entry",
" ",
"order",
",",
" ",
"to",
" ",
"get",
" ",
"it",
" ",
"filled",
" ",
"on",
" ",
"the",
" ",
"first",
" ",
"bar",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"True_",
")_",
"#",
" ",
"Clos",
"e",
":",
" ",
"15.",
"90_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Order_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
",_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"SEL",
"L_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"False_",
")_",
"#",
" ",
"Open",
":",
" ",
"15.",
"74_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Cas",
"h_",
"(_",
")_",
"==_",
"initial",
"Cas",
"h_",
"+_",
"(_",
"15.",
"74_",
"-_",
"15.",
"90_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fi",
"rst",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"0_",
"]_",
"==_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Second",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"Open",
" ",
"vs",
" ",
"Prev",
".",
" ",
"day",
"'",
"s",
" ",
"close_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"1_",
"]_",
"==_",
"(_",
"15.",
"74_",
"-_",
"15.",
"90_",
")_",
"/_",
"15.",
"90_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Tw",
"o",
"Bar",
"Return",
"s",
"\\u",
"Clos",
"e",
"Close_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"15.",
"90_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"set",
"Bar",
"Filter_",
"(_",
"csv",
"feed_",
"._",
"Date",
"Range",
"Filter_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"7_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"6",
",",
"15.",
"6",
"1",
",",
"16.",
"03",
",",
"15.",
"50",
",",
"15.",
"90",
",",
"669",
"449",
"00",
",",
"15.",
"55_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"200",
"1",
"-1",
"2",
"-0",
"7",
",",
"15.",
"7",
"4",
",",
"15.",
"9",
"5",
",",
"15.",
"5",
"5",
",",
"15.",
"9",
"1",
",",
"424",
"632",
"00",
",",
"15.",
"56_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Manu",
"ally",
" ",
"place",
" ",
"the",
" ",
"entry",
" ",
"order",
",",
" ",
"to",
" ",
"get",
" ",
"it",
" ",
"filled",
" ",
"on",
" ",
"the",
" ",
"first",
" ",
"bar",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"True_",
")_",
"#",
" ",
"Clos",
"e",
":",
" ",
"15.",
"90_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Order_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"12_",
",_",
"0_",
"6_",
")_",
",_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
",_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"SEL",
"L_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"True_",
")_",
"#",
" ",
"Clos",
"e",
":",
" ",
"15.",
"91_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Cas",
"h_",
"(_",
")_",
"==_",
"initial",
"Cas",
"h_",
"+_",
"(_",
"15.",
"91_",
"-_",
"15.",
"90_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fi",
"rst",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"0_",
"]_",
"==_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Second",
" ",
"day",
" ",
"return",
"s",
":",
" ",
"Open",
" ",
"vs",
" ",
"Prev",
".",
" ",
"day",
"'",
"s",
" ",
"close_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"1_",
"]_",
"==_",
"(_",
"15.",
"91_",
"-_",
"15.",
"90_",
")_",
"/_",
"15.",
"90_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Cum",
"ulati",
"ve",
"Return_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"33.",
"06_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"position",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Pos",
"Entry_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"1_",
",_",
"12_",
")_",
",_",
"strat",
"_",
"._",
"enter",
"Long_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
")_",
"#",
" ",
"33.",
"06_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Pos",
"Exi",
"t",
"Market",
"_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"11_",
",_",
"27_",
")_",
")_",
"#",
" ",
"14.",
"32_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"round_",
"(_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Cas",
"h_",
"(_",
")_",
",_",
"2_",
")_",
"==_",
"round_",
"(_",
"initial",
"Cas",
"h_",
"+_",
"(_",
"14.",
"32_",
"-_",
"33.",
"06_",
")_",
",_",
"2_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"round_",
"(_",
"33.",
"06_",
"*_",
"(_",
"1_",
"+_",
"strat",
"Analyzer_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
"[_",
"-_",
"1_",
"]_",
")_",
",_",
"2_",
")_",
"==_",
"14.",
"32_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Goo",
"gle",
"2011_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Value_",
"=_",
"1000000_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"goog",
"-",
"2011",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"order_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
"(_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"165",
"4_",
",_",
"True_",
")_",
"#",
" ",
"2011",
"-0",
"1",
"-0",
"3",
" ",
"close",
":",
" ",
"604",
".3",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"submit",
"Order_",
"(_",
"order_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"final",
"Value_",
"=_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"get",
"Equi",
"ty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
"[_",
"-_",
"1_",
"]_",
",_",
"4_",
")_",
",_",
"round_",
"(_",
"(_",
"final",
"Value_",
"-_",
"initial",
"Value_",
")_",
"/_",
"float_",
"(_",
"initial",
"Value_",
")_",
",_",
"4_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Multipl",
"e",
"Instrum",
"ents",
"Inter",
"lea",
"ved",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"\"",
"spy",
"\"_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"spy",
"-",
"2010",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
",_",
"markets",
"ession",
"_",
"._",
"NY",
"SE_",
"._",
"get",
"Timezone",
"_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"\"",
"nik",
"kei",
"\"_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"nik",
"kei",
"-",
"2010",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
",_",
"markets",
"ession",
"_",
"._",
"TS",
"E_",
"._",
"get",
"Timezone",
"_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"1000_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"_",
"._",
"market",
"Order_",
"(_",
"\"",
"spy",
"\"_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"cumul",
"ative",
" ",
"return",
" ",
"shou",
"ld",
" ",
"be",
" ",
"the",
" ",
"same",
" ",
"if",
" ",
"we",
" ",
"load",
" ",
"nik",
"kei",
" ",
"or",
" ",
"not",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"round_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
"[_",
"-_",
"1_",
"]_",
",_",
"5_",
")_",
",_",
"0.013",
"38_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Analy",
"zer",
"Test",
"Case_",
"(_",
"common_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Fi",
"rst",
"Bar_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"initial",
"Cas",
"h_",
"=_",
"1000_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"=_",
"ya",
"hoo",
"feed_",
"._",
"Feed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"Feed_",
"._",
"add",
"Bar",
"s",
"Fro",
"m",
"CSV_",
"(_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"common_",
"._",
"get",
"\\u",
"data\\u",
"file",
"\\u",
"path_",
"(_",
"\"",
"orc",
"l",
"-",
"200",
"1",
"-",
"ya",
"hoo",
"finance",
".",
"csv",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"=_",
"strat",
"eg",
"y",
"\\u",
"test_",
"._",
"Test",
"Strategy_",
"(_",
"bar",
"Feed_",
",_",
"initial",
"Cas",
"h_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"_",
"._",
"add",
"Order_",
"(_",
"datetime_",
"._",
"datetime_",
"(_",
"2001_",
",_",
"0_",
"1_",
",_",
"0_",
"2_",
")_",
",_",
"strat",
"_",
"._",
"get",
"Broker",
"_",
"(_",
")_",
"._",
"create",
"Market",
"Order_",
",_",
"broker_",
"._",
"Order_",
"._",
"Action_",
"._",
"BU",
"Y_",
",_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
",_",
"1_",
",_",
"False_",
")_",
"#",
" ",
"200",
"1",
"-0",
"1",
"-0",
"3",
" ",
"Open",
":",
" ",
"25.",
"25",
" ",
"Clos",
"e",
":",
" ",
"32.",
"00_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"strat",
"Analyzer_",
"=_",
"returns_",
"._",
"Return",
"s_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"attach",
"Analyzer_",
"(_",
"strat",
"Analyzer_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"strat",
"_",
"._",
"run_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"0_",
"]_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"[_",
"1_",
"]_",
",_",
"(_",
"32.",
"00_",
"-_",
"25.",
"25_",
")_",
"/_",
"1000_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Check",
" ",
"date",
" ",
"times",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"datetimes",
"_",
"=_",
"bar",
"Feed_",
"[_",
"Analy",
"zer",
"Test",
"Case_",
"._",
"Test",
"Instrument_",
"]_",
"._",
"get",
"Date",
"Times_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"[_",
"0_",
",_",
"-_",
"1_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Equal_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Return",
"s_",
"(_",
")_",
"._",
"get",
"Date",
"Times_",
"(_",
")_",
"[_",
"i_",
"]_",
",_",
"datetimes",
"_",
"[_",
"i_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"strat",
"Analyzer_",
"._",
"get",
"Cum",
"ulati",
"ve",
"Return",
"s_",
"(_",
")_",
"._",
"get",
"Date",
"Times_",
"(_",
")_",
"[_",
"i_",
"]_",
",_",
"datetimes",
"_",
"[_",
"i_",
"]_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Unused import | jesolem/PCV/examples/ch9_chan_vese.py | [
{
"content": "from PIL import Image\nfrom numpy import *\nfrom scipy.misc import imsave\n\nfrom PCV.tools import rof\n\n\"\"\"\nSimple example of Chan-Vese segmentation from Section 9.3.\nLoad an image, segment in two classes and save result.\n\"\"\"\n\nim = array(Image.open('../data/houses.png').convert('L')) \nU,T = rof.denoise(im,im,tolerance=0.001)\nt = 0.4\n\nimsave('result.pdf',U < t*U.max())",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"PIL_",
"import_",
"Image_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"numpy_",
"import_",
"*_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"scipy_",
"._",
"misc_",
"import_",
"ims",
"ave_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"PC",
"V_",
"._",
"tools_",
"import_",
"rof",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Simple",
" ",
"example",
" ",
"of",
" ",
"Chan",
"-",
"Ves",
"e",
" ",
"segmentation",
" ",
"from",
" ",
"Sect",
"ion",
" ",
"9.3",
".",
"\\",
"10",
";",
"Load",
" ",
"an",
" ",
"image",
",",
" ",
"segment",
" ",
"in",
" ",
"two",
" ",
"classe",
"s",
" ",
"and",
" ",
"save",
" ",
"result",
".",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"im_",
"=_",
"array_",
"(_",
"Image_",
"._",
"open_",
"(_",
"'../",
"data",
"/",
"houses",
".",
"png",
"'_",
")_",
"._",
"convert_",
"(_",
"'",
"L",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"U_",
",_",
"T_",
"=_",
"rof",
"_",
"._",
"deno",
"ise_",
"(_",
"im_",
",_",
"im_",
",_",
"tolerance_",
"=_",
"0.001_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"t_",
"=_",
"0.4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ims",
"ave_",
"(_",
"'",
"result",
".",
"pdf",
"'_",
",_",
"U_",
"<_",
"t_",
"*_",
"U_",
"._",
"max_",
"(_",
")_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | hcarvalhoalves/django-rest-thumbnails/restthumbnails/defaults.py | [
{
"content": "def source_storage_backend():\n SOURCE_STORAGE_BACKEND = getattr(settings,\n 'THUMBNAILS_SOURCE_STORAGE_BACKEND',\n 'django.core.files.storage.FileSystemStorage')\n\n SOURCE_STORAGE_LOCATION = getattr(settings,\n 'THUMBNAILS_SOURCE_ROOT',\n settings.MEDIA_ROOT)\n\n return get_storage_class(SOURCE_STORAGE_BACKEND)(\n location=SOURCE_STORAGE_LOCATION)",
"metadata": "root.source_storage_backend",
"header": "['module', '___EOS___']",
"index": 70
}
] | [] | [] | 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_",
"def_",
"source",
"\\u",
"storage",
"\\u",
"backend_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"SOU",
"RC",
"E",
"\\u",
"STOR",
"AGE",
"\\u",
"BACKEND_",
"=_",
"getattr_",
"(_",
"settings_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"THUMB",
"NA",
"IL",
"S",
"\\u",
"SOU",
"RC",
"E",
"\\u",
"STOR",
"AGE",
"\\u",
"BACK",
"END",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"django",
".",
"core",
".",
"files",
".",
"storage",
".",
"File",
"System",
"Stor",
"age",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"SOU",
"RC",
"E",
"\\u",
"STOR",
"AGE",
"\\u",
"LOCATION_",
"=_",
"getattr_",
"(_",
"settings_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"THUMB",
"NA",
"IL",
"S",
"\\u",
"SOU",
"RC",
"E",
"\\u",
"ROO",
"T",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"settings_",
"._",
"MEDIA",
"\\u",
"ROOT_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"get",
"\\u",
"storage",
"\\u",
"class_",
"(_",
"SOU",
"RC",
"E",
"\\u",
"STOR",
"AGE",
"\\u",
"BACKEND_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"location_",
"=_",
"SOU",
"RC",
"E",
"\\u",
"STOR",
"AGE",
"\\u",
"LOCATION_",
")_",
"\\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
] |
First parameter of a method is not named 'self' | glue-viz/glue/glue/core/tests/test_component_link.py | [
{
"content": " def toy_data(self):\n data = Data()\n from_comp = Component(np.array([1, 2, 3]))\n to_comp = Component(np.array([4, 5, 6]))\n return data, from_comp, to_comp",
"metadata": "root.TestComponentLink.toy_data",
"header": "['class', 'TestComponentLink', '(', 'object', ')', ':', '___EOS___']",
"index": 17
}
] | [] | [] | 0 | true | [
"[CLS]_",
"First_",
"parameter_",
"of_",
"a_",
"method_",
"is_",
"not_",
"named_",
"'",
"self",
"'_",
"[SEP]_",
"class_",
"Test",
"Compo",
"nent",
"Link_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"toy",
"\\u",
"data_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"Data_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from",
"\\u",
"comp_",
"=_",
"Component_",
"(_",
"np_",
"._",
"array_",
"(_",
"[_",
"1_",
",_",
"2_",
",_",
"3_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"to",
"\\u",
"comp_",
"=_",
"Component_",
"(_",
"np_",
"._",
"array_",
"(_",
"[_",
"4_",
",_",
"5_",
",_",
"6_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"data_",
",_",
"from",
"\\u",
"comp_",
",_",
"to",
"\\u",
"comp_",
"\\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
] |
Unused local variable | genzgd/Lampost-Mud/lampost/datastore/redisstore.py | [
{
"content": " def delete_object(self, dbo):\n key = dbo.dbo_key\n dbo.db_deleted()\n self.delete_key(key)\n self._clear_old_refs(dbo)\n if dbo.dbo_set_key:\n self.redis.srem(dbo.dbo_set_key, dbo.dbo_id)\n for children_type in dbo.dbo_children_types:\n self.delete_object_set(get_dbo_class(children_type),\n \"{}_{}s:{}\".format(dbo.dbo_key_type, children_type, dbo.dbo_id))\n for ix_name in dbo.dbo_indexes:\n ix_value = getattr(dbo, ix_name, None)\n if ix_value is not None and ix_value != '':\n self.delete_index('ix:{}:{}'.format(dbo.dbo_key_type, ix_name), ix_value)\n debug(\"object deleted: {}\", key)\n self.evict_object(dbo)",
"metadata": "root.RedisStore.delete_object",
"header": "['class', 'RedisStore', '(', ')', ':', '___EOS___']",
"index": 142
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Red",
"is",
"Store_",
"(_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"delete",
"\\u",
"object_",
"(_",
"self_",
",_",
"dbo_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"key_",
"=_",
"dbo_",
"._",
"dbo",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dbo_",
"._",
"db",
"\\u",
"deleted_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"delete",
"\\u",
"key_",
"(_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"clear",
"\\u",
"old",
"\\u",
"refs_",
"(_",
"dbo_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"dbo_",
"._",
"dbo",
"\\u",
"set\\u",
"key_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"redis_",
"._",
"sre",
"m_",
"(_",
"dbo_",
"._",
"dbo",
"\\u",
"set\\u",
"key_",
",_",
"dbo_",
"._",
"dbo",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"child",
"ren",
"\\u",
"type_",
"in_",
"dbo_",
"._",
"dbo",
"\\u",
"child",
"ren",
"\\u",
"types_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"delete",
"\\u",
"object\\u",
"set_",
"(_",
"get",
"\\u",
"dbo",
"\\u",
"class_",
"(_",
"child",
"ren",
"\\u",
"type_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"{}\\u",
"{}",
"s",
":{}\"_",
"._",
"format_",
"(_",
"dbo_",
"._",
"dbo",
"\\u",
"key",
"\\u",
"type_",
",_",
"child",
"ren",
"\\u",
"type_",
",_",
"dbo_",
"._",
"dbo",
"\\u",
"id_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"ix",
"\\u",
"name_",
"in_",
"dbo_",
"._",
"dbo",
"\\u",
"indexes_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ix",
"\\u",
"value_",
"=_",
"getattr_",
"(_",
"dbo_",
",_",
"ix",
"\\u",
"name_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"ix",
"\\u",
"value_",
"is_",
"not_",
"None_",
"and_",
"ix",
"\\u",
"value_",
"!=_",
"''_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"delete",
"\\u",
"index_",
"(_",
"'",
"ix",
":{}",
":{}'_",
"._",
"format_",
"(_",
"dbo_",
"._",
"dbo",
"\\u",
"key",
"\\u",
"type_",
",_",
"ix",
"\\u",
"name_",
")_",
",_",
"ix",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"debug_",
"(_",
"\"",
"object",
" ",
"delete",
"d",
":",
" ",
"{}\"_",
",_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"evi",
"ct",
"\\u",
"object_",
"(_",
"dbo_",
")_",
"\\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
] |
Unused import | datamade/dedupe/tests/test_blocking.py | [
{
"content": "import dedupe\nfrom collections import defaultdict\nimport unittest\n\nfrom future.utils import viewitems, viewvalues\n\n\n\n \n\n\n\n\n\n\n\n \n\nif __name__ == \"__main__\":\n unittest.main()\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class BlockingTest(unittest.TestCase):\n",
"metadata": "root.BlockingTest",
"header": "['module', '___EOS___']",
"index": 6
},
{
"content": " def setUp(self):\n self.frozendict = dedupe.core.frozendict\n\n field_definition = [{'field' : 'name', 'type': 'String'}]\n self.data_model = dedupe.Dedupe(field_definition).data_model\n self.training_pairs = {\n 'match': [(self.frozendict({\"name\": \"Bob\", \"age\": \"50\"}),\n self.frozendict({\"name\": \"Bob\", \"age\": \"75\"})),\n (self.frozendict({\"name\": \"Meredith\", \"age\": \"40\"}),\n self.frozendict({\"name\": \"Sue\", \"age\": \"10\"}))], \n 'distinct': [(self.frozendict({\"name\": \"Jimmy\", \"age\": \"20\"}),\n self.frozendict({\"name\": \"Jimbo\", \"age\": \"21\"})),\n (self.frozendict({\"name\": \"Willy\", \"age\": \"35\"}),\n self.frozendict({\"name\": \"William\", \"age\": \"35\"})),\n (self.frozendict({\"name\": \"William\", \"age\": \"36\"}),\n self.frozendict({\"name\": \"William\", \"age\": \"35\"}))]\n }\n\n self.training = self.training_pairs['match'] + self.training_pairs['distinct']\n self.training_records = set().union(*self.training)\n\n self.simple = lambda x : set([str(k) for k in x \n if \"CompoundPredicate\" not in str(k)])",
"metadata": "root.BlockingTest.setUp",
"header": "['class', 'BlockingTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 7
},
{
"content": " def test_dedupe_coverage(self) :\n predicates = self.data_model.predicates()\n blocker = dedupe.blocking.Blocker(predicates)\n blocker.indexAll({i : x for i, x in enumerate(self.training_records)})\n coverage = dedupe.training.coveredPairs(blocker.predicates,\n self.training)\n assert self.simple(coverage.keys()).issuperset(\n set([\"SimplePredicate: (tokenFieldPredicate, name)\", \n \"SimplePredicate: (commonSixGram, name)\", \n \"TfidfTextCanopyPredicate: (0.4, name)\", \n \"SimplePredicate: (sortedAcronym, name)\",\n \"SimplePredicate: (sameThreeCharStartPredicate, name)\", \n \"TfidfTextCanopyPredicate: (0.2, name)\", \n \"SimplePredicate: (sameFiveCharStartPredicate, name)\", \n \"TfidfTextCanopyPredicate: (0.6, name)\", \n \"SimplePredicate: (wholeFieldPredicate, name)\", \n \"TfidfTextCanopyPredicate: (0.8, name)\", \n \"SimplePredicate: (commonFourGram, name)\", \n \"SimplePredicate: (firstTokenPredicate, name)\", \n \"SimplePredicate: (sameSevenCharStartPredicate, name)\"]))",
"metadata": "root.BlockingTest.test_dedupe_coverage",
"header": "['class', 'BlockingTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 31
},
{
"content": "class TfidfTest(unittest.TestCase):\n \n",
"metadata": "root.TfidfTest",
"header": "['module', '___EOS___']",
"index": 54
},
{
"content": " def setUp(self):\n self.data_d = {\n 100 : {\"name\": \"Bob\", \"age\": \"50\", \"dataset\": 0},\n 105 : {\"name\": \"Charlie\", \"age\": \"75\", \"dataset\": 1},\n 110 : {\"name\": \"Meredith\", \"age\": \"40\", \"dataset\": 1},\n 115 : {\"name\": \"Sue\", \"age\": \"10\", \"dataset\": 0},\n 120 : {\"name\": \"Jimbo\", \"age\": \"21\",\"dataset\": 0},\n 125 : {\"name\": \"Jimbo\", \"age\": \"21\", \"dataset\": 0},\n 130 : {\"name\": \"Willy\", \"age\": \"35\", \"dataset\": 0},\n 135 : {\"name\": \"Willy\", \"age\": \"35\", \"dataset\": 1},\n 140 : {\"name\": \"Martha\", \"age\": \"19\", \"dataset\": 1},\n 145 : {\"name\": \"Kyle\", \"age\": \"27\", \"dataset\": 0},\n }",
"metadata": "root.TfidfTest.setUp",
"header": "['class', 'TfidfTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 55
},
{
"content": " def test_unconstrained_inverted_index(self):\n\n blocker = dedupe.blocking.Blocker([dedupe.predicates.TfidfTextSearchPredicate(0.0, \"name\")])\n\n blocker.index(set(record[\"name\"] \n for record \n in viewvalues(self.data_d)),\n \"name\")\n\n blocks = defaultdict(set)\n \n for block_key, record_id in blocker(self.data_d.items()) :\n blocks[block_key].add(record_id)\n\n blocks = set([frozenset(block) for block in blocks.values()\n if len(block) > 1 ])\n\n assert blocks ==\\\n set([frozenset([120, 125]), frozenset([130, 135])])",
"metadata": "root.TfidfTest.test_unconstrained_inverted_index",
"header": "['class', 'TfidfTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 70
},
{
"content": "class TfIndexUnindex(unittest.TestCase) :\n\n\n\n\n",
"metadata": "root.TfIndexUnindex",
"header": "['module', '___EOS___']",
"index": 90
},
{
"content": " def setUp(self) :\n data_d = {\n 100 : {\"name\": \"Bob\", \"age\": \"50\", \"dataset\": 0},\n 105 : {\"name\": \"Charlie\", \"age\": \"75\", \"dataset\": 1},\n 110 : {\"name\": \"Meredith\", \"age\": \"40\", \"dataset\": 1},\n 115 : {\"name\": \"Sue\", \"age\": \"10\", \"dataset\": 0},\n 120 : {\"name\": \"Jimbo\", \"age\": \"21\",\"dataset\": 0},\n 125 : {\"name\": \"Jimbo\", \"age\": \"21\", \"dataset\": 0},\n 130 : {\"name\": \"Willy\", \"age\": \"35\", \"dataset\": 0},\n 135 : {\"name\": \"Willy\", \"age\": \"35\", \"dataset\": 1},\n 140 : {\"name\": \"Martha\", \"age\": \"19\", \"dataset\": 1},\n 145 : {\"name\": \"Kyle\", \"age\": \"27\", \"dataset\": 0},\n }\n\n\n self.blocker = dedupe.blocking.Blocker([dedupe.predicates.TfidfTextSearchPredicate(0.0, \"name\")])\n\n self.records_1 = dict((record_id, record) \n for record_id, record \n in viewitems(data_d)\n if record[\"dataset\"] == 0)\n\n self.fields_2 = dict((record_id, record[\"name\"])\n for record_id, record \n in viewitems(data_d)\n if record[\"dataset\"] == 1)",
"metadata": "root.TfIndexUnindex.setUp",
"header": "['class', 'TfIndexUnindex', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 91
},
{
"content": " def test_index(self):\n self.blocker.index(set(self.fields_2.values()), \"name\")\n\n blocks = defaultdict(set)\n \n for block_key, record_id in self.blocker(self.records_1.items()) :\n blocks[block_key].add(record_id)\n\n assert list(blocks.items())[0][1] == set([130])",
"metadata": "root.TfIndexUnindex.test_index",
"header": "['class', 'TfIndexUnindex', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 119
},
{
"content": " def test_doubled_index(self):\n self.blocker.index(self.fields_2.values(), \"name\")\n self.blocker.index(self.fields_2.values(), \"name\")\n\n blocks = defaultdict(set)\n \n for block_key, record_id in self.blocker(self.records_1.items()) :\n blocks[block_key].add(record_id)\n\n assert list(blocks.items()) == [(u'4:0', set([130]))]",
"metadata": "root.TfIndexUnindex.test_doubled_index",
"header": "['class', 'TfIndexUnindex', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 130
},
{
"content": " def test_unindex(self) :\n self.blocker.index(self.fields_2.values(), \"name\")\n self.blocker.unindex(self.fields_2.values(), \"name\")\n\n blocks = defaultdict(set)\n \n for block_key, record_id in self.blocker(self.records_1.items()) :\n blocks[block_key].add(record_id)\n\n assert len(blocks.values()) == 0 ",
"metadata": "root.TfIndexUnindex.test_unindex",
"header": "['class', 'TfIndexUnindex', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 141
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"dedup",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"collections_",
"import_",
"defaultdict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"unittest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"future_",
"._",
"utils_",
"import_",
"view",
"items_",
",_",
"view",
"values_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"\"\\u\\u",
"main",
"\\u\\u\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"unittest_",
"._",
"main_",
"(_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Block",
"ing",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Block",
"ing",
"Test_",
"(_",
"unittest_",
"._",
"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_",
"._",
"frozen",
"dict_",
"=_",
"dedup",
"e_",
"._",
"core_",
"._",
"frozen",
"dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"field",
"\\u",
"definition_",
"=_",
"[_",
"{_",
"'",
"field",
"'_",
":_",
"'",
"name",
"'_",
",_",
"'",
"type",
"'_",
":_",
"'",
"String",
"'_",
"}_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data\\u",
"model_",
"=_",
"dedup",
"e_",
"._",
"Ded",
"upe",
"_",
"(_",
"field",
"\\u",
"definition_",
")_",
"._",
"data\\u",
"model_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"train",
"ing",
"\\u",
"pairs_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"match",
"'_",
":_",
"[_",
"(_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Bob",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"50",
"\"_",
"}_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Bob",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"7",
"5",
"\"_",
"}_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Mer",
"edit",
"h",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"40",
"\"_",
"}_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Su",
"e",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"10",
"\"_",
"}_",
")_",
")_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"distinct",
"'_",
":_",
"[_",
"(_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ji",
"mm",
"y",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"20",
"\"_",
"}_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ji",
"mbo",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"21",
"\"_",
"}_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Wil",
"ly",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
"}_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Willi",
"am",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
"}_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Willi",
"am",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"6",
"\"_",
"}_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"frozen",
"dict_",
"(_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Willi",
"am",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
"}_",
")_",
")_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"training_",
"=_",
"self_",
"._",
"train",
"ing",
"\\u",
"pairs_",
"[_",
"'",
"match",
"'_",
"]_",
"+_",
"self_",
"._",
"train",
"ing",
"\\u",
"pairs_",
"[_",
"'",
"distinct",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"train",
"ing",
"\\u",
"records_",
"=_",
"set_",
"(_",
")_",
"._",
"union_",
"(_",
"*_",
"self_",
"._",
"training_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"simple_",
"=_",
"lambda_",
"x_",
":_",
"set_",
"(_",
"[_",
"str_",
"(_",
"k_",
")_",
"for_",
"k_",
"in_",
"x_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"\"",
"Compo",
"und",
"Predicate",
"\"_",
"not_",
"in_",
"str_",
"(_",
"k_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Block",
"ing",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"dedup",
"e\\u",
"coverage_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"predicates_",
"=_",
"self_",
"._",
"data\\u",
"model_",
"._",
"predicates_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"blocker",
"_",
"=_",
"dedup",
"e_",
"._",
"blocking_",
"._",
"Block",
"er_",
"(_",
"predicates_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"blocker",
"_",
"._",
"index",
"All_",
"(_",
"{_",
"i_",
":_",
"x_",
"for_",
"i_",
",_",
"x_",
"in_",
"enumerate_",
"(_",
"self_",
"._",
"train",
"ing",
"\\u",
"records_",
")_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"coverage_",
"=_",
"dedup",
"e_",
"._",
"training_",
"._",
"covered",
"Pairs_",
"(_",
"blocker",
"_",
"._",
"predicates_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"training_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"self_",
"._",
"simple_",
"(_",
"coverage_",
"._",
"keys_",
"(_",
")_",
")_",
"._",
"issu",
"perse",
"t_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"set_",
"(_",
"[_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"token",
"Field",
"Predicate",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"common",
"Six",
"Gram",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Tf",
"idf",
"Text",
"Can",
"opy",
"Predicate",
":",
" ",
"(",
"0.",
"4",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"sorte",
"d",
"Acr",
"ony",
"m",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"same",
"Thre",
"e",
"Char",
"Start",
"Predicate",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Tf",
"idf",
"Text",
"Can",
"opy",
"Predicate",
":",
" ",
"(",
"0.",
"2",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"same",
"Fiv",
"e",
"Char",
"Start",
"Predicate",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Tf",
"idf",
"Text",
"Can",
"opy",
"Predicate",
":",
" ",
"(",
"0.",
"6",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"whole",
"Field",
"Predicate",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Tf",
"idf",
"Text",
"Can",
"opy",
"Predicate",
":",
" ",
"(",
"0.",
"8",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"common",
"Four",
"Gram",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"first",
"Token",
"Predicate",
",",
" ",
"name",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Simple",
"Predicate",
":",
" ",
"(",
"same",
"Seve",
"n",
"Char",
"Start",
"Predicate",
",",
" ",
"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_",
"Tf",
"idf",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Tf",
"idf",
"Test_",
"(_",
"unittest_",
"._",
"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_",
"._",
"data\\u",
"d_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"100_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Bob",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"50",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"105_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Charl",
"ie",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"7",
"5",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"110_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Mer",
"edit",
"h",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"40",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"115_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Su",
"e",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"10",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"120_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ji",
"mbo",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"21",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"125_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ji",
"mbo",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"21",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"130_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Wil",
"ly",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"135_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Wil",
"ly",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"140_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Mart",
"ha",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"1",
"9",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"145_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ky",
"le",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"2",
"7",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Tf",
"idf",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"uncon",
"strain",
"ed",
"\\u",
"inverted",
"\\u",
"index_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"blocker",
"_",
"=_",
"dedup",
"e_",
"._",
"blocking_",
"._",
"Block",
"er_",
"(_",
"[_",
"dedup",
"e_",
"._",
"predicates_",
"._",
"Tf",
"idf",
"Text",
"Sear",
"ch",
"Predicate_",
"(_",
"0.0_",
",_",
"\"",
"name",
"\"_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"blocker",
"_",
"._",
"index_",
"(_",
"set_",
"(_",
"record_",
"[_",
"\"",
"name",
"\"_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"record_",
"\\u\\u\\uNL\\u\\u\\u_",
"in_",
"view",
"values_",
"(_",
"self_",
"._",
"data\\u",
"d_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"name",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"blocks_",
"=_",
"defaultdict_",
"(_",
"set_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"block",
"\\u",
"key_",
",_",
"record",
"\\u",
"id_",
"in_",
"blocker",
"_",
"(_",
"self_",
"._",
"data\\u",
"d_",
"._",
"items_",
"(_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"blocks_",
"[_",
"block",
"\\u",
"key_",
"]_",
"._",
"add_",
"(_",
"record",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"blocks_",
"=_",
"set_",
"(_",
"[_",
"frozenset_",
"(_",
"block_",
")_",
"for_",
"block_",
"in_",
"blocks_",
"._",
"values_",
"(_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"len_",
"(_",
"block_",
")_",
">_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"blocks_",
"==_",
"set_",
"(_",
"[_",
"frozenset_",
"(_",
"[_",
"120_",
",_",
"125_",
"]_",
")_",
",_",
"frozenset_",
"(_",
"[_",
"130_",
",_",
"135_",
"]_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\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_",
"Tf",
"Index",
"Unin",
"dex_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Tf",
"Index",
"Unin",
"dex_",
"(_",
"unittest_",
"._",
"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 ",
" _",
"data\\u",
"d_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"100_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Bob",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"50",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"105_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Charl",
"ie",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"7",
"5",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"110_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Mer",
"edit",
"h",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"40",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"115_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Su",
"e",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"10",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"120_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ji",
"mbo",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"21",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"125_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ji",
"mbo",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"21",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"130_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Wil",
"ly",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"135_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Wil",
"ly",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"3",
"5",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"140_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Mart",
"ha",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"1",
"9",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"1_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"145_",
":_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"Ky",
"le",
"\"_",
",_",
"\"",
"age",
"\"_",
":_",
"\"",
"2",
"7",
"\"_",
",_",
"\"",
"dataset",
"\"_",
":_",
"0_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"blocker",
"_",
"=_",
"dedup",
"e_",
"._",
"blocking_",
"._",
"Block",
"er_",
"(_",
"[_",
"dedup",
"e_",
"._",
"predicates_",
"._",
"Tf",
"idf",
"Text",
"Sear",
"ch",
"Predicate_",
"(_",
"0.0_",
",_",
"\"",
"name",
"\"_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"record",
"s",
"\\u",
"1_",
"=_",
"dict_",
"(_",
"(_",
"record",
"\\u",
"id_",
",_",
"record_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"record",
"\\u",
"id_",
",_",
"record_",
"\\u\\u\\uNL\\u\\u\\u_",
"in_",
"view",
"items_",
"(_",
"data\\u",
"d_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"record_",
"[_",
"\"",
"dataset",
"\"_",
"]_",
"==_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"fields",
"\\u",
"2_",
"=_",
"dict_",
"(_",
"(_",
"record",
"\\u",
"id_",
",_",
"record_",
"[_",
"\"",
"name",
"\"_",
"]_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"record",
"\\u",
"id_",
",_",
"record_",
"\\u\\u\\uNL\\u\\u\\u_",
"in_",
"view",
"items_",
"(_",
"data\\u",
"d_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"record_",
"[_",
"\"",
"dataset",
"\"_",
"]_",
"==_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Tf",
"Index",
"Unin",
"dex_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"index_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"blocker",
"_",
"._",
"index_",
"(_",
"set_",
"(_",
"self_",
"._",
"fields",
"\\u",
"2_",
"._",
"values_",
"(_",
")_",
")_",
",_",
"\"",
"name",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"blocks_",
"=_",
"defaultdict_",
"(_",
"set_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"block",
"\\u",
"key_",
",_",
"record",
"\\u",
"id_",
"in_",
"self_",
"._",
"blocker",
"_",
"(_",
"self_",
"._",
"record",
"s",
"\\u",
"1_",
"._",
"items_",
"(_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"blocks_",
"[_",
"block",
"\\u",
"key_",
"]_",
"._",
"add_",
"(_",
"record",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"list_",
"(_",
"blocks_",
"._",
"items_",
"(_",
")_",
")_",
"[_",
"0_",
"]_",
"[_",
"1_",
"]_",
"==_",
"set_",
"(_",
"[_",
"130_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Tf",
"Index",
"Unin",
"dex_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"double",
"d\\u",
"index_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"blocker",
"_",
"._",
"index_",
"(_",
"self_",
"._",
"fields",
"\\u",
"2_",
"._",
"values_",
"(_",
")_",
",_",
"\"",
"name",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"blocker",
"_",
"._",
"index_",
"(_",
"self_",
"._",
"fields",
"\\u",
"2_",
"._",
"values_",
"(_",
")_",
",_",
"\"",
"name",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"blocks_",
"=_",
"defaultdict_",
"(_",
"set_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"block",
"\\u",
"key_",
",_",
"record",
"\\u",
"id_",
"in_",
"self_",
"._",
"blocker",
"_",
"(_",
"self_",
"._",
"record",
"s",
"\\u",
"1_",
"._",
"items_",
"(_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"blocks_",
"[_",
"block",
"\\u",
"key_",
"]_",
"._",
"add_",
"(_",
"record",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"list_",
"(_",
"blocks_",
"._",
"items_",
"(_",
")_",
")_",
"==_",
"[_",
"(_",
"u",
"'",
"4",
":",
"0",
"'_",
",_",
"set_",
"(_",
"[_",
"130_",
"]_",
")_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Tf",
"Index",
"Unin",
"dex_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"unin",
"dex_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"blocker",
"_",
"._",
"index_",
"(_",
"self_",
"._",
"fields",
"\\u",
"2_",
"._",
"values_",
"(_",
")_",
",_",
"\"",
"name",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"blocker",
"_",
"._",
"unin",
"dex_",
"(_",
"self_",
"._",
"fields",
"\\u",
"2_",
"._",
"values_",
"(_",
")_",
",_",
"\"",
"name",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"blocks_",
"=_",
"defaultdict_",
"(_",
"set_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"block",
"\\u",
"key_",
",_",
"record",
"\\u",
"id_",
"in_",
"self_",
"._",
"blocker",
"_",
"(_",
"self_",
"._",
"record",
"s",
"\\u",
"1_",
"._",
"items_",
"(_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"blocks_",
"[_",
"block",
"\\u",
"key_",
"]_",
"._",
"add_",
"(_",
"record",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"len_",
"(_",
"blocks_",
"._",
"values_",
"(_",
")_",
")_",
"==_",
"0_",
"\\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,
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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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | ReactiveX/RxPY/tests/test_observable/test_replay.py | [
{
"content": " def test_replay_time_lambda_zip_error(self):\n ex = 'ex'\n scheduler = TestScheduler()\n xs = scheduler.create_hot_observable(on_next(110, 7), on_next(220, 3), on_next(280, 4), on_next(290, 1), on_next(340, 8), on_next(360, 5), on_next(370, 6), on_next(390, 7), on_next(410, 13), on_next(430, 2), on_next(450, 9), on_next(520, 11), on_next(560, 20), on_error(600, ex))\n\n def create():\n def selector(_xs):\n return _xs.take(6).repeat()\n\n return xs.replay(selector, None, 50, scheduler)\n\n results = scheduler.start(create)\n\n results.messages.assert_equal(on_next(221, 3), on_next(281, 4), on_next(291, 1), on_next(341, 8), on_next(361, 5), on_next(371, 6), on_next(372, 8), on_next(373, 5), on_next(374, 6), on_next(391, 7), on_next(411, 13), on_next(431, 2), on_next(432, 7), on_next(433, 13), on_next(434, 2), on_next(451, 9), on_next(521, 11), on_next(561, 20), on_next(562, 11), on_next(563, 20), on_error(601, ex))\n xs.subscriptions.assert_equal(subscribe(200, 600))",
"metadata": "root.TestReplay.test_replay_time_lambda_zip_error",
"header": "['class', 'TestReplay', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 448
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Test",
"Repl",
"ay_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"repla",
"y",
"\\u",
"time",
"\\u",
"lambda",
"\\u",
"zip",
"\\u",
"error_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ex_",
"=_",
"'",
"ex",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"scheduler_",
"=_",
"Test",
"Scheduler_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"xs_",
"=_",
"scheduler_",
"._",
"create",
"\\u",
"hot",
"\\u",
"observable_",
"(_",
"on",
"\\u",
"next_",
"(_",
"110_",
",_",
"7_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"220_",
",_",
"3_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"280_",
",_",
"4_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"290_",
",_",
"1_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"340_",
",_",
"8_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"360_",
",_",
"5_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"370",
"_",
",_",
"6_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"390",
"_",
",_",
"7_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"410",
"_",
",_",
"13_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"430",
"_",
",_",
"2_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"450_",
",_",
"9_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"520",
"_",
",_",
"11_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"560",
"_",
",_",
"20_",
")_",
",_",
"on",
"\\u",
"error_",
"(_",
"600_",
",_",
"ex_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"create_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"selector_",
"(_",
"\\u",
"xs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u",
"xs_",
"._",
"take_",
"(_",
"6_",
")_",
"._",
"repeat_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"xs_",
"._",
"replay_",
"(_",
"selector_",
",_",
"None_",
",_",
"50_",
",_",
"scheduler_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"results_",
"=_",
"scheduler_",
"._",
"start_",
"(_",
"create_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"results_",
"._",
"messages_",
"._",
"assert",
"\\u",
"equal_",
"(_",
"on",
"\\u",
"next_",
"(_",
"221_",
",_",
"3_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"281",
"_",
",_",
"4_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"291",
"_",
",_",
"1_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"341",
"_",
",_",
"8_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"361",
"_",
",_",
"5_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"371",
"_",
",_",
"6_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"372",
"_",
",_",
"8_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"373",
"_",
",_",
"5_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"374",
"_",
",_",
"6_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"391",
"_",
",_",
"7_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"411",
"_",
",_",
"13_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"431",
"_",
",_",
"2_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"432",
"_",
",_",
"7_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"433",
"_",
",_",
"13_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"434",
"_",
",_",
"2_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"451",
"_",
",_",
"9_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"521",
"_",
",_",
"11_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"561",
"_",
",_",
"20_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"562",
"_",
",_",
"11_",
")_",
",_",
"on",
"\\u",
"next_",
"(_",
"563",
"_",
",_",
"20_",
")_",
",_",
"on",
"\\u",
"error_",
"(_",
"601",
"_",
",_",
"ex_",
")_",
")_",
"\\u\\u\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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Imprecise assert | sassoftware/conary/conary_test/localtest/deptabletest.py | [
{
"content": " def testIterativeOrdering(self):\n \"\"\"Jobs order correctly when the graph is built over several check()\n calls.\n\n @tests: CNY-3654\n \"\"\"\n dt, db, cu = self.init()\n\n # Create a cycle between two troves, as that's easy to verify in the\n # final ordering. One of them also requires a third trove, which will\n # be added in a separate dep check cycle.\n dep1 = parseDep('python: dep1')\n dep2 = parseDep('python: dep2')\n dep3 = parseDep('python: dep3')\n\n # trv1 requires dep2 + dep3\n trv1reqs = deps.DependencySet()\n trv1reqs.union(dep2)\n trv1reqs.union(dep3)\n trv1 = self.prvReqTrove('trv1:runtime', dep1, trv1reqs)\n trv2 = self.prvReqTrove('trv2:runtime', dep2, dep1)\n trv3 = self.prvTrove('trv3:runtime', dep3)\n\n # The first job has just the cycle in it, and is missing trv3 to\n # complete the graph.\n _, job12, src = self.createJobInfo(db, trv1, trv2)\n # The second job includes the needed trove\n _, job3, src3 = self.createJobInfo(db, trv3)\n # Merge the second job's changeset into the first so the trove source\n # is complete.\n src.addChangeSets(src3.csList)\n\n checker = db.db.dependencyChecker(src, findOrdering=True)\n # First pass: missing one dep\n checker.addJobs(job12)\n result = checker.check()\n self.assertEqual(result.unsatisfiedList,\n [(('trv1:runtime', self.new, self.flv), dep3)])\n # Second pass: add provider\n checker.addJobs(job3)\n result = checker.check()\n self.assertEqual(result.unsatisfiedList, [])\n # trv1 and trv2 require each other and so constitute a single job, trv3\n # is not part of the cycle so it is a separate job. The original bug\n # would have all three troves as separate jobs since it forgot about\n # the deps from the first check.\n checker.done()\n self.assertEqual(result.getChangeSetList(), [job3, job12])",
"metadata": "root.DepTableTest.testIterativeOrdering",
"header": "['class', 'DepTableTest', '(', 'testhelp', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 178
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Dep",
"Table",
"Test_",
"(_",
"testh",
"elp",
"_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Iterat",
"ive",
"Order",
"ing_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Jo",
"bs",
" ",
"order",
" ",
"correct",
"ly",
" ",
"whe",
"n",
" ",
"the",
" ",
"graph",
" ",
"is",
" ",
"bui",
"lt",
" ",
"over",
" ",
"sever",
"al",
" ",
"check",
"()",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"calls",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"tests",
":",
" ",
"CN",
"Y",
"-",
"365",
"4",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dt_",
",_",
"db_",
",_",
"cu_",
"=_",
"self_",
"._",
"init_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Creat",
"e",
" ",
"a",
" ",
"cycle",
" ",
"bet",
"ween",
" ",
"two",
" ",
"trove",
"s",
",",
" ",
"as",
" ",
"tha",
"t",
"'",
"s",
" ",
"easy",
" ",
"to",
" ",
"verify",
" ",
"in",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"final",
" ",
"orderi",
"ng",
".",
" ",
"One",
" ",
"of",
" ",
"them",
" ",
"als",
"o",
" ",
"require",
"s",
" ",
"a",
" ",
"third",
" ",
"trove",
",",
" ",
"whi",
"ch",
" ",
"will",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"be",
" ",
"adde",
"d",
" ",
"in",
" ",
"a",
" ",
"separate",
" ",
"dep",
" ",
"check",
" ",
"cycle",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"dep",
"1_",
"=_",
"parse",
"Dep",
"_",
"(_",
"'",
"python",
":",
" ",
"dep",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dep",
"2_",
"=_",
"parse",
"Dep",
"_",
"(_",
"'",
"python",
":",
" ",
"dep",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dep",
"3_",
"=_",
"parse",
"Dep",
"_",
"(_",
"'",
"python",
":",
" ",
"dep",
"3",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tr",
"v1",
" ",
"require",
"s",
" ",
"dep",
"2",
" ",
"+",
" ",
"dep",
"3_",
"\\u\\u\\uNL\\u\\u\\u_",
"tr",
"v1",
"reqs_",
"=_",
"deps_",
"._",
"Dependenc",
"y",
"Set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tr",
"v1",
"reqs_",
"._",
"union_",
"(_",
"dep",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tr",
"v1",
"reqs_",
"._",
"union_",
"(_",
"dep",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tr",
"v1_",
"=_",
"self_",
"._",
"prv",
"Re",
"q",
"Trove",
"_",
"(_",
"'",
"tr",
"v1",
":",
"runt",
"ime",
"'_",
",_",
"dep",
"1_",
",_",
"tr",
"v1",
"reqs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tr",
"v2_",
"=_",
"self_",
"._",
"prv",
"Re",
"q",
"Trove",
"_",
"(_",
"'",
"tr",
"v2",
":",
"runt",
"ime",
"'_",
",_",
"dep",
"2_",
",_",
"dep",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tr",
"v3_",
"=_",
"self_",
"._",
"prv",
"Trove",
"_",
"(_",
"'",
"tr",
"v",
"3",
":",
"runt",
"ime",
"'_",
",_",
"dep",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"first",
" ",
"job",
" ",
"has",
" ",
"just",
" ",
"the",
" ",
"cycle",
" ",
"in",
" ",
"it",
",",
" ",
"and",
" ",
"is",
" ",
"missi",
"ng",
" ",
"tr",
"v",
"3",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"complete",
" ",
"the",
" ",
"graph",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u_",
",_",
"job",
"12_",
",_",
"src_",
"=_",
"self_",
"._",
"create",
"Jo",
"b",
"Info_",
"(_",
"db_",
",_",
"tr",
"v1_",
",_",
"tr",
"v2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"second",
" ",
"job",
" ",
"include",
"s",
" ",
"the",
" ",
"need",
"ed",
" ",
"trove_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u_",
",_",
"job",
"3_",
",_",
"src",
"3_",
"=_",
"self_",
"._",
"create",
"Jo",
"b",
"Info_",
"(_",
"db_",
",_",
"tr",
"v3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Merge",
" ",
"the",
" ",
"second",
" ",
"job",
"'",
"s",
" ",
"changeset",
" ",
"int",
"o",
" ",
"the",
" ",
"first",
" ",
"so",
" ",
"the",
" ",
"trove",
" ",
"source_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"is",
" ",
"complete",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"src_",
"._",
"add",
"Change",
"Sets_",
"(_",
"src",
"3_",
"._",
"cs",
"List_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"checker_",
"=_",
"db_",
"._",
"db_",
"._",
"dependen",
"cy",
"Checker_",
"(_",
"src_",
",_",
"find",
"Order",
"ing_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fi",
"rst",
" ",
"pass",
":",
" ",
"missi",
"ng",
" ",
"one",
" ",
"dep_",
"\\u\\u\\uNL\\u\\u\\u_",
"checker_",
"._",
"add",
"Jobs_",
"(_",
"job",
"12_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"=_",
"checker_",
"._",
"check_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"result_",
"._",
"unsa",
"tis",
"fied",
"List_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"(_",
"(_",
"'",
"tr",
"v1",
":",
"runt",
"ime",
"'_",
",_",
"self_",
"._",
"new_",
",_",
"self_",
"._",
"fl",
"v_",
")_",
",_",
"dep",
"3_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Second",
" ",
"pass",
":",
" ",
"add",
" ",
"provider_",
"\\u\\u\\uNL\\u\\u\\u_",
"checker_",
"._",
"add",
"Jobs_",
"(_",
"job",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"=_",
"checker_",
"._",
"check_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"result_",
"._",
"unsa",
"tis",
"fied",
"List_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"tr",
"v1",
" ",
"and",
" ",
"tr",
"v2",
" ",
"require",
" ",
"each",
" ",
"other",
" ",
"and",
" ",
"so",
" ",
"constitu",
"te",
" ",
"a",
" ",
"single",
" ",
"job",
",",
" ",
"tr",
"v3_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"is",
" ",
"not",
" ",
"part",
" ",
"of",
" ",
"the",
" ",
"cycle",
" ",
"so",
" ",
"it",
" ",
"is",
" ",
"a",
" ",
"separate",
" ",
"job",
".",
" ",
"The",
" ",
"original",
" ",
"bug_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"wou",
"ld",
" ",
"have",
" ",
"all",
" ",
"three",
" ",
"trove",
"s",
" ",
"as",
" ",
"separate",
" ",
"jobs",
" ",
"sinc",
"e",
" ",
"it",
" ",
"forgo",
"t",
" ",
"about_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"dep",
"s",
" ",
"from",
" ",
"the",
" ",
"first",
" ",
"check",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"checker_",
"._",
"done_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"result_",
"._",
"get",
"Change",
"Set",
"List_",
"(_",
")_",
",_",
"[_",
"job",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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
] |
Imprecise assert | codalab/codalab-cli/tests/lib/canonicalize_test.py | [
{
"content": " def test_get_bundle_uuid(self):\n tester = self\n\n worksheet_uuid = '0x12345'\n missing_name = 'missing_name'\n unique_name = 'unique_name'\n ambiguous_name = 'ambiguous_name'\n bundle_counts = {\n missing_name: 0,\n unique_name: 1,\n ambiguous_name: 2,\n }\n test_uuids = ['test_uuid_0', 'test_uuid_1', 'test_uuid_2']\n test_uuid = test_uuids[0]\n\n class MockBundleModel(object):\n def get_bundle_uuids(self, conditions, max_results, count=False):\n tester.assertEqual(set(conditions), set(['name', 'user_id', 'worksheet_uuid']))\n name = conditions['name'].replace('%', '')\n tester.assertIn(name, bundle_counts)\n count = bundle_counts[name]\n return [\n test_uuids[i]\n for i in range(count)\n ]\n model = MockBundleModel()\n user_id = None\n\n # Test that get_bundle_uuid is idempotent on generated uuids.\n uuid = spec_util.generate_uuid()\n self.assertEqual(uuid, canonicalize.get_bundle_uuid(model, user_id, worksheet_uuid, uuid))\n # Test that get_bundle_uuid returns the uuid of a uniquely named bundle.\n self.assertEqual(test_uuid, canonicalize.get_bundle_uuid(model, user_id, worksheet_uuid, unique_name))\n # Test that get_bundle_uuid raises UsageErrors on missing names.\n self.assertRaises(\n UsageError,\n lambda: canonicalize.get_bundle_uuid(model, user_id, worksheet_uuid, missing_name),\n )\n # Test that get_bundle_uuid raises UsageError on specs that can be neither a\n # name or a uuid.\n self.assertRaises(\n UsageError,\n lambda: canonicalize.get_bundle_uuid(model, user_id, worksheet_uuid, 'names have no exclamations!'),\n )",
"metadata": "root.CanonicalizeTest.test_get_bundle_uuid",
"header": "['class', 'CanonicalizeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 15
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Canonical",
"ize",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test\\u",
"get",
"\\u",
"bundle",
"\\u",
"uuid_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tester_",
"=_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"worksheet",
"\\u",
"uuid_",
"=_",
"'",
"0x12",
"345",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"missi",
"ng",
"\\u",
"name_",
"=_",
"'",
"missi",
"ng",
"\\u",
"name",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"unique",
"\\u",
"name_",
"=_",
"'",
"unique",
"\\u",
"name",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ambiguous",
"\\u",
"name_",
"=_",
"'",
"ambiguous",
"\\u",
"name",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bundle",
"\\u",
"counts_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"missi",
"ng",
"\\u",
"name_",
":_",
"0_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"unique",
"\\u",
"name_",
":_",
"1_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ambiguous",
"\\u",
"name_",
":_",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"test\\u",
"uuids_",
"=_",
"[_",
"'",
"test\\u",
"uuid",
"\\u",
"0",
"'_",
",_",
"'",
"test\\u",
"uuid",
"\\u",
"1",
"'_",
",_",
"'",
"test\\u",
"uuid",
"\\u",
"2",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"test\\u",
"uuid_",
"=_",
"test\\u",
"uuids_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Moc",
"k",
"Bun",
"dle",
"Model_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"get",
"\\u",
"bundle",
"\\u",
"uuids_",
"(_",
"self_",
",_",
"conditions_",
",_",
"max",
"\\u",
"results_",
",_",
"count_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tester_",
"._",
"assert",
"Equal_",
"(_",
"set_",
"(_",
"conditions_",
")_",
",_",
"set_",
"(_",
"[_",
"'",
"name",
"'_",
",_",
"'",
"user",
"\\u",
"id",
"'_",
",_",
"'",
"worksheet",
"\\u",
"uuid",
"'_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"name_",
"=_",
"conditions_",
"[_",
"'",
"name",
"'_",
"]_",
"._",
"replace_",
"(_",
"'%'_",
",_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tester_",
"._",
"assert",
"In_",
"(_",
"name_",
",_",
"bundle",
"\\u",
"counts_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"count_",
"=_",
"bundle",
"\\u",
"counts_",
"[_",
"name_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"test\\u",
"uuids_",
"[_",
"i_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"i_",
"in_",
"range_",
"(_",
"count_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"model_",
"=_",
"Moc",
"k",
"Bun",
"dle",
"Model_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"user",
"\\u",
"id_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Test",
" ",
"tha",
"t",
" ",
"get",
"\\u",
"bundle",
"\\u",
"uuid",
" ",
"is",
" ",
"idempotent",
" ",
"on",
" ",
"generat",
"ed",
" ",
"uuids",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"uuid_",
"=_",
"spec",
"\\u",
"util_",
"._",
"generat",
"e\\u",
"uuid_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"uuid_",
",_",
"canonicaliz",
"e_",
"._",
"get",
"\\u",
"bundle",
"\\u",
"uuid_",
"(_",
"model_",
",_",
"user",
"\\u",
"id_",
",_",
"worksheet",
"\\u",
"uuid_",
",_",
"uuid_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Test",
" ",
"tha",
"t",
" ",
"get",
"\\u",
"bundle",
"\\u",
"uuid",
" ",
"return",
"s",
" ",
"the",
" ",
"uuid",
" ",
"of",
" ",
"a",
" ",
"unique",
"ly",
" ",
"named",
" ",
"bundle",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"test\\u",
"uuid_",
",_",
"canonicaliz",
"e_",
"._",
"get",
"\\u",
"bundle",
"\\u",
"uuid_",
"(_",
"model_",
",_",
"user",
"\\u",
"id_",
",_",
"worksheet",
"\\u",
"uuid_",
",_",
"unique",
"\\u",
"name_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Test",
" ",
"tha",
"t",
" ",
"get",
"\\u",
"bundle",
"\\u",
"uuid",
" ",
"raise",
"s",
" ",
"Us",
"age",
"Error",
"s",
" ",
"on",
" ",
"missi",
"ng",
" ",
"names",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Us",
"age",
"Error_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"lambda_",
":_",
"canonicaliz",
"e_",
"._",
"get",
"\\u",
"bundle",
"\\u",
"uuid_",
"(_",
"model_",
",_",
"user",
"\\u",
"id_",
",_",
"worksheet",
"\\u",
"uuid_",
",_",
"missi",
"ng",
"\\u",
"name_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Test",
" ",
"tha",
"t",
" ",
"get",
"\\u",
"bundle",
"\\u",
"uuid",
" ",
"raise",
"s",
" ",
"Us",
"age",
"Error",
" ",
"on",
" ",
"spec",
"s",
" ",
"tha",
"t",
" ",
"can",
" ",
"be",
" ",
"nei",
"ther",
" ",
"a_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"name",
" ",
"or",
" ",
"a",
" ",
"uuid",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
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[
{
"content": "import logging\nimport json\nimport operator\nimport traceback\nimport string\nimport os\nimport re\nimport sys\n\n# Local module imports\nfrom . import parsing\n\n# Python 3 compatibility shims\nfrom . import six\nfrom .six import binary_type\nfrom .six import text_type\n\n# Python 3 compatibility\nPYTHON_MAJOR_VERSION = sys.version_info[0]\nif PYTHON_MAJOR_VERSION > 2:\n from past.builtins import basestring\n from past.builtins import long\n\n\"\"\"\nValidator/Extractor logic for utility use\nDefines objects:\n- Extractors that take a text body and context, and return a result from the (text) body\n- Validators (functions) that take a text body and context, and validate the body\n- Several useful implementations for each:\n\nExtractors:\n - json mini extractor (sudo-jsonpath)\n\nValidators:\n - TEST validator, config includes and extractor function and test name, applies test to extract results\n - Uses VALIDATOR_TESTS, for pluggable test functions\n - comparator validator:\n - runs named extractor, compares to expected value (can be template or extractor)\n - uses (pluggable) comparator function for comparison\n\n\"\"\"\n\nlogger = logging.getLogger('pyresttest.validators')\n\n\n# Binary comparison tests\nCOMPARATORS = {\n 'count_eq': lambda x, y: safe_length(x) == y,\n 'lt': operator.lt,\n 'less_than': operator.lt,\n 'le': operator.lt,\n 'less_than_or_equal': operator.lt,\n 'eq': operator.eq,\n 'equals': operator.eq,\n 'str_eq': lambda x, y: operator.eq(str(x), str(y)),\n 'ne': operator.ne,\n 'not_equals': operator.ne,\n 'ge': operator.ge,\n 'greater_than_or_equal': operator.ge,\n 'gt': operator.gt,\n 'greater_than': operator.gt,\n 'contains': lambda x, y: x and operator.contains(x, y), # is y in x\n 'contained_by': lambda x, y: y and operator.contains(y, x), # is x in y\n 'regex': lambda x, y: regex_compare(str(x), str(y)),\n 'type': lambda x, y: test_type(x, y)\n}\nCOMPARATORS['length_eq'] = COMPARATORS['count_eq']\n\n# Allow for testing basic types in comparators\nTYPES = {\n 'null': type(None),\n 'none': type(None),\n 'number': (int, long, float),\n 'int': (int, long),\n 'float': float,\n 'boolean': bool,\n 'string': basestring,\n 'array': list,\n 'list': list,\n 'dict': dict,\n 'map': dict,\n 'scalar': (bool, int, long, float, basestring, type(None)),\n 'collection': (list, dict, set)\n}\n\n\n\n# Unury comparison tests\nVALIDATOR_TESTS = {\n 'exists': lambda x: x is not None,\n 'not_exists': lambda x: x is None\n}\n\n# Validators and Extractors are registered once their parse functions exist\nEXTRACTORS = dict()\nVALIDATORS = dict()\n\n\n\n\n\n# Validator Failure Reasons\nFAILURE_INVALID_RESPONSE = 'Invalid HTTP Response Code'\nFAILURE_CURL_EXCEPTION = 'Curl Exception'\nFAILURE_TEST_EXCEPTION = 'Test Execution Exception'\nFAILURE_VALIDATOR_FAILED = 'Validator Failed'\nFAILURE_VALIDATOR_EXCEPTION = 'Validator Exception'\nFAILURE_EXTRACTOR_EXCEPTION = 'Extractor Exception'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# --- REGISTRY OF EXTRACTORS AND VALIDATORS ---\nregister_extractor('jsonpath_mini', MiniJsonExtractor.parse)\nregister_extractor('header', HeaderExtractor.parse)\nregister_extractor('raw_body', RawBodyExtractor.parse)\n# ENHANCEME: add JsonPath-rw support for full JsonPath syntax\n# ENHANCEME: add elementree support for xpath extract on XML, very simple no?\n# See: https://docs.python.org/2/library/xml.etree.elementtree.html,\n# findall syntax\n\nregister_validator('comparator', ComparatorValidator.parse)\nregister_validator('compare', ComparatorValidator.parse)\nregister_validator('assertEqual', ComparatorValidator.parse)\nregister_validator('extract_test', ExtractTestValidator.parse)\nregister_validator('assertTrue', ExtractTestValidator.parse)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Import_",
"of_",
"deprecated_",
"module_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"logging_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"json_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"operator_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"traceback_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"string_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Local",
" ",
"module",
" ",
"imports_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"import_",
"parsing_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Pyth",
"on",
" ",
"3",
" ",
"compatibility",
" ",
"shi",
"ms_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"import_",
"six_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"six_",
"import_",
"binar",
"y",
"\\u",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"six_",
"import_",
"text",
"\\u",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Pyth",
"on",
" ",
"3",
" ",
"compatibility",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"PYTHON",
"\\u",
"MAJOR",
"\\u",
"VERSION_",
"=_",
"sys_",
"._",
"version",
"\\u",
"info_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"PYTHON",
"\\u",
"MAJOR",
"\\u",
"VERSION_",
">_",
"2_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"past_",
"._",
"builtins_",
"import_",
"basestring_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"past_",
"._",
"builtins_",
"import_",
"long_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Validat",
"or",
"/",
"Extract",
"or",
" ",
"logic",
" ",
"for",
" ",
"utility",
" ",
"use",
"\\",
"10",
";",
"Define",
"s",
" ",
"object",
"s",
":",
"\\",
"10",
";",
"-",
" ",
"Extract",
"ors",
" ",
"tha",
"t",
" ",
"take",
" ",
"a",
" ",
"text",
" ",
"body",
" ",
"and",
" ",
"context",
",",
" ",
"and",
" ",
"return",
" ",
"a",
" ",
"result",
" ",
"from",
" ",
"the",
" ",
"(",
"text",
")",
" ",
"body",
"\\",
"10",
";",
"-",
" ",
"Validat",
"ors",
" ",
"(",
"function",
"s",
")",
" ",
"tha",
"t",
" ",
"take",
" ",
"a",
" ",
"text",
" ",
"body",
" ",
"and",
" ",
"context",
",",
" ",
"and",
" ",
"validat",
"e",
" ",
"the",
" ",
"body",
"\\",
"10",
";",
"-",
" ",
"Seve",
"ral",
" ",
"usef",
"ul",
" ",
"implementation",
"s",
" ",
"for",
" ",
"each",
":",
"\\",
"10",
";",
"\\",
"10",
";",
"Extract",
"ors",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"json",
" ",
"mini",
" ",
"extract",
"or",
" ",
"(",
"sudo",
"-",
"jsonp",
"ath",
")",
"\\",
"10",
";",
"\\",
"10",
";",
"Validat",
"ors",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"TEST",
" ",
"validator",
",",
" ",
"config",
" ",
"include",
"s",
" ",
"and",
" ",
"extract",
"or",
" ",
"function",
" ",
"and",
" ",
"test",
" ",
"name",
",",
" ",
"appli",
"es",
" ",
"test",
" ",
"to",
" ",
"extract",
" ",
"results",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"Us",
"es",
" ",
"VALIDATOR",
"\\u",
"TESTS",
",",
" ",
"for",
" ",
"plug",
"gab",
"le",
" ",
"test",
" ",
"function",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"comparator",
" ",
"validator",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"runs",
" ",
"named",
" ",
"extract",
"or",
",",
" ",
"compare",
"s",
" ",
"to",
" ",
"expected",
" ",
"value",
" ",
"(",
"can",
" ",
"be",
" ",
"template",
" ",
"or",
" ",
"extract",
"or",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"use",
"s",
" ",
"(",
"plug",
"gab",
"le",
")",
" ",
"comparator",
" ",
"function",
" ",
"for",
" ",
"compa",
"ris",
"on",
"\\",
"10",
";",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"logger_",
"=_",
"logging_",
"._",
"get",
"Logger_",
"(_",
"'",
"pyre",
"stt",
"est",
".",
"validator",
"s",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Bin",
"ary",
" ",
"compa",
"ris",
"on",
" ",
"tests_",
"\\u\\u\\uNL\\u\\u\\u_",
"COMPA",
"RAT",
"ORS",
"_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"count",
"\\u",
"eq",
"'_",
":_",
"lambda_",
"x_",
",_",
"y_",
":_",
"safe",
"\\u",
"length_",
"(_",
"x_",
")_",
"==_",
"y_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"lt",
"'_",
":_",
"operator_",
"._",
"lt_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"less",
"\\u",
"than",
"'_",
":_",
"operator_",
"._",
"lt_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"le",
"'_",
":_",
"operator_",
"._",
"lt_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"less",
"\\u",
"than",
"\\u",
"or",
"\\u",
"equal",
"'_",
":_",
"operator_",
"._",
"lt_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"eq",
"'_",
":_",
"operator_",
"._",
"eq_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"equals",
"'_",
":_",
"operator_",
"._",
"eq_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"str",
"\\u",
"eq",
"'_",
":_",
"lambda_",
"x_",
",_",
"y_",
":_",
"operator_",
"._",
"eq_",
"(_",
"str_",
"(_",
"x_",
")_",
",_",
"str_",
"(_",
"y_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ne",
"'_",
":_",
"operator_",
"._",
"ne_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"not",
"\\u",
"equals",
"'_",
":_",
"operator_",
"._",
"ne_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ge",
"'_",
":_",
"operator_",
"._",
"ge_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"great",
"er",
"\\u",
"than",
"\\u",
"or",
"\\u",
"equal",
"'_",
":_",
"operator_",
"._",
"ge_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"gt",
"'_",
":_",
"operator_",
"._",
"gt_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"great",
"er",
"\\u",
"than",
"'_",
":_",
"operator_",
"._",
"gt_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"contain",
"s",
"'_",
":_",
"lambda_",
"x_",
",_",
"y_",
":_",
"x_",
"and_",
"operator_",
"._",
"contains_",
"(_",
"x_",
",_",
"y_",
")_",
",_",
"#",
" ",
"is",
" ",
"y",
" ",
"in",
" ",
"x_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"contain",
"ed",
"\\u",
"by",
"'_",
":_",
"lambda_",
"x_",
",_",
"y_",
":_",
"y_",
"and_",
"operator_",
"._",
"contains_",
"(_",
"y_",
",_",
"x_",
")_",
",_",
"#",
" ",
"is",
" ",
"x",
" ",
"in",
" ",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"regex",
"'_",
":_",
"lambda_",
"x_",
",_",
"y_",
":_",
"regex",
"\\u",
"compare_",
"(_",
"str_",
"(_",
"x_",
")_",
",_",
"str_",
"(_",
"y_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"type",
"'_",
":_",
"lambda_",
"x_",
",_",
"y_",
":_",
"test\\u",
"type_",
"(_",
"x_",
",_",
"y_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPA",
"RAT",
"ORS",
"_",
"[_",
"'",
"length",
"\\u",
"eq",
"'_",
"]_",
"=_",
"COMPA",
"RAT",
"ORS",
"_",
"[_",
"'",
"count",
"\\u",
"eq",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
"ow",
" ",
"for",
" ",
"testi",
"ng",
" ",
"basic",
" ",
"types",
" ",
"in",
" ",
"comparator",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"TYPES_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"null",
"'_",
":_",
"type_",
"(_",
"None_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"none",
"'_",
":_",
"type_",
"(_",
"None_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"number",
"'_",
":_",
"(_",
"int_",
",_",
"long_",
",_",
"float_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"int",
"'_",
":_",
"(_",
"int_",
",_",
"long_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"float",
"'_",
":_",
"float_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"boolean",
"'_",
":_",
"bool_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"string",
"'_",
":_",
"basestring_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"array",
"'_",
":_",
"list_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"list",
"'_",
":_",
"list_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"dict",
"'_",
":_",
"dict_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"map",
"'_",
":_",
"dict_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"scala",
"r",
"'_",
":_",
"(_",
"bool_",
",_",
"int_",
",_",
"long_",
",_",
"float_",
",_",
"basestring_",
",_",
"type_",
"(_",
"None_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"collection",
"'_",
":_",
"(_",
"list_",
",_",
"dict_",
",_",
"set_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Un",
"ur",
"y",
" ",
"compa",
"ris",
"on",
" ",
"tests_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"VALIDATOR",
"\\u",
"TESTS_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"exist",
"s",
"'_",
":_",
"lambda_",
"x_",
":_",
"x_",
"is_",
"not_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"not",
"\\u",
"exist",
"s",
"'_",
":_",
"lambda_",
"x_",
":_",
"x_",
"is_",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Validat",
"ors",
" ",
"and",
" ",
"Extract",
"ors",
" ",
"are",
" ",
"register",
"ed",
" ",
"onc",
"e",
" ",
"thei",
"r",
" ",
"parse",
" ",
"function",
"s",
" ",
"exist_",
"\\u\\u\\uNL\\u\\u\\u_",
"EXTRACT",
"ORS",
"_",
"=_",
"dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"VALIDATOR",
"S_",
"=_",
"dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Validat",
"or",
" ",
"Fail",
"ure",
" ",
"Rea",
"sons",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"FAIL",
"URE",
"\\u",
"INVALID",
"\\u",
"RESPONSE_",
"=_",
"'",
"Inva",
"lid",
" ",
"HTTP",
" ",
"Respons",
"e",
" ",
"Code",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FAIL",
"URE",
"\\u",
"CUR",
"L",
"\\u",
"EXCEPTION_",
"=_",
"'",
"Curl",
" ",
"Except",
"ion",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FAIL",
"URE",
"\\u",
"TEST",
"\\u",
"EXCEPTION_",
"=_",
"'",
"Test",
" ",
"Execut",
"ion",
" ",
"Except",
"ion",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FAIL",
"URE",
"\\u",
"VALIDATOR",
"\\u",
"FAILED_",
"=_",
"'",
"Validat",
"or",
" ",
"Fail",
"ed",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FAIL",
"URE",
"\\u",
"VALIDATOR",
"\\u",
"EXCEPTION_",
"=_",
"'",
"Validat",
"or",
" ",
"Except",
"ion",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FAIL",
"URE",
"\\u",
"EXTRACT",
"OR",
"\\u",
"EXCEPTION_",
"=_",
"'",
"Extract",
"or",
" ",
"Except",
"ion",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"---",
" ",
"REGISTRY",
" ",
"OF",
" ",
"EXTRACT",
"ORS",
" ",
"AND",
" ",
"VALIDATOR",
"S",
" ",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"register",
"\\u",
"extractor_",
"(_",
"'",
"jsonp",
"ath",
"\\u",
"mini",
"'_",
",_",
"Mini",
"Js",
"on",
"Extractor_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"register",
"\\u",
"extractor_",
"(_",
"'",
"header",
"'_",
",_",
"Head",
"er",
"Extractor_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"register",
"\\u",
"extractor_",
"(_",
"'",
"raw",
"\\u",
"body",
"'_",
",_",
"Ra",
"w",
"Bod",
"y",
"Extractor_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"EN",
"HAN",
"CE",
"ME",
":",
" ",
"add",
" ",
"Js",
"on",
"Path",
"-",
"rw",
" ",
"support",
" ",
"for",
" ",
"full",
" ",
"Js",
"on",
"Path",
" ",
"syntax_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"EN",
"HAN",
"CE",
"ME",
":",
" ",
"add",
" ",
"element",
"ree",
" ",
"support",
" ",
"for",
" ",
"xpa",
"th",
" ",
"extract",
" ",
"on",
" ",
"XML",
",",
" ",
"very",
" ",
"simple",
" ",
"no",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"See",
":",
" ",
"https",
"://",
"docs",
".",
"python",
".",
"org",
"/",
"2",
"/",
"librar",
"y",
"/",
"xml",
".",
"etree",
".",
"element",
"tree",
".",
"html",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"find",
"all",
" ",
"syntax_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"register",
"\\u",
"validator_",
"(_",
"'",
"comparator",
"'_",
",_",
"Compara",
"tor",
"Validator_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"register",
"\\u",
"validator_",
"(_",
"'",
"compare",
"'_",
",_",
"Compara",
"tor",
"Validator_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"register",
"\\u",
"validator_",
"(_",
"'",
"assert",
"Equal",
"'_",
",_",
"Compara",
"tor",
"Validator_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"register",
"\\u",
"validator_",
"(_",
"'",
"extract",
"\\u",
"test",
"'_",
",_",
"Extract",
"Test",
"Validator_",
"._",
"parse_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"register",
"\\u",
"validator_",
"(_",
"'",
"assert",
"Tru",
"e",
"'_",
",_",
"Extract",
"Test",
"Validator_",
"._",
"parse_",
")_"
] | [
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,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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
] |
Insecure temporary file | BD2KGenomics/toil/src/toil/lib/bioio.py | [
{
"content": "def parseBasicOptions(parser):\n \"\"\"Setups the standard things from things added by getBasicOptionParser.\n \"\"\"\n options = parser.parse_args()\n\n setLoggingFromOptions(options)\n\n #Set up the temp dir root\n if options.tempDirRoot == \"None\": # FIXME: Really, a string containing the word None?\n options.tempDirRoot = tempfile.gettempdir()\n\n return options",
"metadata": "root.parseBasicOptions",
"header": "['module', '___EOS___']",
"index": 255
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Inse",
"cure",
"_",
"temporar",
"y_",
"file_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"parse",
"Basic",
"Options_",
"(_",
"parser_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Set",
"ups",
" ",
"the",
" ",
"standard",
" ",
"thing",
"s",
" ",
"from",
" ",
"thing",
"s",
" ",
"adde",
"d",
" ",
"by",
" ",
"get",
"Basic",
"Optio",
"n",
"Parser",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"options_",
"=_",
"parser_",
"._",
"parse",
"\\u",
"args_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"set",
"Log",
"ging",
"Fro",
"m",
"Options_",
"(_",
"options_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"Set",
" ",
"up",
" ",
"the",
" ",
"temp",
" ",
"dir",
" ",
"root_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"options_",
"._",
"temp",
"Dir",
"Root_",
"==_",
"\"",
"Non",
"e",
"\"_",
":_",
"#",
" ",
"FIX",
"ME",
":",
" ",
"Real",
"ly",
",",
" ",
"a",
" ",
"string",
" ",
"contain",
"ing",
" ",
"the",
" ",
"word",
" ",
"Non",
"e",
"?",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"options_",
"._",
"temp",
"Dir",
"Root_",
"=_",
"tempfile_",
"._",
"gettempdir_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"options_",
"\\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
] |
Unused import | owocki/pytrader/history/management/commands/predict_many_sk.py | [
{
"content": "from django.core.management.base import BaseCommand\nfrom history.models import ClassifierTest\nfrom django.conf import settings\nfrom history.tools import print_and_log\nfrom multiprocessing import Pool\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def do_classifier_test(name, ticker, data_set_inputs, granularity, min_back, timedelta_back):\n try:\n ct = ClassifierTest(name=name,\n type='mock',\n symbol=ticker,\n datasetinputs=data_set_inputs,\n granularity=granularity,\n minutes_back=min_back,\n timedelta_back_in_granularity_increments=timedelta_back)\n ct.get_classifier()\n ct.save()\n return_data = \"(ct) {} {} {} {} {} {} returned {}% correct \".format(name, ticker, data_set_inputs,\n granularity,\n min_back,\n timedelta_back,\n ct.percent_correct)\n\n print_and_log(return_data)\n # Hack to only graph successful charts, until we figure out this warning\n # http://bits.owocki.com/010Z1M3d170p/Image%202016-03-02%20at%208.30.17%20AM.png\n if ct.percent_correct > 60 or not settings.MAKE_TRADES:\n ct.graph(ct.graph_url())\n return return_data\n except Exception as e:\n return \"Exception in {} {} {} {} {} {}: {}\".format(name, ticker, data_set_inputs,\n granularity,\n min_back,\n timedelta_back,\n str(e))",
"metadata": "root.do_classifier_test",
"header": "['module', '___EOS___']",
"index": 7
},
{
"content": "class Command(BaseCommand):\n\n help = 'tests various settings that could make the NN more accurate'\n result_list = []\n\n",
"metadata": "root.Command",
"header": "['module', '___EOS___']",
"index": 38
},
{
"content": " def _log_results(self, result):\n self.result_list.append(result)",
"metadata": "root.Command._log_results",
"header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']",
"index": 43
},
{
"content": " def handle(self, *args, **options):\n\n pool = Pool(settings.NUM_THREADS)\n conf = settings.TRAINER_CURRENCY_CONFIG['classifiers']\n print(\"Starting SK run\")\n for ticker in conf['ticker']:\n for min_back in conf['min_back']:\n for granularity in conf['granularity']:\n for datasetinputs in conf['datasetinputs']:\n for timedelta_back_in_granularity_increments in \\\n conf['timedelta_back_in_granularity_increments']:\n for name in conf['name']:\n pool.apply_async(do_classifier_test, args=(\n name,\n ticker,\n datasetinputs,\n granularity,\n min_back,\n timedelta_back_in_granularity_increments\n ), callback=self._log_results)\n print(\"All SK jobs queued\")\n pool.close()\n pool.join()\n print(\"SK run complete\")\n for result in self.result_list:\n print(result)",
"metadata": "root.Command.handle",
"header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']",
"index": 46
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"management_",
"._",
"base_",
"import_",
"Base",
"Command_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"history_",
"._",
"models_",
"import_",
"Classif",
"ier",
"Test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"conf_",
"import_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"history_",
"._",
"tools_",
"import_",
"print",
"\\u",
"and",
"\\u",
"log_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"multiprocessing_",
"import_",
"Pool_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"do",
"\\u",
"classif",
"ier",
"\\u",
"test_",
"(_",
"name_",
",_",
"ticker_",
",_",
"data\\u",
"set\\u",
"inputs_",
",_",
"granularity",
"_",
",_",
"min",
"\\u",
"back_",
",_",
"timedelta",
"\\u",
"back_",
")_",
":_",
"\\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 ",
" _",
"ct_",
"=_",
"Classif",
"ier",
"Test_",
"(_",
"name_",
"=_",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"type_",
"=_",
"'",
"mock",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"symbol_",
"=_",
"ticker_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"dataset",
"inputs_",
"=_",
"data\\u",
"set\\u",
"inputs_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"granularity",
"_",
"=_",
"granularity",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"minute",
"s",
"\\u",
"back_",
"=_",
"min",
"\\u",
"back_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"timedelta",
"\\u",
"back",
"\\u",
"in",
"\\u",
"granularity",
"\\u",
"increment",
"s_",
"=_",
"timedelta",
"\\u",
"back_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ct_",
"._",
"get",
"\\u",
"classifier_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ct_",
"._",
"save_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return",
"\\u",
"data_",
"=_",
"\"(",
"ct",
")",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"return",
"ed",
" ",
"{}",
"%",
" ",
"correct",
" ",
"\"_",
"._",
"format_",
"(_",
"name_",
",_",
"ticker_",
",_",
"data\\u",
"set\\u",
"inputs_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"granularity",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"min",
"\\u",
"back_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"timedelta",
"\\u",
"back_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ct_",
"._",
"percent",
"\\u",
"correct_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"print",
"\\u",
"and",
"\\u",
"log_",
"(_",
"return",
"\\u",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Hack",
" ",
"to",
" ",
"only",
" ",
"graph",
" ",
"success",
"ful",
" ",
"charts",
",",
" ",
"unti",
"l",
" ",
"we",
" ",
"figure",
" ",
"out",
" ",
"this",
" ",
"warning_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"http",
"://",
"bits",
".",
"ow",
"ock",
"i",
".",
"com",
"/",
"010",
"Z",
"1",
"M3",
"d1",
"7",
"0",
"p",
"/",
"Image",
"%",
"2020",
"16",
"-0",
"3",
"-0",
"2",
"%",
"20",
"at",
"%",
"208",
".3",
"0.17",
"%",
"20",
"AM",
".",
"png_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"ct_",
"._",
"percent",
"\\u",
"correct_",
">_",
"60_",
"or_",
"not_",
"settings_",
"._",
"MAKE",
"\\u",
"TRA",
"DES",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ct_",
"._",
"graph_",
"(_",
"ct_",
"._",
"graph",
"\\u",
"url_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"return",
"\\u",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Exception_",
"as_",
"e_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"",
"Except",
"ion",
" ",
"in",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"{}",
" ",
"{}:",
" ",
"{}\"_",
"._",
"format_",
"(_",
"name_",
",_",
"ticker_",
",_",
"data\\u",
"set\\u",
"inputs_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"granularity",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"min",
"\\u",
"back_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"timedelta",
"\\u",
"back_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"str_",
"(_",
"e_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Command_",
"(_",
"Base",
"Command_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"help_",
"=_",
"'",
"tests",
" ",
"vari",
"ous",
" ",
"settings",
" ",
"tha",
"t",
" ",
"coul",
"d",
" ",
"make",
" ",
"the",
" ",
"NN",
" ",
"more",
" ",
"accurate",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result",
"\\u",
"list_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Command_",
"(_",
"Base",
"Command_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u",
"log",
"\\u",
"results_",
"(_",
"self_",
",_",
"result_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"result",
"\\u",
"list_",
"._",
"append_",
"(_",
"result_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Command_",
"(_",
"Base",
"Command_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"handle_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"options_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pool_",
"=_",
"Pool_",
"(_",
"settings_",
"._",
"NUM",
"\\u",
"THREADS",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"conf_",
"=_",
"settings_",
"._",
"TRAIN",
"ER",
"\\u",
"CURREN",
"CY",
"\\u",
"CONFIG_",
"[_",
"'",
"classif",
"iers",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"print_",
"(_",
"\"",
"Start",
"ing",
" ",
"SK",
" ",
"run",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"ticker_",
"in_",
"conf_",
"[_",
"'",
"ticker",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"min",
"\\u",
"back_",
"in_",
"conf_",
"[_",
"'",
"min",
"\\u",
"back",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"granularity",
"_",
"in_",
"conf_",
"[_",
"'",
"granularity",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"dataset",
"inputs_",
"in_",
"conf_",
"[_",
"'",
"dataset",
"inputs",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"for_",
"timedelta",
"\\u",
"back",
"\\u",
"in",
"\\u",
"granularity",
"\\u",
"increment",
"s_",
"in_",
"conf_",
"[_",
"'",
"timedelta",
"\\u",
"back",
"\\u",
"in",
"\\u",
"granularity",
"\\u",
"increment",
"s",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"for_",
"name_",
"in_",
"conf_",
"[_",
"'",
"name",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"pool_",
"._",
"appl",
"y",
"\\u",
"async_",
"(_",
"do",
"\\u",
"classif",
"ier",
"\\u",
"test_",
",_",
"args_",
"=_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ticker_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"dataset",
"inputs_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"granularity",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"min",
"\\u",
"back_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"timedelta",
"\\u",
"back",
"\\u",
"in",
"\\u",
"granularity",
"\\u",
"increment",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"callback_",
"=_",
"self_",
"._",
"\\u",
"log",
"\\u",
"results_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"print_",
"(_",
"\"",
"All",
" ",
"SK",
" ",
"jobs",
" ",
"queue",
"d",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pool_",
"._",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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
] |
Module is imported with 'import' and 'import from' | ardekantur/pyglet/pyglet/graphics/vertexattribute.py | [
{
"content": "# ----------------------------------------------------------------------------\n# pyglet\n# Copyright (c) 2006-2008 Alex Holkner\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 \n# are met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# * Redistributions in binary form must reproduce the above copyright \n# notice, this list of conditions and the following disclaimer in\n# the documentation and/or other materials provided with the\n# distribution.\n# * Neither the name of pyglet nor the names of its\n# contributors may be used to endorse or promote products\n# derived from this software without specific prior written\n# 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\n# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n# ----------------------------------------------------------------------------\n# $Id:$\n\n'''Access byte arrays as arrays of vertex attributes.\n\nUse `create_attribute` to create an attribute accessor given a simple format\nstring. Alternatively, the classes may be constructed directly.\n\nAttribute format strings\n========================\n\nAn attribute format string specifies the format of a vertex attribute. Format\nstrings are accepted by the `create_attribute` function as well as most\nmethods in the `pyglet.graphics` module.\n\nFormat strings have the following (BNF) syntax::\n\n attribute ::= ( name | index 'g' 'n'? | texture 't' ) count type\n\n``name`` describes the vertex attribute, and is one of the following\nconstants for the predefined attributes:\n\n``c``\n Vertex color\n``e``\n Edge flag\n``f``\n Fog coordinate\n``n``\n Normal vector\n``s``\n Secondary color\n``t``\n Texture coordinate\n``v``\n Vertex coordinate\n\nYou can alternatively create a generic indexed vertex attribute by\nspecifying its index in decimal followed by the constant ``g``. For\nexample, ``0g`` specifies the generic vertex attribute with index 0.\nIf the optional constant ``n`` is present after the ``g``, the\nattribute is normalised to the range ``[0, 1]`` or ``[-1, 1]`` within\nthe range of the data type.\n\nTexture coordinates for multiple texture units can be specified with the \ntexture number before the constant 't'. For example, ``1t`` gives the\ntexture coordinate attribute for texture unit 1.\n\n``count`` gives the number of data components in the attribute. For\nexample, a 3D vertex position has a count of 3. Some attributes\nconstrain the possible counts that can be used; for example, a normal\nvector must have a count of 3.\n\n``type`` gives the data type of each component of the attribute. The\nfollowing types can be used:\n\n``b``\n ``GLbyte``\n``B``\n ``GLubyte``\n``s``\n ``GLshort``\n``S``\n ``GLushort``\n``i``\n ``GLint``\n``I``\n ``GLuint``\n``f``\n ``GLfloat``\n``d``\n ``GLdouble``\n\nSome attributes constrain the possible data types; for example,\nnormal vectors must use one of the signed data types. The use of\nsome data types, while not illegal, may have severe performance\nconcerns. For example, the use of ``GLdouble`` is discouraged,\nand colours should be specified with ``GLubyte``.\n\nWhitespace is prohibited within the format string.\n\nSome examples follow:\n\n``v3f``\n 3-float vertex position\n``c4b``\n 4-byte colour\n``1eb``\n Edge flag\n``0g3f``\n 3-float generic vertex attribute 0\n``1gn1i``\n Integer generic vertex attribute 1, normalized to [-1, 1]\n``2gn4B``\n 4-byte generic vertex attribute 2, normalized to [0, 1] (because\n the type is unsigned)\n``3t2f``\n 2-float texture coordinate for texture unit 3.\n\n'''\n\n__docformat__ = 'restructuredtext'\n__version__ = '$Id: $'\n\nimport ctypes\nimport re\n\nfrom pyglet.gl import *\nfrom pyglet.graphics import vertexbuffer\n\n_c_types = {\n GL_BYTE: ctypes.c_byte,\n GL_UNSIGNED_BYTE: ctypes.c_ubyte,\n GL_SHORT: ctypes.c_short,\n GL_UNSIGNED_SHORT: ctypes.c_ushort,\n GL_INT: ctypes.c_int,\n GL_UNSIGNED_INT: ctypes.c_uint,\n GL_FLOAT: ctypes.c_float,\n GL_DOUBLE: ctypes.c_double,\n}\n\n_gl_types = {\n 'b': GL_BYTE,\n 'B': GL_UNSIGNED_BYTE,\n 's': GL_SHORT,\n 'S': GL_UNSIGNED_SHORT,\n 'i': GL_INT,\n 'I': GL_UNSIGNED_INT,\n 'f': GL_FLOAT,\n 'd': GL_DOUBLE,\n}\n\n_attribute_format_re = re.compile(r'''\n (?P<name>\n [cefnstv] | \n (?P<generic_index>[0-9]+) g (?P<generic_normalized>n?) |\n (?P<texcoord_texture>[0-9]+) t)\n (?P<count>[1234])\n (?P<type>[bBsSiIfd])\n''', re.VERBOSE)\n\n_attribute_cache = {}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_attribute_classes = {\n 'c': ColorAttribute,\n 'e': EdgeFlagAttribute,\n 'f': FogCoordAttribute,\n 'n': NormalAttribute,\n 's': SecondaryColorAttribute,\n 't': TexCoordAttribute,\n 'v': VertexAttribute,\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_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pyglet_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"2006",
"-",
"2008",
" ",
"Alex",
" ",
"Hol",
"kne",
"r_",
"\\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",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"are",
" ",
"met",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"*",
" ",
"Redistributi",
"ons",
" ",
"of",
" ",
"source",
" ",
"code",
" ",
"must",
" ",
"retain",
" ",
"the",
" ",
"above",
" ",
"copyright_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"notice",
",",
" ",
"this",
" ",
"list",
" ",
"of",
" ",
"condition",
"s",
" ",
"and",
" ",
"the",
" ",
"follow",
"ing",
" ",
"discl",
"aime",
"r",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"*",
" ",
"Redistributi",
"ons",
" ",
"in",
" ",
"binar",
"y",
" ",
"form",
" ",
"must",
" ",
"reproduce",
" ",
"the",
" ",
"above",
" ",
"copyr",
"ight",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"notice",
",",
" ",
"this",
" ",
"list",
" ",
"of",
" ",
"condition",
"s",
" ",
"and",
" ",
"the",
" ",
"follow",
"ing",
" ",
"discl",
"aime",
"r",
" ",
"in_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"the",
" ",
"documentation",
" ",
"and",
"/",
"or",
" ",
"other",
" ",
"material",
"s",
" ",
"provided",
" ",
"with",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"distribu",
"tion",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"*",
" ",
"Nei",
"ther",
" ",
"the",
" ",
"name",
" ",
"of",
" ",
"pyg",
"let",
" ",
"nor",
" ",
"the",
" ",
"names",
" ",
"of",
" ",
"its_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"contributor",
"s",
" ",
"may",
" ",
"be",
" ",
"used",
" ",
"to",
" ",
"endo",
"rse",
" ",
"or",
" ",
"promote",
" ",
"products_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"derive",
"d",
" ",
"from",
" ",
"this",
" ",
"software",
" ",
"with",
"out",
" ",
"specific",
" ",
"prior",
" ",
"written_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"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",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"FOR",
" ",
"A",
" ",
"PARTI",
"CUL",
"AR",
" ",
"PUR",
"POS",
"E",
" ",
"ARE",
" ",
"DISC",
"LAI",
"MED",
".",
" ",
"IN",
" ",
"NO",
" ",
"EVENT",
" ",
"SHA",
"LL",
" ",
"THE",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"COPY",
"RIG",
"HT",
" ",
"OWNER",
" ",
"OR",
" ",
"CONTRIB",
"UTO",
"RS",
" ",
"BE",
" ",
"LI",
"AB",
"LE",
" ",
"FOR",
" ",
"ANY",
" ",
"DIRECT",
",",
" ",
"INDI",
"RECT",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"INC",
"IDENT",
"AL",
",",
" ",
"SPECIAL",
",",
" ",
"EXE",
"MPL",
"ARY",
",",
" ",
"OR",
" ",
"CONS",
"EQU",
"ENTI",
"AL",
" ",
"DA",
"MAGE",
"S",
" ",
"(",
"INC",
"LU",
"DING",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"BUT",
" ",
"NOT",
" ",
"LIMIT",
"ED",
" ",
"TO",
",",
" ",
"PROC",
"URE",
"MENT",
" ",
"OF",
" ",
"SUBST",
"ITU",
"TE",
" ",
"GOOD",
"S",
" ",
"OR",
" ",
"SERVICES",
";_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"LOSS",
" ",
"OF",
" ",
"USE",
",",
" ",
"DATA",
",",
" ",
"OR",
" ",
"PROF",
"IT",
"S",
";",
" ",
"OR",
" ",
"BUS",
"INE",
"SS",
" ",
"INTER",
"RU",
"PTION",
")",
" ",
"HO",
"WE",
"VER_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"CAU",
"SED",
" ",
"AND",
" ",
"ON",
" ",
"ANY",
" ",
"THE",
"ORY",
" ",
"OF",
" ",
"LI",
"ABI",
"LIT",
"Y",
",",
" ",
"WHE",
"THER",
" ",
"IN",
" ",
"CONTR",
"ACT",
",",
" ",
"STRI",
"CT_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"LI",
"ABI",
"LIT",
"Y",
",",
" ",
"OR",
" ",
"TOR",
"T",
" ",
"(",
"INC",
"LU",
"DING",
" ",
"NEG",
"LIG",
"ENCE",
" ",
"OR",
" ",
"OTHER",
"WI",
"SE",
")",
" ",
"ARI",
"SIN",
"G",
" ",
"IN_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"ANY",
" ",
"WAY",
" ",
"OUT",
" ",
"OF",
" ",
"THE",
" ",
"USE",
" ",
"OF",
" ",
"THIS",
" ",
"SOFT",
"WARE",
",",
" ",
"EVE",
"N",
" ",
"IF",
" ",
"ADV",
"ISE",
"D",
" ",
"OF",
" ",
"THE",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"POS",
"SIB",
"ILI",
"TY",
" ",
"OF",
" ",
"SUC",
"H",
" ",
"DA",
"MAGE",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"$",
"Id",
":$",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"'''",
"Access",
" ",
"byte",
" ",
"arrays",
" ",
"as",
" ",
"arrays",
" ",
"of",
" ",
"vertex",
" ",
"attribute",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Us",
"e",
" ",
"`",
"create",
"\\u",
"attribute",
"`",
" ",
"to",
" ",
"create",
" ",
"an",
" ",
"attribute",
" ",
"accessor",
" ",
"give",
"n",
" ",
"a",
" ",
"simple",
" ",
"format",
"\\",
"10",
";",
"string",
".",
" ",
" ",
"Alternative",
"ly",
",",
" ",
"the",
" ",
"classe",
"s",
" ",
"may",
" ",
"be",
" ",
"construct",
"ed",
" ",
"direct",
"ly",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Attribute",
" ",
"format",
" ",
"string",
"s",
"\\",
"10",
";",
"==============",
"=========",
"=",
"\\",
"10",
";",
"\\",
"10",
";",
"An",
" ",
"attribute",
" ",
"format",
" ",
"string",
" ",
"speci",
"fie",
"s",
" ",
"the",
" ",
"format",
" ",
"of",
" ",
"a",
" ",
"vertex",
" ",
"attribute",
".",
" ",
" ",
"Format",
"\\",
"10",
";",
"string",
"s",
" ",
"are",
" ",
"accept",
"ed",
" ",
"by",
" ",
"the",
" ",
"`",
"create",
"\\u",
"attribute",
"`",
" ",
"function",
" ",
"as",
" ",
"well",
" ",
"as",
" ",
"most",
"\\",
"10",
";",
"method",
"s",
" ",
"in",
" ",
"the",
" ",
"`",
"pyg",
"let",
".",
"graphic",
"s",
"`",
" ",
"module",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Format",
" ",
"string",
"s",
" ",
"have",
" ",
"the",
" ",
"follow",
"ing",
" ",
"(",
"BN",
"F",
")",
" ",
"synta",
"x",
"::",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"attribute",
" ",
"::",
"=",
" ",
"(",
" ",
"name",
" ",
"|",
" ",
"index",
" ",
"'",
"g",
"'",
" ",
"'",
"n",
"'?",
" ",
"|",
" ",
"textu",
"re",
" ",
"'",
"t",
"'",
" ",
")",
" ",
"count",
" ",
"type",
"\\",
"10",
";",
"\\",
"10",
";",
"``",
"name",
"``",
" ",
"descri",
"bes",
" ",
"the",
" ",
"vertex",
" ",
"attribute",
",",
" ",
"and",
" ",
"is",
" ",
"one",
" ",
"of",
" ",
"the",
" ",
"follow",
"ing",
"\\",
"10",
";",
"constant",
"s",
" ",
"for",
" ",
"the",
" ",
"prede",
"fined",
" ",
"attribute",
"s",
":",
"\\",
"10",
";",
"\\",
"10",
";",
"``",
"c",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Vertex",
" ",
"color",
"\\",
"10",
";",
"``",
"e",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Ed",
"ge",
" ",
"flag",
"\\",
"10",
";",
"``",
"f",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Fo",
"g",
" ",
"coordinate",
"\\",
"10",
";",
"``",
"n",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Normal",
" ",
"vector",
"\\",
"10",
";",
"``",
"s",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Second",
"ary",
" ",
"color",
"\\",
"10",
";",
"``",
"t",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Text",
"ure",
" ",
"coordinate",
"\\",
"10",
";",
"``",
"v",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Vertex",
" ",
"coordinate",
"\\",
"10",
";",
"\\",
"10",
";",
"You",
" ",
"can",
" ",
"alternative",
"ly",
" ",
"create",
" ",
"a",
" ",
"gener",
"ic",
" ",
"indexe",
"d",
" ",
"vertex",
" ",
"attribute",
" ",
"by",
"\\",
"10",
";",
"speci",
"fy",
"ing",
" ",
"its",
" ",
"index",
" ",
"in",
" ",
"decima",
"l",
" ",
"followe",
"d",
" ",
"by",
" ",
"the",
" ",
"constant",
" ",
"``",
"g",
"``.",
" ",
" ",
"For",
"\\",
"10",
";",
"example",
",",
" ",
"``",
"0",
"g",
"``",
" ",
"speci",
"fie",
"s",
" ",
"the",
" ",
"gener",
"ic",
" ",
"vertex",
" ",
"attribute",
" ",
"with",
" ",
"index",
" ",
"0.",
"\\",
"10",
";",
"If",
" ",
"the",
" ",
"option",
"al",
" ",
"constant",
" ",
"``",
"n",
"``",
" ",
"is",
" ",
"presen",
"t",
" ",
"after",
" ",
"the",
" ",
"``",
"g",
"``",
",",
" ",
"the",
"\\",
"10",
";",
"attribute",
" ",
"is",
" ",
"normalise",
"d",
" ",
"to",
" ",
"the",
" ",
"range",
" ",
"``[",
"0",
",",
" ",
"1",
"]``",
" ",
"or",
" ",
"``[",
"-1",
",",
" ",
"1",
"]``",
" ",
"within",
"\\",
"10",
";",
"the",
" ",
"range",
" ",
"of",
" ",
"the",
" ",
"data",
" ",
"type",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Text",
"ure",
" ",
"coordinate",
"s",
" ",
"for",
" ",
"multiple",
" ",
"textu",
"re",
" ",
"unit",
"s",
" ",
"can",
" ",
"be",
" ",
"specified",
" ",
"with",
" ",
"the",
" ",
"\\",
"10",
";",
"textu",
"re",
" ",
"number",
" ",
"bef",
"ore",
" ",
"the",
" ",
"constant",
" ",
"'",
"t",
"'.",
" ",
" ",
"For",
" ",
"example",
",",
" ",
"``",
"1",
"t",
"``",
" ",
"give",
"s",
" ",
"the",
"\\",
"10",
";",
"textu",
"re",
" ",
"coordinate",
" ",
"attribute",
" ",
"for",
" ",
"textu",
"re",
" ",
"unit",
" ",
"1",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"``",
"count",
"``",
" ",
"give",
"s",
" ",
"the",
" ",
"number",
" ",
"of",
" ",
"data",
" ",
"component",
"s",
" ",
"in",
" ",
"the",
" ",
"attribute",
".",
" ",
" ",
"For",
"\\",
"10",
";",
"example",
",",
" ",
"a",
" ",
"3",
"D",
" ",
"vertex",
" ",
"position",
" ",
"has",
" ",
"a",
" ",
"count",
" ",
"of",
" ",
"3",
".",
" ",
" ",
"Some",
" ",
"attribute",
"s",
"\\",
"10",
";",
"constrain",
" ",
"the",
" ",
"possib",
"le",
" ",
"count",
"s",
" ",
"tha",
"t",
" ",
"can",
" ",
"be",
" ",
"used",
";",
" ",
"for",
" ",
"example",
",",
" ",
"a",
" ",
"normal",
"\\",
"10",
";",
"vector",
" ",
"must",
" ",
"have",
" ",
"a",
" ",
"count",
" ",
"of",
" ",
"3",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"``",
"type",
"``",
" ",
"give",
"s",
" ",
"the",
" ",
"data",
" ",
"type",
" ",
"of",
" ",
"each",
" ",
"component",
" ",
"of",
" ",
"the",
" ",
"attribute",
".",
" ",
" ",
"The",
"\\",
"10",
";",
"follow",
"ing",
" ",
"types",
" ",
"can",
" ",
"be",
" ",
"used",
":",
"\\",
"10",
";",
"\\",
"10",
";",
"``",
"b",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"byte",
"``",
"\\",
"10",
";",
"``",
"B",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"ub",
"yte",
"``",
"\\",
"10",
";",
"``",
"s",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"short",
"``",
"\\",
"10",
";",
"``",
"S",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"ushort",
"``",
"\\",
"10",
";",
"``",
"i",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"int",
"``",
"\\",
"10",
";",
"``",
"I",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"uint",
"``",
"\\",
"10",
";",
"``",
"f",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"float",
"``",
"\\",
"10",
";",
"``",
"d",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"GL",
"double",
"``",
"\\",
"10",
";",
"\\",
"10",
";",
"Some",
" ",
"attribute",
"s",
" ",
"constrain",
" ",
"the",
" ",
"possib",
"le",
" ",
"data",
" ",
"types",
";",
" ",
"for",
" ",
"example",
",",
"\\",
"10",
";",
"normal",
" ",
"vector",
"s",
" ",
"must",
" ",
"use",
" ",
"one",
" ",
"of",
" ",
"the",
" ",
"sign",
"ed",
" ",
"data",
" ",
"types",
".",
" ",
" ",
"The",
" ",
"use",
" ",
"of",
"\\",
"10",
";",
"some",
" ",
"data",
" ",
"types",
",",
" ",
"whi",
"le",
" ",
"not",
" ",
"ille",
"gal",
",",
" ",
"may",
" ",
"have",
" ",
"sever",
"e",
" ",
"perform",
"anc",
"e",
"\\",
"10",
";",
"concern",
"s",
".",
" ",
" ",
"For",
" ",
"example",
",",
" ",
"the",
" ",
"use",
" ",
"of",
" ",
"``",
"GL",
"double",
"``",
" ",
"is",
" ",
"discou",
"rage",
"d",
",",
"\\",
"10",
";",
"and",
" ",
"colour",
"s",
" ",
"shou",
"ld",
" ",
"be",
" ",
"specified",
" ",
"with",
" ",
"``",
"GL",
"ub",
"yte",
"``.",
"\\",
"10",
";",
"\\",
"10",
";",
"Whitespace",
" ",
"is",
" ",
"pro",
"hibit",
"ed",
" ",
"within",
" ",
"the",
" ",
"format",
" ",
"string",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Some",
" ",
"example",
"s",
" ",
"follow",
":",
"\\",
"10",
";",
"\\",
"10",
";",
"``",
"v",
"3f",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"3",
"-",
"float",
" ",
"vertex",
" ",
"position",
"\\",
"10",
";",
"``",
"c4",
"b",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"4",
"-",
"byte",
" ",
"colour",
"\\",
"10",
";",
"``",
"1e",
"b",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Ed",
"ge",
" ",
"flag",
"\\",
"10",
";",
"``",
"0",
"g3",
"f",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"3",
"-",
"float",
" ",
"gener",
"ic",
" ",
"vertex",
" ",
"attribute",
" ",
"0",
"\\",
"10",
";",
"``",
"1",
"gn",
"1i",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Integer",
" ",
"gener",
"ic",
" ",
"vertex",
" ",
"attribute",
" ",
"1",
",",
" ",
"normali",
"zed",
" ",
"to",
" ",
"[-",
"1",
",",
" ",
"1",
"]",
"\\",
"10",
";",
"``",
"2g",
"n4",
"B",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"4",
"-",
"byte",
" ",
"gener",
"ic",
" ",
"vertex",
" ",
"attribute",
" ",
"2",
",",
" ",
"normali",
"zed",
" ",
"to",
" ",
"[",
"0",
",",
" ",
"1",
"]",
" ",
"(",
"bec",
"aus",
"e",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"type",
" ",
"is",
" ",
"unsigned",
")",
"\\",
"10",
";",
"``",
"3",
"t2",
"f",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"2",
"-",
"float",
" ",
"textu",
"re",
" ",
"coordinate",
" ",
"for",
" ",
"textu",
"re",
" ",
"unit",
" ",
"3",
".",
"\\",
"10",
";",
"\\",
"10",
";'",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u",
"docformat",
"\\u\\u_",
"=_",
"'",
"restructur",
"edt",
"ext",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u",
"version\\u\\u_",
"=_",
"'$",
"Id",
":",
" ",
"$'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"ctypes_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"pyglet_",
"._",
"gl_",
"import_",
"*_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pyglet_",
"._",
"graphics_",
"import_",
"vertex",
"buffer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"c\\u",
"types_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"BYTE_",
":_",
"ctypes_",
"._",
"c\\u",
"byte_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"UNSIGNED",
"\\u",
"BYTE_",
":_",
"ctypes_",
"._",
"c\\u",
"ubyte_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"SHORT",
"_",
":_",
"ctypes_",
"._",
"c\\u",
"short_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"UNSIGNED",
"\\u",
"SHORT",
"_",
":_",
"ctypes_",
"._",
"c\\u",
"ushort",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"INT_",
":_",
"ctypes_",
"._",
"c\\u",
"int_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"UNSIGNED",
"\\u",
"INT_",
":_",
"ctypes_",
"._",
"c\\u",
"uint_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"FLOAT_",
":_",
"ctypes_",
"._",
"c\\u",
"float_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"GL",
"\\u",
"DOUBLE_",
":_",
"ctypes_",
"._",
"c\\u",
"double_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"gl",
"\\u",
"types_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"b",
"'_",
":_",
"GL",
"\\u",
"BYTE_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"B",
"'_",
":_",
"GL",
"\\u",
"UNSIGNED",
"\\u",
"BYTE_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"s",
"'_",
":_",
"GL",
"\\u",
"SHORT",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"S",
"'_",
":_",
"GL",
"\\u",
"UNSIGNED",
"\\u",
"SHORT",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"i",
"'_",
":_",
"GL",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"I",
"'_",
":_",
"GL",
"\\u",
"UNSIGNED",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"f",
"'_",
":_",
"GL",
"\\u",
"FLOAT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"d",
"'_",
":_",
"GL",
"\\u",
"DOUBLE_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"attribute",
"\\u",
"format\\u",
"re_",
"=_",
"re_",
"._",
"compile_",
"(_",
"r",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(?",
"P",
"<",
"name",
">",
"\\",
"10",
";",
" ",
" ",
" ",
"[",
"cef",
"nst",
"v",
"]",
" ",
"|",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
"(?",
"P",
"<",
"gener",
"ic",
"\\u",
"index",
">[",
"0",
"-",
"9",
"]+)",
" ",
"g",
" ",
"(?",
"P",
"<",
"gener",
"ic",
"\\u",
"normali",
"zed",
">",
"n",
"?)",
" ",
"|",
"\\",
"10",
";",
" ",
" ",
" ",
"(?",
"P",
"<",
"tex",
"coord",
"\\u",
"textu",
"re",
">[",
"0",
"-",
"9",
"]+)",
" ",
"t",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(?",
"P",
"<",
"count",
">[",
"1234",
"])",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(?",
"P",
"<",
"type",
">[",
"b",
"Bs",
"Si",
"If",
"d",
"])",
"\\",
"10",
";'",
"''_",
",_",
"re_",
"._",
"VERBOSE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"attribute",
"\\u",
"cache_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"attribute",
"\\u",
"classes_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"c",
"'_",
":_",
"Color",
"Attribute_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"e",
"'_",
":_",
"Ed",
"ge",
"Fla",
"g",
"Attribute_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"f",
"'_",
":_",
"Fo",
"g",
"Coord",
"Attribute_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"n",
"'_",
":_",
"Normal",
"Attribute_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"s",
"'_",
":_",
"Second",
"ary",
"Color",
"Attribute_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"t",
"'_",
":_",
"Tex",
"Coord",
"Attribute_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"v",
"'_",
":_",
"Vertex",
"Attribute_",
",_",
"\\u\\u\\uNL\\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,
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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
] |
Except block handles 'BaseException' | ClusterHQ/flocker/flocker/node/agents/loopback.py | [
{
"content": " def _initialise_directories(self):\n \"\"\"\n Create the root and sub-directories in which loopback files will be\n created.\n \"\"\"\n self._unattached_directory = self._root_path.child(\n self._unattached_directory_name)\n\n try:\n self._unattached_directory.makedirs()\n except OSError:\n pass\n\n self._attached_directory = self._root_path.child(\n self._attached_directory_name)\n\n try:\n self._attached_directory.makedirs()\n except OSError:\n pass",
"metadata": "root.LoopbackBlockDeviceAPI._initialise_directories",
"header": "['class', 'LoopbackBlockDeviceAPI', '(', 'object', ')', ':', '___EOS___']",
"index": 220
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Loop",
"back",
"Block",
"Dev",
"ice",
"API_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"initialise",
"\\u",
"directories_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Creat",
"e",
" ",
"the",
" ",
"root",
" ",
"and",
" ",
"sub",
"-",
"director",
"ies",
" ",
"in",
" ",
"whi",
"ch",
" ",
"loopback",
" ",
"files",
" ",
"will",
" ",
"be",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"created",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"unat",
"tach",
"ed",
"\\u",
"directory_",
"=_",
"self_",
"._",
"\\u",
"root",
"\\u",
"path_",
"._",
"child_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"unat",
"tach",
"ed",
"\\u",
"director",
"y",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"unat",
"tach",
"ed",
"\\u",
"directory_",
"._",
"makedirs_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"OSE",
"rror_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"attache",
"d\\u",
"directory_",
"=_",
"self_",
"._",
"\\u",
"root",
"\\u",
"path_",
"._",
"child_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"attache",
"d\\u",
"director",
"y",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"attache",
"d\\u",
"directory_",
"._",
"makedirs_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"OSE",
"rror_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | mozilla/inventory/mozdns/view/views.py | [
{
"content": "# Create your views here.\nfrom mozdns.views import MozdnsDeleteView\nfrom mozdns.views import MozdnsCreateView\nfrom mozdns.views import MozdnsDetailView\nfrom mozdns.views import MozdnsUpdateView\nfrom mozdns.views import MozdnsListView\nfrom mozdns.view.models import View\nfrom mozdns.view.forms import ViewForm\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class ViewView(object):\n model = View\n form_class = ViewForm\n queryset = View.objects.all()",
"metadata": "root.ViewView",
"header": "['module', '___EOS___']",
"index": 10
},
{
"content": "class ViewDeleteView(ViewView, MozdnsDeleteView):\n \"\"\" \"\"\"",
"metadata": "root.ViewDeleteView",
"header": "['module', '___EOS___']",
"index": 16
},
{
"content": "class ViewDetailView(ViewView, MozdnsDetailView):\n \"\"\" \"\"\"\n template_name = 'view/view_detail.html'",
"metadata": "root.ViewDetailView",
"header": "['module', '___EOS___']",
"index": 20
},
{
"content": "class ViewCreateView(ViewView, MozdnsCreateView):\n \"\"\" \"\"\"",
"metadata": "root.ViewCreateView",
"header": "['module', '___EOS___']",
"index": 25
},
{
"content": "class ViewUpdateView(ViewView, MozdnsUpdateView):\n \"\"\" \"\"\"",
"metadata": "root.ViewUpdateView",
"header": "['module', '___EOS___']",
"index": 29
},
{
"content": "class ViewListView(ViewView, MozdnsListView):\n \"\"\" \"\"\"",
"metadata": "root.ViewListView",
"header": "['module', '___EOS___']",
"index": 33
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"Creat",
"e",
" ",
"your",
" ",
"views",
" ",
"here",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"views_",
"import_",
"Mo",
"zd",
"ns",
"Delete",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"views_",
"import_",
"Mo",
"zd",
"ns",
"Creat",
"e",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"views_",
"import_",
"Mo",
"zd",
"ns",
"Det",
"ail",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"views_",
"import_",
"Mo",
"zd",
"ns",
"Update",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"views_",
"import_",
"Mo",
"zd",
"ns",
"List",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"view_",
"._",
"models_",
"import_",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"moz",
"dns_",
"._",
"view_",
"._",
"forms_",
"import_",
"View",
"Form_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"View",
"View_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"model_",
"=_",
"View_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"form",
"\\u",
"class_",
"=_",
"View",
"Form_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"queryset_",
"=_",
"View_",
"._",
"objects_",
"._",
"all_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"View",
"Delete",
"View_",
"(_",
"View",
"View_",
",_",
"Mo",
"zd",
"ns",
"Delete",
"View_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\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_",
"class_",
"View",
"Det",
"ail",
"View_",
"(_",
"View",
"View_",
",_",
"Mo",
"zd",
"ns",
"Det",
"ail",
"View_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"template",
"\\u",
"name_",
"=_",
"'",
"view",
"/",
"view",
"\\u",
"deta",
"il",
".",
"html",
"'_",
"\\u\\u\\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_",
"View",
"Creat",
"e",
"View_",
"(_",
"View",
"View_",
",_",
"Mo",
"zd",
"ns",
"Creat",
"e",
"View_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\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_",
"class_",
"View",
"Update",
"View_",
"(_",
"View",
"View_",
",_",
"Mo",
"zd",
"ns",
"Update",
"View_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\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_",
"class_",
"View",
"List",
"View_",
"(_",
"View",
"View_",
",_",
"Mo",
"zd",
"ns",
"List",
"View_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | numba/numba/numba/tests/test_dispatcher.py | [
{
"content": " def test_matching_error_message(self):\n f = jit(\"(intc,intc)\")(add)\n with self.assertRaises(TypeError) as cm:\n f(1j, 1j)\n self.assertEqual(str(cm.exception),\n \"No matching definition for argument type(s) \"\n \"complex128, complex128\")",
"metadata": "root.TestDispatcher.test_matching_error_message",
"header": "['class', 'TestDispatcher', '(', 'BaseTest', ')', ':', '___EOS___']",
"index": 200
},
{
"content": " def test_outer_then_inner(self):\n # Caching outer then inner function is ok\n mod = self.import_module()\n self.assertPreciseEqual(mod.outer(3, 2), 2)\n self.check_pycache(4) # 2 index, 2 data\n self.assertPreciseEqual(mod.outer_uncached(3, 2), 2)\n self.check_pycache(4) # same\n mod = self.import_module()\n f = mod.inner\n self.assertPreciseEqual(f(3, 2), 6)\n self.check_pycache(4) # same\n self.assertPreciseEqual(f(3.5, 2), 6.5)\n self.check_pycache(5) # 2 index, 3 data",
"metadata": "root.TestCache.test_outer_then_inner",
"header": "['class', 'TestCache', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 653
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Test",
"Dispatcher_",
"(_",
"Base",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"matchi",
"ng",
"\\u",
"error",
"\\u",
"message_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"jit_",
"(_",
"\"(",
"int",
"c",
",",
"int",
"c",
")\"_",
")_",
"(_",
"add_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Type",
"Error_",
")_",
"as_",
"cm_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"(_",
"1j_",
",_",
"1j_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"str_",
"(_",
"cm_",
"._",
"exception_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"No",
" ",
"matchi",
"ng",
" ",
"definit",
"ion",
" ",
"for",
" ",
"argu",
"ment",
" ",
"type",
"(",
"s",
")",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"complex",
"128",
",",
" ",
"complex",
"128",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Cache_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"outer",
"\\u",
"then",
"\\u",
"inner_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Caching",
" ",
"outer",
" ",
"then",
" ",
"inner",
" ",
"function",
" ",
"is",
" ",
"ok_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mod_",
"=_",
"self_",
"._",
"import",
"\\u",
"module_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Precis",
"e",
"Equal_",
"(_",
"mod_",
"._",
"outer_",
"(_",
"3_",
",_",
"2_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"check",
"\\u",
"pyca",
"che_",
"(_",
"4_",
")_",
"#",
" ",
"2",
" ",
"index",
",",
" ",
"2",
" ",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Precis",
"e",
"Equal_",
"(_",
"mod_",
"._",
"outer",
"\\u",
"unca",
"ched",
"_",
"(_",
"3_",
",_",
"2_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"check",
"\\u",
"pyca",
"che_",
"(_",
"4_",
")_",
"#",
" ",
"same_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mod_",
"=_",
"self_",
"._",
"import",
"\\u",
"module_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"f_",
"=_",
"mod_",
"._",
"inner_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Precis",
"e",
"Equal_",
"(_",
"f_",
"(_",
"3_",
",_",
"2_",
")_",
",_",
"6_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"check",
"\\u",
"pyca",
"che_",
"(_",
"4_",
")_",
"#",
" ",
"same_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Precis",
"e",
"Equal_",
"(_",
"f_",
"(_",
"3.5_",
",_",
"2_",
")_",
",_",
"6.5",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"check",
"\\u",
"pyca",
"che_",
"(_",
"5_",
")_",
"#",
" ",
"2",
" ",
"index",
",",
" ",
"3",
" ",
"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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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/pycrypto-2.6.1/lib/Crypto/PublicKey/ElGamal.py | [
{
"content": " def decrypt(self, ciphertext):\n \"\"\"Decrypt a piece of data with ElGamal.\n\n :Parameter ciphertext: The piece of data to decrypt with ElGamal.\n :Type ciphertext: byte string, long or a 2-item tuple as returned\n by `encrypt`\n\n :Return: A byte string if ciphertext was a byte string or a tuple\n of byte strings. A long otherwise.\n \"\"\"\n return pubkey.decrypt(self, ciphertext)",
"metadata": "root.ElGamalobj.decrypt",
"header": "['class', 'ElGamalobj', '(', 'pubkey', ')', ':', '___EOS___']",
"index": 271
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"El",
"Gam",
"alo",
"bj_",
"(_",
"pubkey_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"decrypt_",
"(_",
"self_",
",_",
"ciphertext_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Decrypt",
" ",
"a",
" ",
"piece",
" ",
"of",
" ",
"data",
" ",
"with",
" ",
"El",
"Gam",
"al",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"Parameter",
" ",
"cipher",
"text",
":",
" ",
"The",
" ",
"piece",
" ",
"of",
" ",
"data",
" ",
"to",
" ",
"decrypt",
" ",
"with",
" ",
"El",
"Gam",
"al",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"Type",
" ",
"cipher",
"text",
":",
" ",
"byte",
" ",
"string",
",",
" ",
"long",
" ",
"or",
" ",
"a",
" ",
"2",
"-",
"item",
" ",
"tuple",
" ",
"as",
" ",
"return",
"ed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
" ",
"by",
" ",
"`",
"encrypt",
"`",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"Return",
":",
" ",
"A",
" ",
"byte",
" ",
"string",
" ",
"if",
" ",
"cipher",
"text",
" ",
"was",
" ",
"a",
" ",
"byte",
" ",
"string",
" ",
"or",
" ",
"a",
" ",
"tuple",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
" ",
"of",
" ",
"byte",
" ",
"string",
"s",
".",
" ",
"A",
" ",
"long",
" ",
"other",
"wis",
"e",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"pubkey_",
"._",
"decrypt_",
"(_",
"self_",
",_",
"ciphertext_",
")_",
"\\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
] |
Wrong number of arguments in a call | cloudkick/libcloud/libcloud/__init__.py | [
{
"content": "def enable_debug(fo):\n \"\"\"\n Enable library wide debugging to a file-like object.\n\n @param fo: Where to append debugging information\n @type fo: File like object, only write operations are used.\n \"\"\"\n from libcloud.base import ConnectionKey, LoggingHTTPConnection, LoggingHTTPSConnection\n LoggingHTTPSConnection.log = fo\n LoggingHTTPConnection.log = fo\n ConnectionKey.conn_classes = (LoggingHTTPConnection, LoggingHTTPSConnection)",
"metadata": "root.enable_debug",
"header": "['module', '___EOS___']",
"index": 25
},
{
"content": "def _init_once():\n \"\"\"\n Utility function that is ran once on Library import.\n\n This checks for the LIBCLOUD_DEBUG enviroment variable, which if it exists\n is where we will log debug information about the provider transports.\n\n If LIBCLOUD_DEBUG is not a path, C{/tmp/libcloud_debug.log} is used by\n default.\n \"\"\"\n import os\n d = os.getenv(\"LIBCLOUD_DEBUG\")\n if d:\n if d.isdigit():\n d = \"/tmp/libcloud_debug.log\"\n fo = open(d, \"a\")\n enable_debug(fo)",
"metadata": "root._init_once",
"header": "['module', '___EOS___']",
"index": 37
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Wro",
"ng_",
"number_",
"of_",
"arguments_",
"in_",
"a_",
"call_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"enable",
"\\u",
"debug_",
"(_",
"fo_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Enable",
" ",
"librar",
"y",
" ",
"wide",
" ",
"debugg",
"ing",
" ",
"to",
" ",
"a",
" ",
"file",
"-",
"like",
" ",
"object",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"fo",
":",
" ",
"Whe",
"re",
" ",
"to",
" ",
"append",
" ",
"debugg",
"ing",
" ",
"informati",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"type",
" ",
"fo",
":",
" ",
"File",
" ",
"like",
" ",
"object",
",",
" ",
"only",
" ",
"write",
" ",
"operati",
"ons",
" ",
"are",
" ",
"used",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"base_",
"import_",
"Connect",
"ion",
"Key_",
",_",
"Log",
"ging",
"HTTP",
"Connection_",
",_",
"Log",
"ging",
"HTTP",
"SC",
"onnect",
"ion_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Log",
"ging",
"HTTP",
"SC",
"onnect",
"ion_",
"._",
"log_",
"=_",
"fo_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Log",
"ging",
"HTTP",
"Connection_",
"._",
"log_",
"=_",
"fo_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Connect",
"ion",
"Key_",
"._",
"conn",
"\\u",
"classes_",
"=_",
"(_",
"Log",
"ging",
"HTTP",
"Connection_",
",_",
"Log",
"ging",
"HTTP",
"SC",
"onnect",
"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",
"init",
"\\u",
"once_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Utili",
"ty",
" ",
"function",
" ",
"tha",
"t",
" ",
"is",
" ",
"ran",
" ",
"onc",
"e",
" ",
"on",
" ",
"Libr",
"ary",
" ",
"import",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"checks",
" ",
"for",
" ",
"the",
" ",
"LIB",
"CLOUD",
"\\u",
"DEBU",
"G",
" ",
"envi",
"rom",
"ent",
" ",
"variab",
"le",
",",
" ",
"whi",
"ch",
" ",
"if",
" ",
"it",
" ",
"exist",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"is",
" ",
"where",
" ",
"we",
" ",
"will",
" ",
"log",
" ",
"debug",
" ",
"informati",
"on",
" ",
"abo",
"ut",
" ",
"the",
" ",
"provide",
"r",
" ",
"transport",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"LIB",
"CLOUD",
"\\u",
"DEBU",
"G",
" ",
"is",
" ",
"not",
" ",
"a",
" ",
"path",
",",
" ",
"C",
"{",
"/",
"tmp",
"/",
"libc",
"loud",
"\\u",
"debug",
".",
"log",
"}",
" ",
"is",
" ",
"used",
" ",
"by",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"default",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"d_",
"=_",
"os_",
"._",
"getenv_",
"(_",
"\"",
"LIB",
"CLOUD",
"\\u",
"DEBU",
"G",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | saga-project/BigJob/pilot/coordination/advert_adaptor.py | [
{
"content": " @classmethod\n def add_pd(cls, pds_url, pd):\n pds_url = cls.__remove_dbtype(pds_url) \n pd_url =pds_url+\"/\" + pd.id\n pd_description_url = cls.__get_url(pd_url + \"/description\")\n logger.debug(\"PDS URL: %s, PD Description URL: %s\"%(pds_url, pd_description_url))\n # directory is recursively created\n pd_desc_entry = saga.advert.entry(saga.url(pd_description_url),\n saga.advert.Create | saga.advert.CreateParents | saga.advert.ReadWrite)\n logger.debug(\"initialized advert entry for pds: \" + pd_description_url)\n pd_desc_entry.store_string(json.dumps(pd.data_unit_description))\n return pd_url",
"metadata": "root.AdvertCoordinationAdaptor.add_pd",
"header": "['class', 'AdvertCoordinationAdaptor', ':', '___EOS___']",
"index": 71
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"class_",
"Advert",
"Coordinat",
"ion",
"Adapt",
"or_",
":_",
"\\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_",
"add",
"\\u",
"pd_",
"(_",
"cls_",
",_",
"pd",
"s",
"\\u",
"url_",
",_",
"pd_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pd",
"s",
"\\u",
"url_",
"=_",
"cls_",
"._",
"\\u\\u",
"remove",
"\\u",
"dbt",
"ype_",
"(_",
"pd",
"s",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pd",
"\\u",
"url_",
"=_",
"pd",
"s",
"\\u",
"url_",
"+_",
"\"/\"_",
"+_",
"pd_",
"._",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pd",
"\\u",
"description",
"\\u",
"url_",
"=_",
"cls_",
"._",
"\\u\\u",
"get",
"\\u",
"url_",
"(_",
"pd",
"\\u",
"url_",
"+_",
"\"/",
"description",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logger_",
"._",
"debug_",
"(_",
"\"",
"PD",
"S",
" ",
"URL",
":",
" ",
"%",
"s",
",",
" ",
"PD",
" ",
"Descripti",
"on",
" ",
"URL",
":",
" ",
"%",
"s",
"\"_",
"%_",
"(_",
"pd",
"s",
"\\u",
"url_",
",_",
"pd",
"\\u",
"description",
"\\u",
"url_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"director",
"y",
" ",
"is",
" ",
"recurs",
"ively",
" ",
"created_",
"\\u\\u\\uNL\\u\\u\\u_",
"pd",
"\\u",
"desc",
"\\u",
"entry_",
"=_",
"sag",
"a_",
"._",
"adver",
"t_",
"._",
"entry_",
"(_",
"sag",
"a_",
"._",
"url_",
"(_",
"pd",
"\\u",
"description",
"\\u",
"url_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"sag",
"a_",
"._",
"adver",
"t_",
"._",
"Create_",
"|_",
"sag",
"a_",
"._",
"adver",
"t_",
"._",
"Creat",
"e",
"Parent",
"s_",
"|_",
"sag",
"a_",
"._",
"adver",
"t_",
"._",
"Read",
"Write_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logger_",
"._",
"debug_",
"(_",
"\"",
"initialize",
"d",
" ",
"adver",
"t",
" ",
"entry",
" ",
"for",
" ",
"pd",
"s",
":",
" ",
"\"_",
"+_",
"pd",
"\\u",
"description",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pd",
"\\u",
"desc",
"\\u",
"entry_",
"._",
"store",
"\\u",
"string_",
"(_",
"json_",
"._",
"dumps_",
"(_",
"pd_",
"._",
"data\\u",
"unit",
"\\u",
"description_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"pd",
"\\u",
"url_",
"\\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
] |
Comparison of constants | GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/datastore_stub_util.py | [
{
"content": " def Contains(self, value):\n \"\"\"Check if the range contains a specific value.\n\n Args:\n value: the value to check.\n Returns:\n True iff value is contained in this range.\n \"\"\"\n if self.__start is not None:\n if self.__start_inclusive and value < self.__start: return False\n if not self.__start_inclusive and value <= self.__start: return False\n if self.__end is not None:\n if self.__end_inclusive and value > self.__end: return False\n if not self.__end_inclusive and value >= self.__end: return False\n return True",
"metadata": "root.ValueRange.Contains",
"header": "['class', 'ValueRange', '(', 'object', ')', ':', '___EOS___']",
"index": 786
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"Value",
"Range_",
"(_",
"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_",
"Contains_",
"(_",
"self_",
",_",
"value_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Check",
" ",
"if",
" ",
"the",
" ",
"range",
" ",
"contain",
"s",
" ",
"a",
" ",
"specific",
" ",
"value",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Arg",
"s",
":",
"\\",
"10",
";",
" ",
" ",
"value",
":",
" ",
"the",
" ",
"value",
" ",
"to",
" ",
"check",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
":",
"\\",
"10",
";",
" ",
" ",
"Tru",
"e",
" ",
"iff",
" ",
"value",
" ",
"is",
" ",
"contain",
"ed",
" ",
"in",
" ",
"this",
" ",
"range",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u\\u",
"start_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"\\u\\u",
"start",
"\\u",
"inclu",
"sive",
"_",
"and_",
"value_",
"<_",
"self_",
"._",
"\\u\\u",
"start_",
":_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"\\u\\u",
"start",
"\\u",
"inclu",
"sive",
"_",
"and_",
"value_",
"<=_",
"self_",
"._",
"\\u\\u",
"start_",
":_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u\\u",
"end_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"\\u\\u",
"end",
"\\u",
"inclu",
"sive",
"_",
"and_",
"value_",
">_",
"self_",
"._",
"\\u\\u",
"end_",
":_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"\\u\\u",
"end",
"\\u",
"inclu",
"sive",
"_",
"and_",
"value_",
">=_",
"self_",
"._",
"\\u\\u",
"end_",
":_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | deanhiller/databus/webapp/play1.3.x/python/Lib/bsddb/dbobj.py | [
{
"content": " def open(self, *args, **kwargs):\n return apply(self._cobj.open, args, kwargs)",
"metadata": "root.DB.open",
"header": "['class', 'DB', '(', 'MutableMapping', ')', ':', '___EOS___']",
"index": 182
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"class_",
"DB_",
"(_",
"Mut",
"able",
"Mapping_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"open_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"apply_",
"(_",
"self_",
"._",
"\\u",
"cobj",
"_",
"._",
"open_",
",_",
"args_",
",_",
"kwargs_",
")_",
"\\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
] |
Unused import | statsmodels/statsmodels/statsmodels/stats/moment_helpers.py | [
{
"content": "'''helper functions conversion between moments\n\ncontains:\n\n* conversion between central and non-central moments, skew, kurtosis and\n cummulants\n* cov2corr : convert covariance matrix to correlation matrix\n\n\nAuthor: Josef Perktold\nLicense: BSD-3\n\n'''\n\nfrom statsmodels.compat.python import range\nimport numpy as np\nfrom scipy.misc import comb\n\n\n## start moment helpers\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#def mnc2mc(args):\n# '''convert four non-central moments to central moments\n# '''\n# mnc, mnc2, mnc3, mnc4 = args\n# mc = mnc\n# mc2 = mnc2 - mnc*mnc\n# mc3 = mnc3 - (3*mc*mc2+mc**3) # 3rd central moment\n# mc4 = mnc4 - (4*mc*mc3+6*mc*mc*mc2+mc**4)\n# return mc, mc2, mc\n\n #TODO: no return, did it get lost in cut-paste?\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def mc2mnc(mc):\n '''convert central to non-central moments, uses recursive formula\n optionally adjusts first moment to return mean\n\n '''\n n = len(mc)\n mean = mc[0]\n mc = [1] + list(mc) # add zero moment = 1\n mc[1] = 0 # define central mean as zero for formula\n mnc = [1, mean] # zero and first raw moments\n for nn,m in enumerate(mc[2:]):\n n=nn+2\n mnc.append(0)\n for k in range(n+1):\n mnc[n] += comb(n,k,exact=1) * mc[k] * mean**(n-k)\n\n return mnc[1:]",
"metadata": "root.mc2mnc",
"header": "['module', '___EOS___']",
"index": 21
},
{
"content": "def mnc2mc(mnc, wmean = True):\n '''convert non-central to central moments, uses recursive formula\n optionally adjusts first moment to return mean\n\n '''\n n = len(mnc)\n mean = mnc[0]\n mnc = [1] + list(mnc) # add zero moment = 1\n mu = [] #np.zeros(n+1)\n for n,m in enumerate(mnc):\n mu.append(0)\n #[comb(n-1,k,exact=1) for k in range(n)]\n for k in range(n+1):\n mu[n] += (-1)**(n-k) * comb(n,k,exact=1) * mnc[k] * mean**(n-k)\n if wmean:\n mu[1] = mean\n return mu[1:]",
"metadata": "root.mnc2mc",
"header": "['module', '___EOS___']",
"index": 40
},
{
"content": "def cum2mc(kappa):\n '''convert non-central moments to cumulants\n recursive formula produces as many cumulants as moments\n\n References\n ----------\n Kenneth Lange: Numerical Analysis for Statisticians, page 40\n (http://books.google.ca/books?id=gm7kwttyRT0C&pg=PA40&lpg=PA40&dq=convert+cumulants+to+moments&source=web&ots=qyIaY6oaWH&sig=cShTDWl-YrWAzV7NlcMTRQV6y0A&hl=en&sa=X&oi=book_result&resnum=1&ct=result)\n\n\n '''\n mc = [1,0.0] #_kappa[0]] #insert 0-moment and mean\n kappa0 = kappa[0]\n kappa = [1] + list(kappa)\n for nn,m in enumerate(kappa[2:]):\n n = nn+2\n mc.append(0)\n for k in range(n-1):\n mc[n] += comb(n-1,k,exact=1) * kappa[n-k]*mc[k]\n\n mc[1] = kappa0 # insert mean as first moments by convention\n return mc[1:]",
"metadata": "root.cum2mc",
"header": "['module', '___EOS___']",
"index": 59
},
{
"content": "def mnc2cum(mnc):\n '''convert non-central moments to cumulants\n recursive formula produces as many cumulants as moments\n\n http://en.wikipedia.org/wiki/Cumulant#Cumulants_and_moments\n '''\n mnc = [1] + list(mnc)\n kappa = [1]\n for nn,m in enumerate(mnc[1:]):\n n = nn+1\n kappa.append(m)\n for k in range(1,n):\n kappa[n] -= comb(n-1,k-1,exact=1) * kappa[k]*mnc[n-k]\n\n return kappa[1:]",
"metadata": "root.mnc2cum",
"header": "['module', '___EOS___']",
"index": 83
},
{
"content": "def mc2cum(mc):\n '''just chained because I have still the test case\n '''\n return mnc2cum(mc2mnc(mc))",
"metadata": "root.mc2cum",
"header": "['module', '___EOS___']",
"index": 100
},
{
"content": "def mvsk2mc(args):\n '''convert mean, variance, skew, kurtosis to central moments'''\n mu,sig2,sk,kur = args\n\n cnt = [None]*4\n cnt[0] = mu\n cnt[1] = sig2\n cnt[2] = sk * sig2**1.5\n cnt[3] = (kur+3.0) * sig2**2.0\n return tuple(cnt)",
"metadata": "root.mvsk2mc",
"header": "['module', '___EOS___']",
"index": 106
},
{
"content": "def mvsk2mnc(args):\n '''convert mean, variance, skew, kurtosis to non-central moments'''\n mc, mc2, skew, kurt = args\n mnc = mc\n mnc2 = mc2 + mc*mc\n mc3 = skew*(mc2**1.5) # 3rd central moment\n mnc3 = mc3+3*mc*mc2+mc**3 # 3rd non-central moment\n mc4 = (kurt+3.0)*(mc2**2.0) # 4th central moment\n mnc4 = mc4+4*mc*mc3+6*mc*mc*mc2+mc**4\n return (mnc, mnc2, mnc3, mnc4)",
"metadata": "root.mvsk2mnc",
"header": "['module', '___EOS___']",
"index": 118
},
{
"content": "def mc2mvsk(args):\n '''convert central moments to mean, variance, skew, kurtosis\n '''\n mc, mc2, mc3, mc4 = args\n skew = np.divide(mc3, mc2**1.5)\n kurt = np.divide(mc4, mc2**2.0) - 3.0\n return (mc, mc2, skew, kurt)",
"metadata": "root.mc2mvsk",
"header": "['module', '___EOS___']",
"index": 130
},
{
"content": "def mnc2mvsk(args):\n '''convert central moments to mean, variance, skew, kurtosis\n '''\n #convert four non-central moments to central moments\n mnc, mnc2, mnc3, mnc4 = args\n mc = mnc\n mc2 = mnc2 - mnc*mnc\n mc3 = mnc3 - (3*mc*mc2+mc**3) # 3rd central moment\n mc4 = mnc4 - (4*mc*mc3+6*mc*mc*mc2+mc**4)\n\n return mc2mvsk((mc, mc2, mc3, mc4))",
"metadata": "root.mnc2mvsk",
"header": "['module', '___EOS___']",
"index": 139
},
{
"content": "def cov2corr(cov, return_std=False):\n '''convert covariance matrix to correlation matrix\n\n Parameters\n ----------\n cov : array_like, 2d\n covariance matrix, see Notes\n\n Returns\n -------\n corr : ndarray (subclass)\n correlation matrix\n return_std : bool\n If this is true then the standard deviation is also returned.\n By default only the correlation matrix is returned.\n\n Notes\n -----\n This function does not convert subclasses of ndarrays. This requires\n that division is defined elementwise. np.ma.array and np.matrix are allowed.\n\n '''\n cov = np.asanyarray(cov)\n std_ = np.sqrt(np.diag(cov))\n corr = cov / np.outer(std_, std_)\n if return_std:\n return corr, std_\n else:\n return corr",
"metadata": "root.cov2corr",
"header": "['module', '___EOS___']",
"index": 165
},
{
"content": "def corr2cov(corr, std):\n '''convert correlation matrix to covariance matrix given standard deviation\n\n Parameters\n ----------\n corr : array_like, 2d\n correlation matrix, see Notes\n std : array_like, 1d\n standard deviation\n\n Returns\n -------\n cov : ndarray (subclass)\n covariance matrix\n\n Notes\n -----\n This function does not convert subclasses of ndarrays. This requires\n that multiplication is defined elementwise. np.ma.array are allowed, but\n not matrices.\n\n '''\n corr = np.asanyarray(corr)\n std_ = np.asanyarray(std)\n cov = corr * np.outer(std_, std_)\n return cov",
"metadata": "root.corr2cov",
"header": "['module', '___EOS___']",
"index": 195
},
{
"content": "def se_cov(cov):\n '''get standard deviation from covariance matrix\n\n just a shorthand function np.sqrt(np.diag(cov))\n\n Parameters\n ----------\n cov : array_like, square\n covariance matrix\n\n Returns\n -------\n std : ndarray\n standard deviation from diagonal of cov\n\n '''\n return np.sqrt(np.diag(cov))",
"metadata": "root.se_cov",
"header": "['module', '___EOS___']",
"index": 222
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"'''",
"help",
"er",
" ",
"function",
"s",
" ",
"conve",
"rsi",
"on",
" ",
"bet",
"ween",
" ",
"moments",
"\\",
"10",
";",
"\\",
"10",
";",
"contain",
"s",
":",
"\\",
"10",
";",
"\\",
"10",
";",
"*",
" ",
"conve",
"rsi",
"on",
" ",
"bet",
"ween",
" ",
"central",
" ",
"and",
" ",
"non",
"-",
"central",
" ",
"moments",
",",
" ",
"skew",
",",
" ",
"kur",
"tos",
"is",
" ",
"and",
"\\",
"10",
";",
" ",
" ",
"cum",
"mul",
"ant",
"s",
"\\",
"10",
";",
"*",
" ",
"cov",
"2co",
"rr",
" ",
":",
" ",
"convert",
" ",
"covariance",
" ",
"matrix",
" ",
"to",
" ",
"correlation",
" ",
"matrix",
"\\",
"10",
";",
"\\",
"10",
";",
"\\",
"10",
";",
"Author",
":",
" ",
"Jos",
"ef",
" ",
"Per",
"kto",
"ld",
"\\",
"10",
";",
"License",
":",
" ",
"BS",
"D",
"-",
"3",
"\\",
"10",
";",
"\\",
"10",
";'",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"stats",
"models_",
"._",
"compat_",
"._",
"python_",
"import_",
"range_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"numpy_",
"as_",
"np_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"scipy_",
"._",
"misc_",
"import_",
"comb_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"start",
" ",
"moment",
" ",
"helpers_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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",
" ",
"mn",
"c2",
"mc",
"(",
"args",
"):",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"'''",
"convert",
" ",
"four",
" ",
"non",
"-",
"central",
" ",
"moments",
" ",
"to",
" ",
"central",
" ",
"moments_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"mn",
"c",
",",
" ",
"mn",
"c2",
",",
" ",
"mn",
"c3",
",",
" ",
"mn",
"c4",
" ",
"=",
" ",
"args_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"mc",
" ",
"=",
" ",
"mn",
"c_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"mc",
"2",
" ",
"=",
" ",
"mn",
"c2",
" ",
"-",
" ",
"mn",
"c",
"*",
"mn",
"c_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"mc",
"3",
" ",
"=",
" ",
"mn",
"c3",
" ",
"-",
" ",
"(",
"3",
"*",
"mc",
"*",
"mc",
"2",
"+",
"mc",
"**",
"3",
")",
" ",
"#",
" ",
"3",
"rd",
" ",
"central",
" ",
"moment_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"mc",
"4",
" ",
"=",
" ",
"mn",
"c4",
" ",
"-",
" ",
"(",
"4",
"*",
"mc",
"*",
"mc",
"3",
"+",
"6",
"*",
"mc",
"*",
"mc",
"*",
"mc",
"2",
"+",
"mc",
"**",
"4",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"return",
" ",
"mc",
",",
" ",
"mc",
"2",
",",
" ",
"mc_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"TOD",
"O",
":",
" ",
"no",
" ",
"return",
",",
" ",
"did",
" ",
"it",
" ",
"get",
" ",
"lost",
" ",
"in",
" ",
"cut",
"-",
"paste",
"?",
"_",
"\\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\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"mc",
"2m",
"nc_",
"(_",
"mc_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"central",
" ",
"to",
" ",
"non",
"-",
"central",
" ",
"moments",
",",
" ",
"use",
"s",
" ",
"recurs",
"ive",
" ",
"formula",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"option",
"ally",
" ",
"adjust",
"s",
" ",
"first",
" ",
"moment",
" ",
"to",
" ",
"return",
" ",
"mean",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"n_",
"=_",
"len_",
"(_",
"mc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mean_",
"=_",
"mc_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
"=_",
"[_",
"1_",
"]_",
"+_",
"list_",
"(_",
"mc_",
")_",
"#",
" ",
"add",
" ",
"zero",
" ",
"moment",
" ",
"=",
" ",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
"[_",
"1_",
"]_",
"=_",
"0_",
"#",
" ",
"defin",
"e",
" ",
"central",
" ",
"mean",
" ",
"as",
" ",
"zero",
" ",
"for",
" ",
"formula_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c_",
"=_",
"[_",
"1_",
",_",
"mean_",
"]_",
"#",
" ",
"zero",
" ",
"and",
" ",
"first",
" ",
"raw",
" ",
"moments_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"nn_",
",_",
"m_",
"in_",
"enumerate_",
"(_",
"mc_",
"[_",
"2_",
":_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"nn_",
"+_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c_",
"._",
"append_",
"(_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"k_",
"in_",
"range_",
"(_",
"n_",
"+_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mn",
"c_",
"[_",
"n_",
"]_",
"+=_",
"comb_",
"(_",
"n_",
",_",
"k_",
",_",
"exact_",
"=_",
"1_",
")_",
"*_",
"mc_",
"[_",
"k_",
"]_",
"*_",
"mean_",
"**_",
"(_",
"n_",
"-_",
"k_",
")_",
"\\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_",
"mn",
"c_",
"[_",
"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_",
"mn",
"c2",
"mc_",
"(_",
"mn",
"c_",
",_",
"wm",
"ean_",
"=_",
"True_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"non",
"-",
"central",
" ",
"to",
" ",
"central",
" ",
"moments",
",",
" ",
"use",
"s",
" ",
"recurs",
"ive",
" ",
"formula",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"option",
"ally",
" ",
"adjust",
"s",
" ",
"first",
" ",
"moment",
" ",
"to",
" ",
"return",
" ",
"mean",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"n_",
"=_",
"len_",
"(_",
"mn",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mean_",
"=_",
"mn",
"c_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c_",
"=_",
"[_",
"1_",
"]_",
"+_",
"list_",
"(_",
"mn",
"c_",
")_",
"#",
" ",
"add",
" ",
"zero",
" ",
"moment",
" ",
"=",
" ",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mu_",
"=_",
"[_",
"]_",
"#",
"np",
".",
"zero",
"s",
"(",
"n",
"+",
"1",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"n_",
",_",
"m_",
"in_",
"enumerate_",
"(_",
"mn",
"c_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mu_",
"._",
"append_",
"(_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#[",
"comb",
"(",
"n",
"-1",
",",
"k",
",",
"exact",
"=",
"1",
")",
" ",
"for",
" ",
"k",
" ",
"in",
" ",
"range",
"(",
"n",
")]",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"k_",
"in_",
"range_",
"(_",
"n_",
"+_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mu_",
"[_",
"n_",
"]_",
"+=_",
"(_",
"-_",
"1_",
")_",
"**_",
"(_",
"n_",
"-_",
"k_",
")_",
"*_",
"comb_",
"(_",
"n_",
",_",
"k_",
",_",
"exact_",
"=_",
"1_",
")_",
"*_",
"mn",
"c_",
"[_",
"k_",
"]_",
"*_",
"mean_",
"**_",
"(_",
"n_",
"-_",
"k_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"wm",
"ean_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mu_",
"[_",
"1_",
"]_",
"=_",
"mean_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"mu_",
"[_",
"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_",
"cum",
"2m",
"c_",
"(_",
"kappa_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"non",
"-",
"central",
" ",
"moments",
" ",
"to",
" ",
"cumul",
"ant",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"recurs",
"ive",
" ",
"formula",
" ",
"produce",
"s",
" ",
"as",
" ",
"many",
" ",
"cumul",
"ant",
"s",
" ",
"as",
" ",
"moments",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Reference",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Ken",
"net",
"h",
" ",
"Lang",
"e",
":",
" ",
"Numerical",
" ",
"Analy",
"sis",
" ",
"for",
" ",
"Statistic",
"ian",
"s",
",",
" ",
"page",
" ",
"40",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"http",
"://",
"books",
".",
"google",
".",
"ca",
"/",
"books",
"?",
"id",
"=",
"gm",
"7",
"kw",
"tt",
"y",
"RT",
"0",
"C",
"&",
"pg",
"=",
"PA",
"40",
"&",
"lp",
"g",
"=",
"PA",
"40",
"&",
"dq",
"=",
"convert",
"+",
"cumul",
"ant",
"s",
"+",
"to",
"+",
"moments",
"&",
"source",
"=",
"web",
"&",
"ots",
"=",
"qy",
"Ia",
"Y",
"6",
"oa",
"WH",
"&",
"sig",
"=",
"c",
"Sh",
"TD",
"Wl",
"-",
"Yr",
"WA",
"z",
"V",
"7",
"Nl",
"c",
"MT",
"RQ",
"V6",
"y",
"0",
"A",
"&",
"hl",
"=",
"en",
"&",
"sa",
"=",
"X",
"&",
"oi",
"=",
"book",
"\\u",
"result",
"&",
"resn",
"um",
"=",
"1",
"&",
"ct",
"=",
"result",
")",
"\\",
"10",
";",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
"=_",
"[_",
"1_",
",_",
"0.0_",
"]_",
"#\\u",
"kap",
"pa",
"[",
"0",
"]]",
" ",
" ",
"#",
"insert",
" ",
"0",
"-",
"moment",
" ",
"and",
" ",
"mean_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kap",
"pa",
"0_",
"=_",
"kappa_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kappa_",
"=_",
"[_",
"1_",
"]_",
"+_",
"list_",
"(_",
"kappa_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"nn_",
",_",
"m_",
"in_",
"enumerate_",
"(_",
"kappa_",
"[_",
"2_",
":_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"nn_",
"+_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
"._",
"append_",
"(_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"k_",
"in_",
"range_",
"(_",
"n_",
"-_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mc_",
"[_",
"n_",
"]_",
"+=_",
"comb_",
"(_",
"n_",
"-_",
"1_",
",_",
"k_",
",_",
"exact_",
"=_",
"1_",
")_",
"*_",
"kappa_",
"[_",
"n_",
"-_",
"k_",
"]_",
"*_",
"mc_",
"[_",
"k_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"mc_",
"[_",
"1_",
"]_",
"=_",
"kap",
"pa",
"0_",
"#",
" ",
"insert",
" ",
"mean",
" ",
"as",
" ",
"first",
" ",
"moments",
" ",
"by",
" ",
"convention",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"mc_",
"[_",
"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_",
"mn",
"c2",
"cum",
"_",
"(_",
"mn",
"c_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"non",
"-",
"central",
" ",
"moments",
" ",
"to",
" ",
"cumul",
"ant",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"recurs",
"ive",
" ",
"formula",
" ",
"produce",
"s",
" ",
"as",
" ",
"many",
" ",
"cumul",
"ant",
"s",
" ",
"as",
" ",
"moments",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"http",
"://",
"en",
".",
"wikip",
"edia",
".",
"org",
"/",
"wiki",
"/",
"Cum",
"ula",
"nt",
"#",
"Cum",
"ula",
"nts",
"\\u",
"and",
"\\u",
"moments",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c_",
"=_",
"[_",
"1_",
"]_",
"+_",
"list_",
"(_",
"mn",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kappa_",
"=_",
"[_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"nn_",
",_",
"m_",
"in_",
"enumerate_",
"(_",
"mn",
"c_",
"[_",
"1_",
":_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"nn_",
"+_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kappa_",
"._",
"append_",
"(_",
"m_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"k_",
"in_",
"range_",
"(_",
"1_",
",_",
"n_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kappa_",
"[_",
"n_",
"]_",
"-=_",
"comb_",
"(_",
"n_",
"-_",
"1_",
",_",
"k_",
"-_",
"1_",
",_",
"exact_",
"=_",
"1_",
")_",
"*_",
"kappa_",
"[_",
"k_",
"]_",
"*_",
"mn",
"c_",
"[_",
"n_",
"-_",
"k_",
"]_",
"\\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_",
"kappa_",
"[_",
"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_",
"mc",
"2c",
"um_",
"(_",
"mc_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"just",
" ",
"chained",
" ",
"bec",
"aus",
"e",
" ",
"I",
" ",
"have",
" ",
"still",
" ",
"the",
" ",
"test",
" ",
"case",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"mn",
"c2",
"cum",
"_",
"(_",
"mc",
"2m",
"nc_",
"(_",
"mc_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mv",
"sk",
"2m",
"c_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"mean",
",",
" ",
"varian",
"ce",
",",
" ",
"skew",
",",
" ",
"kur",
"tos",
"is",
" ",
"to",
" ",
"central",
" ",
"moments",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mu_",
",_",
"sig",
"2_",
",_",
"sk_",
",_",
"kur",
"_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"cnt_",
"=_",
"[_",
"None_",
"]_",
"*_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cnt_",
"[_",
"0_",
"]_",
"=_",
"mu_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cnt_",
"[_",
"1_",
"]_",
"=_",
"sig",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cnt_",
"[_",
"2_",
"]_",
"=_",
"sk_",
"*_",
"sig",
"2_",
"**_",
"1.5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cnt_",
"[_",
"3_",
"]_",
"=_",
"(_",
"kur",
"_",
"+_",
"3.0_",
")_",
"*_",
"sig",
"2_",
"**_",
"2.0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"tuple_",
"(_",
"cnt_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mv",
"sk",
"2m",
"nc_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"mean",
",",
" ",
"varian",
"ce",
",",
" ",
"skew",
",",
" ",
"kur",
"tos",
"is",
" ",
"to",
" ",
"non",
"-",
"central",
" ",
"moments",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
",_",
"mc",
"2_",
",_",
"skew",
"_",
",_",
"kur",
"t_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c_",
"=_",
"mc_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c2_",
"=_",
"mc",
"2_",
"+_",
"mc_",
"*_",
"mc_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc",
"3_",
"=_",
"skew",
"_",
"*_",
"(_",
"mc",
"2_",
"**_",
"1.5_",
")_",
"#",
" ",
"3",
"rd",
" ",
"central",
" ",
"moment_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c3_",
"=_",
"mc",
"3_",
"+_",
"3_",
"*_",
"mc_",
"*_",
"mc",
"2_",
"+_",
"mc_",
"**_",
"3_",
"#",
" ",
"3",
"rd",
" ",
"non",
"-",
"central",
" ",
"moment_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc",
"4_",
"=_",
"(_",
"kur",
"t_",
"+_",
"3.0_",
")_",
"*_",
"(_",
"mc",
"2_",
"**_",
"2.0_",
")_",
"#",
" ",
"4",
"th",
" ",
"central",
" ",
"moment_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mn",
"c4_",
"=_",
"mc",
"4_",
"+_",
"4_",
"*_",
"mc_",
"*_",
"mc",
"3_",
"+_",
"6_",
"*_",
"mc_",
"*_",
"mc_",
"*_",
"mc",
"2_",
"+_",
"mc_",
"**_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"(_",
"mn",
"c_",
",_",
"mn",
"c2_",
",_",
"mn",
"c3_",
",_",
"mn",
"c4_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mc",
"2m",
"vs",
"k_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"central",
" ",
"moments",
" ",
"to",
" ",
"mean",
",",
" ",
"varian",
"ce",
",",
" ",
"skew",
",",
" ",
"kur",
"tos",
"is",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
",_",
"mc",
"2_",
",_",
"mc",
"3_",
",_",
"mc",
"4_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"skew",
"_",
"=_",
"np_",
"._",
"divide_",
"(_",
"mc",
"3_",
",_",
"mc",
"2_",
"**_",
"1.5_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kur",
"t_",
"=_",
"np_",
"._",
"divide_",
"(_",
"mc",
"4_",
",_",
"mc",
"2_",
"**_",
"2.0_",
")_",
"-_",
"3.0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"(_",
"mc_",
",_",
"mc",
"2_",
",_",
"skew",
"_",
",_",
"kur",
"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_",
"mn",
"c2",
"mv",
"sk_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"central",
" ",
"moments",
" ",
"to",
" ",
"mean",
",",
" ",
"varian",
"ce",
",",
" ",
"skew",
",",
" ",
"kur",
"tos",
"is",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
"convert",
" ",
"four",
" ",
"non",
"-",
"central",
" ",
"moments",
" ",
"to",
" ",
"central",
" ",
"moments_",
"\\u\\u\\uNL\\u\\u\\u_",
"mn",
"c_",
",_",
"mn",
"c2_",
",_",
"mn",
"c3_",
",_",
"mn",
"c4_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
"=_",
"mn",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc",
"2_",
"=_",
"mn",
"c2_",
"-_",
"mn",
"c_",
"*_",
"mn",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc",
"3_",
"=_",
"mn",
"c3_",
"-_",
"(_",
"3_",
"*_",
"mc_",
"*_",
"mc",
"2_",
"+_",
"mc_",
"**_",
"3_",
")_",
"#",
" ",
"3",
"rd",
" ",
"central",
" ",
"moment_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc",
"4_",
"=_",
"mn",
"c4_",
"-_",
"(_",
"4_",
"*_",
"mc_",
"*_",
"mc",
"3_",
"+_",
"6_",
"*_",
"mc_",
"*_",
"mc_",
"*_",
"mc",
"2_",
"+_",
"mc_",
"**_",
"4_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"mc",
"2m",
"vs",
"k_",
"(_",
"(_",
"mc_",
",_",
"mc",
"2_",
",_",
"mc",
"3_",
",_",
"mc",
"4_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"cov",
"2co",
"rr_",
"(_",
"cov_",
",_",
"return",
"\\u",
"std_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"covariance",
" ",
"matrix",
" ",
"to",
" ",
"correlation",
" ",
"matrix",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"cov",
" ",
":",
" ",
"array",
"\\u",
"like",
",",
" ",
"2d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"covariance",
" ",
"matrix",
",",
" ",
"see",
" ",
"Not",
"es",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"corr",
" ",
":",
" ",
"ndar",
"ray",
" ",
"(",
"subclass",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"correlation",
" ",
"matrix",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"return",
"\\u",
"std",
" ",
":",
" ",
"bool",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"this",
" ",
"is",
" ",
"true",
" ",
"then",
" ",
"the",
" ",
"standard",
" ",
"deviation",
" ",
"is",
" ",
"als",
"o",
" ",
"return",
"ed",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"By",
" ",
"default",
" ",
"only",
" ",
"the",
" ",
"correlation",
" ",
"matrix",
" ",
"is",
" ",
"return",
"ed",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-----",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"function",
" ",
"doe",
"s",
" ",
"not",
" ",
"convert",
" ",
"subclasses",
" ",
"of",
" ",
"ndar",
"rays",
".",
" ",
"Thi",
"s",
" ",
"require",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"tha",
"t",
" ",
"divisi",
"on",
" ",
"is",
" ",
"defin",
"ed",
" ",
"element",
"wis",
"e",
".",
" ",
"np",
".",
"ma",
".",
"array",
" ",
"and",
" ",
"np",
".",
"matrix",
" ",
"are",
" ",
"allow",
"ed",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cov_",
"=_",
"np_",
"._",
"asan",
"yar",
"ray_",
"(_",
"cov_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"std",
"\\u_",
"=_",
"np_",
"._",
"sqrt_",
"(_",
"np_",
"._",
"diag_",
"(_",
"cov_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"corr_",
"=_",
"cov_",
"/_",
"np_",
"._",
"outer_",
"(_",
"std",
"\\u_",
",_",
"std",
"\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"return",
"\\u",
"std_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"corr_",
",_",
"std",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"corr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"corr",
"2co",
"v_",
"(_",
"corr_",
",_",
"std_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"convert",
" ",
"correlation",
" ",
"matrix",
" ",
"to",
" ",
"covariance",
" ",
"matrix",
" ",
"give",
"n",
" ",
"standard",
" ",
"deviation",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"corr",
" ",
":",
" ",
"array",
"\\u",
"like",
",",
" ",
"2d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"correlation",
" ",
"matrix",
",",
" ",
"see",
" ",
"Not",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"std",
" ",
":",
" ",
"array",
"\\u",
"like",
",",
" ",
"1d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"standard",
" ",
"deviation",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"cov",
" ",
":",
" ",
"ndar",
"ray",
" ",
"(",
"subclass",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"covariance",
" ",
"matrix",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-----",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"function",
" ",
"doe",
"s",
" ",
"not",
" ",
"convert",
" ",
"subclasses",
" ",
"of",
" ",
"ndar",
"rays",
".",
" ",
"Thi",
"s",
" ",
"require",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"tha",
"t",
" ",
"multiplication",
" ",
"is",
" ",
"defin",
"ed",
" ",
"element",
"wis",
"e",
".",
" ",
"np",
".",
"ma",
".",
"array",
" ",
"are",
" ",
"allow",
"ed",
",",
" ",
"but",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"not",
" ",
"matric",
"es",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"corr_",
"=_",
"np_",
"._",
"asan",
"yar",
"ray_",
"(_",
"corr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"std",
"\\u_",
"=_",
"np_",
"._",
"asan",
"yar",
"ray_",
"(_",
"std_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cov_",
"=_",
"corr_",
"*_",
"np_",
"._",
"outer_",
"(_",
"std",
"\\u_",
",_",
"std",
"\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"cov_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"se",
"\\u",
"cov_",
"(_",
"cov_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"get",
" ",
"standard",
" ",
"deviation",
" ",
"from",
" ",
"covariance",
" ",
"matrix",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"just",
" ",
"a",
" ",
"short",
"hand",
" ",
"function",
" ",
"np",
".",
"sqrt",
"(",
"np",
".",
"diag",
"(",
"cov",
"))\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"cov",
" ",
":",
" ",
"array",
"\\u",
"like",
",",
" ",
"square",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"covariance",
" ",
"matrix",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"std",
" ",
":",
" ",
"ndar",
"ray",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"standard",
" ",
"deviation",
" ",
"from",
" ",
"diagonal",
" ",
"of",
" ",
"cov",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"np_",
"._",
"sqrt_",
"(_",
"np_",
"._",
"diag_",
"(_",
"cov_",
")_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Duplicate key in dict literal | dahlia/sider/sidertests/test_sortedset.py | [
{
"content": "def test_discard_t(session):\n session2 = get_session()\n keyid = key('test_sortedset_discard_t')\n set_ = session.set(keyid, S('abc'), SortedSet)\n set2 = session2.get(keyid, SortedSet)\n with Transaction(session, [keyid]):\n len(set_)\n set_.discard('a')\n assert dict(set2) == {'a': 1, 'b': 1, 'c': 1}\n with raises(CommitError):\n len(set_)\n assert dict(set_) == dict(set2) == {'b': 1, 'c': 1}\n with Transaction(session, [keyid]):\n len(set_)\n set_.discard('d')\n assert dict(set2) == {'b': 1, 'c': 1}\n assert dict(set_) == dict(set2) == {'b': 1, 'c': 1}\n with Transaction(session, [keyid]):\n len(set_)\n set_.discard('b', score=0.5)\n assert dict(set2) == {'b': 1, 'c': 1}\n with raises(CommitError):\n len(set_)\n assert dict(set_) == dict(set2) == {'b': 0.5, 'c': 1}\n with Transaction(session, [keyid]):\n len(set_)\n set_.discard('b', score=0.5, remove=-1)\n assert dict(set2) == {'b': 0.5, 'c': 1}\n with raises(CommitError):\n len(set_)\n assert dict(set_) == dict(set2) == {'b': 0, 'c': 1}",
"metadata": "root.test_discard_t",
"header": "['module', '___EOS___']",
"index": 297
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Duplicate",
"_",
"key_",
"in_",
"dict_",
"literal_",
"[SEP]_",
"module_",
"\\u\\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",
"discard",
"\\u",
"t_",
"(_",
"session_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"session",
"2_",
"=_",
"get",
"\\u",
"session_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"keyid",
"_",
"=_",
"key_",
"(_",
"'",
"test\\u",
"sorte",
"dset",
"\\u",
"discard",
"\\u",
"t",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set\\u",
"_",
"=_",
"session_",
"._",
"set_",
"(_",
"keyid",
"_",
",_",
"S_",
"(_",
"'",
"abc",
"'_",
")_",
",_",
"Sorte",
"d",
"Set_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set",
"2_",
"=_",
"session",
"2_",
"._",
"get_",
"(_",
"keyid",
"_",
",_",
"Sorte",
"d",
"Set_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"Transaction_",
"(_",
"session_",
",_",
"[_",
"keyid",
"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"len_",
"(_",
"set\\u",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set\\u",
"_",
"._",
"discard_",
"(_",
"'",
"a",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"a",
"'_",
":_",
"1_",
",_",
"'",
"b",
"'_",
":_",
"1_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"raises_",
"(_",
"Commi",
"t",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"len_",
"(_",
"set\\u",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set\\u",
"_",
")_",
"==_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"b",
"'_",
":_",
"1_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"Transaction_",
"(_",
"session_",
",_",
"[_",
"keyid",
"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"len_",
"(_",
"set\\u",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set\\u",
"_",
"._",
"discard_",
"(_",
"'",
"d",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"b",
"'_",
":_",
"1_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set\\u",
"_",
")_",
"==_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"b",
"'_",
":_",
"1_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"Transaction_",
"(_",
"session_",
",_",
"[_",
"keyid",
"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"len_",
"(_",
"set\\u",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set\\u",
"_",
"._",
"discard_",
"(_",
"'",
"b",
"'_",
",_",
"score_",
"=_",
"0.5_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"b",
"'_",
":_",
"1_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"raises_",
"(_",
"Commi",
"t",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"len_",
"(_",
"set\\u",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set\\u",
"_",
")_",
"==_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"b",
"'_",
":_",
"0.5_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"Transaction_",
"(_",
"session_",
",_",
"[_",
"keyid",
"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"len_",
"(_",
"set\\u",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set\\u",
"_",
"._",
"discard_",
"(_",
"'",
"b",
"'_",
",_",
"score_",
"=_",
"0.5_",
",_",
"remove_",
"=_",
"-_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"dict_",
"(_",
"set",
"2_",
")_",
"==_",
"{_",
"'",
"b",
"'_",
":_",
"0.5_",
",_",
"'",
"c",
"'_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/gdal/libgdal.py | [
{
"content": "from __future__ import unicode_literals\n\nimport logging\nimport os\nimport re\nfrom ctypes import c_char_p, c_int, CDLL, CFUNCTYPE\nfrom ctypes.util import find_library\n\nfrom django.contrib.gis.gdal.error import OGRException\nfrom django.core.exceptions import ImproperlyConfigured\n\nlogger = logging.getLogger('django.contrib.gis')\n\n# Custom library path set?\ntry:\n from django.conf import settings\n lib_path = settings.GDAL_LIBRARY_PATH\nexcept (AttributeError, EnvironmentError,\n ImportError, ImproperlyConfigured):\n lib_path = None\n\nif lib_path:\n lib_names = None\nelif os.name == 'nt':\n # Windows NT shared libraries\n lib_names = ['gdal19', 'gdal18', 'gdal17', 'gdal16', 'gdal15']\nelif os.name == 'posix':\n # *NIX library names.\n lib_names = ['gdal', 'GDAL', 'gdal1.9.0', 'gdal1.8.0', 'gdal1.7.0',\n 'gdal1.6.0', 'gdal1.5.0']\nelse:\n raise OGRException('Unsupported OS \"%s\"' % os.name)\n\n# Using the ctypes `find_library` utility to find the\n# path to the GDAL library from the list of library names.\nif lib_names:\n for lib_name in lib_names:\n lib_path = find_library(lib_name)\n if not lib_path is None: break\n\nif lib_path is None:\n raise OGRException('Could not find the GDAL library (tried \"%s\"). '\n 'Try setting GDAL_LIBRARY_PATH in your settings.' %\n '\", \"'.join(lib_names))\n\n# This loads the GDAL/OGR C library\nlgdal = CDLL(lib_path)\n\n# On Windows, the GDAL binaries have some OSR routines exported with\n# STDCALL, while others are not. Thus, the library will also need to\n# be loaded up as WinDLL for said OSR functions that require the\n# different calling convention.\nif os.name == 'nt':\n from ctypes import WinDLL\n lwingdal = WinDLL(lib_path)\n\n\n#### Version-information functions. ####\n\n# Returns GDAL library version information with the given key.\n_version_info = std_call('GDALVersionInfo')\n_version_info.argtypes = [c_char_p]\n_version_info.restype = c_char_p\n\n\n\nversion_regex = re.compile(r'^(?P<major>\\d+)\\.(?P<minor>\\d+)(\\.(?P<subminor>\\d+))?')\n\n_verinfo = gdal_version_info()\nGDAL_MAJOR_VERSION = int(_verinfo['major'])\nGDAL_MINOR_VERSION = int(_verinfo['minor'])\nGDAL_SUBMINOR_VERSION = _verinfo['subminor'] and int(_verinfo['subminor'])\nGDAL_VERSION = (GDAL_MAJOR_VERSION, GDAL_MINOR_VERSION, GDAL_SUBMINOR_VERSION)\ndel _verinfo\n\n# Set library error handling so as errors are logged\nCPLErrorHandler = CFUNCTYPE(None, c_int, c_int, c_char_p)\nerr_handler = CPLErrorHandler(err_handler)\n\n\nset_error_handler = function('CPLSetErrorHandler', [CPLErrorHandler], CPLErrorHandler)\nset_error_handler(err_handler)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def std_call(func):\n \"\"\"\n Returns the correct STDCALL function for certain OSR routines on Win32\n platforms.\n \"\"\"\n if os.name == 'nt':\n return lwingdal[func]\n else:\n return lgdal[func]",
"metadata": "root.std_call",
"header": "['module', '___EOS___']",
"index": 56
},
{
"content": "def gdal_version():\n \"Returns only the GDAL version number information.\"\n return _version_info(b'RELEASE_NAME')",
"metadata": "root.gdal_version",
"header": "['module', '___EOS___']",
"index": 73
},
{
"content": "def gdal_full_version():\n \"Returns the full GDAL version information.\"\n return _version_info('')",
"metadata": "root.gdal_full_version",
"header": "['module', '___EOS___']",
"index": 77
},
{
"content": "def gdal_version_info():\n ver = gdal_version().decode()\n m = version_regex.match(ver)\n if not m: raise OGRException('Could not parse GDAL version string \"%s\"' % ver)\n return dict([(key, m.group(key)) for key in ('major', 'minor', 'subminor')])",
"metadata": "root.gdal_version_info",
"header": "['module', '___EOS___']",
"index": 82
},
{
"content": "def err_handler(error_class, error_number, message):\n logger.error('GDAL_ERROR %d: %s' % (error_number, message))",
"metadata": "root.err_handler",
"header": "['module', '___EOS___']",
"index": 97
},
{
"content": "def function(name, args, restype):\n func = std_call(name)\n func.argtypes = args\n func.restype = restype\n return func",
"metadata": "root.function",
"header": "['module', '___EOS___']",
"index": 101
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\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_",
"logging_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"ctypes_",
"import_",
"c\\u",
"char",
"\\u",
"p_",
",_",
"c\\u",
"int_",
",_",
"CD",
"LL_",
",_",
"CFUNCTYPE_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"ctypes_",
"._",
"util_",
"import_",
"find",
"\\u",
"library_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"gis_",
"._",
"gdal_",
"._",
"error_",
"import_",
"OGR",
"Exception_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"exceptions_",
"import_",
"Impro",
"perl",
"y",
"Configured_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"logger_",
"=_",
"logging_",
"._",
"get",
"Logger_",
"(_",
"'",
"django",
".",
"contrib",
".",
"gi",
"s",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Custom",
" ",
"librar",
"y",
" ",
"path",
" ",
"set",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"django_",
"._",
"conf_",
"import_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lib",
"\\u",
"path_",
"=_",
"settings_",
"._",
"GDA",
"L",
"\\u",
"LIBRARY",
"\\u",
"PATH_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"(_",
"Attribute",
"Error_",
",_",
"Environ",
"ment",
"Error_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Import",
"Error_",
",_",
"Impro",
"perl",
"y",
"Configured_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"lib",
"\\u",
"path_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"lib",
"\\u",
"path_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"lib",
"\\u",
"names_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"os_",
"._",
"name_",
"==_",
"'",
"nt",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Window",
"s",
" ",
"NT",
" ",
"shared",
" ",
"libraries_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"lib",
"\\u",
"names_",
"=_",
"[_",
"'",
"gdal",
"1",
"9",
"'_",
",_",
"'",
"gdal",
"1",
"8",
"'_",
",_",
"'",
"gdal",
"1",
"7",
"'_",
",_",
"'",
"gdal",
"16",
"'_",
",_",
"'",
"gdal",
"15",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"os_",
"._",
"name_",
"==_",
"'",
"posix",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"*",
"NI",
"X",
" ",
"librar",
"y",
" ",
"names",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"lib",
"\\u",
"names_",
"=_",
"[_",
"'",
"gdal",
"'_",
",_",
"'",
"GDA",
"L",
"'_",
",_",
"'",
"gdal",
"1.9",
".0",
"'_",
",_",
"'",
"gdal",
"1.8",
".0",
"'_",
",_",
"'",
"gdal",
"1.7",
".0",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"gdal",
"1.6",
".0",
"'_",
",_",
"'",
"gdal",
"1.5",
".0",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"OGR",
"Exception_",
"(_",
"'",
"Unsu",
"ppo",
"rted",
" ",
"OS",
" ",
"\"%",
"s",
"\"'_",
"%_",
"os_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Us",
"ing",
" ",
"the",
" ",
"ctype",
"s",
" ",
"`",
"find",
"\\u",
"librar",
"y",
"`",
" ",
"utility",
" ",
" ",
"to",
" ",
"find",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"path",
" ",
"to",
" ",
"the",
" ",
"GDA",
"L",
" ",
"librar",
"y",
" ",
"from",
" ",
"the",
" ",
"list",
" ",
"of",
" ",
"librar",
"y",
" ",
"names",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"lib",
"\\u",
"names_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"lib",
"\\u",
"name_",
"in_",
"lib",
"\\u",
"names_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"lib",
"\\u",
"path_",
"=_",
"find",
"\\u",
"library_",
"(_",
"lib",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"lib",
"\\u",
"path_",
"is_",
"None_",
":_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"lib",
"\\u",
"path_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"OGR",
"Exception_",
"(_",
"'",
"Cou",
"ld",
" ",
"not",
" ",
"find",
" ",
"the",
" ",
"GDA",
"L",
" ",
"librar",
"y",
" ",
"(",
"trie",
"d",
" ",
"\"%",
"s",
"\")",
".",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"GDA",
"L",
"\\u",
"LIBRARY",
"\\u",
"PATH",
" ",
"in",
" ",
"your",
" ",
"settings",
".'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"'\",",
" ",
"\"'_",
"._",
"join_",
"(_",
"lib",
"\\u",
"names_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"load",
"s",
" ",
"the",
" ",
"GDA",
"L",
"/",
"OGR",
" ",
"C",
" ",
"library_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"lg",
"dal",
"_",
"=_",
"CD",
"LL_",
"(_",
"lib",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"On",
" ",
"Window",
"s",
",",
" ",
"the",
" ",
"GDA",
"L",
" ",
"binaries",
" ",
"have",
" ",
"some",
" ",
"OS",
"R",
" ",
"routin",
"es",
" ",
"exported",
" ",
"with_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"STD",
"CALL",
",",
" ",
"whi",
"le",
" ",
"other",
"s",
" ",
"are",
" ",
"not",
".",
" ",
" ",
"Thu",
"s",
",",
" ",
"the",
" ",
"librar",
"y",
" ",
"will",
" ",
"als",
"o",
" ",
"need",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"be",
" ",
"load",
"ed",
" ",
"up",
" ",
"as",
" ",
"Win",
"DLL",
" ",
"for",
" ",
"sai",
"d",
" ",
"OS",
"R",
" ",
"function",
"s",
" ",
"tha",
"t",
" ",
"require",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"different",
" ",
"calling",
" ",
"convention",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"os_",
"._",
"name_",
"==_",
"'",
"nt",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"ctypes_",
"import_",
"Win",
"DLL",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lw",
"ing",
"dal",
"_",
"=_",
"Win",
"DLL",
"_",
"(_",
"lib",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###",
"#",
" ",
"Version",
"-",
"informati",
"on",
" ",
"function",
"s",
".",
" ",
"###",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Return",
"s",
" ",
"GDA",
"L",
" ",
"librar",
"y",
" ",
"version",
" ",
"informati",
"on",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
" ",
"key",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"version",
"\\u",
"info_",
"=_",
"std",
"\\u",
"call_",
"(_",
"'",
"GDA",
"LV",
"ersi",
"on",
"Info",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"version",
"\\u",
"info_",
"._",
"argtypes_",
"=_",
"[_",
"c\\u",
"char",
"\\u",
"p_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"version",
"\\u",
"info_",
"._",
"restype_",
"=_",
"c\\u",
"char",
"\\u",
"p_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"version",
"\\u",
"regex_",
"=_",
"re_",
"._",
"compile_",
"(_",
"r",
"'",
"^",
"(?",
"P",
"<",
"major",
">\\\\",
"d",
"+)\\\\",
".(",
"?",
"P",
"<",
"mino",
"r",
">\\\\",
"d",
"+)(",
"\\\\.(",
"?",
"P",
"<",
"subm",
"inor",
">\\\\",
"d",
"+))",
"?'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"veri",
"nfo_",
"=_",
"gdal",
"\\u",
"version",
"\\u",
"info_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GDA",
"L",
"\\u",
"MAJOR",
"\\u",
"VERSION_",
"=_",
"int_",
"(_",
"\\u",
"veri",
"nfo_",
"[_",
"'",
"major",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GDA",
"L",
"\\u",
"MINOR",
"\\u",
"VERSION_",
"=_",
"int_",
"(_",
"\\u",
"veri",
"nfo_",
"[_",
"'",
"mino",
"r",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GDA",
"L",
"\\u",
"SUB",
"MINOR",
"\\u",
"VERSION_",
"=_",
"\\u",
"veri",
"nfo_",
"[_",
"'",
"subm",
"inor",
"'_",
"]_",
"and_",
"int_",
"(_",
"\\u",
"veri",
"nfo_",
"[_",
"'",
"subm",
"inor",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GDA",
"L",
"\\u",
"VERSION_",
"=_",
"(_",
"GDA",
"L",
"\\u",
"MAJOR",
"\\u",
"VERSION_",
",_",
"GDA",
"L",
"\\u",
"MINOR",
"\\u",
"VERSION_",
",_",
"GDA",
"L",
"\\u",
"SUB",
"MINOR",
"\\u",
"VERSION_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"del_",
"\\u",
"veri",
"nfo_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Set",
" ",
"librar",
"y",
" ",
"error",
" ",
"handling",
" ",
"so",
" ",
"as",
" ",
"error",
"s",
" ",
"are",
" ",
"logged",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"CP",
"LE",
"rror",
"Handler_",
"=_",
"CFUNCTYPE_",
"(_",
"None_",
",_",
"c\\u",
"int_",
",_",
"c\\u",
"int_",
",_",
"c\\u",
"char",
"\\u",
"p_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"err",
"\\u",
"handler_",
"=_",
"CP",
"LE",
"rror",
"Handler_",
"(_",
"err",
"\\u",
"handler_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"set\\u",
"error",
"\\u",
"handler_",
"=_",
"function_",
"(_",
"'",
"CP",
"LS",
"et",
"Error",
"Handle",
"r",
"'_",
",_",
"[_",
"CP",
"LE",
"rror",
"Handler_",
"]_",
",_",
"CP",
"LE",
"rror",
"Handler_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"set\\u",
"error",
"\\u",
"handler_",
"(_",
"err",
"\\u",
"handler_",
")_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"std",
"\\u",
"call_",
"(_",
"func_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
" ",
"the",
" ",
"correct",
" ",
"STD",
"CALL",
" ",
"function",
" ",
"for",
" ",
"cert",
"ain",
" ",
"OS",
"R",
" ",
"routin",
"es",
" ",
"on",
" ",
"Win",
"32",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"platform",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"os_",
"._",
"name_",
"==_",
"'",
"nt",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"lw",
"ing",
"dal",
"_",
"[_",
"func_",
"]_",
"\\u\\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_",
"lg",
"dal",
"_",
"[_",
"func_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"gdal",
"\\u",
"version_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Return",
"s",
" ",
"only",
" ",
"the",
" ",
"GDA",
"L",
" ",
"version",
" ",
"number",
" ",
"informati",
"on",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u",
"version",
"\\u",
"info_",
"(_",
"b",
"'",
"RELEASE",
"\\u",
"NAME",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"gdal",
"\\u",
"full",
"\\u",
"version_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Return",
"s",
" ",
"the",
" ",
"full",
" ",
"GDA",
"L",
" ",
"version",
" ",
"informati",
"on",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u",
"version",
"\\u",
"info_",
"(_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"gdal",
"\\u",
"version",
"\\u",
"info_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ver_",
"=_",
"gdal",
"\\u",
"version_",
"(_",
")_",
"._",
"decode_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"m_",
"=_",
"version",
"\\u",
"regex_",
"._",
"match_",
"(_",
"ver_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"m_",
":_",
"raise_",
"OGR",
"Exception_",
"(_",
"'",
"Cou",
"ld",
" ",
"not",
" ",
"parse",
" ",
"GDA",
"L",
" ",
"version",
" ",
"string",
" ",
"\"%",
"s",
"\"'_",
"%_",
"ver_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"dict_",
"(_",
"[_",
"(_",
"key_",
",_",
"m_",
"._",
"group_",
"(_",
"key_",
")_",
")_",
"for_",
"key_",
"in_",
"(_",
"'",
"major",
"'_",
",_",
"'",
"mino",
"r",
"'_",
",_",
"'",
"subm",
"inor",
"'_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"err",
"\\u",
"handler_",
"(_",
"error",
"\\u",
"class_",
",_",
"error",
"\\u",
"number_",
",_",
"message_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"error_",
"(_",
"'",
"GDA",
"L",
"\\u",
"ERROR",
" ",
"%",
"d",
":",
" ",
"%",
"s",
"'_",
"%_",
"(_",
"error",
"\\u",
"number_",
",_",
"message_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"function_",
"(_",
"name_",
",_",
"args_",
",_",
"restype_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"std",
"\\u",
"call_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"func_",
"._",
"argtypes_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"func_",
"._",
"restype_",
"=_",
"restype_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"func_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | seomoz/shovel/test/test_run.py | [
{
"content": " def test_tasks(self):\n '''Make sure we can enumerate tasks'''\n actual = self.stdout(\n 'test/examples/run/basic', 'tasks')\n expected = ['bar # Dummy function']\n self.assertEqual(actual, expected)",
"metadata": "root.TestRun.test_tasks",
"header": "['class', 'TestRun', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 102
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Test",
"Run_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"tasks_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"Make",
" ",
"sure",
" ",
"we",
" ",
"can",
" ",
"enumerate",
" ",
"task",
"s",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"actual_",
"=_",
"self_",
"._",
"stdout_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
"/",
"example",
"s",
"/",
"run",
"/",
"basic",
"'_",
",_",
"'",
"task",
"s",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"[_",
"'",
"bar",
" ",
"#",
" ",
"Du",
"mm",
"y",
" ",
"function",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"actual_",
",_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | thisissoon/Flask-Via/tests/test_routers/test_default.py | [
{
"content": " def test_url_prefix(self):\n route = default.Pluggable('/', self.View, 'foo')\n route.add_to_app(self.app, url_prefix='/foo')\n\n self.assertEqual(url_for('foo'), '/foo/')\n self.assertEqual(self.client.get('/foo/').data, b'foo')",
"metadata": "root.TestFlaskPluggableRouter.test_url_prefix",
"header": "['class', 'TestFlaskPluggableRouter', '(', 'ViaTestCase', ')', ':', '___EOS___']",
"index": 71
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Test",
"Fla",
"sk",
"Plug",
"gab",
"le",
"Router_",
"(_",
"Via",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"url",
"\\u",
"prefix_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"route_",
"=_",
"default_",
"._",
"Plug",
"gab",
"le_",
"(_",
"'/'_",
",_",
"self_",
"._",
"View_",
",_",
"'",
"foo",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"route_",
"._",
"add",
"\\u",
"to",
"\\u",
"app_",
"(_",
"self_",
"._",
"app_",
",_",
"url",
"\\u",
"prefix_",
"=_",
"'/",
"foo",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"url",
"\\u",
"for_",
"(_",
"'",
"foo",
"'_",
")_",
",_",
"'/",
"foo",
"/'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"self_",
"._",
"client_",
"._",
"get_",
"(_",
"'/",
"foo",
"/'_",
")_",
"._",
"data_",
",_",
"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
] |
Unused import | amueller/word_cloud/doc/conf.py | [
{
"content": "# -*- coding: utf-8 -*-\n#\n# wordcloud documentation build configuration file, created by\n# sphinx-quickstart on Fri May 3 17:14:50 2013.\n#\n# This file is execfile()d with the current directory set to its containing\n# dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\nimport sphinx_bootstrap_theme\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.\nsys.path.insert(0, os.path.abspath('sphinxext'))\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 ones.\nextensions = ['gen_rst', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary',\n 'sphinx.ext.doctest', 'sphinx.ext.pngmath',\n 'sphinx.ext.viewcode', 'numpy_ext.numpydoc']\n\nautosummary_generate = True\n\nautodoc_default_flags = ['members', 'inherited-members']\n\n# generate autosummary even if no references\nautosummary_generate = True\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'wordcloud'\ncopyright = u'2013, Andreas Mueller'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '0.1'\n# The full version, including alpha/beta/rc tags.\nrelease = '0.1'\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 = ['_build', '_templates', '_themes']\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\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 = 'bootstrap'\n\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = ['_themes']\nhtml_theme_path = sphinx_bootstrap_theme.get_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# 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 = 'wordclouddoc'\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, author, documentclass\n# [howto/manual]).\n#latex_documents = [('index', 'wordcloud.tex', u'wordcloud Documentation',\n #u'Andreas Mueller', 'manual'), ]\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', 'wordcloud', u'wordcloud Documentation',\n [u'Andreas Mueller'], 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', 'wordcloud', u'wordcloud Documentation', u'Andreas Mueller',\n 'wordcloud', 'One line description of project.', '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\n# Theme options are theme-specific and customize the look and feel of a\n# theme further.\nhtml_theme_options = {\n # Navigation bar title. (Default: ``project`` value)\n 'navbar_title': \"Wordcloud\",\n\n # Tab name for entire site. (Default: \"Site\")\n #'navbar_site_name': \"Site\",\n\n # A list of tuples containting pages to link to. The value should\n # be in the form [(name, page), ..]\n 'navbar_links': [\n ('Examples', 'auto_examples/index'),\n ('References', 'references'),\n ],\n\n # Global TOC depth for \"site\" navbar tab. (Default: 1)\n # Switching to -1 shows all levels.\n 'globaltoc_depth': 0,\n\n # Include hidden TOCs in Site navbar?\n #\n # Note: If this is \"false\", you cannot have mixed ``:hidden:`` and\n # non-hidden ``toctree`` directives in the same page, or else the build\n # will break.\n #\n # Values: \"true\" (default) or \"false\"\n 'globaltoc_includehidden': \"true\",\n\n # HTML navbar class (Default: \"navbar\") to attach to <div> element.\n # For black navbar, do \"navbar navbar-inverse\"\n 'navbar_class': \"navbar\",\n\n # Fix navigation bar to top of page?\n # Values: \"true\" (default) or \"false\"\n 'navbar_fixed_top': \"true\",\n\n # Location of link to source.\n # Options are \"nav\" (default), \"footer\" or anything else to exclude.\n 'source_link_position': \"None\",\n\n # Bootswatch (http://bootswatch.com/) theme.\n #\n # Options are nothing with \"\" (default) or the name of a valid theme\n # such as \"amelia\" or \"cosmo\".\n #\n # Note that this is served off CDN, so won't be available offline.\n #'bootswatch_theme': \"united\",\n}\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_",
"#",
" ",
"wordc",
"loud",
" ",
"documentation",
" ",
"build",
" ",
"configura",
"tion",
" ",
"file",
",",
" ",
"created",
" ",
"by_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"sphinx",
"-",
"quicks",
"tart",
" ",
"on",
" ",
"Fri",
" ",
"Ma",
"y",
" ",
" ",
"3",
" ",
"1",
"7",
":",
"14",
":",
"50",
" ",
"2013",
"._",
"\\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",
" ",
"contain",
"ing_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"dir",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Not",
"e",
" ",
"tha",
"t",
" ",
"not",
" ",
"all",
" ",
"possib",
"le",
" ",
"configura",
"tion",
" ",
"values",
" ",
"are",
" ",
"presen",
"t",
" ",
"in",
" ",
"this_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"autogen",
"erate",
"d",
" ",
"file",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"configura",
"tion",
" ",
"values",
" ",
"have",
" ",
"a",
" ",
"default",
";",
" ",
"values",
" ",
"tha",
"t",
" ",
"are",
" ",
"commente",
"d",
" ",
"out_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"serve",
" ",
"to",
" ",
"show",
" ",
"the",
" ",
"default",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"sphinx",
"\\u",
"boots",
"trap",
"\\u",
"theme_",
"\\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_",
"._",
"abspath_",
"(_",
"'",
"sphinx",
"ext",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\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",
" ",
"ones",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"extensions_",
"=_",
"[_",
"'",
"gen",
"\\u",
"rst",
"'_",
",_",
"'",
"sphinx",
".",
"ext",
".",
"autod",
"oc",
"'_",
",_",
"'",
"sphinx",
".",
"ext",
".",
"autosu",
"mmar",
"y",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"sphinx",
".",
"ext",
".",
"docte",
"st",
"'_",
",_",
"'",
"sphinx",
".",
"ext",
".",
"png",
"math",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"sphinx",
".",
"ext",
".",
"view",
"code",
"'_",
",_",
"'",
"nump",
"y",
"\\u",
"ext",
".",
"nump",
"ydo",
"c",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"autosu",
"mmar",
"y",
"\\u",
"generate_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"autod",
"oc",
"\\u",
"default",
"\\u",
"flags_",
"=_",
"[_",
"'",
"member",
"s",
"'_",
",_",
"'",
"inherited",
"-",
"member",
"s",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"generat",
"e",
" ",
"autosu",
"mmar",
"y",
" ",
"even",
" ",
"if",
" ",
"no",
" ",
"references_",
"\\u\\u\\uNL\\u\\u\\u_",
"autosu",
"mmar",
"y",
"\\u",
"generate_",
"=_",
"True_",
"\\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",
"'",
"wordc",
"loud",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"copyright_",
"=_",
"u",
"'",
"2013",
",",
" ",
"Andre",
"as",
" ",
"Mu",
"elle",
"r",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"version",
" ",
"info",
" ",
"for",
" ",
"the",
" ",
"project",
" ",
"you",
"'",
"re",
" ",
"document",
"ing",
",",
" ",
"acts",
" ",
"as",
" ",
"replace",
"ment",
" ",
"for_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"|",
"version",
"|",
" ",
"and",
" ",
"|",
"release",
"|",
",",
" ",
"als",
"o",
" ",
"used",
" ",
"in",
" ",
"vari",
"ous",
" ",
"other",
" ",
"place",
"s",
" ",
"through",
"out",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"bui",
"lt",
" ",
"document",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"short",
" ",
"X",
".",
"Y",
" ",
"version",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"version_",
"=_",
"'",
"0.",
"1",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"full",
" ",
"version",
",",
" ",
"inclu",
"ding",
" ",
"alpha",
"/",
"beta",
"/",
"rc",
" ",
"tags",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"release_",
"=_",
"'",
"0.",
"1",
"'_",
"\\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",
"build",
"'_",
",_",
"'\\u",
"template",
"s",
"'_",
",_",
"'\\u",
"themes",
"'_",
"]_",
"\\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_",
"\\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_",
"=_",
"'",
"boots",
"trap",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\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",
"themes",
"']",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"html",
"\\u",
"them",
"e\\u",
"path_",
"=_",
"sphinx",
"\\u",
"boots",
"trap",
"\\u",
"theme_",
"._",
"get",
"\\u",
"html",
"\\u",
"them",
"e\\u",
"path_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\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_",
"#",
" ",
"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_",
"=_",
"'",
"wordc",
"loud",
"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",
",",
" ",
"author",
",",
" ",
"document",
"class_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"[",
"how",
"to",
"/",
"manu",
"al",
"])",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"document",
"s",
" ",
"=",
" ",
"[(",
"'",
"index",
"',",
" ",
"'",
"wordc",
"loud",
".",
"tex",
"',",
" ",
"u",
"'",
"wordc",
"loud",
" ",
"Document",
"ation",
"',",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"u",
"'",
"Andre",
"as",
" ",
"Mu",
"elle",
"r",
"',",
" ",
"'",
"manu",
"al",
"')",
",",
" ",
"]_",
"\\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",
" ",
"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",
"'_",
",_",
"'",
"wordc",
"loud",
"'_",
",_",
"u",
"'",
"wordc",
"loud",
" ",
"Document",
"ation",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"u",
"'",
"Andre",
"as",
" ",
"Mu",
"elle",
"r",
"'_",
"]_",
",_",
"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",
"'_",
",_",
"'",
"wordc",
"loud",
"'_",
",_",
"u",
"'",
"wordc",
"loud",
" ",
"Document",
"ation",
"'_",
",_",
"u",
"'",
"Andre",
"as",
" ",
"Mu",
"elle",
"r",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"wordc",
"loud",
"'_",
",_",
"'",
"One",
" ",
"line",
" ",
"description",
" ",
"of",
" ",
"project",
".'_",
",_",
"'",
"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_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Them",
"e",
" ",
"options",
" ",
"are",
" ",
"them",
"e-",
"specific",
" ",
"and",
" ",
"customize",
" ",
"the",
" ",
"look",
" ",
"and",
" ",
"feel",
" ",
"of",
" ",
"a_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"them",
"e",
" ",
"fur",
"ther",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"html",
"\\u",
"them",
"e\\u",
"options_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Navigat",
"ion",
" ",
"bar",
" ",
"title",
".",
" ",
"(",
"Default",
":",
" ",
"``",
"project",
"``",
" ",
"value",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"navbar",
"\\u",
"title",
"'_",
":_",
"\"",
"Word",
"cloud",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tab",
" ",
"name",
" ",
"for",
" ",
"entire",
" ",
"site",
".",
" ",
"(",
"Default",
":",
" ",
"\"",
"Site",
"\")",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"navbar",
"\\u",
"site",
"\\u",
"name",
"':",
" ",
"\"",
"Site",
"\",",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"A",
" ",
"list",
" ",
"of",
" ",
"tuple",
"s",
" ",
"contain",
"ting",
" ",
"page",
"s",
" ",
"to",
" ",
"link",
" ",
"to",
".",
" ",
" ",
"The",
" ",
"value",
" ",
"should_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"be",
" ",
"in",
" ",
"the",
" ",
"form",
" ",
"[(",
"name",
",",
" ",
"page",
"),",
" ",
"..",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"navbar",
"\\u",
"link",
"s",
"'_",
":_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"Exam",
"ples",
"'_",
",_",
"'",
"auto",
"\\u",
"example",
"s",
"/",
"index",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"Reference",
"s",
"'_",
",_",
"'",
"reference",
"s",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Global",
" ",
"TOC",
" ",
"depth",
" ",
"for",
" ",
"\"",
"site",
"\"",
" ",
"navbar",
" ",
"tab",
".",
" ",
"(",
"Default",
":",
" ",
"1",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Switch",
"ing",
" ",
"to",
" ",
"-1",
" ",
"show",
"s",
" ",
"all",
" ",
"level",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"global",
"toc",
"\\u",
"depth",
"'_",
":_",
"0_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Include",
" ",
"hidden",
" ",
"TOC",
"s",
" ",
"in",
" ",
"Site",
" ",
"navbar",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Not",
"e",
":",
" ",
"If",
" ",
"this",
" ",
"is",
" ",
"\"",
"fal",
"se",
"\",",
" ",
"you",
" ",
"cann",
"ot",
" ",
"have",
" ",
"mixed",
" ",
"``",
":",
"hidden",
":`",
"`",
" ",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"non",
"-",
"hidden",
" ",
"``",
"toc",
"tree",
"``",
" ",
"directive",
"s",
" ",
"in",
" ",
"the",
" ",
"same",
" ",
"page",
",",
" ",
"or",
" ",
"else",
" ",
"the",
" ",
"build_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"will",
" ",
"break",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Value",
"s",
":",
" ",
"\"",
"true",
"\"",
" ",
"(",
"default",
")",
" ",
"or",
" ",
"\"",
"fal",
"se",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"global",
"toc",
"\\u",
"include",
"hidden",
"'_",
":_",
"\"",
"true",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"HTM",
"L",
" ",
"navbar",
" ",
"class",
" ",
"(",
"Default",
":",
" ",
"\"",
"navbar",
"\")",
" ",
"to",
" ",
"attach",
" ",
"to",
" ",
"<",
"div",
">",
" ",
"element",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"For",
" ",
"black",
" ",
"navbar",
",",
" ",
"do",
" ",
"\"",
"navbar",
" ",
"navbar",
"-",
"inv",
"erse",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"navbar",
"\\u",
"class",
"'_",
":_",
"\"",
"navbar",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Fix",
" ",
"navigation",
" ",
"bar",
" ",
"to",
" ",
"top",
" ",
"of",
" ",
"page",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Value",
"s",
":",
" ",
"\"",
"true",
"\"",
" ",
"(",
"default",
")",
" ",
"or",
" ",
"\"",
"fal",
"se",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"navbar",
"\\u",
"fixed",
"\\u",
"top",
"'_",
":_",
"\"",
"true",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Locat",
"ion",
" ",
"of",
" ",
"link",
" ",
"to",
" ",
"source",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Optio",
"ns",
" ",
"are",
" ",
"\"",
"nav",
"\"",
" ",
"(",
"default",
"),",
" ",
"\"",
"footer",
"\"",
" ",
"or",
" ",
"anyt",
"hing",
" ",
"else",
" ",
"to",
" ",
"exclu",
"de",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"source",
"\\u",
"link",
"\\u",
"position",
"'_",
":_",
"\"",
"Non",
"e",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Boots",
"watch",
" ",
"(",
"http",
"://",
"boots",
"watch",
".",
"com",
"/)",
" ",
"them",
"e",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Optio",
"ns",
" ",
"are",
" ",
"not",
"hing",
" ",
"with",
" ",
"\"\"",
" ",
"(",
"default",
")",
" ",
"or",
" ",
"the",
" ",
"name",
" ",
"of",
" ",
"a",
" ",
"valid",
" ",
"theme_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"suc",
"h",
" ",
"as",
" ",
"\"",
"ame",
"lia",
"\"",
" ",
"or",
" ",
"\"",
"cosmo",
"\".",
"_",
"\\u\\u\\uNL\\u\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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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' | KunihikoKido/sublime-elasticsearch-client/panel/warmer_list_panel.py | [
{
"content": " def show(self, callback):\n self.callback = callback\n\n options = dict(\n index=self.index\n )\n\n try:\n response = self.client.indices.get_warmer(**options)\n except Exception as e:\n return sublime.error_message(\"Error: {}\".format(e))\n\n self.choices = []\n for name in response[self.index][\"warmers\"].keys():\n print(response[self.index])\n self.choices.append(name)\n self.choices.sort()\n self.window.show_quick_panel(self.choices, self.on_done)",
"metadata": "root.WarmerListPanel.show",
"header": "['class', 'WarmerListPanel', '(', 'object', ')', ':', '___EOS___']",
"index": 17
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"War",
"mer",
"List",
"Panel_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"show_",
"(_",
"self_",
",_",
"callback_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"callback_",
"=_",
"callback_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"options_",
"=_",
"dict_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"index_",
"=_",
"self_",
"._",
"index_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"response_",
"=_",
"self_",
"._",
"client_",
"._",
"indices_",
"._",
"get",
"\\u",
"warm",
"er_",
"(_",
"**_",
"options_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Exception_",
"as_",
"e_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"sublime_",
"._",
"error",
"\\u",
"message_",
"(_",
"\"",
"Error",
":",
" ",
"{}\"_",
"._",
"format_",
"(_",
"e_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"choices_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"response_",
"[_",
"self_",
"._",
"index_",
"]_",
"[_",
"\"",
"warm",
"ers",
"\"_",
"]_",
"._",
"keys_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"response_",
"[_",
"self_",
"._",
"index_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"choices_",
"._",
"append_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"choices_",
"._",
"sort_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"window_",
"._",
"show",
"\\u",
"quick",
"\\u",
"panel_",
"(_",
"self_",
"._",
"choices_",
",_",
"self_",
"._",
"on",
"\\u",
"done_",
")_"
] | [
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
] |
Unused import | christabor/MoAL/MOAL/algorithms/utilities/xor_swap.py | [
{
"content": "# -*- coding: utf-8 -*-\n\n__author__ = \"\"\"Chris Tabor ([email protected])\"\"\"\n\nif __name__ == '__main__':\n from os import getcwd\n from os import sys\n sys.path.append(getcwd())\n\nfrom MOAL.helpers.display import Section\nfrom functools import wraps\nfrom random import randrange as rr\n\nDEBUG = True if __name__ == '__main__' else False\n\n\n\n\n\n\nif DEBUG:\n with Section('XOR Swap'):\n nums = [(rr(10, 999), rr(10, 999)) for _ in range(12)]\n for vars in nums:\n x, y = vars\n assert xor_swap(x, y) == y\n print('x: {}, y: {} => x: {}'.format(x, y, xor_swap(x, y)))\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def _check(func, *args, **kwargs):\n @wraps(func)\n def inner(*args, **kwargs):\n x, y = args\n assert type(x) == type(y) and x is not y\n return func(*args, **kwargs)\n return inner",
"metadata": "root._check",
"header": "['module', '___EOS___']",
"index": 16
},
{
"content": "@_check\ndef xor_swap(x, y):\n x ^= y\n y ^= x\n x ^= y\n return x",
"metadata": "root.xor_swap",
"header": "['module', '___EOS___']",
"index": 25
}
] | [] | [] | 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_",
"\\u\\u",
"author\\u\\u_",
"=_",
"\"\"\"",
"Chr",
"is",
" ",
"Tab",
"or",
" ",
"(",
"dx",
"dst",
"udio",
"@",
"gma",
"il",
".",
"com",
")\"\"\"_",
"\\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 ",
" _",
"from_",
"os_",
"import_",
"getcwd_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"os_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sys_",
"._",
"path_",
"._",
"append_",
"(_",
"getcwd_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"MO",
"AL_",
"._",
"helpers_",
"._",
"display_",
"import_",
"Section_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"functools_",
"import_",
"wraps_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"random_",
"import_",
"randrange_",
"as_",
"rr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"DEBUG_",
"=_",
"True_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"'\\u",
"\\u",
"main",
"\\u\\u'_",
"else_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"DEBUG_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"Section_",
"(_",
"'",
"XO",
"R",
" ",
"Swa",
"p",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"nums_",
"=_",
"[_",
"(_",
"rr_",
"(_",
"10_",
",_",
"999_",
")_",
",_",
"rr_",
"(_",
"10_",
",_",
"999_",
")_",
")_",
"for_",
"\\u_",
"in_",
"range_",
"(_",
"12_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"vars_",
"in_",
"nums_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"x_",
",_",
"y_",
"=_",
"vars_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"xor",
"\\u",
"swap_",
"(_",
"x_",
",_",
"y_",
")_",
"==_",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"print_",
"(_",
"'",
"x",
":",
" ",
"{}",
",",
" ",
"y",
":",
" ",
"{}",
" ",
"=>",
" ",
"x",
":",
" ",
"{}'_",
"._",
"format_",
"(_",
"x_",
",_",
"y_",
",_",
"xor",
"\\u",
"swap_",
"(_",
"x_",
",_",
"y_",
")_",
")_",
")_",
"\\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_",
"def_",
"\\u",
"check_",
"(_",
"func_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"@_",
"wraps_",
"(_",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"inner_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"x_",
",_",
"y_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"type_",
"(_",
"x_",
")_",
"==_",
"type_",
"(_",
"y_",
")_",
"and_",
"x_",
"is_",
"not_",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"func_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"inner_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"\\u",
"check_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"xor",
"\\u",
"swap_",
"(_",
"x_",
",_",
"y_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"x_",
"^",
"=_",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y_",
"^",
"=_",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x_",
"^",
"=_",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Comparison of constants | sahana/eden/modules/unit_tests/s3/s3xml.py | [
{
"content": " def testWithHierarchyInfo(self):\n \"\"\" Test options lookup with foreign key constraint with hierarchy info \"\"\"\n\n assertEqual = self.assertEqual\n assertTrue = self.assertTrue\n\n db = current.db\n s3db = current.s3db\n table = db.fotest_lookup_table\n\n # Configure parent-field\n represent = S3Represent(lookup=\"fotest_lookup_table\")\n table.parent.requires = IS_EMPTY_OR(\n IS_ONE_OF(db,\n \"fotest_lookup_table.id\",\n represent,\n ))\n table.parent.requires = represent\n\n # Configure hierarchy\n s3db.configure(\"fotest_lookup_table\", hierarchy=\"parent\")\n S3Hierarchy.dirty(\"fotest_lookup_table\")\n\n # Insert a child node\n options = dict(self.records)\n child_node = {\"name\": \"option3\",\n \"uuid\": \"OPTION3\",\n \"parent\": options.keys()[0],\n }\n child_id = table.insert(**child_node)\n options[child_id] = child_node\n\n xml = current.xml\n table = db.fotest_table\n fo = xml.get_field_options(table, \"lookup\", show_uids=True, hierarchy=True)\n\n assertTrue(isinstance(fo, etree._Element))\n assertEqual(fo.tag, \"select\")\n\n ATTRIBUTE = xml.ATTRIBUTE\n VALUE = ATTRIBUTE.value\n PARENT = ATTRIBUTE.parent\n UID = xml.UID\n\n has_empty = False\n self.assertEqual(len(fo), len(options) + 1)\n for opt in fo:\n assertEqual(opt.tag, \"option\")\n\n attr = opt.attrib\n assertTrue(VALUE in attr)\n\n value = attr[VALUE]\n if value == \"\":\n has_empty = True\n self.assertFalse(UID in attr)\n assertEqual(opt.text, \"\")\n continue\n else:\n value = int(value)\n\n assertTrue(UID in attr)\n assertEqual(attr[UID], options[value][\"uuid\"])\n assertTrue(value in options)\n assertEqual(opt.text, options[value][\"name\"])\n\n if \"parent\" in options[value] and options[value][\"parent\"]:\n assertTrue(PARENT in attr)\n assertEqual(attr[PARENT], str(options[value][\"parent\"]))\n\n assertTrue(has_empty, msg=\"Empty-option missing\")",
"metadata": "root.GetFieldOptionsTests.testWithHierarchyInfo",
"header": "['class', 'GetFieldOptionsTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 488
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"Get",
"Field",
"Optio",
"ns",
"Tests_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"With",
"Hier",
"arch",
"y",
"Info_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Test",
" ",
"options",
" ",
"look",
"up",
" ",
"with",
" ",
"foreign",
" ",
"key",
" ",
"constraint",
" ",
"with",
" ",
"hier",
"arch",
"y",
" ",
"info",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert",
"Equal_",
"=_",
"self_",
"._",
"assert",
"Equal_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"True_",
"=_",
"self_",
"._",
"assert",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"db_",
"=_",
"current_",
"._",
"db_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s3db_",
"=_",
"current_",
"._",
"s3db_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"table_",
"=_",
"db_",
"._",
"fot",
"est",
"\\u",
"look",
"up",
"\\u",
"table_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Configure",
" ",
"parent",
"-",
"field_",
"\\u\\u\\uNL\\u\\u\\u_",
"represent_",
"=_",
"S",
"3",
"Represent",
"_",
"(_",
"lookup_",
"=_",
"\"",
"fot",
"est",
"\\u",
"look",
"up",
"\\u",
"table",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"table_",
"._",
"parent_",
"._",
"requires_",
"=_",
"IS",
"\\u",
"EMP",
"TY",
"\\u",
"OR_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"IS",
"\\u",
"ONE",
"\\u",
"OF_",
"(_",
"db_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"fot",
"est",
"\\u",
"look",
"up",
"\\u",
"table",
".",
"id",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"represent_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"table_",
"._",
"parent_",
"._",
"requires_",
"=_",
"represent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Configure",
" ",
"hierarchy_",
"\\u\\u\\uNL\\u\\u\\u_",
"s3db_",
"._",
"configure_",
"(_",
"\"",
"fot",
"est",
"\\u",
"look",
"up",
"\\u",
"table",
"\"_",
",_",
"hierarchy_",
"=_",
"\"",
"parent",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"S",
"3",
"Hier",
"arch",
"y_",
"._",
"dirty_",
"(_",
"\"",
"fot",
"est",
"\\u",
"look",
"up",
"\\u",
"table",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Insert",
" ",
"a",
" ",
"child",
" ",
"node_",
"\\u\\u\\uNL\\u\\u\\u_",
"options_",
"=_",
"dict_",
"(_",
"self_",
"._",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"child",
"\\u",
"node_",
"=_",
"{_",
"\"",
"name",
"\"_",
":_",
"\"",
"option",
"3",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"uuid",
"\"_",
":_",
"\"",
"OPTION",
"3",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"parent",
"\"_",
":_",
"options_",
"._",
"keys_",
"(_",
")_",
"[_",
"0_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"child",
"\\u",
"id_",
"=_",
"table_",
"._",
"insert_",
"(_",
"**_",
"child",
"\\u",
"node_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"options_",
"[_",
"child",
"\\u",
"id_",
"]_",
"=_",
"child",
"\\u",
"node_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"xml_",
"=_",
"current_",
"._",
"xml_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"table_",
"=_",
"db_",
"._",
"fot",
"est",
"\\u",
"table_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fo_",
"=_",
"xml_",
"._",
"get",
"\\u",
"field",
"\\u",
"options_",
"(_",
"table_",
",_",
"\"",
"look",
"up",
"\"_",
",_",
"show",
"\\u",
"uids_",
"=_",
"True_",
",_",
"hierarchy_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert",
"True_",
"(_",
"isinstance_",
"(_",
"fo_",
",_",
"etree_",
"._",
"\\u",
"Element_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"Equal_",
"(_",
"fo_",
"._",
"tag_",
",_",
"\"",
"select",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ATTRIBUTE_",
"=_",
"xml_",
"._",
"ATTRIBUTE_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"VALUE_",
"=_",
"ATTRIBUTE_",
"._",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PARENT",
"_",
"=_",
"ATTRIBUTE_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"UID_",
"=_",
"xml_",
"._",
"UID_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"has",
"\\u",
"empty_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"fo_",
")_",
",_",
"len_",
"(_",
"options_",
")_",
"+_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"opt_",
"in_",
"fo_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert",
"Equal_",
"(_",
"opt_",
"._",
"tag_",
",_",
"\"",
"option",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"attr_",
"=_",
"opt_",
"._",
"attrib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"True_",
"(_",
"VALUE_",
"in_",
"attr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"value_",
"=_",
"attr_",
"[_",
"VALUE_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"value_",
"==_",
"\"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"has",
"\\u",
"empty_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"UID_",
"in_",
"attr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"Equal_",
"(_",
"opt_",
"._",
"text_",
",_",
"\"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"int_",
"(_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"True_",
"(_",
"UID_",
"in_",
"attr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"Equal_",
"(_",
"attr_",
"[_",
"UID_",
"]_",
",_",
"options_",
"[_",
"value_",
"]_",
"[_",
"\"",
"uuid",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"True_",
"(_",
"value_",
"in_",
"options_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"Equal_",
"(_",
"opt_",
"._",
"text_",
",_",
"options_",
"[_",
"value_",
"]_",
"[_",
"\"",
"name",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"\"",
"parent",
"\"_",
"in_",
"options_",
"[_",
"value_",
"]_",
"and_",
"options_",
"[_",
"value_",
"]_",
"[_",
"\"",
"parent",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert",
"True_",
"(_",
"PARENT",
"_",
"in_",
"attr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"Equal_",
"(_",
"attr_",
"[_",
"PARENT",
"_",
"]_",
",_",
"str_",
"(_",
"options_",
"[_",
"value_",
"]_",
"[_",
"\"",
"parent",
"\"_",
"]_",
")_",
")_",
"\\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",
"True_",
"(_",
"has",
"\\u",
"empty_",
",_",
"msg_",
"=_",
"\"",
"Emp",
"ty",
"-",
"option",
" ",
"missi",
"ng",
"\"_",
")_",
"\\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,
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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
] |
Unreachable code | RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/httputil.py | [
{
"content": "def parse_response_start_line(line):\n \"\"\"Returns a (version, code, reason) tuple for an HTTP 1.x response line.\n\n The response is a `collections.namedtuple`.\n\n >>> parse_response_start_line(\"HTTP/1.1 200 OK\")\n ResponseStartLine(version='HTTP/1.1', code=200, reason='OK')\n \"\"\"\n line = native_str(line)\n match = re.match(\"(HTTP/1.[01]) ([0-9]+) ([^\\r]*)\", line)\n if not match:\n raise HTTPInputError(\"Error parsing response start line\")\n return ResponseStartLine(match.group(1), int(match.group(2)),\n match.group(3))",
"metadata": "root.parse_response_start_line",
"header": "['module', '___EOS___']",
"index": 787
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"parse",
"\\u",
"response",
"\\u",
"start",
"\\u",
"line_",
"(_",
"line_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
"s",
" ",
"a",
" ",
"(",
"version",
",",
" ",
"code",
",",
" ",
"reason",
")",
" ",
"tuple",
" ",
"for",
" ",
"an",
" ",
"HTTP",
" ",
"1",
".",
"x",
" ",
"response",
" ",
"line",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"response",
" ",
"is",
" ",
"a",
" ",
"`",
"collection",
"s",
".",
"namedtupl",
"e",
"`.",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"parse",
"\\u",
"response",
"\\u",
"start",
"\\u",
"line",
"(\"",
"HTTP",
"/",
"1.1",
" ",
"200",
" ",
"OK",
"\")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Respons",
"e",
"Start",
"Line",
"(",
"version",
"='",
"HTTP",
"/",
"1.1",
"',",
" ",
"code",
"=",
"200",
",",
" ",
"reason",
"='",
"OK",
"')",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"line_",
"=_",
"nativ",
"e\\u",
"str_",
"(_",
"line_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"match_",
"=_",
"re_",
"._",
"match_",
"(_",
"\"(",
"HTTP",
"/",
"1",
".",
"[",
"01",
"])",
" ",
"([",
"0",
"-",
"9",
"]+)",
" ",
"([",
"^",
"\\\\",
"r",
"]*)",
"\"_",
",_",
"line_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"match_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"HTTP",
"Inp",
"ut",
"Error_",
"(_",
"\"",
"Error",
" ",
"pars",
"ing",
" ",
"response",
" ",
"start",
" ",
"line",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"Respons",
"e",
"Start",
"Line_",
"(_",
"match_",
"._",
"group_",
"(_",
"1_",
")_",
",_",
"int_",
"(_",
"match_",
"._",
"group_",
"(_",
"2_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"match_",
"._",
"group_",
"(_",
"3_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | sendgrid/python-http-client/python_http_client/client.py | [
{
"content": "\"\"\"HTTP Client library\"\"\"\nimport json\n\n\ntry:\n # Python 3\n import urllib.request as urllib\n from urllib.parse import urlencode\nexcept ImportError:\n # Python 2\n import urllib2 as urllib\n from urllib import urlencode\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class Response(object):\n \"\"\"Holds the response from an API call.\"\"\"\n\n\n",
"metadata": "root.Response",
"header": "['module', '___EOS___']",
"index": 14
},
{
"content": " def __init__(self, response):\n \"\"\"\n :param response: The return value from a open call\n on a urllib.build_opener()\n :type response: urllib response object\n \"\"\"\n self._status_code = response.getcode()\n self._response_body = response.read()\n self._response_headers = response.info()",
"metadata": "root.Response.__init__",
"header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']",
"index": 16
},
{
"content": " @property\n def status_code(self):\n \"\"\"\n :return: integer, status code of API call\n \"\"\"\n return self._status_code",
"metadata": "root.Response.status_code",
"header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']",
"index": 26
},
{
"content": " @property\n def response_body(self):\n \"\"\"\n :return: response from the API\n \"\"\"\n return self._response_body",
"metadata": "root.Response.response_body",
"header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']",
"index": 33
},
{
"content": " @property\n def response_headers(self):\n \"\"\"\n :return: dict of response headers\n \"\"\"\n return self._response_headers",
"metadata": "root.Response.response_headers",
"header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']",
"index": 40
},
{
"content": "class Client(object):\n \"\"\"Quickly and easily access any REST or REST-like API.\"\"\"\n\n\n\n\n\n\n",
"metadata": "root.Client",
"header": "['module', '___EOS___']",
"index": 48
},
{
"content": " def __init__(self,\n host,\n request_headers=None,\n version=None,\n url_path=None):\n \"\"\"\n :param host: Base URL for the api. (e.g. https://api.sendgrid.com)\n :type host: string\n :param request_headers: A dictionary of the headers you want\n applied on all calls\n :type request_headers: dictionary\n :param version: The version number of the API.\n Subclass _build_versioned_url for custom behavior.\n Or just pass the version as part of the URL\n (e.g. client._(\"/v3\"))\n :type version: integer\n :param url_path: A list of the url path segments\n :type url_path: list of strings\n \"\"\"\n self.host = host\n self.request_headers = request_headers or {}\n self._version = version\n # _url_path keeps track of the dynamically built url\n self._url_path = url_path or []\n # These are the supported HTTP verbs\n self.methods = ['delete', 'get', 'patch', 'post', 'put']",
"metadata": "root.Client.__init__",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 50
},
{
"content": " def _build_versioned_url(self, url):\n \"\"\"Subclass this function for your own needs.\n Or just pass the version as part of the URL\n (e.g. client._('/v3'))\n :param url: URI portion of the full URL being requested\n :type url: string\n :return: string\n \"\"\"\n return '{0}/v{1}{2}'.format(self.host, str(self._version), url)",
"metadata": "root.Client._build_versioned_url",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 77
},
{
"content": " def _build_url(self, query_params):\n \"\"\"Build the final URL to be passed to urllib\n\n :param query_params: A dictionary of all the query parameters\n :type query_params: dictionary\n :return: string\n \"\"\"\n url = ''\n count = 0\n while count < len(self._url_path):\n url += '/{0}'.format(self._url_path[count])\n count += 1\n if query_params:\n url_values = urlencode(sorted(query_params.items()))\n url = '{0}?{1}'.format(url, url_values)\n url = self._build_versioned_url(url) if self._version else self.host + url\n return url",
"metadata": "root.Client._build_url",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 87
},
{
"content": " def _update_headers(self, request_headers):\n \"\"\"Update the headers for the request\n\n :param request_headers: headers to set for the API call\n :type response: dictionary\n :return: dictionary\n \"\"\"\n self.request_headers.update(request_headers)",
"metadata": "root.Client._update_headers",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 105
},
{
"content": " def _build_client(self, name=None):\n \"\"\"Make a new Client object\n\n :param name: Name of the url segment\n :type name: string\n :return: A Client object\n \"\"\"\n url_path = self._url_path+[name] if name else self._url_path\n return Client(host=self.host,\n version=self._version,\n request_headers=self.request_headers,\n url_path=url_path)",
"metadata": "root.Client._build_client",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 114
},
{
"content": " def _make_request(self, opener, request):\n \"\"\"Make the API call and return the response. This is separated into\n it's own function, so we can mock it easily for testing.\n\n :param opener:\n :type opener:\n :param request: url payload to request\n :type request: urllib.Request object\n :return: urllib response\n \"\"\"\n return opener.open(request)",
"metadata": "root.Client._make_request",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 127
},
{
"content": " def _(self, name):\n \"\"\"Add variable values to the url.\n (e.g. /your/api/{variable_value}/call)\n Another example: if you have a Python reserved word, such as global,\n in your url, you must use this method.\n\n :param name: Name of the url segment\n :type name: string\n :return: Client object\n \"\"\"\n return self._build_client(name)",
"metadata": "root.Client._",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 139
},
{
"content": " def __getattr__(self, name):\n \"\"\"Dynamically add method calls to the url, then call a method.\n (e.g. client.name.name.method())\n You can also add a version number by using .version(<int>)\n\n :param name: Name of the url segment or method call\n :type name: string or integer if name == version\n :return: mixed\n \"\"\"\n if name == 'version':\n def get_version(*args, **kwargs):\n \"\"\"\n :param args: dict of settings\n :param kwargs: unused\n :return: string, version\n \"\"\"\n self._version = args[0]\n return self._build_client()\n return get_version\n\n # We have reached the end of the method chain, make the API call\n if name in self.methods:\n method = name.upper()\n\n def http_request(*args, **kwargs):\n \"\"\"Make the API call\n :param args: unused\n :param kwargs:\n :return: Client object\n \"\"\"\n if 'request_headers' in kwargs:\n self._update_headers(kwargs['request_headers'])\n data = json.dumps(kwargs['request_body']).encode('utf-8')\\\n if 'request_body' in kwargs else None\n params = kwargs['query_params']\\\n if 'query_params' in kwargs else None\n opener = urllib.build_opener()\n request = urllib.Request(self._build_url(params), data=data)\n if self.request_headers:\n for key, value in self.request_headers.items():\n request.add_header(key, value)\n request.get_method = lambda: method\n return Response(self._make_request(opener, request))\n return http_request\n else:\n # Add a segment to the URL\n return self._(name)",
"metadata": "root.Client.__getattr__",
"header": "['class', 'Client', '(', 'object', ')', ':', '___EOS___']",
"index": 151
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"HTTP",
" ",
"Client",
" ",
"librar",
"y",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"json_",
"\\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_",
"#",
" ",
"Pyth",
"on",
" ",
"3_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"urllib_",
"._",
"request_",
"as_",
"urllib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"urllib_",
"._",
"parse_",
"import_",
"urlencode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Pyth",
"on",
" ",
"2_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"urllib2_",
"as_",
"urllib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"urllib_",
"import_",
"urlencode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Response_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Hold",
"s",
" ",
"the",
" ",
"response",
" ",
"from",
" ",
"an",
" ",
"API",
" ",
"call",
".\"\"\"_",
"\\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_",
"Response_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"response_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"response",
":",
" ",
"The",
" ",
"return",
" ",
"value",
" ",
"from",
" ",
"a",
" ",
"open",
" ",
"call",
"\\",
"10",
";",
" ",
" ",
" ",
"on",
" ",
"a",
" ",
"url",
"lib",
".",
"build",
"\\u",
"opene",
"r",
"()",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"response",
":",
" ",
" ",
"url",
"lib",
" ",
"response",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"status",
"\\u",
"code_",
"=_",
"response_",
"._",
"getco",
"de_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"response",
"\\u",
"body_",
"=_",
"response_",
"._",
"read_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"response",
"\\u",
"headers_",
"=_",
"response_",
"._",
"info_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Response_",
"(_",
"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_",
"status",
"\\u",
"code_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"integ",
"er",
",",
" ",
"status",
" ",
"code",
" ",
"of",
" ",
"API",
" ",
"call",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Response_",
"(_",
"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_",
"response",
"\\u",
"body_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"response",
" ",
"from",
" ",
"the",
" ",
"API",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"response",
"\\u",
"body_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Response_",
"(_",
"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_",
"response",
"\\u",
"headers_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"dict",
" ",
"of",
" ",
"response",
" ",
"header",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"response",
"\\u",
"headers_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Qui",
"ckl",
"y",
" ",
"and",
" ",
"easi",
"ly",
" ",
"access",
" ",
"any",
" ",
"REST",
" ",
"or",
" ",
"REST",
"-",
"like",
" ",
"API",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"host_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"request",
"\\u",
"headers_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"version_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"url",
"\\u",
"path_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"host",
":",
" ",
"Base",
" ",
"URL",
" ",
"for",
" ",
"the",
" ",
"api",
".",
" ",
"(",
"e",
".",
"g",
".",
" ",
"https",
"://",
"api",
".",
"send",
"grid",
".",
"com",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"host",
":",
" ",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"request",
"\\u",
"header",
"s",
":",
" ",
"A",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"the",
" ",
"header",
"s",
" ",
"you",
" ",
"want",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
" ",
" ",
"applied",
" ",
"on",
" ",
"all",
" ",
"calls",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"request",
"\\u",
"header",
"s",
":",
" ",
"dictionar",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"version",
":",
" ",
"The",
" ",
"version",
" ",
"number",
" ",
"of",
" ",
"the",
" ",
"API",
".",
"\\",
"10",
";",
" ",
" ",
"Subc",
"lass",
" ",
"\\u",
"build",
"\\u",
"versioned",
"\\u",
"url",
" ",
"for",
" ",
"custom",
" ",
"behavior",
".",
"\\",
"10",
";",
" ",
" ",
"Or",
" ",
"just",
" ",
"pass",
" ",
"the",
" ",
"version",
" ",
"as",
" ",
"part",
" ",
"of",
" ",
"the",
" ",
"URL",
"\\",
"10",
";",
" ",
" ",
"(",
"e",
".",
"g",
".",
" ",
"client",
".\\u",
"(\"",
"/",
"v",
"3",
"\"))",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"version",
":",
" ",
"integ",
"er",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"url",
"\\u",
"path",
":",
" ",
"A",
" ",
"list",
" ",
"of",
" ",
"the",
" ",
"url",
" ",
"path",
" ",
"segments",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"url",
"\\u",
"path",
":",
" ",
"list",
" ",
"of",
" ",
"string",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"host_",
"=_",
"host_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"request",
"\\u",
"headers_",
"=_",
"request",
"\\u",
"headers_",
"or_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"version_",
"=_",
"version_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"\\u",
"url",
"\\u",
"path",
" ",
"keep",
"s",
" ",
"track",
" ",
"of",
" ",
"the",
" ",
"dynami",
"call",
"y",
" ",
"bui",
"lt",
" ",
"url_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"url",
"\\u",
"path_",
"=_",
"url",
"\\u",
"path_",
"or_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
"se",
" ",
"are",
" ",
"the",
" ",
"support",
"ed",
" ",
"HTTP",
" ",
"verbs",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"methods_",
"=_",
"[_",
"'",
"delete",
"'_",
",_",
"'",
"get",
"'_",
",_",
"'",
"patch",
"'_",
",_",
"'",
"post",
"'_",
",_",
"'",
"put",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"build",
"\\u",
"versioned",
"\\u",
"url_",
"(_",
"self_",
",_",
"url_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Subc",
"lass",
" ",
"this",
" ",
"function",
" ",
"for",
" ",
"your",
" ",
"own",
" ",
"need",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
"Or",
" ",
"just",
" ",
"pass",
" ",
"the",
" ",
"version",
" ",
"as",
" ",
"part",
" ",
"of",
" ",
"the",
" ",
"URL",
"\\",
"10",
";",
" ",
" ",
" ",
"(",
"e",
".",
"g",
".",
" ",
"client",
".\\u",
"('",
"/",
"v",
"3",
"'))",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"url",
":",
" ",
"URI",
" ",
"porti",
"on",
" ",
"of",
" ",
"the",
" ",
"full",
" ",
"URL",
" ",
"bei",
"ng",
" ",
"request",
"ed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"url",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"'{",
"0",
"}/",
"v",
"{",
"1",
"}{",
"2",
"}'_",
"._",
"format_",
"(_",
"self_",
"._",
"host_",
",_",
"str_",
"(_",
"self_",
"._",
"\\u",
"version_",
")_",
",_",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"build",
"\\u",
"url_",
"(_",
"self_",
",_",
"query",
"\\u",
"params_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Build",
" ",
"the",
" ",
"final",
" ",
"URL",
" ",
"to",
" ",
"be",
" ",
"pass",
"ed",
" ",
"to",
" ",
"url",
"lib",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"query",
"\\u",
"params",
":",
" ",
"A",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"all",
" ",
"the",
" ",
"query",
" ",
"parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"query",
"\\u",
"params",
":",
" ",
"dictionar",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"url_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"count_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"count_",
"<_",
"len_",
"(_",
"self_",
"._",
"\\u",
"url",
"\\u",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"url_",
"+=_",
"'/{",
"0",
"}'_",
"._",
"format_",
"(_",
"self_",
"._",
"\\u",
"url",
"\\u",
"path_",
"[_",
"count_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"count_",
"+=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"query",
"\\u",
"params_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"url",
"\\u",
"values_",
"=_",
"urlencode_",
"(_",
"sorted_",
"(_",
"query",
"\\u",
"params_",
"._",
"items_",
"(_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"url_",
"=_",
"'{",
"0",
"}?",
"{",
"1",
"}'_",
"._",
"format_",
"(_",
"url_",
",_",
"url",
"\\u",
"values_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"url_",
"=_",
"self_",
"._",
"\\u",
"build",
"\\u",
"versioned",
"\\u",
"url_",
"(_",
"url_",
")_",
"if_",
"self_",
"._",
"\\u",
"version_",
"else_",
"self_",
"._",
"host_",
"+_",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"update",
"\\u",
"headers_",
"(_",
"self_",
",_",
"request",
"\\u",
"headers_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Update",
" ",
"the",
" ",
"header",
"s",
" ",
"for",
" ",
"the",
" ",
"request",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"request",
"\\u",
"header",
"s",
":",
" ",
"header",
"s",
" ",
"to",
" ",
"set",
" ",
"for",
" ",
"the",
" ",
"API",
" ",
"call",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"response",
":",
" ",
"dictionar",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"dictionar",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"request",
"\\u",
"headers_",
"._",
"update_",
"(_",
"request",
"\\u",
"headers_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"build",
"\\u",
"client_",
"(_",
"self_",
",_",
"name_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Make",
" ",
"a",
" ",
"new",
" ",
"Client",
" ",
"object",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"name",
":",
" ",
"Name",
" ",
"of",
" ",
"the",
" ",
"url",
" ",
"segment",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"name",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"A",
" ",
"Client",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"url",
"\\u",
"path_",
"=_",
"self_",
"._",
"\\u",
"url",
"\\u",
"path_",
"+_",
"[_",
"name_",
"]_",
"if_",
"name_",
"else_",
"self_",
"._",
"\\u",
"url",
"\\u",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Client_",
"(_",
"host_",
"=_",
"self_",
"._",
"host_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"version_",
"=_",
"self_",
"._",
"\\u",
"version_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"request",
"\\u",
"headers_",
"=_",
"self_",
"._",
"request",
"\\u",
"headers_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"url",
"\\u",
"path_",
"=_",
"url",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"make",
"\\u",
"request_",
"(_",
"self_",
",_",
"opener_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Make",
" ",
"the",
" ",
"API",
" ",
"call",
" ",
"and",
" ",
"return",
" ",
"the",
" ",
"response",
".",
" ",
"Thi",
"s",
" ",
"is",
" ",
"separate",
"d",
" ",
"int",
"o",
"\\",
"10",
";",
" ",
" ",
" ",
"it",
"'",
"s",
" ",
"own",
" ",
"function",
",",
" ",
"so",
" ",
"we",
" ",
"can",
" ",
"mock",
" ",
"it",
" ",
"easi",
"ly",
" ",
"for",
" ",
"testi",
"ng",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"opene",
"r",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"opene",
"r",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"request",
":",
" ",
"url",
" ",
"payload",
" ",
"to",
" ",
"request",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"request",
":",
" ",
"url",
"lib",
".",
"Request",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"url",
"lib",
" ",
"response",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"opener_",
"._",
"open_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u_",
"(_",
"self_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Add",
" ",
"variab",
"le",
" ",
"values",
" ",
"to",
" ",
"the",
" ",
"url",
".",
"\\",
"10",
";",
" ",
" ",
" ",
"(",
"e",
".",
"g",
".",
" ",
"/",
"your",
"/",
"api",
"/{",
"variab",
"le",
"\\u",
"value",
"}/",
"call",
")",
"\\",
"10",
";",
" ",
" ",
" ",
"Ano",
"ther",
" ",
"example",
":",
" ",
"if",
" ",
"you",
" ",
"have",
" ",
"a",
" ",
"Pyth",
"on",
" ",
"reserve",
"d",
" ",
"word",
",",
" ",
"suc",
"h",
" ",
"as",
" ",
"global",
",",
"\\",
"10",
";",
" ",
" ",
" ",
"in",
" ",
"your",
" ",
"url",
",",
" ",
"you",
" ",
"must",
" ",
"use",
" ",
"this",
" ",
"method",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"name",
":",
" ",
"Name",
" ",
"of",
" ",
"the",
" ",
"url",
" ",
"segment",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"name",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"Client",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"build",
"\\u",
"client_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Client_",
"(_",
"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_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Dynamic",
"ally",
" ",
"add",
" ",
"method",
" ",
"calls",
" ",
"to",
" ",
"the",
" ",
"url",
",",
" ",
"then",
" ",
"call",
" ",
"a",
" ",
"method",
".",
"\\",
"10",
";",
" ",
" ",
" ",
"(",
"e",
".",
"g",
".",
" ",
"client",
".",
"name",
".",
"name",
".",
"method",
"())",
"\\",
"10",
";",
" ",
" ",
" ",
"You",
" ",
"can",
" ",
"als",
"o",
" ",
"add",
" ",
"a",
" ",
"version",
" ",
"number",
" ",
"by",
" ",
"usi",
"ng",
" ",
".",
"version",
"(",
"<",
"int",
">)",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"name",
":",
" ",
"Name",
" ",
"of",
" ",
"the",
" ",
"url",
" ",
"segment",
" ",
"or",
" ",
"method",
" ",
"call",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"name",
":",
" ",
"string",
" ",
"or",
" ",
"integ",
"er",
" ",
"if",
" ",
"name",
" ",
"==",
" ",
"version",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"mixed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"name_",
"==_",
"'",
"version",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"get",
"\\u",
"version_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"args",
":",
" ",
"dict",
" ",
"of",
" ",
"settings",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"kwarg",
"s",
":",
" ",
"unu",
"sed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"string",
",",
" ",
"version",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"version_",
"=_",
"args_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"build",
"\\u",
"client_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"get",
"\\u",
"version_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"We",
" ",
"have",
" ",
"reache",
"d",
" ",
"the",
" ",
"end",
" ",
"of",
" ",
"the",
" ",
"method",
" ",
"chain",
",",
" ",
"make",
" ",
"the",
" ",
"API",
" ",
"call_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"name_",
"in_",
"self_",
"._",
"methods_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"method_",
"=_",
"name_",
"._",
"upper_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"http",
"\\u",
"request_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Make",
" ",
"the",
" ",
"API",
" ",
"call",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"args",
":",
" ",
"unu",
"sed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"kwarg",
"s",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
" ",
"Client",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"'",
"request",
"\\u",
"header",
"s",
"'_",
"in_",
"kwargs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"update",
"\\u",
"headers_",
"(_",
"kwargs_",
"[_",
"'",
"request",
"\\u",
"header",
"s",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"data_",
"=_",
"json_",
"._",
"dumps_",
"(_",
"kwargs_",
"[_",
"'",
"request",
"\\u",
"body",
"'_",
"]_",
")_",
"._",
"encode_",
"(_",
"'",
"utf",
"-",
"8",
"'_",
")_",
"if_",
"'",
"request",
"\\u",
"body",
"'_",
"in_",
"kwargs_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"params_",
"=_",
"kwargs_",
"[_",
"'",
"query",
"\\u",
"params",
"'_",
"]_",
"if_",
"'",
"query",
"\\u",
"params",
"'_",
"in_",
"kwargs_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"opener_",
"=_",
"urllib_",
"._",
"build",
"\\u",
"opener_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"request_",
"=_",
"urllib_",
"._",
"Request_",
"(_",
"self_",
"._",
"\\u",
"build",
"\\u",
"url_",
"(_",
"params_",
")_",
",_",
"data_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"request",
"\\u",
"headers_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"key_",
",_",
"value_",
"in_",
"self_",
"._",
"request",
"\\u",
"headers_",
"._",
"items_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"request_",
"._",
"add",
"\\u",
"header_",
"(_",
"key_",
",_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"request_",
"._",
"get",
"\\u",
"method_",
"=_",
"lambda_",
":_",
"method_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Response_",
"(_",
"self_",
"._",
"\\u",
"make",
"\\u",
"request_",
"(_",
"opener_",
",_",
"request_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"http",
"\\u",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Add",
" ",
"a",
" ",
"segment",
" ",
"to",
" ",
"the",
" ",
"URL_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u_",
"(_",
"name_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Unused import | orisi/orisi/src/oracle/handlers/timelock_contract/timelock_create_handler.py | [
{
"content": "from basehandler import BaseHandler\nfrom password_db import LockedPasswordTransaction\n\nimport json\nimport logging\nimport datetime\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TimelockCreateHandler(BaseHandler):\n\n\n\n",
"metadata": "root.TimelockCreateHandler",
"header": "['module', '___EOS___']",
"index": 8
},
{
"content": " def __init__(self, oracle):\n self.oracle = oracle\n self.btc = oracle.btc",
"metadata": "root.TimelockCreateHandler.__init__",
"header": "['class', 'TimelockCreateHandler', '(', 'BaseHandler', ')', ':', '___EOS___']",
"index": 9
},
{
"content": " def handle_request(self, request):\n message = request.message\n\n if not self.try_prepare_raw_transaction(message):\n logging.debug('transaction looks invalid, ignoring')\n return\n\n pwtxid = self.oracle.btc.add_multisig_address(message['req_sigs'], message['pubkey_list'])\n\n if LockedPasswordTransaction(self.oracle.db).get_by_pwtxid(pwtxid):\n logging.debug('pwtxid/multisig address already in use. did you resend the same request?')\n return\n\n reply_msg = { 'operation' : 'timelock_created',\n 'pwtxid' : pwtxid,\n 'in_reply_to' : message['message_id'] }\n\n logging.debug('broadcasting reply')\n self.oracle.broadcast_with_fastcast(json.dumps(reply_msg))\n\n LockedPasswordTransaction(self.oracle.db).save({'pwtxid':pwtxid, 'json_data':json.dumps(message)})\n\n locktime = int(message['locktime'])\n\n logging.debug(\"awaiting %r\" % datetime.datetime.fromtimestamp(locktime).strftime('%Y-%m-%d %H:%M:%S'))\n\n message['pwtxid'] = pwtxid\n\n self.oracle.task_queue.save({\n \"operation\": 'timelock_create',\n \"json_data\": json.dumps(message),\n \"done\": 0,\n \"next_check\": int(locktime)\n })",
"metadata": "root.TimelockCreateHandler.handle_request",
"header": "['class', 'TimelockCreateHandler', '(', 'BaseHandler', ')', ':', '___EOS___']",
"index": 14
},
{
"content": " def handle_task(self, task):\n message = json.loads(task['json_data'])\n future_transaction = self.try_prepare_raw_transaction_full_node(message)\n assert(future_transaction is not None) # should've been verified gracefully in handle_request\n\n logging.debug('transaction ready to be signed')\n\n self.oracle.signer.sign(future_transaction, message['pwtxid'], message['prevtxs'], message['req_sigs'])",
"metadata": "root.TimelockCreateHandler.handle_task",
"header": "['class', 'TimelockCreateHandler', '(', 'BaseHandler', ')', ':', '___EOS___']",
"index": 50
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"base",
"handler_",
"import_",
"Base",
"Handler_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"password",
"\\u",
"db_",
"import_",
"Locke",
"d",
"Passw",
"ord",
"Transaction_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"json_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"logging_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"datetime_",
"\\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_",
"Time",
"lock",
"Creat",
"e",
"Handler_",
"(_",
"Base",
"Handler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Time",
"lock",
"Creat",
"e",
"Handler_",
"(_",
"Base",
"Handler_",
")_",
":_",
"\\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_",
",_",
"oracle",
"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"oracle",
"_",
"=_",
"oracle",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"btc",
"_",
"=_",
"oracle",
"_",
"._",
"btc",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Time",
"lock",
"Creat",
"e",
"Handler_",
"(_",
"Base",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"handle",
"\\u",
"request_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"request_",
"._",
"message_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"try",
"\\u",
"prepar",
"e\\u",
"raw",
"\\u",
"transaction_",
"(_",
"message_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logging_",
"._",
"debug_",
"(_",
"'",
"transaction",
" ",
"look",
"s",
" ",
"invalid",
",",
" ",
"ign",
"orin",
"g",
"'_",
")_",
"\\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_",
"pw",
"txid_",
"=_",
"self_",
"._",
"oracle",
"_",
"._",
"btc",
"_",
"._",
"add",
"\\u",
"multisi",
"g",
"\\u",
"address_",
"(_",
"message_",
"[_",
"'",
"req",
"\\u",
"sig",
"s",
"'_",
"]_",
",_",
"message_",
"[_",
"'",
"pubkey",
"\\u",
"list",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"Locke",
"d",
"Passw",
"ord",
"Transaction_",
"(_",
"self_",
"._",
"oracle",
"_",
"._",
"db_",
")_",
"._",
"get",
"\\u",
"by",
"\\u",
"pw",
"txid_",
"(_",
"pw",
"txid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logging_",
"._",
"debug_",
"(_",
"'",
"pw",
"txi",
"d",
"/",
"multisi",
"g",
" ",
"address",
" ",
"alr",
"ead",
"y",
" ",
"in",
" ",
"use",
".",
" ",
"did",
" ",
"you",
" ",
"resen",
"d",
" ",
"the",
" ",
"same",
" ",
"request",
"?'_",
")_",
"\\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_",
"repl",
"y",
"\\u",
"msg_",
"=_",
"{_",
"'",
"operati",
"on",
"'_",
":_",
"'",
"timel",
"ock",
"\\u",
"created",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"pw",
"txi",
"d",
"'_",
":_",
"pw",
"txid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"in",
"\\u",
"repl",
"y",
"\\u",
"to",
"'_",
":_",
"message_",
"[_",
"'",
"message",
"\\u",
"id",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"logging_",
"._",
"debug_",
"(_",
"'",
"broadcast",
"ing",
" ",
"repl",
"y",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"oracle",
"_",
"._",
"broadcast",
"\\u",
"with",
"\\u",
"fast",
"cast_",
"(_",
"json_",
"._",
"dumps_",
"(_",
"repl",
"y",
"\\u",
"msg_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Locke",
"d",
"Passw",
"ord",
"Transaction_",
"(_",
"self_",
"._",
"oracle",
"_",
"._",
"db_",
")_",
"._",
"save_",
"(_",
"{_",
"'",
"pw",
"txi",
"d",
"'_",
":_",
"pw",
"txid_",
",_",
"'",
"json",
"\\u",
"data",
"'_",
":_",
"json_",
"._",
"dumps_",
"(_",
"message_",
")_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"lock",
"time_",
"=_",
"int_",
"(_",
"message_",
"[_",
"'",
"lock",
"time",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"logging_",
"._",
"debug_",
"(_",
"\"",
"await",
"ing",
" ",
"%",
"r",
"\"_",
"%_",
"datetime_",
"._",
"datetime_",
"._",
"fromtimestamp_",
"(_",
"lock",
"time_",
")_",
"._",
"strftime_",
"(_",
"'%",
"Y",
"-%",
"m",
"-%",
"d",
" ",
"%",
"H",
":",
"%",
"M",
":",
"%",
"S",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"message_",
"[_",
"'",
"pw",
"txi",
"d",
"'_",
"]_",
"=_",
"pw",
"txid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"oracle",
"_",
"._",
"task",
"\\u",
"queue_",
"._",
"save_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"operati",
"on",
"\"_",
":_",
"'",
"timel",
"ock",
"\\u",
"create",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"json",
"\\u",
"data",
"\"_",
":_",
"json_",
"._",
"dumps_",
"(_",
"message_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"don",
"e",
"\"_",
":_",
"0_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"next",
"\\u",
"check",
"\"_",
":_",
"int_",
"(_",
"lock",
"time_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Time",
"lock",
"Creat",
"e",
"Handler_",
"(_",
"Base",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"handle",
"\\u",
"task_",
"(_",
"self_",
",_",
"task_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"json_",
"._",
"loads_",
"(_",
"task_",
"[_",
"'",
"json",
"\\u",
"data",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"future",
"\\u",
"transaction_",
"=_",
"self_",
"._",
"try",
"\\u",
"prepar",
"e\\u",
"raw",
"\\u",
"transaction",
"\\u",
"full",
"\\u",
"node_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"(_",
"future",
"\\u",
"transaction_",
"is_",
"not_",
"None_",
")_",
"#",
" ",
"shou",
"ld",
"'",
"ve",
" ",
"bee",
"n",
" ",
"verifie",
"d",
" ",
"graceful",
"ly",
" ",
"in",
" ",
"handle",
"\\u",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"logging_",
"._",
"debug_",
"(_",
"'",
"transaction",
" ",
"read",
"y",
" ",
"to",
" ",
"be",
" ",
"sign",
"ed",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"oracle",
"_",
"._",
"signer_",
"._",
"sign_",
"(_",
"future",
"\\u",
"transaction_",
",_",
"message_",
"[_",
"'",
"pw",
"txi",
"d",
"'_",
"]_",
",_",
"message_",
"[_",
"'",
"prev",
"txs",
"'_",
"]_",
",_",
"message_",
"[_",
"'",
"req",
"\\u",
"sig",
"s",
"'_",
"]_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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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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
] |
Unused local variable | django/django/django/contrib/flatpages/models.py | [
{
"content": " def get_absolute_url(self):\n # Handle script prefix manually because we bypass reverse()\n return iri_to_uri(get_script_prefix().rstrip('/') + self.url)",
"metadata": "root.FlatPage.get_absolute_url",
"header": "['class', 'FlatPage', '(', 'models', '.', 'Model', ')', ':', '___EOS___']",
"index": 40
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Flat",
"Page_",
"(_",
"models_",
"._",
"Model_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"abs",
"olute",
"\\u",
"url_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Handle",
" ",
"script",
" ",
"prefix",
" ",
"manu",
"ally",
" ",
"bec",
"aus",
"e",
" ",
"we",
" ",
"bypass",
" ",
"reverse",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"iri",
"\\u",
"to",
"\\u",
"uri_",
"(_",
"get",
"\\u",
"script",
"\\u",
"prefix_",
"(_",
")_",
"._",
"rstrip_",
"(_",
"'/'_",
")_",
"+_",
"self_",
"._",
"url_",
")_"
] | [
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
] |
Missing call to `__init__` during object initialization | redhat-cip/software-factory/tests/functional/utils.py | [
{
"content": "class Base(unittest.TestCase):\n pass",
"metadata": "root.Base",
"header": "['module', '___EOS___']",
"index": 205
}
] | [] | [] | 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_",
"Base_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | apache/libcloud/libcloud/dns/drivers/rackspace.py | [
{
"content": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# 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.\nimport copy\n\nfrom libcloud.utils.py3 import httplib\nfrom libcloud.common.openstack import OpenStackDriverMixin\nfrom libcloud.common.base import PollingConnection\nfrom libcloud.common.exceptions import BaseHTTPError\nfrom libcloud.common.types import LibcloudError\nfrom libcloud.utils.misc import merge_valid_keys, get_new_obj\nfrom libcloud.common.rackspace import AUTH_URL\nfrom libcloud.compute.drivers.openstack import OpenStack_1_1_Connection\nfrom libcloud.compute.drivers.openstack import OpenStack_1_1_Response\n\nfrom libcloud.dns.types import Provider, RecordType\nfrom libcloud.dns.types import ZoneDoesNotExistError, RecordDoesNotExistError\nfrom libcloud.dns.base import DNSDriver, Zone, Record\n\n__all__ = [\n 'RackspaceDNSResponse',\n 'RackspaceDNSConnection'\n]\n\nVALID_ZONE_EXTRA_PARAMS = ['email', 'comment', 'ns1']\nVALID_RECORD_EXTRA_PARAMS = ['ttl', 'comment', 'priority', 'created',\n 'updated']\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class RackspaceDNSResponse(OpenStack_1_1_Response):\n \"\"\"\n Rackspace DNS Response class.\n \"\"\"\n",
"metadata": "root.RackspaceDNSResponse",
"header": "['module', '___EOS___']",
"index": 40
},
{
"content": " def parse_error(self):\n status = int(self.status)\n context = self.connection.context\n body = self.parse_body()\n\n if status == httplib.NOT_FOUND:\n if context['resource'] == 'zone':\n raise ZoneDoesNotExistError(value='', driver=self,\n zone_id=context['id'])\n elif context['resource'] == 'record':\n raise RecordDoesNotExistError(value='', driver=self,\n record_id=context['id'])\n if body:\n if 'code' and 'message' in body:\n err = '%s - %s (%s)' % (body['code'], body['message'],\n body['details'])\n return err\n elif 'validationErrors' in body:\n errors = [m for m in body['validationErrors']['messages']]\n err = 'Validation errors: %s' % ', '.join(errors)\n return err\n\n raise LibcloudError('Unexpected status code: %s' % (status))",
"metadata": "root.RackspaceDNSResponse.parse_error",
"header": "['class', 'RackspaceDNSResponse', '(', 'OpenStack_1_1_Response', ')', ':', '___EOS___']",
"index": 45
},
{
"content": "class RackspaceDNSConnection(OpenStack_1_1_Connection, PollingConnection):\n \"\"\"\n Rackspace DNS Connection class.\n \"\"\"\n\n responseCls = RackspaceDNSResponse\n XML_NAMESPACE = None\n poll_interval = 2.5\n timeout = 30\n\n auth_url = AUTH_URL\n _auth_version = '2.0'\n\n\n\n",
"metadata": "root.RackspaceDNSConnection",
"header": "['module', '___EOS___']",
"index": 70
},
{
"content": " def __init__(self, *args, **kwargs):\n self.region = kwargs.pop('region', None)\n super(RackspaceDNSConnection, self).__init__(*args, **kwargs)",
"metadata": "root.RackspaceDNSConnection.__init__",
"header": "['class', 'RackspaceDNSConnection', '(', 'OpenStack_1_1_Connection', ',', 'PollingConnection', ')', ':', '___EOS___']",
"index": 83
},
{
"content": " def get_poll_request_kwargs(self, response, context, request_kwargs):\n job_id = response.object['jobId']\n kwargs = {'action': '/status/%s' % (job_id),\n 'params': {'showDetails': True}}\n return kwargs",
"metadata": "root.RackspaceDNSConnection.get_poll_request_kwargs",
"header": "['class', 'RackspaceDNSConnection', '(', 'OpenStack_1_1_Connection', ',', 'PollingConnection', ')', ':', '___EOS___']",
"index": 87
},
{
"content": " def has_completed(self, response):\n status = response.object['status']\n if status == 'ERROR':\n data = response.object['error']\n\n if 'code' and 'message' in data:\n message = '%s - %s (%s)' % (data['code'], data['message'],\n data['details'])\n else:\n message = data['message']\n\n raise LibcloudError(message,\n driver=self.driver)\n\n return status == 'COMPLETED'",
"metadata": "root.RackspaceDNSConnection.has_completed",
"header": "['class', 'RackspaceDNSConnection', '(', 'OpenStack_1_1_Connection', ',', 'PollingConnection', ')', ':', '___EOS___']",
"index": 93
},
{
"content": " def get_endpoint(self):\n if '2.0' in self._auth_version:\n ep = self.service_catalog.get_endpoint(name='cloudDNS',\n service_type='rax:dns',\n region=None)\n else:\n raise LibcloudError(\"Auth version %s not supported\" %\n (self._auth_version))\n\n public_url = ep.url\n\n # This is a nasty hack, but because of how global auth and old accounts\n # work, there is no way around it.\n if self.region == 'us':\n # Old UK account, which only has us endpoint in the catalog\n public_url = public_url.replace('https://lon.dns.api',\n 'https://dns.api')\n if self.region == 'uk':\n # Old US account, which only has uk endpoint in the catalog\n public_url = public_url.replace('https://dns.api',\n 'https://lon.dns.api')\n\n return public_url",
"metadata": "root.RackspaceDNSConnection.get_endpoint",
"header": "['class', 'RackspaceDNSConnection', '(', 'OpenStack_1_1_Connection', ',', 'PollingConnection', ')', ':', '___EOS___']",
"index": 109
},
{
"content": "class RackspacePTRRecord(object):\n\n\n",
"metadata": "root.RackspacePTRRecord",
"header": "['module', '___EOS___']",
"index": 134
},
{
"content": " def __init__(self, id, ip, domain, driver, extra=None):\n self.id = str(id) if id else None\n self.ip = ip\n self.type = RecordType.PTR\n self.domain = domain\n self.driver = driver\n self.extra = extra or {}",
"metadata": "root.RackspacePTRRecord.__init__",
"header": "['class', 'RackspacePTRRecord', '(', 'object', ')', ':', '___EOS___']",
"index": 135
},
{
"content": " def update(self, domain, extra=None):\n return self.driver.ex_update_ptr_record(record=self, domain=domain,\n extra=extra)",
"metadata": "root.RackspacePTRRecord.update",
"header": "['class', 'RackspacePTRRecord', '(', 'object', ')', ':', '___EOS___']",
"index": 143
},
{
"content": " def delete(self):\n return self.driver.ex_delete_ptr_record(record=self)",
"metadata": "root.RackspacePTRRecord.delete",
"header": "['class', 'RackspacePTRRecord', '(', 'object', ')', ':', '___EOS___']",
"index": 147
},
{
"content": " def __repr__(self):\n return ('<%s: ip=%s, domain=%s, provider=%s ...>' %\n (self.__class__.__name__, self.ip,\n self.domain, self.driver.name))",
"metadata": "root.RackspacePTRRecord.__repr__",
"header": "['class', 'RackspacePTRRecord', '(', 'object', ')', ':', '___EOS___']",
"index": 150
},
{
"content": "class RackspaceDNSDriver(DNSDriver, OpenStackDriverMixin):\n name = 'Rackspace DNS'\n website = 'http://www.rackspace.com/'\n type = Provider.RACKSPACE\n connectionCls = RackspaceDNSConnection\n\n\n RECORD_TYPE_MAP = {\n RecordType.A: 'A',\n RecordType.AAAA: 'AAAA',\n RecordType.CNAME: 'CNAME',\n RecordType.MX: 'MX',\n RecordType.NS: 'NS',\n RecordType.PTR: 'PTR',\n RecordType.SRV: 'SRV',\n RecordType.TXT: 'TXT',\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.RackspaceDNSDriver",
"header": "['module', '___EOS___']",
"index": 156
},
{
"content": " def __init__(self, key, secret=None, secure=True, host=None, port=None,\n region='us', **kwargs):\n valid_regions = self.list_regions()\n if region not in valid_regions:\n raise ValueError('Invalid region: %s' % (region))\n\n OpenStackDriverMixin.__init__(self, **kwargs)\n super(RackspaceDNSDriver, self).__init__(key=key, secret=secret,\n host=host, port=port,\n region=region)",
"metadata": "root.RackspaceDNSDriver.__init__",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 162
},
{
"content": " @classmethod\n def list_regions(cls):\n return ['us', 'uk']",
"metadata": "root.RackspaceDNSDriver.list_regions",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 184
},
{
"content": " def iterate_zones(self):\n offset = 0\n limit = 100\n while True:\n params = {\n 'limit': limit,\n 'offset': offset,\n }\n response = self.connection.request(\n action='/domains', params=params).object\n zones_list = response['domains']\n for item in zones_list:\n yield self._to_zone(item)\n\n if _rackspace_result_has_more(response, len(zones_list), limit):\n offset += limit\n else:\n break",
"metadata": "root.RackspaceDNSDriver.iterate_zones",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 188
},
{
"content": " def iterate_records(self, zone):\n self.connection.set_context({'resource': 'zone', 'id': zone.id})\n offset = 0\n limit = 100\n while True:\n params = {\n 'showRecord': True,\n 'limit': limit,\n 'offset': offset,\n }\n response = self.connection.request(\n action='/domains/%s' % (zone.id), params=params).object\n records_list = response['recordsList']\n records = records_list['records']\n for item in records:\n record = self._to_record(data=item, zone=zone)\n yield record\n\n if _rackspace_result_has_more(records_list, len(records), limit):\n offset += limit\n else:\n break",
"metadata": "root.RackspaceDNSDriver.iterate_records",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 207
},
{
"content": " def get_zone(self, zone_id):\n self.connection.set_context({'resource': 'zone', 'id': zone_id})\n response = self.connection.request(action='/domains/%s' % (zone_id))\n zone = self._to_zone(data=response.object)\n return zone",
"metadata": "root.RackspaceDNSDriver.get_zone",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 230
},
{
"content": " def get_record(self, zone_id, record_id):\n zone = self.get_zone(zone_id=zone_id)\n self.connection.set_context({'resource': 'record', 'id': record_id})\n response = self.connection.request(action='/domains/%s/records/%s' %\n (zone_id, record_id)).object\n record = self._to_record(data=response, zone=zone)\n return record",
"metadata": "root.RackspaceDNSDriver.get_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 236
},
{
"content": " def create_zone(self, domain, type='master', ttl=None, extra=None):\n extra = extra if extra else {}\n\n # Email address is required\n if 'email' not in extra:\n raise ValueError('\"email\" key must be present in extra dictionary')\n\n payload = {'name': domain, 'emailAddress': extra['email'],\n 'recordsList': {'records': []}}\n\n if ttl:\n payload['ttl'] = ttl\n\n if 'comment' in extra:\n payload['comment'] = extra['comment']\n\n data = {'domains': [payload]}\n response = self.connection.async_request(action='/domains',\n method='POST', data=data)\n zone = self._to_zone(data=response.object['response']['domains'][0])\n return zone",
"metadata": "root.RackspaceDNSDriver.create_zone",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 244
},
{
"content": " def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None):\n # Only ttl, comment and email address can be changed\n extra = extra if extra else {}\n\n if domain:\n raise LibcloudError('Domain cannot be changed', driver=self)\n\n data = {}\n\n if ttl:\n data['ttl'] = int(ttl)\n\n if 'email' in extra:\n data['emailAddress'] = extra['email']\n\n if 'comment' in extra:\n data['comment'] = extra['comment']\n\n type = type if type else zone.type\n ttl = ttl if ttl else zone.ttl\n\n self.connection.set_context({'resource': 'zone', 'id': zone.id})\n self.connection.async_request(action='/domains/%s' % (zone.id),\n method='PUT', data=data)\n merged = merge_valid_keys(params=copy.deepcopy(zone.extra),\n valid_keys=VALID_ZONE_EXTRA_PARAMS,\n extra=extra)\n updated_zone = get_new_obj(obj=zone, klass=Zone,\n attributes={'type': type,\n 'ttl': ttl,\n 'extra': merged})\n return updated_zone",
"metadata": "root.RackspaceDNSDriver.update_zone",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 266
},
{
"content": " def create_record(self, name, zone, type, data, extra=None):\n # Name must be a FQDN - e.g. if domain is \"foo.com\" then a record\n # name is \"bar.foo.com\"\n extra = extra if extra else {}\n\n name = self._to_full_record_name(domain=zone.domain, name=name)\n data = {'name': name, 'type': self.RECORD_TYPE_MAP[type],\n 'data': data}\n\n if 'ttl' in extra:\n data['ttl'] = int(extra['ttl'])\n\n if 'priority' in extra:\n data['priority'] = int(extra['priority'])\n\n payload = {'records': [data]}\n self.connection.set_context({'resource': 'zone', 'id': zone.id})\n response = self.connection.async_request(action='/domains/%s/records'\n % (zone.id), data=payload,\n method='POST').object\n record = self._to_record(data=response['response']['records'][0],\n zone=zone)\n return record",
"metadata": "root.RackspaceDNSDriver.create_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 299
},
{
"content": " def update_record(self, record, name=None, type=None, data=None,\n extra=None):\n # Only data, ttl, and comment attributes can be modified, but name\n # attribute must always be present.\n extra = extra if extra else {}\n\n name = self._to_full_record_name(domain=record.zone.domain,\n name=record.name)\n payload = {'name': name}\n\n if data:\n payload['data'] = data\n\n if 'ttl' in extra:\n payload['ttl'] = extra['ttl']\n\n if 'comment' in extra:\n payload['comment'] = extra['comment']\n\n type = type if type is not None else record.type\n data = data if data else record.data\n\n self.connection.set_context({'resource': 'record', 'id': record.id})\n self.connection.async_request(action='/domains/%s/records/%s' %\n (record.zone.id, record.id),\n method='PUT', data=payload)\n\n merged = merge_valid_keys(params=copy.deepcopy(record.extra),\n valid_keys=VALID_RECORD_EXTRA_PARAMS,\n extra=extra)\n updated_record = get_new_obj(obj=record, klass=Record,\n attributes={'type': type,\n 'data': data,\n 'driver': self,\n 'extra': merged})\n return updated_record",
"metadata": "root.RackspaceDNSDriver.update_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 323
},
{
"content": " def delete_zone(self, zone):\n self.connection.set_context({'resource': 'zone', 'id': zone.id})\n self.connection.async_request(action='/domains/%s' % (zone.id),\n method='DELETE')\n return True",
"metadata": "root.RackspaceDNSDriver.delete_zone",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 360
},
{
"content": " def delete_record(self, record):\n self.connection.set_context({'resource': 'record', 'id': record.id})\n self.connection.async_request(action='/domains/%s/records/%s' %\n (record.zone.id, record.id),\n method='DELETE')\n return True",
"metadata": "root.RackspaceDNSDriver.delete_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 366
},
{
"content": " def ex_iterate_ptr_records(self, device):\n \"\"\"\n Return a generator to iterate over existing PTR Records.\n\n The ``device`` should be an instance of one of these:\n :class:`libcloud.compute.base.Node`\n :class:`libcloud.loadbalancer.base.LoadBalancer`\n\n And it needs to have the following ``extra`` fields set:\n service_name - the service catalog name for the device\n uri - the URI pointing to the GET endpoint for the device\n\n Those are automatically set for you if you got the device from\n the Rackspace driver for that service.\n\n For example:\n server = rs_compute.ex_get_node_details(id)\n ptr_iter = rs_dns.ex_list_ptr_records(server)\n\n loadbalancer = rs_lbs.get_balancer(id)\n ptr_iter = rs_dns.ex_list_ptr_records(loadbalancer)\n\n Note: the Rackspace DNS API docs indicate that the device 'href' is\n optional, but testing does not bear this out. It throws a\n 400 Bad Request error if you do not pass in the 'href' from\n the server or loadbalancer. So ``device`` is required.\n\n :param device: the device that owns the IP\n :rtype: ``generator`` of :class:`RackspacePTRRecord`\n \"\"\"\n _check_ptr_extra_fields(device)\n params = {'href': device.extra['uri']}\n\n service_name = device.extra['service_name']\n\n # without a valid context, the 404 on empty list will blow up\n # in the error-handling code\n self.connection.set_context({'resource': 'ptr_records'})\n try:\n response = self.connection.request(\n action='/rdns/%s' % (service_name), params=params).object\n records = response['records']\n link = dict(rel=service_name, **params)\n for item in records:\n record = self._to_ptr_record(data=item, link=link)\n yield record\n except BaseHTTPError as exc:\n # 404 just means empty list\n if exc.code == 404:\n return\n raise",
"metadata": "root.RackspaceDNSDriver.ex_iterate_ptr_records",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 373
},
{
"content": " def ex_get_ptr_record(self, service_name, record_id):\n \"\"\"\n Get a specific PTR record by id.\n\n :param service_name: the service catalog name of the linked device(s)\n i.e. cloudLoadBalancers or cloudServersOpenStack\n :param record_id: the id (i.e. PTR-12345) of the PTR record\n :rtype: instance of :class:`RackspacePTRRecord`\n \"\"\"\n self.connection.set_context({'resource': 'record', 'id': record_id})\n response = self.connection.request(\n action='/rdns/%s/%s' % (service_name, record_id)).object\n item = next(iter(response['recordsList']['records']))\n return self._to_ptr_record(data=item, link=response['link'])",
"metadata": "root.RackspaceDNSDriver.ex_get_ptr_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 425
},
{
"content": " def ex_create_ptr_record(self, device, ip, domain, extra=None):\n \"\"\"\n Create a PTR record for a specific IP on a specific device.\n\n The ``device`` should be an instance of one of these:\n :class:`libcloud.compute.base.Node`\n :class:`libcloud.loadbalancer.base.LoadBalancer`\n\n And it needs to have the following ``extra`` fields set:\n service_name - the service catalog name for the device\n uri - the URI pointing to the GET endpoint for the device\n\n Those are automatically set for you if you got the device from\n the Rackspace driver for that service.\n\n For example:\n server = rs_compute.ex_get_node_details(id)\n rs_dns.create_ptr_record(server, ip, domain)\n\n loadbalancer = rs_lbs.get_balancer(id)\n rs_dns.create_ptr_record(loadbalancer, ip, domain)\n\n :param device: the device that owns the IP\n :param ip: the IP for which you want to set reverse DNS\n :param domain: the fqdn you want that IP to represent\n :param extra: a ``dict`` with optional extra values:\n ttl - the time-to-live of the PTR record\n :rtype: instance of :class:`RackspacePTRRecord`\n \"\"\"\n _check_ptr_extra_fields(device)\n\n if extra is None:\n extra = {}\n\n # the RDNS API reverse the name and data fields for PTRs\n # the record name *should* be the ip and the data the fqdn\n data = {\n \"name\": domain,\n \"type\": RecordType.PTR,\n \"data\": ip\n }\n\n if 'ttl' in extra:\n data['ttl'] = extra['ttl']\n\n payload = {\n \"recordsList\": {\n \"records\": [data]\n },\n \"link\": {\n \"content\": \"\",\n \"href\": device.extra['uri'],\n \"rel\": device.extra['service_name'],\n }\n }\n response = self.connection.async_request(\n action='/rdns', method='POST', data=payload).object\n item = next(iter(response['response']['records']))\n return self._to_ptr_record(data=item, link=payload['link'])",
"metadata": "root.RackspaceDNSDriver.ex_create_ptr_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 440
},
{
"content": " def ex_update_ptr_record(self, record, domain=None, extra=None):\n \"\"\"\n Update a PTR record for a specific IP on a specific device.\n\n If you need to change the domain or ttl, use this API to\n update the record by deleting the old one and creating a new one.\n\n :param record: the original :class:`RackspacePTRRecord`\n :param domain: the fqdn you want that IP to represent\n :param extra: a ``dict`` with optional extra values:\n ttl - the time-to-live of the PTR record\n :rtype: instance of :class:`RackspacePTRRecord`\n \"\"\"\n if domain is not None and domain == record.domain:\n domain = None\n\n if extra is not None:\n extra = dict(extra)\n for key in extra:\n if key in record.extra and record.extra[key] == extra[key]:\n del extra[key]\n\n if domain is None and not extra:\n # nothing to do, it already matches\n return record\n\n _check_ptr_extra_fields(record)\n ip = record.ip\n\n self.ex_delete_ptr_record(record)\n # records have the same metadata in 'extra' as the original device\n # so you can pass the original record object in instead\n return self.ex_create_ptr_record(record, ip, domain, extra=extra)",
"metadata": "root.RackspaceDNSDriver.ex_update_ptr_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 500
},
{
"content": " def ex_delete_ptr_record(self, record):\n \"\"\"\n Delete an existing PTR Record\n\n :param record: the original :class:`RackspacePTRRecord`\n :rtype: ``bool``\n \"\"\"\n _check_ptr_extra_fields(record)\n self.connection.set_context({'resource': 'record', 'id': record.id})\n self.connection.async_request(\n action='/rdns/%s' % (record.extra['service_name']),\n method='DELETE',\n params={'href': record.extra['uri'], 'ip': record.ip},\n )\n return True",
"metadata": "root.RackspaceDNSDriver.ex_delete_ptr_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 534
},
{
"content": " def _to_zone(self, data):\n id = data['id']\n domain = data['name']\n type = 'master'\n ttl = data.get('ttl', 0)\n extra = {}\n\n if 'emailAddress' in data:\n extra['email'] = data['emailAddress']\n\n if 'comment' in data:\n extra['comment'] = data['comment']\n\n zone = Zone(id=str(id), domain=domain, type=type, ttl=int(ttl),\n driver=self, extra=extra)\n return zone",
"metadata": "root.RackspaceDNSDriver._to_zone",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 550
},
{
"content": " def _to_record(self, data, zone):\n id = data['id']\n fqdn = data['name']\n name = self._to_partial_record_name(domain=zone.domain, name=fqdn)\n type = self._string_to_record_type(data['type'])\n record_data = data['data']\n extra = {'fqdn': fqdn}\n\n for key in VALID_RECORD_EXTRA_PARAMS:\n if key in data:\n extra[key] = data[key]\n\n record = Record(id=str(id), name=name, type=type, data=record_data,\n zone=zone, driver=self, ttl=extra.get('ttl', None),\n extra=extra)\n return record",
"metadata": "root.RackspaceDNSDriver._to_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 567
},
{
"content": " def _to_ptr_record(self, data, link):\n id = data['id']\n ip = data['data']\n domain = data['name']\n extra = {'uri': link['href'], 'service_name': link['rel']}\n\n for key in VALID_RECORD_EXTRA_PARAMS:\n if key in data:\n extra[key] = data[key]\n\n record = RackspacePTRRecord(id=str(id), ip=ip, domain=domain,\n driver=self, extra=extra)\n return record",
"metadata": "root.RackspaceDNSDriver._to_ptr_record",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 584
},
{
"content": " def _to_full_record_name(self, domain, name):\n \"\"\"\n Build a FQDN from a domain and record name.\n\n :param domain: Domain name.\n :type domain: ``str``\n\n :param name: Record name.\n :type name: ``str``\n \"\"\"\n if name:\n name = '%s.%s' % (name, domain)\n else:\n name = domain\n\n return name",
"metadata": "root.RackspaceDNSDriver._to_full_record_name",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 598
},
{
"content": " def _to_partial_record_name(self, domain, name):\n \"\"\"\n Remove domain portion from the record name.\n\n :param domain: Domain name.\n :type domain: ``str``\n\n :param name: Full record name (fqdn).\n :type name: ``str``\n \"\"\"\n if name == domain:\n # Map \"root\" record names to None to be consistent with other\n # drivers\n return None\n\n # Strip domain portion\n name = name.replace('.%s' % (domain), '')\n return name",
"metadata": "root.RackspaceDNSDriver._to_partial_record_name",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 615
},
{
"content": " def _ex_connection_class_kwargs(self):\n kwargs = self.openstack_connection_kwargs()\n kwargs['region'] = self.region\n return kwargs",
"metadata": "root.RackspaceDNSDriver._ex_connection_class_kwargs",
"header": "['class', 'RackspaceDNSDriver', '(', 'DNSDriver', ',', 'OpenStackDriverMixin', ')', ':', '___EOS___']",
"index": 634
},
{
"content": "def _rackspace_result_has_more(response, result_length, limit):\n # If rackspace returns less than the limit, then we've reached the end of\n # the result set.\n if result_length < limit:\n return False\n\n # Paginated results return links to the previous and next sets of data, but\n # 'next' only exists when there is more to get.\n for item in response.get('links', ()):\n if item['rel'] == 'next':\n return True\n return False",
"metadata": "root._rackspace_result_has_more",
"header": "['module', '___EOS___']",
"index": 640
},
{
"content": "def _check_ptr_extra_fields(device_or_record):\n if not (hasattr(device_or_record, 'extra') and\n isinstance(device_or_record.extra, dict) and\n device_or_record.extra.get('uri') is not None and\n device_or_record.extra.get('service_name') is not None):\n raise LibcloudError(\"Can't create PTR Record for %s because it \"\n \"doesn't have a 'uri' and 'service_name' in \"\n \"'extra'\" % device_or_record)",
"metadata": "root._check_ptr_extra_fields",
"header": "['module', '___EOS___']",
"index": 654
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"License",
"d",
" ",
"to",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"Sof",
"twa",
"re",
" ",
"Foun",
"dati",
"on",
" ",
"(",
"AS",
"F",
")",
" ",
"under",
" ",
"one",
" ",
"or",
" ",
"more_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"contributor",
" ",
"license",
" ",
"agreement",
"s",
".",
" ",
" ",
"See",
" ",
"the",
" ",
"NOTICE",
" ",
"file",
" ",
"distributed",
" ",
"with_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"this",
" ",
"work",
" ",
"for",
" ",
"addition",
"al",
" ",
"informati",
"on",
" ",
"regarding",
" ",
"copyr",
"ight",
" ",
"owner",
"ship",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"AS",
"F",
" ",
"license",
"s",
" ",
"this",
" ",
"file",
" ",
"to",
" ",
"You",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"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_",
"import_",
"copy_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"utils_",
"._",
"py3",
"_",
"import_",
"httplib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"common_",
"._",
"openstack_",
"import_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"common_",
"._",
"base_",
"import_",
"Poll",
"ing",
"Connection_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"common_",
"._",
"exceptions_",
"import_",
"Base",
"HTTP",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"common_",
"._",
"types_",
"import_",
"Lib",
"cloud",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"utils_",
"._",
"misc_",
"import_",
"merge",
"\\u",
"valid",
"\\u",
"keys_",
",_",
"get",
"\\u",
"new",
"\\u",
"obj_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"common_",
"._",
"racks",
"pace_",
"import_",
"AUTH",
"\\u",
"URL_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"compute_",
"._",
"drivers_",
"._",
"openstack_",
"import_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Connection_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"compute_",
"._",
"drivers_",
"._",
"openstack_",
"import_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Response_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"dns_",
"._",
"types_",
"import_",
"Provider_",
",_",
"Record",
"Type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"dns_",
"._",
"types_",
"import_",
"Zon",
"e",
"Do",
"es",
"Not",
"Exist",
"Error_",
",_",
"Record",
"Do",
"es",
"Not",
"Exist",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"libc",
"loud",
"_",
"._",
"dns_",
"._",
"base_",
"import_",
"DNS",
"Driver_",
",_",
"Zone_",
",_",
"Record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u",
"all\\u\\u_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Rack",
"space",
"DNS",
"Respons",
"e",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Rack",
"space",
"DNS",
"Connect",
"ion",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"VALID",
"\\u",
"ZONE",
"\\u",
"EXTRA",
"\\u",
"PARAMS_",
"=_",
"[_",
"'",
"email",
"'_",
",_",
"'",
"comment",
"'_",
",_",
"'",
"ns",
"1",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"VALID",
"\\u",
"RECORD",
"\\u",
"EXTRA",
"\\u",
"PARAMS_",
"=_",
"[_",
"'",
"ttl",
"'_",
",_",
"'",
"comment",
"'_",
",_",
"'",
"priorit",
"y",
"'_",
",_",
"'",
"created",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"update",
"d",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"Rack",
"space",
"DNS",
"Response_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Response_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Rack",
"space",
" ",
"DNS",
" ",
"Respons",
"e",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Response_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Response_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"parse",
"\\u",
"error_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"status_",
"=_",
"int_",
"(_",
"self_",
"._",
"status_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"context_",
"=_",
"self_",
"._",
"connection_",
"._",
"context_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"self_",
"._",
"parse",
"\\u",
"body_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"status_",
"==_",
"httplib_",
"._",
"NOT",
"\\u",
"FOUND_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"context_",
"[_",
"'",
"resource",
"'_",
"]_",
"==_",
"'",
"zone",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Zon",
"e",
"Do",
"es",
"Not",
"Exist",
"Error_",
"(_",
"value_",
"=_",
"''_",
",_",
"driver_",
"=_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"zone",
"\\u",
"id_",
"=_",
"context_",
"[_",
"'",
"id",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"context_",
"[_",
"'",
"resource",
"'_",
"]_",
"==_",
"'",
"record",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Record",
"Do",
"es",
"Not",
"Exist",
"Error_",
"(_",
"value_",
"=_",
"''_",
",_",
"driver_",
"=_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"record",
"\\u",
"id_",
"=_",
"context_",
"[_",
"'",
"id",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"body_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"'",
"code",
"'_",
"and_",
"'",
"message",
"'_",
"in_",
"body_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"err_",
"=_",
"'%",
"s",
" ",
"-",
" ",
"%",
"s",
" ",
"(%",
"s",
")'_",
"%_",
"(_",
"body_",
"[_",
"'",
"code",
"'_",
"]_",
",_",
"body_",
"[_",
"'",
"message",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"[_",
"'",
"deta",
"il",
"s",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"err_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"'",
"validation",
"Error",
"s",
"'_",
"in_",
"body_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"errors_",
"=_",
"[_",
"m_",
"for_",
"m_",
"in_",
"body_",
"[_",
"'",
"validation",
"Error",
"s",
"'_",
"]_",
"[_",
"'",
"message",
"s",
"'_",
"]_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"err_",
"=_",
"'",
"Validat",
"ion",
" ",
"error",
"s",
":",
" ",
"%",
"s",
"'_",
"%_",
"',",
" ",
"'_",
"._",
"join_",
"(_",
"errors_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"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_",
"raise_",
"Lib",
"cloud",
"Error_",
"(_",
"'",
"Une",
"xpe",
"cte",
"d",
" ",
"status",
" ",
"code",
":",
" ",
"%",
"s",
"'_",
"%_",
"(_",
"status_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Rack",
"space",
"DNS",
"Connection_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Connection_",
",_",
"Poll",
"ing",
"Connection_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Rack",
"space",
" ",
"DNS",
" ",
"Connect",
"ion",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"response",
"Cls",
"_",
"=_",
"Rack",
"space",
"DNS",
"Response_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"XML",
"\\u",
"NAMESPACE_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"poll",
"\\u",
"interval_",
"=_",
"2.5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"timeout_",
"=_",
"30_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"auth",
"\\u",
"url_",
"=_",
"AUTH",
"\\u",
"URL_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"auth",
"\\u",
"version_",
"=_",
"'",
"2.0",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Connection_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Connection_",
",_",
"Poll",
"ing",
"Connection_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"region_",
"=_",
"kwargs_",
"._",
"pop_",
"(_",
"'",
"region",
"'_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"Rack",
"space",
"DNS",
"Connection_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Connection_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Connection_",
",_",
"Poll",
"ing",
"Connection_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"poll",
"\\u",
"request",
"\\u",
"kwargs_",
"(_",
"self_",
",_",
"response_",
",_",
"context_",
",_",
"request",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"job",
"\\u",
"id_",
"=_",
"response_",
"._",
"object_",
"[_",
"'",
"job",
"Id",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kwargs_",
"=_",
"{_",
"'",
"action",
"'_",
":_",
"'/",
"status",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"job",
"\\u",
"id_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"params",
"'_",
":_",
"{_",
"'",
"show",
"Det",
"ail",
"s",
"'_",
":_",
"True_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Connection_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Connection_",
",_",
"Poll",
"ing",
"Connection_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"has",
"\\u",
"completed_",
"(_",
"self_",
",_",
"response_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"status_",
"=_",
"response_",
"._",
"object_",
"[_",
"'",
"status",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"status_",
"==_",
"'",
"ERROR",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"response_",
"._",
"object_",
"[_",
"'",
"error",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"'",
"code",
"'_",
"and_",
"'",
"message",
"'_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"'%",
"s",
" ",
"-",
" ",
"%",
"s",
" ",
"(%",
"s",
")'_",
"%_",
"(_",
"data_",
"[_",
"'",
"code",
"'_",
"]_",
",_",
"data_",
"[_",
"'",
"message",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"[_",
"'",
"deta",
"il",
"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 ",
" _",
"message_",
"=_",
"data_",
"[_",
"'",
"message",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"raise_",
"Lib",
"cloud",
"Error_",
"(_",
"message_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"driver_",
"=_",
"self_",
"._",
"driver_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"status_",
"==_",
"'",
"COMPLETED",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Connection_",
"(_",
"Open",
"Stack",
"\\u",
"1",
"\\u",
"1",
"\\u",
"Connection_",
",_",
"Poll",
"ing",
"Connection_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"endpoint_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"'",
"2.0",
"'_",
"in_",
"self_",
"._",
"\\u",
"auth",
"\\u",
"version_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ep_",
"=_",
"self_",
"._",
"service",
"\\u",
"catalog_",
"._",
"get",
"\\u",
"endpoint_",
"(_",
"name_",
"=_",
"'",
"cloud",
"DNS",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"service",
"\\u",
"type_",
"=_",
"'",
"rax",
":",
"dns",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"region_",
"=_",
"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 ",
" _",
"raise_",
"Lib",
"cloud",
"Error_",
"(_",
"\"",
"Auth",
" ",
"version",
" ",
"%",
"s",
" ",
"not",
" ",
"support",
"ed",
"\"_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"self_",
"._",
"\\u",
"auth",
"\\u",
"version_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"public",
"\\u",
"url_",
"=_",
"ep_",
"._",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"is",
" ",
"a",
" ",
"nas",
"ty",
" ",
"hack",
",",
" ",
"but",
" ",
"bec",
"aus",
"e",
" ",
"of",
" ",
"how",
" ",
"global",
" ",
"auth",
" ",
"and",
" ",
"old",
" ",
"accounts_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"work",
",",
" ",
"there",
" ",
"is",
" ",
"no",
" ",
"way",
" ",
"aro",
"und",
" ",
"it",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"region_",
"==_",
"'",
"us",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Old",
" ",
"UK",
" ",
"account",
",",
" ",
"whi",
"ch",
" ",
"only",
" ",
"has",
" ",
"us",
" ",
"endpoint",
" ",
"in",
" ",
"the",
" ",
"catalog_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"public",
"\\u",
"url_",
"=_",
"public",
"\\u",
"url_",
"._",
"replace_",
"(_",
"'",
"https",
"://",
"lon",
".",
"dns",
".",
"api",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"https",
"://",
"dns",
".",
"api",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"region_",
"==_",
"'",
"uk",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Old",
" ",
"US",
" ",
"account",
",",
" ",
"whi",
"ch",
" ",
"only",
" ",
"has",
" ",
"uk",
" ",
"endpoint",
" ",
"in",
" ",
"the",
" ",
"catalog_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"public",
"\\u",
"url_",
"=_",
"public",
"\\u",
"url_",
"._",
"replace_",
"(_",
"'",
"https",
"://",
"dns",
".",
"api",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"https",
"://",
"lon",
".",
"dns",
".",
"api",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"public",
"\\u",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Rack",
"space",
"PTR",
"Record_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"PTR",
"Record_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"id_",
",_",
"ip_",
",_",
"domain_",
",_",
"driver_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"id_",
"=_",
"str_",
"(_",
"id_",
")_",
"if_",
"id_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"ip_",
"=_",
"ip_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"type_",
"=_",
"Record",
"Type_",
"._",
"PTR",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"domain_",
"=_",
"domain_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"driver_",
"=_",
"driver_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"extra_",
"=_",
"extra_",
"or_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"PTR",
"Record_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"update_",
"(_",
"self_",
",_",
"domain_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"driver_",
"._",
"ex",
"\\u",
"update",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"record_",
"=_",
"self_",
",_",
"domain_",
"=_",
"domain_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"PTR",
"Record_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"delete_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"driver_",
"._",
"ex",
"\\u",
"delete",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"record_",
"=_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"PTR",
"Record_",
"(_",
"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_",
"(_",
"'<",
"%",
"s",
":",
" ",
"ip",
"=",
"%",
"s",
",",
" ",
"domain",
"=",
"%",
"s",
",",
" ",
"provide",
"r",
"=",
"%",
"s",
" ",
"...",
">'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
"._",
"\\u\\u",
"name\\u\\u_",
",_",
"self_",
"._",
"ip_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"domain_",
",_",
"self_",
"._",
"driver_",
"._",
"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_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"'",
"Rack",
"space",
" ",
"DNS",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"website_",
"=_",
"'",
"http",
"://",
"www",
".",
"racks",
"pace",
".",
"com",
"/'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"type_",
"=_",
"Provider_",
"._",
"RACK",
"SPACE_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"connecti",
"on",
"Cls",
"_",
"=_",
"Rack",
"space",
"DNS",
"Connection_",
"\\u\\u\\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_",
"RECORD",
"\\u",
"TYPE",
"\\u",
"MAP_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"A_",
":_",
"'",
"A",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"AAAA",
"_",
":_",
"'",
"AAAA",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"CNA",
"ME_",
":_",
"'",
"CNA",
"ME",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"MX",
"_",
":_",
"'",
"MX",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"NS_",
":_",
"'",
"NS",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"PTR",
"_",
":_",
"'",
"PTR",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"SRV",
"_",
":_",
"'",
"SRV",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Record",
"Type_",
"._",
"TXT",
"_",
":_",
"'",
"TXT",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\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u\\u\\u_",
"\\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_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"key_",
",_",
"secret_",
"=_",
"None_",
",_",
"secure_",
"=_",
"True_",
",_",
"host_",
"=_",
"None_",
",_",
"port_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"region_",
"=_",
"'",
"us",
"'_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"valid",
"\\u",
"regions_",
"=_",
"self_",
"._",
"list",
"\\u",
"regions_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"region_",
"not_",
"in_",
"valid",
"\\u",
"regions_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"'",
"Inva",
"lid",
" ",
"region",
":",
" ",
"%",
"s",
"'_",
"%_",
"(_",
"region_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"Rack",
"space",
"DNS",
"Driver_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"key_",
"=_",
"key_",
",_",
"secret_",
"=_",
"secret_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"host_",
"=_",
"host_",
",_",
"port_",
"=_",
"port_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"region_",
"=_",
"region_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"classmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"list",
"\\u",
"regions_",
"(_",
"cls_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"[_",
"'",
"us",
"'_",
",_",
"'",
"uk",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"iterate",
"\\u",
"zones_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"offset_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"limit_",
"=_",
"100_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"True_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"params_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"limit",
"'_",
":_",
"limit_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"offset",
"'_",
":_",
"offset_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'/",
"domains",
"'_",
",_",
"params_",
"=_",
"params_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"zone",
"s",
"\\u",
"list_",
"=_",
"response_",
"[_",
"'",
"domains",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"zone",
"s",
"\\u",
"list_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"self_",
"._",
"\\u",
"to",
"\\u",
"zone_",
"(_",
"item_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u",
"racks",
"pace\\u",
"result",
"\\u",
"has",
"\\u",
"more_",
"(_",
"response_",
",_",
"len_",
"(_",
"zone",
"s",
"\\u",
"list_",
")_",
",_",
"limit_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"offset_",
"+=_",
"limit_",
"\\u\\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_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"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_",
"iterate",
"\\u",
"records_",
"(_",
"self_",
",_",
"zone_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"zone",
"'_",
",_",
"'",
"id",
"'_",
":_",
"zone_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"offset_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"limit_",
"=_",
"100_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"True_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"params_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"show",
"Record",
"'_",
":_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"limit",
"'_",
":_",
"limit_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"offset",
"'_",
":_",
"offset_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"zone_",
"._",
"id_",
")_",
",_",
"params_",
"=_",
"params_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"record",
"s",
"\\u",
"list_",
"=_",
"response_",
"[_",
"'",
"record",
"s",
"List",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"records_",
"=_",
"record",
"s",
"\\u",
"list_",
"[_",
"'",
"record",
"s",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"records_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"record_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"record_",
"(_",
"data_",
"=_",
"item_",
",_",
"zone_",
"=_",
"zone_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u",
"racks",
"pace\\u",
"result",
"\\u",
"has",
"\\u",
"more_",
"(_",
"record",
"s",
"\\u",
"list_",
",_",
"len_",
"(_",
"records_",
")_",
",_",
"limit_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"offset_",
"+=_",
"limit_",
"\\u\\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_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"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_",
"get",
"\\u",
"zone_",
"(_",
"self_",
",_",
"zone",
"\\u",
"id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"zone",
"'_",
",_",
"'",
"id",
"'_",
":_",
"zone",
"\\u",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"zone",
"\\u",
"id_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"zone_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"zone_",
"(_",
"data_",
"=_",
"response_",
"._",
"object_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"zone_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"record_",
"(_",
"self_",
",_",
"zone",
"\\u",
"id_",
",_",
"record",
"\\u",
"id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"zone_",
"=_",
"self_",
"._",
"get",
"\\u",
"zone_",
"(_",
"zone",
"\\u",
"id_",
"=_",
"zone",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"record",
"'_",
",_",
"'",
"id",
"'_",
":_",
"record",
"\\u",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"/",
"record",
"s",
"/",
"%",
"s",
"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"zone",
"\\u",
"id_",
",_",
"record",
"\\u",
"id_",
")_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"record_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"record_",
"(_",
"data_",
"=_",
"response_",
",_",
"zone_",
"=_",
"zone_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"create",
"\\u",
"zone_",
"(_",
"self_",
",_",
"domain_",
",_",
"type_",
"=_",
"'",
"master",
"'_",
",_",
"ttl_",
"=_",
"None_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"extra_",
"if_",
"extra_",
"else_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Ema",
"il",
" ",
"address",
" ",
"is",
" ",
"required_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"'",
"email",
"'_",
"not_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"'\"",
"email",
"\"",
" ",
"key",
" ",
"must",
" ",
"be",
" ",
"presen",
"t",
" ",
"in",
" ",
"extra",
" ",
"dictionar",
"y",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"payload_",
"=_",
"{_",
"'",
"name",
"'_",
":_",
"domain_",
",_",
"'",
"email",
"Address",
"'_",
":_",
"extra_",
"[_",
"'",
"email",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"record",
"s",
"List",
"'_",
":_",
"{_",
"'",
"record",
"s",
"'_",
":_",
"[_",
"]_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"ttl_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"[_",
"'",
"ttl",
"'_",
"]_",
"=_",
"ttl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"comment",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"[_",
"'",
"comment",
"'_",
"]_",
"=_",
"extra_",
"[_",
"'",
"comment",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"data_",
"=_",
"{_",
"'",
"domains",
"'_",
":_",
"[_",
"payload_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"POST",
"'_",
",_",
"data_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"zone_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"zone_",
"(_",
"data_",
"=_",
"response_",
"._",
"object_",
"[_",
"'",
"response",
"'_",
"]_",
"[_",
"'",
"domains",
"'_",
"]_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"zone_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"update",
"\\u",
"zone_",
"(_",
"self_",
",_",
"zone_",
",_",
"domain_",
"=_",
"None_",
",_",
"type_",
"=_",
"None_",
",_",
"ttl_",
"=_",
"None_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"On",
"ly",
" ",
"ttl",
",",
" ",
"comment",
" ",
"and",
" ",
"email",
" ",
"address",
" ",
"can",
" ",
"be",
" ",
"changed_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"extra_",
"if_",
"extra_",
"else_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"domain_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Lib",
"cloud",
"Error_",
"(_",
"'",
"Doma",
"in",
" ",
"cann",
"ot",
" ",
"be",
" ",
"change",
"d",
"'_",
",_",
"driver_",
"=_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"data_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"ttl_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"ttl",
"'_",
"]_",
"=_",
"int_",
"(_",
"ttl_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"email",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"email",
"Address",
"'_",
"]_",
"=_",
"extra_",
"[_",
"'",
"email",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"comment",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"comment",
"'_",
"]_",
"=_",
"extra_",
"[_",
"'",
"comment",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"type_",
"=_",
"type_",
"if_",
"type_",
"else_",
"zone_",
"._",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ttl_",
"=_",
"ttl_",
"if_",
"ttl_",
"else_",
"zone_",
"._",
"ttl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"zone",
"'_",
",_",
"'",
"id",
"'_",
":_",
"zone_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"zone_",
"._",
"id_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
",_",
"data_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"merged_",
"=_",
"merge",
"\\u",
"valid",
"\\u",
"keys_",
"(_",
"params_",
"=_",
"copy_",
"._",
"deepcopy_",
"(_",
"zone_",
"._",
"extra_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"valid",
"\\u",
"keys_",
"=_",
"VALID",
"\\u",
"ZONE",
"\\u",
"EXTRA",
"\\u",
"PARAMS_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"update",
"d\\u",
"zone_",
"=_",
"get",
"\\u",
"new",
"\\u",
"obj_",
"(_",
"obj_",
"=_",
"zone_",
",_",
"klass_",
"=_",
"Zone_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"attributes_",
"=_",
"{_",
"'",
"type",
"'_",
":_",
"type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ttl",
"'_",
":_",
"ttl_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"extra",
"'_",
":_",
"merged_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"update",
"d\\u",
"zone_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"create",
"\\u",
"record_",
"(_",
"self_",
",_",
"name_",
",_",
"zone_",
",_",
"type_",
",_",
"data_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Name",
" ",
"must",
" ",
"be",
" ",
"a",
" ",
"FQ",
"DN",
" ",
"-",
" ",
"e",
".",
"g",
".",
" ",
"if",
" ",
"domain",
" ",
"is",
" ",
"\"",
"foo",
".",
"com",
"\"",
" ",
"then",
" ",
"a",
" ",
"record_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"name",
" ",
"is",
" ",
"\"",
"bar",
".",
"foo",
".",
"com",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"extra_",
"if_",
"extra_",
"else_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"full",
"\\u",
"record",
"\\u",
"name_",
"(_",
"domain_",
"=_",
"zone_",
"._",
"domain_",
",_",
"name_",
"=_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"{_",
"'",
"name",
"'_",
":_",
"name_",
",_",
"'",
"type",
"'_",
":_",
"self_",
"._",
"RECORD",
"\\u",
"TYPE",
"\\u",
"MAP_",
"[_",
"type_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"data",
"'_",
":_",
"data_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"'",
"ttl",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"ttl",
"'_",
"]_",
"=_",
"int_",
"(_",
"extra_",
"[_",
"'",
"ttl",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"priorit",
"y",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"priorit",
"y",
"'_",
"]_",
"=_",
"int_",
"(_",
"extra_",
"[_",
"'",
"priorit",
"y",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"payload_",
"=_",
"{_",
"'",
"record",
"s",
"'_",
":_",
"[_",
"data_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"zone",
"'_",
",_",
"'",
"id",
"'_",
":_",
"zone_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"/",
"record",
"s",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"%_",
"(_",
"zone_",
"._",
"id_",
")_",
",_",
"data_",
"=_",
"payload_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"POST",
"'_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"record_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"record_",
"(_",
"data_",
"=_",
"response_",
"[_",
"'",
"response",
"'_",
"]_",
"[_",
"'",
"record",
"s",
"'_",
"]_",
"[_",
"0_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"zone_",
"=_",
"zone_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"update",
"\\u",
"record_",
"(_",
"self_",
",_",
"record_",
",_",
"name_",
"=_",
"None_",
",_",
"type_",
"=_",
"None_",
",_",
"data_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"On",
"ly",
" ",
"data",
",",
" ",
"ttl",
",",
" ",
"and",
" ",
"comment",
" ",
"attribute",
"s",
" ",
"can",
" ",
"be",
" ",
"modifi",
"ed",
",",
" ",
"but",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"attribute",
" ",
"must",
" ",
"alw",
"ay",
"s",
" ",
"be",
" ",
"presen",
"t",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"extra_",
"if_",
"extra_",
"else_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"full",
"\\u",
"record",
"\\u",
"name_",
"(_",
"domain_",
"=_",
"record_",
"._",
"zone_",
"._",
"domain_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"record_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"{_",
"'",
"name",
"'_",
":_",
"name_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"[_",
"'",
"data",
"'_",
"]_",
"=_",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"ttl",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"[_",
"'",
"ttl",
"'_",
"]_",
"=_",
"extra_",
"[_",
"'",
"ttl",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"comment",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"[_",
"'",
"comment",
"'_",
"]_",
"=_",
"extra_",
"[_",
"'",
"comment",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"type_",
"=_",
"type_",
"if_",
"type_",
"is_",
"not_",
"None_",
"else_",
"record_",
"._",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"data_",
"if_",
"data_",
"else_",
"record_",
"._",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"record",
"'_",
",_",
"'",
"id",
"'_",
":_",
"record_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"/",
"record",
"s",
"/",
"%",
"s",
"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"record_",
"._",
"zone_",
"._",
"id_",
",_",
"record_",
"._",
"id_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
",_",
"data_",
"=_",
"payload_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"merged_",
"=_",
"merge",
"\\u",
"valid",
"\\u",
"keys_",
"(_",
"params_",
"=_",
"copy_",
"._",
"deepcopy_",
"(_",
"record_",
"._",
"extra_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"valid",
"\\u",
"keys_",
"=_",
"VALID",
"\\u",
"RECORD",
"\\u",
"EXTRA",
"\\u",
"PARAMS_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"update",
"d\\u",
"record_",
"=_",
"get",
"\\u",
"new",
"\\u",
"obj_",
"(_",
"obj_",
"=_",
"record_",
",_",
"klass_",
"=_",
"Record_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"attributes_",
"=_",
"{_",
"'",
"type",
"'_",
":_",
"type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"data",
"'_",
":_",
"data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"driver",
"'_",
":_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"extra",
"'_",
":_",
"merged_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"update",
"d\\u",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"delete",
"\\u",
"zone_",
"(_",
"self_",
",_",
"zone_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"zone",
"'_",
",_",
"'",
"id",
"'_",
":_",
"zone_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"zone_",
"._",
"id_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"delete",
"\\u",
"record_",
"(_",
"self_",
",_",
"record_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"record",
"'_",
",_",
"'",
"id",
"'_",
":_",
"record_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"action_",
"=_",
"'/",
"domains",
"/",
"%",
"s",
"/",
"record",
"s",
"/",
"%",
"s",
"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"record_",
"._",
"zone_",
"._",
"id_",
",_",
"record_",
"._",
"id_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"ex",
"\\u",
"iterate",
"\\u",
"ptr",
"\\u",
"records_",
"(_",
"self_",
",_",
"device_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
"generat",
"or",
" ",
"to",
" ",
"iterate",
" ",
"over",
" ",
"exist",
"ing",
" ",
"PTR",
" ",
"Record",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"``",
"device",
"``",
" ",
"shou",
"ld",
" ",
"be",
" ",
"an",
" ",
"instance",
" ",
"of",
" ",
"one",
" ",
"of",
" ",
"these",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"class",
":`",
"libc",
"loud",
".",
"compute",
".",
"base",
".",
"Node",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"class",
":`",
"libc",
"loud",
".",
"loadbalancer",
".",
"base",
".",
"Load",
"Balance",
"r",
"`",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"And",
" ",
"it",
" ",
"need",
"s",
" ",
"to",
" ",
"have",
" ",
"the",
" ",
"follow",
"ing",
" ",
"``",
"extra",
"``",
" ",
"fields",
" ",
"set",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"service",
"\\u",
"name",
" ",
"-",
" ",
"the",
" ",
"service",
" ",
"catal",
"og",
" ",
"name",
" ",
"for",
" ",
"the",
" ",
"device",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"uri",
" ",
"-",
" ",
"the",
" ",
"URI",
" ",
"pointi",
"ng",
" ",
"to",
" ",
"the",
" ",
"GET",
" ",
"endpoint",
" ",
"for",
" ",
"the",
" ",
"device",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Tho",
"se",
" ",
"are",
" ",
"automati",
"call",
"y",
" ",
"set",
" ",
"for",
" ",
"you",
" ",
"if",
" ",
"you",
" ",
"got",
" ",
"the",
" ",
"device",
" ",
"from",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"Rack",
"space",
" ",
"driver",
" ",
"for",
" ",
"tha",
"t",
" ",
"service",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"For",
" ",
"example",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"server",
" ",
"=",
" ",
"rs",
"\\u",
"compute",
".",
"ex",
"\\u",
"get",
"\\u",
"node",
"\\u",
"deta",
"il",
"s",
"(",
"id",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"ptr",
"\\u",
"iter",
" ",
"=",
" ",
"rs",
"\\u",
"dns",
".",
"ex",
"\\u",
"list",
"\\u",
"ptr",
"\\u",
"record",
"s",
"(",
"server",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"loadbalancer",
" ",
"=",
" ",
"rs",
"\\u",
"lb",
"s",
".",
"get",
"\\u",
"balancer",
"(",
"id",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"ptr",
"\\u",
"iter",
" ",
"=",
" ",
"rs",
"\\u",
"dns",
".",
"ex",
"\\u",
"list",
"\\u",
"ptr",
"\\u",
"record",
"s",
"(",
"loadbalancer",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"e",
":",
" ",
"the",
" ",
"Rack",
"space",
" ",
"DNS",
" ",
"API",
" ",
"docs",
" ",
"indicat",
"e",
" ",
"tha",
"t",
" ",
"the",
" ",
"device",
" ",
"'",
"href",
"'",
" ",
"is",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"option",
"al",
",",
" ",
"but",
" ",
"testi",
"ng",
" ",
"doe",
"s",
" ",
"not",
" ",
"bear",
" ",
"this",
" ",
"out",
".",
" ",
"It",
" ",
"throw",
"s",
" ",
"a",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"400",
" ",
"Ba",
"d",
" ",
"Request",
" ",
"error",
" ",
"if",
" ",
"you",
" ",
"do",
" ",
"not",
" ",
"pass",
" ",
"in",
" ",
"the",
" ",
"'",
"href",
"'",
" ",
"from",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"server",
" ",
"or",
" ",
"loadbalancer",
".",
" ",
" ",
"So",
" ",
"``",
"device",
"``",
" ",
"is",
" ",
"require",
"d",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"device",
":",
" ",
"the",
" ",
"device",
" ",
"tha",
"t",
" ",
"owns",
" ",
"the",
" ",
"IP",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"rty",
"pe",
":",
" ",
"``",
"generat",
"or",
"``",
" ",
"of",
" ",
":",
"class",
":`",
"Rack",
"space",
"PTR",
"Record",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"check",
"\\u",
"ptr",
"\\u",
"extra",
"\\u",
"fields_",
"(_",
"device_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"params_",
"=_",
"{_",
"'",
"href",
"'_",
":_",
"device_",
"._",
"extra_",
"[_",
"'",
"uri",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"service",
"\\u",
"name_",
"=_",
"device_",
"._",
"extra_",
"[_",
"'",
"service",
"\\u",
"name",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"with",
"out",
" ",
"a",
" ",
"valid",
" ",
"context",
",",
" ",
"the",
" ",
"404",
" ",
"on",
" ",
"empty",
" ",
"list",
" ",
"will",
" ",
"blow",
" ",
"up_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"in",
" ",
"the",
" ",
"error",
"-",
"handling",
" ",
"code_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"ptr",
"\\u",
"record",
"s",
"'_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'/",
"rd",
"ns",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"service",
"\\u",
"name_",
")_",
",_",
"params_",
"=_",
"params_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"records_",
"=_",
"response_",
"[_",
"'",
"record",
"s",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"link_",
"=_",
"dict_",
"(_",
"rel_",
"=_",
"service",
"\\u",
"name_",
",_",
"**_",
"params_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"records_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"record_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"data_",
"=_",
"item_",
",_",
"link_",
"=_",
"link_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Base",
"HTTP",
"Error_",
"as_",
"exc_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"404",
" ",
"just",
" ",
"means",
" ",
"empty",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"exc_",
"._",
"code_",
"==_",
"404_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"raise_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"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_",
"ex",
"\\u",
"get",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"self_",
",_",
"service",
"\\u",
"name_",
",_",
"record",
"\\u",
"id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"a",
" ",
"specific",
" ",
"PTR",
" ",
"record",
" ",
"by",
" ",
"id",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"service",
"\\u",
"name",
":",
" ",
"the",
" ",
"service",
" ",
"catal",
"og",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"linked",
" ",
"device",
"(",
"s",
")",
"\\",
"10",
";",
" ",
" ",
" ",
"i",
".",
"e",
".",
" ",
"cloud",
"Load",
"Balance",
"rs",
" ",
"or",
" ",
"cloud",
"Server",
"s",
"Open",
"Stack",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"record",
"\\u",
"id",
":",
" ",
"the",
" ",
"id",
" ",
"(",
"i",
".",
"e",
".",
" ",
"PTR",
"-1",
"2345",
")",
" ",
"of",
" ",
"the",
" ",
"PTR",
" ",
"record",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"rty",
"pe",
":",
" ",
"instance",
" ",
"of",
" ",
":",
"class",
":`",
"Rack",
"space",
"PTR",
"Record",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"record",
"'_",
",_",
"'",
"id",
"'_",
":_",
"record",
"\\u",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'/",
"rd",
"ns",
"/",
"%",
"s",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"service",
"\\u",
"name_",
",_",
"record",
"\\u",
"id_",
")_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"=_",
"next_",
"(_",
"iter_",
"(_",
"response_",
"[_",
"'",
"record",
"s",
"List",
"'_",
"]_",
"[_",
"'",
"record",
"s",
"'_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"to",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"data_",
"=_",
"item_",
",_",
"link_",
"=_",
"response_",
"[_",
"'",
"link",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"ex",
"\\u",
"create",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"self_",
",_",
"device_",
",_",
"ip_",
",_",
"domain_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Creat",
"e",
" ",
"a",
" ",
"PTR",
" ",
"record",
" ",
"for",
" ",
"a",
" ",
"specific",
" ",
"IP",
" ",
"on",
" ",
"a",
" ",
"specific",
" ",
"device",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"``",
"device",
"``",
" ",
"shou",
"ld",
" ",
"be",
" ",
"an",
" ",
"instance",
" ",
"of",
" ",
"one",
" ",
"of",
" ",
"these",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"class",
":`",
"libc",
"loud",
".",
"compute",
".",
"base",
".",
"Node",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"class",
":`",
"libc",
"loud",
".",
"loadbalancer",
".",
"base",
".",
"Load",
"Balance",
"r",
"`",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"And",
" ",
"it",
" ",
"need",
"s",
" ",
"to",
" ",
"have",
" ",
"the",
" ",
"follow",
"ing",
" ",
"``",
"extra",
"``",
" ",
"fields",
" ",
"set",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"service",
"\\u",
"name",
" ",
"-",
" ",
"the",
" ",
"service",
" ",
"catal",
"og",
" ",
"name",
" ",
"for",
" ",
"the",
" ",
"device",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"uri",
" ",
"-",
" ",
"the",
" ",
"URI",
" ",
"pointi",
"ng",
" ",
"to",
" ",
"the",
" ",
"GET",
" ",
"endpoint",
" ",
"for",
" ",
"the",
" ",
"device",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Tho",
"se",
" ",
"are",
" ",
"automati",
"call",
"y",
" ",
"set",
" ",
"for",
" ",
"you",
" ",
"if",
" ",
"you",
" ",
"got",
" ",
"the",
" ",
"device",
" ",
"from",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"Rack",
"space",
" ",
"driver",
" ",
"for",
" ",
"tha",
"t",
" ",
"service",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"For",
" ",
"example",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"server",
" ",
"=",
" ",
"rs",
"\\u",
"compute",
".",
"ex",
"\\u",
"get",
"\\u",
"node",
"\\u",
"deta",
"il",
"s",
"(",
"id",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rs",
"\\u",
"dns",
".",
"create",
"\\u",
"ptr",
"\\u",
"record",
"(",
"server",
",",
" ",
"ip",
",",
" ",
"domain",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"loadbalancer",
" ",
"=",
" ",
"rs",
"\\u",
"lb",
"s",
".",
"get",
"\\u",
"balancer",
"(",
"id",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rs",
"\\u",
"dns",
".",
"create",
"\\u",
"ptr",
"\\u",
"record",
"(",
"loadbalancer",
",",
" ",
"ip",
",",
" ",
"domain",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"device",
":",
" ",
"the",
" ",
"device",
" ",
"tha",
"t",
" ",
"owns",
" ",
"the",
" ",
"IP",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"ip",
":",
" ",
"the",
" ",
"IP",
" ",
"for",
" ",
"whi",
"ch",
" ",
"you",
" ",
"want",
" ",
"to",
" ",
"set",
" ",
"reverse",
" ",
"DNS",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"domain",
":",
" ",
"the",
" ",
"fq",
"dn",
" ",
"you",
" ",
"want",
" ",
"tha",
"t",
" ",
"IP",
" ",
"to",
" ",
"represent",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"extra",
":",
" ",
"a",
" ",
"``",
"dict",
"``",
" ",
"with",
" ",
"option",
"al",
" ",
"extra",
" ",
"values",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"ttl",
" ",
"-",
" ",
"the",
" ",
"time",
"-",
"to",
"-",
"live",
" ",
"of",
" ",
"the",
" ",
"PTR",
" ",
"record",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"rty",
"pe",
":",
" ",
"instance",
" ",
"of",
" ",
":",
"class",
":`",
"Rack",
"space",
"PTR",
"Record",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"check",
"\\u",
"ptr",
"\\u",
"extra",
"\\u",
"fields_",
"(_",
"device_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"extra_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"RD",
"NS",
" ",
"API",
" ",
"reverse",
" ",
"the",
" ",
"name",
" ",
"and",
" ",
"data",
" ",
"fields",
" ",
"for",
" ",
"PTR",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"record",
" ",
"name",
" ",
"*",
"shou",
"ld",
"*",
" ",
"be",
" ",
"the",
" ",
"ip",
" ",
"and",
" ",
"the",
" ",
"data",
" ",
"the",
" ",
"fqdn_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"name",
"\"_",
":_",
"domain_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"type",
"\"_",
":_",
"Record",
"Type_",
"._",
"PTR",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"data",
"\"_",
":_",
"ip_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"'",
"ttl",
"'_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"ttl",
"'_",
"]_",
"=_",
"extra_",
"[_",
"'",
"ttl",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"payload_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"record",
"s",
"List",
"\"_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"record",
"s",
"\"_",
":_",
"[_",
"data_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"link",
"\"_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"content",
"\"_",
":_",
"\"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"href",
"\"_",
":_",
"device_",
"._",
"extra_",
"[_",
"'",
"uri",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"rel",
"\"_",
":_",
"device_",
"._",
"extra_",
"[_",
"'",
"service",
"\\u",
"name",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'/",
"rd",
"ns",
"'_",
",_",
"method_",
"=_",
"'",
"POST",
"'_",
",_",
"data_",
"=_",
"payload_",
")_",
"._",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"=_",
"next_",
"(_",
"iter_",
"(_",
"response_",
"[_",
"'",
"response",
"'_",
"]_",
"[_",
"'",
"record",
"s",
"'_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"to",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"data_",
"=_",
"item_",
",_",
"link_",
"=_",
"payload_",
"[_",
"'",
"link",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"ex",
"\\u",
"update",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"self_",
",_",
"record_",
",_",
"domain_",
"=_",
"None_",
",_",
"extra_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Update",
" ",
"a",
" ",
"PTR",
" ",
"record",
" ",
"for",
" ",
"a",
" ",
"specific",
" ",
"IP",
" ",
"on",
" ",
"a",
" ",
"specific",
" ",
"device",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"you",
" ",
"need",
" ",
"to",
" ",
"change",
" ",
"the",
" ",
"domain",
" ",
"or",
" ",
"ttl",
",",
" ",
"use",
" ",
"this",
" ",
"API",
" ",
"to",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"update",
" ",
"the",
" ",
"record",
" ",
"by",
" ",
"delet",
"ing",
" ",
"the",
" ",
"old",
" ",
"one",
" ",
"and",
" ",
"creati",
"ng",
" ",
"a",
" ",
"new",
" ",
"one",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"record",
":",
" ",
"the",
" ",
"original",
" ",
":",
"class",
":`",
"Rack",
"space",
"PTR",
"Record",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"domain",
":",
" ",
"the",
" ",
"fq",
"dn",
" ",
"you",
" ",
"want",
" ",
"tha",
"t",
" ",
"IP",
" ",
"to",
" ",
"represent",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"extra",
":",
" ",
"a",
" ",
"``",
"dict",
"``",
" ",
"with",
" ",
"option",
"al",
" ",
"extra",
" ",
"values",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"ttl",
" ",
"-",
" ",
"the",
" ",
"time",
"-",
"to",
"-",
"live",
" ",
"of",
" ",
"the",
" ",
"PTR",
" ",
"record",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"rty",
"pe",
":",
" ",
"instance",
" ",
"of",
" ",
":",
"class",
":`",
"Rack",
"space",
"PTR",
"Record",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"domain_",
"is_",
"not_",
"None_",
"and_",
"domain_",
"==_",
"record_",
"._",
"domain_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"domain_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"extra_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"dict_",
"(_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"key_",
"in_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"key_",
"in_",
"record_",
"._",
"extra_",
"and_",
"record_",
"._",
"extra_",
"[_",
"key_",
"]_",
"==_",
"extra_",
"[_",
"key_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"del_",
"extra_",
"[_",
"key_",
"]_",
"\\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_",
"domain_",
"is_",
"None_",
"and_",
"not_",
"extra_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"not",
"hing",
" ",
"to",
" ",
"do",
",",
" ",
"it",
" ",
"alr",
"ead",
"y",
" ",
"matches_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"check",
"\\u",
"ptr",
"\\u",
"extra",
"\\u",
"fields_",
"(_",
"record_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ip_",
"=_",
"record_",
"._",
"ip_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"ex",
"\\u",
"delete",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"record_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"record",
"s",
" ",
"have",
" ",
"the",
" ",
"same",
" ",
"metadata",
" ",
"in",
" ",
"'",
"extra",
"'",
" ",
"as",
" ",
"the",
" ",
"original",
" ",
"device_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"so",
" ",
"you",
" ",
"can",
" ",
"pass",
" ",
"the",
" ",
"original",
" ",
"record",
" ",
"object",
" ",
"in",
" ",
"inst",
"ead_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"._",
"ex",
"\\u",
"create",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"record_",
",_",
"ip_",
",_",
"domain_",
",_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"ex",
"\\u",
"delete",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"self_",
",_",
"record_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Delete",
" ",
"an",
" ",
"exist",
"ing",
" ",
"PTR",
" ",
"Record",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"record",
":",
" ",
"the",
" ",
"original",
" ",
":",
"class",
":`",
"Rack",
"space",
"PTR",
"Record",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"rty",
"pe",
":",
" ",
"``",
"bool",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"check",
"\\u",
"ptr",
"\\u",
"extra",
"\\u",
"fields_",
"(_",
"record_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"set\\u",
"context_",
"(_",
"{_",
"'",
"resource",
"'_",
":_",
"'",
"record",
"'_",
",_",
"'",
"id",
"'_",
":_",
"record_",
"._",
"id_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"connection_",
"._",
"async",
"\\u",
"request_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"action_",
"=_",
"'/",
"rd",
"ns",
"/",
"%",
"s",
"'_",
"%_",
"(_",
"record_",
"._",
"extra_",
"[_",
"'",
"service",
"\\u",
"name",
"'_",
"]_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"params_",
"=_",
"{_",
"'",
"href",
"'_",
":_",
"record_",
"._",
"extra_",
"[_",
"'",
"uri",
"'_",
"]_",
",_",
"'",
"ip",
"'_",
":_",
"record_",
"._",
"ip_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"to",
"\\u",
"zone_",
"(_",
"self_",
",_",
"data_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id_",
"=_",
"data_",
"[_",
"'",
"id",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"domain_",
"=_",
"data_",
"[_",
"'",
"name",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"type_",
"=_",
"'",
"master",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ttl_",
"=_",
"data_",
"._",
"get_",
"(_",
"'",
"ttl",
"'_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"extra_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"'",
"email",
"Address",
"'_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"[_",
"'",
"email",
"'_",
"]_",
"=_",
"data_",
"[_",
"'",
"email",
"Address",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"comment",
"'_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"[_",
"'",
"comment",
"'_",
"]_",
"=_",
"data_",
"[_",
"'",
"comment",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"zone_",
"=_",
"Zone_",
"(_",
"id_",
"=_",
"str_",
"(_",
"id_",
")_",
",_",
"domain_",
"=_",
"domain_",
",_",
"type_",
"=_",
"type_",
",_",
"ttl_",
"=_",
"int_",
"(_",
"ttl_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"driver_",
"=_",
"self_",
",_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"zone_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"to",
"\\u",
"record_",
"(_",
"self_",
",_",
"data_",
",_",
"zone_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id_",
"=_",
"data_",
"[_",
"'",
"id",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fqdn_",
"=_",
"data_",
"[_",
"'",
"name",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"name_",
"=_",
"self_",
"._",
"\\u",
"to",
"\\u",
"partial",
"\\u",
"record",
"\\u",
"name_",
"(_",
"domain_",
"=_",
"zone_",
"._",
"domain_",
",_",
"name_",
"=_",
"fqdn_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"type_",
"=_",
"self_",
"._",
"\\u",
"string",
"\\u",
"to",
"\\u",
"record",
"\\u",
"type_",
"(_",
"data_",
"[_",
"'",
"type",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"record",
"\\u",
"data_",
"=_",
"data_",
"[_",
"'",
"data",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"extra_",
"=_",
"{_",
"'",
"fq",
"dn",
"'_",
":_",
"fqdn_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"key_",
"in_",
"VALID",
"\\u",
"RECORD",
"\\u",
"EXTRA",
"\\u",
"PARAMS_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"key_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"[_",
"key_",
"]_",
"=_",
"data_",
"[_",
"key_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"record_",
"=_",
"Record_",
"(_",
"id_",
"=_",
"str_",
"(_",
"id_",
")_",
",_",
"name_",
"=_",
"name_",
",_",
"type_",
"=_",
"type_",
",_",
"data_",
"=_",
"record",
"\\u",
"data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"zone_",
"=_",
"zone_",
",_",
"driver_",
"=_",
"self_",
",_",
"ttl_",
"=_",
"extra_",
"._",
"get_",
"(_",
"'",
"ttl",
"'_",
",_",
"None_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"to",
"\\u",
"ptr",
"\\u",
"record_",
"(_",
"self_",
",_",
"data_",
",_",
"link_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id_",
"=_",
"data_",
"[_",
"'",
"id",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ip_",
"=_",
"data_",
"[_",
"'",
"data",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"domain_",
"=_",
"data_",
"[_",
"'",
"name",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"extra_",
"=_",
"{_",
"'",
"uri",
"'_",
":_",
"link_",
"[_",
"'",
"href",
"'_",
"]_",
",_",
"'",
"service",
"\\u",
"name",
"'_",
":_",
"link_",
"[_",
"'",
"rel",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"key_",
"in_",
"VALID",
"\\u",
"RECORD",
"\\u",
"EXTRA",
"\\u",
"PARAMS_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"key_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"[_",
"key_",
"]_",
"=_",
"data_",
"[_",
"key_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"record_",
"=_",
"Rack",
"space",
"PTR",
"Record_",
"(_",
"id_",
"=_",
"str_",
"(_",
"id_",
")_",
",_",
"ip_",
"=_",
"ip_",
",_",
"domain_",
"=_",
"domain_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"driver_",
"=_",
"self_",
",_",
"extra_",
"=_",
"extra_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"to",
"\\u",
"full",
"\\u",
"record",
"\\u",
"name_",
"(_",
"self_",
",_",
"domain_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Build",
" ",
"a",
" ",
"FQ",
"DN",
" ",
"from",
" ",
"a",
" ",
"domain",
" ",
"and",
" ",
"record",
" ",
"name",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"domain",
":",
" ",
"Doma",
"in",
" ",
"name",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"domain",
":",
" ",
"``",
"str",
"``",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"name",
":",
" ",
"Record",
" ",
"name",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"name",
":",
" ",
"``",
"str",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"name_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"'%",
"s",
".",
"%",
"s",
"'_",
"%_",
"(_",
"name_",
",_",
"domain_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"domain_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"to",
"\\u",
"partial",
"\\u",
"record",
"\\u",
"name_",
"(_",
"self_",
",_",
"domain_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Remove",
" ",
"domain",
" ",
"porti",
"on",
" ",
"from",
" ",
"the",
" ",
"record",
" ",
"name",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"domain",
":",
" ",
"Doma",
"in",
" ",
"name",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"domain",
":",
" ",
"``",
"str",
"``",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"name",
":",
" ",
"Full",
" ",
"record",
" ",
"name",
" ",
"(",
"fq",
"dn",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"type",
" ",
"name",
":",
" ",
"``",
"str",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"name_",
"==_",
"domain_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Map",
" ",
"\"",
"root",
"\"",
" ",
"record",
" ",
"names",
" ",
"to",
" ",
"Non",
"e",
" ",
"to",
" ",
"be",
" ",
"consistent",
" ",
"with",
" ",
"other_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"drivers_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Strip",
" ",
"domain",
" ",
"porti",
"on_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"name_",
"=_",
"name_",
"._",
"replace_",
"(_",
"'.",
"%",
"s",
"'_",
"%_",
"(_",
"domain_",
")_",
",_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rack",
"space",
"DNS",
"Driver_",
"(_",
"DNS",
"Driver_",
",_",
"Open",
"Stack",
"Drive",
"r",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"ex",
"\\u",
"connecti",
"on",
"\\u",
"class",
"\\u",
"kwargs_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kwargs_",
"=_",
"self_",
"._",
"openst",
"ack",
"\\u",
"connecti",
"on",
"\\u",
"kwargs_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kwargs_",
"[_",
"'",
"region",
"'_",
"]_",
"=_",
"self_",
"._",
"region_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\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",
"racks",
"pace\\u",
"result",
"\\u",
"has",
"\\u",
"more_",
"(_",
"response_",
",_",
"result",
"\\u",
"length_",
",_",
"limit_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"racks",
"pace",
" ",
"return",
"s",
" ",
"less",
" ",
"than",
" ",
"the",
" ",
"limit",
",",
" ",
"then",
" ",
"we",
"'",
"ve",
" ",
"reache",
"d",
" ",
"the",
" ",
"end",
" ",
"of_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"result",
" ",
"set",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"result",
"\\u",
"length_",
"<_",
"limit_",
":_",
"\\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_",
"#",
" ",
"Pagina",
"ted",
" ",
"results",
" ",
"return",
" ",
"link",
"s",
" ",
"to",
" ",
"the",
" ",
"previ",
"ous",
" ",
"and",
" ",
"next",
" ",
"sets",
" ",
"of",
" ",
"data",
",",
" ",
"but",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"'",
"next",
"'",
" ",
"only",
" ",
"exist",
"s",
" ",
"whe",
"n",
" ",
"there",
" ",
"is",
" ",
"more",
" ",
"to",
" ",
"get",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"item_",
"in_",
"response_",
"._",
"get_",
"(_",
"'",
"link",
"s",
"'_",
",_",
"(_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"item_",
"[_",
"'",
"rel",
"'_",
"]_",
"==_",
"'",
"next",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"check",
"\\u",
"ptr",
"\\u",
"extra",
"\\u",
"fields_",
"(_",
"device",
"\\u",
"or",
"\\u",
"record_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"(_",
"hasattr_",
"(_",
"device",
"\\u",
"or",
"\\u",
"record_",
",_",
"'",
"extra",
"'_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"isinstance_",
"(_",
"device",
"\\u",
"or",
"\\u",
"record_",
"._",
"extra_",
",_",
"dict_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"device",
"\\u",
"or",
"\\u",
"record_",
"._",
"extra_",
"._",
"get_",
"(_",
"'",
"uri",
"'_",
")_",
"is_",
"not_",
"None_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"device",
"\\u",
"or",
"\\u",
"record_",
"._",
"extra_",
"._",
"get_",
"(_",
"'",
"service",
"\\u",
"name",
"'_",
")_",
"is_",
"not_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Lib",
"cloud",
"Error_",
"(_",
"\"",
"Can",
"'",
"t",
" ",
"create",
" ",
"PTR",
" ",
"Record",
" ",
"for",
" ",
"%",
"s",
" ",
"bec",
"aus",
"e",
" ",
"it",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"doe",
"sn",
"'",
"t",
" ",
"have",
" ",
"a",
" ",
"'",
"uri",
"'",
" ",
"and",
" ",
"'",
"service",
"\\u",
"name",
"'",
" ",
"in",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"'",
"extra",
"'\"_",
"%_",
"device",
"\\u",
"or",
"\\u",
"record_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | statsmodels/statsmodels/statsmodels/tsa/statespace/tests/test_options.py | [
{
"content": "\"\"\"\nMiscellaneous Tests\n\n- Tests for setting options in KalmanFilter, KalmanSmoother, SimulationSmoother\n (does not test the filtering, smoothing, or simulation smoothing for each\n option)\n\nAuthor: Chad Fulton\nLicense: Simplified-BSD\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nimport numpy as np\nfrom statsmodels.tsa.statespace.kalman_filter import (\n FILTER_CONVENTIONAL,\n\n INVERT_UNIVARIATE,\n SOLVE_LU,\n INVERT_LU,\n SOLVE_CHOLESKY,\n INVERT_CHOLESKY,\n\n STABILITY_FORCE_SYMMETRY,\n\n MEMORY_STORE_ALL,\n MEMORY_NO_FORECAST,\n MEMORY_NO_PREDICTED,\n MEMORY_NO_FILTERED,\n MEMORY_NO_LIKELIHOOD,\n MEMORY_CONSERVE\n)\nfrom statsmodels.tsa.statespace.kalman_smoother import (\n KalmanSmoother,\n SMOOTHER_STATE,\n SMOOTHER_STATE_COV,\n SMOOTHER_DISTURBANCE,\n SMOOTHER_DISTURBANCE_COV,\n SMOOTHER_ALL\n)\nfrom numpy.testing import assert_equal\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class Options(object):",
"metadata": "root.Options",
"header": "['module', '___EOS___']",
"index": 42
},
{
"content": " @classmethod\n def setup_class(cls, *args, **kwargs):\n\n # Dummy data\n endog = np.arange(10)\n k_states = 1\n\n cls.model = KalmanSmoother(k_endog=1, k_states=k_states, *args,\n **kwargs)\n cls.model.bind(endog)",
"metadata": "root.Options.setup_class",
"header": "['class', 'Options', '(', 'object', ')', ':', '___EOS___']",
"index": 43
},
{
"content": "class TestOptions(Options):\n\n\n\n",
"metadata": "root.TestOptions",
"header": "['module', '___EOS___']",
"index": 54
},
{
"content": " def test_filter_methods(self):\n model = self.model\n\n # TODO test FilterResults for accurante boolean versions of options\n \n # Clear the filter method\n model.filter_method = 0\n\n # Try setting via boolean\n model.filter_conventional = True\n assert_equal(model.filter_method, FILTER_CONVENTIONAL)\n model.filter_conventional = False\n assert_equal(model.filter_method, 0)\n\n # Try setting directly via method\n model.set_filter_method(FILTER_CONVENTIONAL)\n assert_equal(model.filter_method, FILTER_CONVENTIONAL)\n\n # Try setting via boolean via method\n model.set_filter_method(filter_conventional=True)\n assert_equal(model.filter_method, FILTER_CONVENTIONAL)",
"metadata": "root.TestOptions.test_filter_methods",
"header": "['class', 'TestOptions', '(', 'Options', ')', ':', '___EOS___']",
"index": 55
},
{
"content": " def test_inversion_methods(self):\n model = self.model\n\n # Clear the inversion method\n model.inversion_method = 0\n\n # Try setting via boolean\n model.invert_univariate = True\n assert_equal(model.inversion_method, INVERT_UNIVARIATE)\n model.invert_cholesky = True\n assert_equal(model.inversion_method, INVERT_UNIVARIATE | INVERT_CHOLESKY)\n model.invert_univariate = False\n assert_equal(model.inversion_method, INVERT_CHOLESKY)\n\n # Try setting directly via method\n model.set_inversion_method(INVERT_LU)\n assert_equal(model.inversion_method, INVERT_LU)\n\n # Try setting via boolean via method\n model.set_inversion_method(invert_cholesky=True, invert_univariate=True, invert_lu=False)\n assert_equal(model.inversion_method, INVERT_UNIVARIATE | INVERT_CHOLESKY)\n\n # Try setting and unsetting all\n model.inversion_method = 0\n for name in model.inversion_methods:\n setattr(model, name, True)\n assert_equal(\n model.inversion_method,\n INVERT_UNIVARIATE | SOLVE_LU | INVERT_LU | SOLVE_CHOLESKY |\n INVERT_CHOLESKY\n )\n for name in model.inversion_methods:\n setattr(model, name, False)\n assert_equal(model.inversion_method, 0)",
"metadata": "root.TestOptions.test_inversion_methods",
"header": "['class', 'TestOptions', '(', 'Options', ')', ':', '___EOS___']",
"index": 77
},
{
"content": " def test_stability_methods(self):\n model = self.model\n\n # Clear the stability method\n model.stability_method = 0\n\n # Try setting via boolean\n model.stability_force_symmetry = True\n assert_equal(model.stability_method, STABILITY_FORCE_SYMMETRY)\n model.stability_force_symmetry = False\n assert_equal(model.stability_method, 0)\n\n # Try setting directly via method\n model.stability_method = 0\n model.set_stability_method(STABILITY_FORCE_SYMMETRY)\n assert_equal(model.stability_method, STABILITY_FORCE_SYMMETRY)\n\n # Try setting via boolean via method\n model.stability_method = 0\n model.set_stability_method(stability_method=True)\n assert_equal(model.stability_method, STABILITY_FORCE_SYMMETRY)\n\n # Try setting via keyword via method\n model.stability_method = 0\n model.set_stability_method(stability_force_symmetry=True)\n assert_equal(model.stability_method, STABILITY_FORCE_SYMMETRY)",
"metadata": "root.TestOptions.test_stability_methods",
"header": "['class', 'TestOptions', '(', 'Options', ')', ':', '___EOS___']",
"index": 112
},
{
"content": " def test_conserve_memory(self):\n model = self.model\n\n # Clear the filter method\n model.conserve_memory = MEMORY_STORE_ALL\n\n # Try setting via boolean\n model.memory_no_forecast = True\n assert_equal(model.conserve_memory, MEMORY_NO_FORECAST)\n model.memory_no_filtered = True\n assert_equal(model.conserve_memory, MEMORY_NO_FORECAST | MEMORY_NO_FILTERED)\n model.memory_no_forecast = False\n assert_equal(model.conserve_memory, MEMORY_NO_FILTERED)\n\n # Try setting directly via method\n model.set_conserve_memory(MEMORY_NO_PREDICTED)\n assert_equal(model.conserve_memory, MEMORY_NO_PREDICTED)\n\n # Try setting via boolean via method\n model.set_conserve_memory(memory_no_filtered=True, memory_no_predicted=False)\n assert_equal(model.conserve_memory, MEMORY_NO_FILTERED)\n\n # Try setting and unsetting all\n model.conserve_memory = 0\n for name in model.memory_options:\n if name == 'memory_conserve':\n continue\n setattr(model, name, True)\n assert_equal(\n model.conserve_memory,\n MEMORY_NO_FORECAST | MEMORY_NO_PREDICTED | MEMORY_NO_FILTERED |\n MEMORY_NO_LIKELIHOOD\n )\n assert_equal(model.conserve_memory, MEMORY_CONSERVE)\n for name in model.memory_options:\n if name == 'memory_conserve':\n continue\n setattr(model, name, False)\n assert_equal(model.conserve_memory, 0)",
"metadata": "root.TestOptions.test_conserve_memory",
"header": "['class', 'TestOptions', '(', 'Options', ')', ':', '___EOS___']",
"index": 139
},
{
"content": " def test_smoother_outputs(self):\n model = self.model\n\n # TODO test SmootherResults for accurante boolean versions of options\n\n # Clear the smoother output\n model.smoother_output = 0\n\n # Try setting via boolean\n model.smoother_state = True\n assert_equal(model.smoother_output, SMOOTHER_STATE)\n model.smoother_disturbance = True\n assert_equal(model.smoother_output, SMOOTHER_STATE | SMOOTHER_DISTURBANCE)\n model.smoother_state = False\n assert_equal(model.smoother_output, SMOOTHER_DISTURBANCE)\n\n # Try setting directly via method\n model.set_smoother_output(SMOOTHER_DISTURBANCE_COV)\n assert_equal(model.smoother_output, SMOOTHER_DISTURBANCE_COV)\n\n # Try setting via boolean via method\n model.set_smoother_output(smoother_disturbance=True, smoother_disturbance_cov=False)\n assert_equal(model.smoother_output, SMOOTHER_DISTURBANCE)\n\n # Try setting and unsetting all\n model.smoother_output = 0\n for name in model.smoother_outputs:\n if name == 'smoother_all':\n continue\n setattr(model, name, True)\n assert_equal(\n model.smoother_output,\n SMOOTHER_STATE | SMOOTHER_STATE_COV | SMOOTHER_DISTURBANCE |\n SMOOTHER_DISTURBANCE_COV\n )\n assert_equal(model.smoother_output, SMOOTHER_ALL)\n for name in model.smoother_outputs:\n if name == 'smoother_all':\n continue\n setattr(model, name, False)\n assert_equal(model.smoother_output, 0)",
"metadata": "root.TestOptions.test_smoother_outputs",
"header": "['class', 'TestOptions', '(', 'Options', ')', ':', '___EOS___']",
"index": 179
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Mis",
"cell",
"ane",
"ous",
" ",
"Test",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
"-",
" ",
"Test",
"s",
" ",
"for",
" ",
"setti",
"ng",
" ",
"options",
" ",
"in",
" ",
"Kal",
"man",
"Filter",
",",
" ",
"Kal",
"man",
"Smooth",
"er",
",",
" ",
"Simul",
"ation",
"Smooth",
"er",
"\\",
"10",
";",
" ",
" ",
"(",
"doe",
"s",
" ",
"not",
" ",
"test",
" ",
"the",
" ",
"filtering",
",",
" ",
"smoothing",
",",
" ",
"or",
" ",
"simulati",
"on",
" ",
"smoothing",
" ",
"for",
" ",
"each",
"\\",
"10",
";",
" ",
" ",
"option",
")",
"\\",
"10",
";",
"\\",
"10",
";",
"Author",
":",
" ",
"Cha",
"d",
" ",
"Fu",
"lto",
"n",
"\\",
"10",
";",
"License",
":",
" ",
"Simplif",
"ied",
"-",
"BS",
"D",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"division_",
",_",
"abs",
"olute",
"\\u",
"import_",
",_",
"print",
"\\u",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"numpy_",
"as_",
"np_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"stats",
"models_",
"._",
"tsa",
"_",
"._",
"state",
"space_",
"._",
"kal",
"man",
"\\u",
"filter_",
"import_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"FILTER",
"\\u",
"CONVE",
"NTI",
"ONA",
"L_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"INVE",
"RT",
"\\u",
"UNI",
"VAR",
"IAT",
"E_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SOL",
"VE",
"\\u",
"LU_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"INVE",
"RT",
"\\u",
"LU_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SOL",
"VE",
"\\u",
"CHO",
"LES",
"KY",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"INVE",
"RT",
"\\u",
"CHO",
"LES",
"KY",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"STA",
"BILITY",
"\\u",
"FORCE",
"\\u",
"SYM",
"METR",
"Y_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"STORE",
"\\u",
"ALL_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FORE",
"CAST",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"PREDIC",
"TED_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FILTER",
"ED_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"LI",
"KE",
"LI",
"HO",
"OD_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"CONS",
"ERVE",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"stats",
"models_",
"._",
"tsa",
"_",
"._",
"state",
"space_",
"._",
"kal",
"man",
"\\u",
"smooth",
"er_",
"import_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Kal",
"man",
"Smooth",
"er_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"STATE_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"STATE",
"\\u",
"CO",
"V_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE",
"\\u",
"CO",
"V_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"ALL_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"numpy_",
"._",
"testing_",
"import_",
"assert",
"\\u",
"equal_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\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_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Options_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Options_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"@_",
"classmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"setup",
"\\u",
"class_",
"(_",
"cls_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Du",
"mm",
"y",
" ",
"data_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"endo",
"g_",
"=_",
"np_",
"._",
"arange_",
"(_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"k",
"\\u",
"states_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"cls_",
"._",
"model_",
"=_",
"Kal",
"man",
"Smooth",
"er_",
"(_",
"k",
"\\u",
"endo",
"g_",
"=_",
"1_",
",_",
"k",
"\\u",
"states_",
"=_",
"k",
"\\u",
"states_",
",_",
"*_",
"args_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cls_",
"._",
"model_",
"._",
"bind_",
"(_",
"endo",
"g_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Test",
"Options_",
"(_",
"Options_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Options_",
"(_",
"Options_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test\\u",
"filter",
"\\u",
"methods_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"model_",
"=_",
"self_",
"._",
"model_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
" ",
"test",
" ",
"Filter",
"Result",
"s",
" ",
"for",
" ",
"accu",
"rant",
"e",
" ",
"boolean",
" ",
"version",
"s",
" ",
"of",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clear",
" ",
"the",
" ",
"filter",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"filter",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"filter",
"\\u",
"convention",
"al_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"filter",
"\\u",
"method_",
",_",
"FILTER",
"\\u",
"CONVE",
"NTI",
"ONA",
"L_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"filter",
"\\u",
"convention",
"al_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"filter",
"\\u",
"method_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"direct",
"ly",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"filter",
"\\u",
"method_",
"(_",
"FILTER",
"\\u",
"CONVE",
"NTI",
"ONA",
"L_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"filter",
"\\u",
"method_",
",_",
"FILTER",
"\\u",
"CONVE",
"NTI",
"ONA",
"L_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"filter",
"\\u",
"method_",
"(_",
"filter",
"\\u",
"convention",
"al_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"filter",
"\\u",
"method_",
",_",
"FILTER",
"\\u",
"CONVE",
"NTI",
"ONA",
"L_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Options_",
"(_",
"Options_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"inversion",
"\\u",
"methods_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"model_",
"=_",
"self_",
"._",
"model_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clear",
" ",
"the",
" ",
"inversion",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"inversion",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"invert",
"\\u",
"univ",
"aria",
"te_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"INVE",
"RT",
"\\u",
"UNI",
"VAR",
"IAT",
"E_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"invert",
"\\u",
"choles",
"ky_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"INVE",
"RT",
"\\u",
"UNI",
"VAR",
"IAT",
"E_",
"|_",
"INVE",
"RT",
"\\u",
"CHO",
"LES",
"KY",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"invert",
"\\u",
"univ",
"aria",
"te_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"INVE",
"RT",
"\\u",
"CHO",
"LES",
"KY",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"direct",
"ly",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"inversion",
"\\u",
"method_",
"(_",
"INVE",
"RT",
"\\u",
"LU_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"INVE",
"RT",
"\\u",
"LU_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"inversion",
"\\u",
"method_",
"(_",
"invert",
"\\u",
"choles",
"ky_",
"=_",
"True_",
",_",
"invert",
"\\u",
"univ",
"aria",
"te_",
"=_",
"True_",
",_",
"invert",
"\\u",
"lu_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"INVE",
"RT",
"\\u",
"UNI",
"VAR",
"IAT",
"E_",
"|_",
"INVE",
"RT",
"\\u",
"CHO",
"LES",
"KY",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"and",
" ",
"unse",
"tting",
" ",
"all_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"inversion",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"model_",
"._",
"inversion",
"\\u",
"methods_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"setattr_",
"(_",
"model_",
",_",
"name_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"INVE",
"RT",
"\\u",
"UNI",
"VAR",
"IAT",
"E_",
"|_",
"SOL",
"VE",
"\\u",
"LU_",
"|_",
"INVE",
"RT",
"\\u",
"LU_",
"|_",
"SOL",
"VE",
"\\u",
"CHO",
"LES",
"KY",
"_",
"|_",
"\\u\\u\\uNL\\u\\u\\u_",
"INVE",
"RT",
"\\u",
"CHO",
"LES",
"KY",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"model_",
"._",
"inversion",
"\\u",
"methods_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"setattr_",
"(_",
"model_",
",_",
"name_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"inversion",
"\\u",
"method_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Options_",
"(_",
"Options_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"stability",
"\\u",
"methods_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"model_",
"=_",
"self_",
"._",
"model_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clear",
" ",
"the",
" ",
"stability",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"stability",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"stability",
"\\u",
"force",
"\\u",
"symmetry",
"_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"stability",
"\\u",
"method_",
",_",
"STA",
"BILITY",
"\\u",
"FORCE",
"\\u",
"SYM",
"METR",
"Y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"stability",
"\\u",
"force",
"\\u",
"symmetry",
"_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"stability",
"\\u",
"method_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"direct",
"ly",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"stability",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"set\\u",
"stability",
"\\u",
"method_",
"(_",
"STA",
"BILITY",
"\\u",
"FORCE",
"\\u",
"SYM",
"METR",
"Y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"stability",
"\\u",
"method_",
",_",
"STA",
"BILITY",
"\\u",
"FORCE",
"\\u",
"SYM",
"METR",
"Y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"stability",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"set\\u",
"stability",
"\\u",
"method_",
"(_",
"stability",
"\\u",
"method_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"stability",
"\\u",
"method_",
",_",
"STA",
"BILITY",
"\\u",
"FORCE",
"\\u",
"SYM",
"METR",
"Y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"keyw",
"ord",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"stability",
"\\u",
"method_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"set\\u",
"stability",
"\\u",
"method_",
"(_",
"stability",
"\\u",
"force",
"\\u",
"symmetry",
"_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"stability",
"\\u",
"method_",
",_",
"STA",
"BILITY",
"\\u",
"FORCE",
"\\u",
"SYM",
"METR",
"Y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Options_",
"(_",
"Options_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"conserv",
"e\\u",
"memory_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"model_",
"=_",
"self_",
"._",
"model_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clear",
" ",
"the",
" ",
"filter",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
"=_",
"MEM",
"ORY",
"\\u",
"STORE",
"\\u",
"ALL_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"memory",
"\\u",
"no",
"\\u",
"forecast_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FORE",
"CAST",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"memory",
"\\u",
"no",
"\\u",
"filtered_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FORE",
"CAST",
"_",
"|_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FILTER",
"ED_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"memory",
"\\u",
"no",
"\\u",
"forecast_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FILTER",
"ED_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"direct",
"ly",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"conserv",
"e\\u",
"memory_",
"(_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"PREDIC",
"TED_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"PREDIC",
"TED_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"conserv",
"e\\u",
"memory_",
"(_",
"memory",
"\\u",
"no",
"\\u",
"filtered_",
"=_",
"True_",
",_",
"memory",
"\\u",
"no",
"\\u",
"predicted_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FILTER",
"ED_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"and",
" ",
"unse",
"tting",
" ",
"all_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"model_",
"._",
"memory",
"\\u",
"options_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"==_",
"'",
"memory",
"\\u",
"conserv",
"e",
"'_",
":_",
"\\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_",
"setattr_",
"(_",
"model_",
",_",
"name_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FORE",
"CAST",
"_",
"|_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"PREDIC",
"TED_",
"|_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"FILTER",
"ED_",
"|_",
"\\u\\u\\uNL\\u\\u\\u_",
"MEM",
"ORY",
"\\u",
"NO",
"\\u",
"LI",
"KE",
"LI",
"HO",
"OD_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"MEM",
"ORY",
"\\u",
"CONS",
"ERVE",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"model_",
"._",
"memory",
"\\u",
"options_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"==_",
"'",
"memory",
"\\u",
"conserv",
"e",
"'_",
":_",
"\\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_",
"setattr_",
"(_",
"model_",
",_",
"name_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"conserv",
"e\\u",
"memory_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Options_",
"(_",
"Options_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"smooth",
"er",
"\\u",
"outputs_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"model_",
"=_",
"self_",
"._",
"model_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
" ",
"test",
" ",
"Smooth",
"er",
"Result",
"s",
" ",
"for",
" ",
"accu",
"rant",
"e",
" ",
"boolean",
" ",
"version",
"s",
" ",
"of",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Clear",
" ",
"the",
" ",
"smooth",
"er",
" ",
"output_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"smooth",
"er",
"\\u",
"state_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"SMO",
"OTHER",
"\\u",
"STATE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"smooth",
"er",
"\\u",
"dist",
"urban",
"ce_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"SMO",
"OTHER",
"\\u",
"STATE_",
"|_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"model_",
"._",
"smooth",
"er",
"\\u",
"state_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"direct",
"ly",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"smooth",
"er",
"\\u",
"output_",
"(_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE",
"\\u",
"CO",
"V_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE",
"\\u",
"CO",
"V_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"via",
" ",
"boolean",
" ",
"via",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"set\\u",
"smooth",
"er",
"\\u",
"output_",
"(_",
"smooth",
"er",
"\\u",
"dist",
"urban",
"ce_",
"=_",
"True_",
",_",
"smooth",
"er",
"\\u",
"dist",
"urban",
"ce",
"\\u",
"cov_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"setti",
"ng",
" ",
"and",
" ",
"unse",
"tting",
" ",
"all_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"model_",
"._",
"smooth",
"er",
"\\u",
"outputs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"==_",
"'",
"smooth",
"er",
"\\u",
"all",
"'_",
":_",
"\\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_",
"setattr_",
"(_",
"model_",
",_",
"name_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"STATE_",
"|_",
"SMO",
"OTHER",
"\\u",
"STATE",
"\\u",
"CO",
"V_",
"|_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE_",
"|_",
"\\u\\u\\uNL\\u\\u\\u_",
"SMO",
"OTHER",
"\\u",
"DIST",
"UR",
"BAN",
"CE",
"\\u",
"CO",
"V_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"SMO",
"OTHER",
"\\u",
"ALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
"in_",
"model_",
"._",
"smooth",
"er",
"\\u",
"outputs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"==_",
"'",
"smooth",
"er",
"\\u",
"all",
"'_",
":_",
"\\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_",
"setattr_",
"(_",
"model_",
",_",
"name_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert",
"\\u",
"equal_",
"(_",
"model_",
"._",
"smooth",
"er",
"\\u",
"output_",
",_",
"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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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
] |
Unreachable code | srob650/pytvmaze/setup.py | [
{
"content": "from setuptools import setup, find_packages\n\nsetup(\n name = 'pytvmaze',\n version = '1.5.1',\n description = 'Python interface to the TV Maze API (www.tvmaze.com)',\n url = 'https://github.com/srob650/pytvmaze',\n author = 'Spencer Roberts',\n author_email = '[email protected]',\n license='MIT',\n\n classifiers = [\n 'Development Status :: 5 - Production/Stable',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: MIT License',\n 'Programming Language :: Python :: 2.6',\n 'Programming Language :: Python :: 2.7',\n 'Programming Language :: Python :: 3.5'\n ],\n\n keywords = 'python tv television tvmaze',\n packages=['pytvmaze']\n\n)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"setuptools_",
"import_",
"setup_",
",_",
"find",
"\\u",
"packages_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"setup_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"'",
"pyt",
"vma",
"ze",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"version_",
"=_",
"'",
"1.5",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"description_",
"=_",
"'",
"Pyth",
"on",
" ",
"interface",
" ",
"to",
" ",
"the",
" ",
"TV",
" ",
"Ma",
"ze",
" ",
"API",
" ",
"(",
"www",
".",
"tvm",
"az",
"e",
".",
"com",
")'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"url_",
"=_",
"'",
"https",
"://",
"git",
"hub",
".",
"com",
"/",
"sr",
"ob",
"650",
"/",
"pyt",
"vma",
"ze",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"author_",
"=_",
"'",
"Spe",
"nce",
"r",
" ",
"Robert",
"s",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"author",
"\\u",
"email_",
"=_",
"'",
"pyt",
"vma",
"ze",
"@",
"gma",
"il",
".",
"com",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"license_",
"=_",
"'",
"MIT",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"classifiers_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Dev",
"elo",
"pme",
"nt",
" ",
"Status",
" ",
"::",
" ",
"5",
" ",
"-",
" ",
"Product",
"ion",
"/",
"Sta",
"ble",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Inten",
"ded",
" ",
"Audi",
"ence",
" ",
"::",
" ",
"Dev",
"elope",
"rs",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"License",
" ",
"::",
" ",
"OSI",
" ",
"Appro",
"ved",
" ",
"::",
" ",
"MIT",
" ",
"License",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Programm",
"ing",
" ",
"Lang",
"ua",
"ge",
" ",
"::",
" ",
"Pyth",
"on",
" ",
"::",
" ",
"2.6",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Programm",
"ing",
" ",
"Lang",
"ua",
"ge",
" ",
"::",
" ",
"Pyth",
"on",
" ",
"::",
" ",
"2.7",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Programm",
"ing",
" ",
"Lang",
"ua",
"ge",
" ",
"::",
" ",
"Pyth",
"on",
" ",
"::",
" ",
"3.5",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"keywords_",
"=_",
"'",
"python",
" ",
"tv",
" ",
"tele",
"vision",
" ",
"tvm",
"az",
"e",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"packages_",
"=_",
"[_",
"'",
"pyt",
"vma",
"ze",
"'_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
")_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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' | anzev/hedwig/build/pip/pip/baseparser.py | [
{
"content": " def check_default(self, option, key, val):\n try:\n return option.check_value(key, val)\n except optparse.OptionValueError as exc:\n print(\"An error occurred during configuration: %s\" % exc)\n sys.exit(3)",
"metadata": "root.ConfigOptionParser.check_default",
"header": "['class', 'ConfigOptionParser', '(', 'CustomOptionParser', ')', ':', '___EOS___']",
"index": 190
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Config",
"Optio",
"n",
"Parser_",
"(_",
"Custom",
"Optio",
"n",
"Parser_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"default_",
"(_",
"self_",
",_",
"option_",
",_",
"key_",
",_",
"val_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"option_",
"._",
"check",
"\\u",
"value_",
"(_",
"key_",
",_",
"val_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"optparse_",
"._",
"Optio",
"n",
"Value",
"Error_",
"as_",
"exc_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"\"",
"An",
" ",
"error",
" ",
"occur",
"red",
" ",
"dur",
"ing",
" ",
"configura",
"tion",
":",
" ",
"%",
"s",
"\"_",
"%_",
"exc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sys_",
"._",
"exit_",
"(_",
"3_",
")_",
"\\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
] |
Unused local variable | Mathzx/zxLoLBoT/zxlolbot.py | [
{
"content": " def message(self, to, message, newline=True):\n \"\"\"Sends a message to the specified person\"\"\"\n\n if newline:\n message = \"~\\n\"+message\n mtype = \"chat\"\n if str(to)[2:3] == \"~\":\n mtype = \"groupchat\"\n to = to[0:to.find(\"/\")]\n self.xmpp.send_message(mto=str(to), mbody=str(message), mtype=mtype)",
"metadata": "root.zxLoLBoT.message",
"header": "['class', 'zxLoLBoT', '(', ')', ':', '___EOS___']",
"index": 291
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"zx",
"Lo",
"LB",
"o",
"T_",
"(_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"message_",
"(_",
"self_",
",_",
"to_",
",_",
"message_",
",_",
"newline_",
"=_",
"True_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Sen",
"ds",
" ",
"a",
" ",
"message",
" ",
"to",
" ",
"the",
" ",
"specified",
" ",
"person",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"newline_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"\"",
"~",
"\\\\",
"n",
"\"_",
"+_",
"message_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"mtype_",
"=_",
"\"",
"chat",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"str_",
"(_",
"to_",
")_",
"[_",
"2_",
":_",
"3_",
"]_",
"==_",
"\"~\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mtype_",
"=_",
"\"",
"group",
"chat",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"to_",
"=_",
"to_",
"[_",
"0_",
":_",
"to_",
"._",
"find_",
"(_",
"\"/\"_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"xmpp_",
"._",
"send",
"\\u",
"message_",
"(_",
"mto",
"_",
"=_",
"str_",
"(_",
"to_",
")_",
",_",
"mbo",
"dy_",
"=_",
"str_",
"(_",
"message_",
")_",
",_",
"mtype_",
"=_",
"mtype_",
")_",
"\\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
] |
Unreachable code | pearu/pylibtiff/libtiff/tiff_h_3_8_2.py | [
{
"content": "TIFF_VERSION = 42\nTIFF_BIGTIFF_VERSION = 43\nTIFF_BIGENDIAN = 0x4d4d\nTIFF_LITTLEENDIAN = 0x4949\nMDI_LITTLEENDIAN = 0x5045\nMDI_BIGENDIAN = 0x4550\nTIFF_MAGIC_SIZE = 2\nTIFF_VERSION_SIZE = 2\nTIFF_DIROFFSET_SIZE = 4\nTIFFTAG_SUBFILETYPE = 254\nFILETYPE_REDUCEDIMAGE = 0x1\nFILETYPE_PAGE = 0x2\nFILETYPE_MASK = 0x4\nTIFFTAG_OSUBFILETYPE = 255\nOFILETYPE_IMAGE = 1\nOFILETYPE_REDUCEDIMAGE = 2\nOFILETYPE_PAGE = 3\nTIFFTAG_IMAGEWIDTH = 256\nTIFFTAG_IMAGELENGTH = 257\nTIFFTAG_BITSPERSAMPLE = 258\nTIFFTAG_COMPRESSION = 259\nCOMPRESSION_NONE = 1\nCOMPRESSION_CCITTRLE = 2\nCOMPRESSION_CCITTFAX3 = 3\nCOMPRESSION_CCITT_T4 = 3\nCOMPRESSION_CCITTFAX4 = 4\nCOMPRESSION_CCITT_T6 = 4\nCOMPRESSION_LZW = 5\nCOMPRESSION_OJPEG = 6\nCOMPRESSION_JPEG = 7\nCOMPRESSION_NEXT = 32766\nCOMPRESSION_CCITTRLEW = 32771\nCOMPRESSION_PACKBITS = 32773\nCOMPRESSION_THUNDERSCAN = 32809\nCOMPRESSION_IT8CTPAD = 32895\nCOMPRESSION_IT8LW = 32896\nCOMPRESSION_IT8MP = 32897\nCOMPRESSION_IT8BL = 32898\nCOMPRESSION_PIXARFILM = 32908\nCOMPRESSION_PIXARLOG = 32909\nCOMPRESSION_DEFLATE = 32946\nCOMPRESSION_ADOBE_DEFLATE = 8\nCOMPRESSION_DCS = 32947\nCOMPRESSION_JBIG = 34661\nCOMPRESSION_SGILOG = 34676\nCOMPRESSION_SGILOG24 = 34677\nCOMPRESSION_JP2000 = 34712\nTIFFTAG_PHOTOMETRIC = 262\nPHOTOMETRIC_MINISWHITE = 0\nPHOTOMETRIC_MINISBLACK = 1\nPHOTOMETRIC_RGB = 2\nPHOTOMETRIC_PALETTE = 3\nPHOTOMETRIC_MASK = 4\nPHOTOMETRIC_SEPARATED = 5\nPHOTOMETRIC_YCBCR = 6\nPHOTOMETRIC_CIELAB = 8\nPHOTOMETRIC_ICCLAB = 9\nPHOTOMETRIC_ITULAB = 10\nPHOTOMETRIC_LOGL = 32844\nPHOTOMETRIC_LOGLUV = 32845\nTIFFTAG_THRESHHOLDING = 263\nTHRESHHOLD_BILEVEL = 1\nTHRESHHOLD_HALFTONE = 2\nTHRESHHOLD_ERRORDIFFUSE = 3\nTIFFTAG_CELLWIDTH = 264\nTIFFTAG_CELLLENGTH = 265\nTIFFTAG_FILLORDER = 266\nFILLORDER_MSB2LSB = 1\nFILLORDER_LSB2MSB = 2\nTIFFTAG_DOCUMENTNAME = 269\nTIFFTAG_IMAGEDESCRIPTION = 270\nTIFFTAG_MAKE = 271\nTIFFTAG_MODEL = 272\nTIFFTAG_STRIPOFFSETS = 273\nTIFFTAG_ORIENTATION = 274\nORIENTATION_TOPLEFT = 1\nORIENTATION_TOPRIGHT = 2\nORIENTATION_BOTRIGHT = 3\nORIENTATION_BOTLEFT = 4\nORIENTATION_LEFTTOP = 5\nORIENTATION_RIGHTTOP = 6\nORIENTATION_RIGHTBOT = 7\nORIENTATION_LEFTBOT = 8\nTIFFTAG_SAMPLESPERPIXEL = 277\nTIFFTAG_ROWSPERSTRIP = 278\nTIFFTAG_STRIPBYTECOUNTS = 279\nTIFFTAG_MINSAMPLEVALUE = 280\nTIFFTAG_MAXSAMPLEVALUE = 281\nTIFFTAG_XRESOLUTION = 282\nTIFFTAG_YRESOLUTION = 283\nTIFFTAG_PLANARCONFIG = 284\nPLANARCONFIG_CONTIG = 1\nPLANARCONFIG_SEPARATE = 2\nTIFFTAG_PAGENAME = 285\nTIFFTAG_XPOSITION = 286\nTIFFTAG_YPOSITION = 287\nTIFFTAG_FREEOFFSETS = 288\nTIFFTAG_FREEBYTECOUNTS = 289\nTIFFTAG_GRAYRESPONSEUNIT = 290\nGRAYRESPONSEUNIT_10S = 1\nGRAYRESPONSEUNIT_100S = 2\nGRAYRESPONSEUNIT_1000S = 3\nGRAYRESPONSEUNIT_10000S = 4\nGRAYRESPONSEUNIT_100000S = 5\nTIFFTAG_GRAYRESPONSECURVE = 291\nTIFFTAG_GROUP3OPTIONS = 292\nTIFFTAG_T4OPTIONS = 292\nGROUP3OPT_2DENCODING = 0x1\nGROUP3OPT_UNCOMPRESSED = 0x2\nGROUP3OPT_FILLBITS = 0x4\nTIFFTAG_GROUP4OPTIONS = 293\nTIFFTAG_T6OPTIONS = 293\nGROUP4OPT_UNCOMPRESSED = 0x2\nTIFFTAG_RESOLUTIONUNIT = 296\nRESUNIT_NONE = 1\nRESUNIT_INCH = 2\nRESUNIT_CENTIMETER = 3\nTIFFTAG_PAGENUMBER = 297\nTIFFTAG_COLORRESPONSEUNIT = 300\nCOLORRESPONSEUNIT_10S = 1\nCOLORRESPONSEUNIT_100S = 2\nCOLORRESPONSEUNIT_1000S = 3\nCOLORRESPONSEUNIT_10000S = 4\nCOLORRESPONSEUNIT_100000S = 5\nTIFFTAG_TRANSFERFUNCTION = 301\nTIFFTAG_SOFTWARE = 305\nTIFFTAG_DATETIME = 306\nTIFFTAG_ARTIST = 315\nTIFFTAG_HOSTCOMPUTER = 316\nTIFFTAG_PREDICTOR = 317\nPREDICTOR_NONE = 1\nPREDICTOR_HORIZONTAL = 2\nPREDICTOR_FLOATINGPOINT = 3\nTIFFTAG_WHITEPOINT = 318\nTIFFTAG_PRIMARYCHROMATICITIES = 319\nTIFFTAG_COLORMAP = 320\nTIFFTAG_HALFTONEHINTS = 321\nTIFFTAG_TILEWIDTH = 322\nTIFFTAG_TILELENGTH = 323\nTIFFTAG_TILEOFFSETS = 324\nTIFFTAG_TILEBYTECOUNTS = 325\nTIFFTAG_BADFAXLINES = 326\nTIFFTAG_CLEANFAXDATA = 327\nCLEANFAXDATA_CLEAN = 0\nCLEANFAXDATA_REGENERATED = 1\nCLEANFAXDATA_UNCLEAN = 2\nTIFFTAG_CONSECUTIVEBADFAXLINES = 328\nTIFFTAG_SUBIFD = 330\nTIFFTAG_INKSET = 332\nINKSET_CMYK = 1\nINKSET_MULTIINK = 2\nTIFFTAG_INKNAMES = 333\nTIFFTAG_NUMBEROFINKS = 334\nTIFFTAG_DOTRANGE = 336\nTIFFTAG_TARGETPRINTER = 337\nTIFFTAG_EXTRASAMPLES = 338\nEXTRASAMPLE_UNSPECIFIED = 0\nEXTRASAMPLE_ASSOCALPHA = 1\nEXTRASAMPLE_UNASSALPHA = 2\nTIFFTAG_SAMPLEFORMAT = 339\nSAMPLEFORMAT_UINT = 1\nSAMPLEFORMAT_INT = 2\nSAMPLEFORMAT_IEEEFP = 3\nSAMPLEFORMAT_VOID = 4\nSAMPLEFORMAT_COMPLEXINT = 5\nSAMPLEFORMAT_COMPLEXIEEEFP = 6\nTIFFTAG_SMINSAMPLEVALUE = 340\nTIFFTAG_SMAXSAMPLEVALUE = 341\nTIFFTAG_CLIPPATH = 343\nTIFFTAG_XCLIPPATHUNITS = 344\nTIFFTAG_YCLIPPATHUNITS = 345\nTIFFTAG_INDEXED = 346\nTIFFTAG_JPEGTABLES = 347\nTIFFTAG_OPIPROXY = 351\nTIFFTAG_JPEGPROC = 512\nJPEGPROC_BASELINE = 1\nJPEGPROC_LOSSLESS = 14\nTIFFTAG_JPEGIFOFFSET = 513\nTIFFTAG_JPEGIFBYTECOUNT = 514\nTIFFTAG_JPEGRESTARTINTERVAL = 515\nTIFFTAG_JPEGLOSSLESSPREDICTORS = 517\nTIFFTAG_JPEGPOINTTRANSFORM = 518\nTIFFTAG_JPEGQTABLES = 519\nTIFFTAG_JPEGDCTABLES = 520\nTIFFTAG_JPEGACTABLES = 521\nTIFFTAG_YCBCRCOEFFICIENTS = 529\nTIFFTAG_YCBCRSUBSAMPLING = 530\nTIFFTAG_YCBCRPOSITIONING = 531\nYCBCRPOSITION_CENTERED = 1\nYCBCRPOSITION_COSITED = 2\nTIFFTAG_REFERENCEBLACKWHITE = 532\nTIFFTAG_XMLPACKET = 700\nTIFFTAG_OPIIMAGEID = 32781\nTIFFTAG_REFPTS = 32953\nTIFFTAG_REGIONTACKPOINT = 32954\nTIFFTAG_REGIONWARPCORNERS = 32955\nTIFFTAG_REGIONAFFINE = 32956\nTIFFTAG_MATTEING = 32995\nTIFFTAG_DATATYPE = 32996\nTIFFTAG_IMAGEDEPTH = 32997\nTIFFTAG_TILEDEPTH = 32998\nTIFFTAG_PIXAR_IMAGEFULLWIDTH = 33300\nTIFFTAG_PIXAR_IMAGEFULLLENGTH = 33301\nTIFFTAG_PIXAR_TEXTUREFORMAT = 33302\nTIFFTAG_PIXAR_WRAPMODES = 33303\nTIFFTAG_PIXAR_FOVCOT = 33304\nTIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN = 33305\nTIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA = 33306\nTIFFTAG_WRITERSERIALNUMBER = 33405\nTIFFTAG_COPYRIGHT = 33432\nTIFFTAG_RICHTIFFIPTC = 33723\nTIFFTAG_IT8SITE = 34016\nTIFFTAG_IT8COLORSEQUENCE = 34017\nTIFFTAG_IT8HEADER = 34018\nTIFFTAG_IT8RASTERPADDING = 34019\nTIFFTAG_IT8BITSPERRUNLENGTH = 34020\nTIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH = 34021\nTIFFTAG_IT8COLORTABLE = 34022\nTIFFTAG_IT8IMAGECOLORINDICATOR = 34023\nTIFFTAG_IT8BKGCOLORINDICATOR = 34024\nTIFFTAG_IT8IMAGECOLORVALUE = 34025\nTIFFTAG_IT8BKGCOLORVALUE = 34026\nTIFFTAG_IT8PIXELINTENSITYRANGE = 34027\nTIFFTAG_IT8TRANSPARENCYINDICATOR = 34028\nTIFFTAG_IT8COLORCHARACTERIZATION = 34029\nTIFFTAG_IT8HCUSAGE = 34030\nTIFFTAG_IT8TRAPINDICATOR = 34031\nTIFFTAG_IT8CMYKEQUIVALENT = 34032\nTIFFTAG_FRAMECOUNT = 34232\nTIFFTAG_PHOTOSHOP = 34377\nTIFFTAG_EXIFIFD = 34665\nTIFFTAG_ICCPROFILE = 34675\nTIFFTAG_JBIGOPTIONS = 34750\nTIFFTAG_GPSIFD = 34853\nTIFFTAG_FAXRECVPARAMS = 34908\nTIFFTAG_FAXSUBADDRESS = 34909\nTIFFTAG_FAXRECVTIME = 34910\nTIFFTAG_FAXDCS = 34911\nTIFFTAG_STONITS = 37439\nTIFFTAG_FEDEX_EDR = 34929\nTIFFTAG_INTEROPERABILITYIFD = 40965\nTIFFTAG_DNGVERSION = 50706\nTIFFTAG_DNGBACKWARDVERSION = 50707\nTIFFTAG_UNIQUECAMERAMODEL = 50708\nTIFFTAG_LOCALIZEDCAMERAMODEL = 50709\nTIFFTAG_CFAPLANECOLOR = 50710\nTIFFTAG_CFALAYOUT = 50711\nTIFFTAG_LINEARIZATIONTABLE = 50712\nTIFFTAG_BLACKLEVELREPEATDIM = 50713\nTIFFTAG_BLACKLEVEL = 50714\nTIFFTAG_BLACKLEVELDELTAH = 50715\nTIFFTAG_BLACKLEVELDELTAV = 50716\nTIFFTAG_WHITELEVEL = 50717\nTIFFTAG_DEFAULTSCALE = 50718\nTIFFTAG_DEFAULTCROPORIGIN = 50719\nTIFFTAG_DEFAULTCROPSIZE = 50720\nTIFFTAG_COLORMATRIX1 = 50721\nTIFFTAG_COLORMATRIX2 = 50722\nTIFFTAG_CAMERACALIBRATION1 = 50723\nTIFFTAG_CAMERACALIBRATION2 = 50724\nTIFFTAG_REDUCTIONMATRIX1 = 50725\nTIFFTAG_REDUCTIONMATRIX2 = 50726\nTIFFTAG_ANALOGBALANCE = 50727\nTIFFTAG_ASSHOTNEUTRAL = 50728\nTIFFTAG_ASSHOTWHITEXY = 50729\nTIFFTAG_BASELINEEXPOSURE = 50730\nTIFFTAG_BASELINENOISE = 50731\nTIFFTAG_BASELINESHARPNESS = 50732\nTIFFTAG_BAYERGREENSPLIT = 50733\nTIFFTAG_LINEARRESPONSELIMIT = 50734\nTIFFTAG_CAMERASERIALNUMBER = 50735\nTIFFTAG_LENSINFO = 50736\nTIFFTAG_CHROMABLURRADIUS = 50737\nTIFFTAG_ANTIALIASSTRENGTH = 50738\nTIFFTAG_SHADOWSCALE = 50739\nTIFFTAG_DNGPRIVATEDATA = 50740\nTIFFTAG_MAKERNOTESAFETY = 50741\nTIFFTAG_CALIBRATIONILLUMINANT1 = 50778\nTIFFTAG_CALIBRATIONILLUMINANT2 = 50779\nTIFFTAG_BESTQUALITYSCALE = 50780\nTIFFTAG_RAWDATAUNIQUEID = 50781\nTIFFTAG_ORIGINALRAWFILENAME = 50827\nTIFFTAG_ORIGINALRAWFILEDATA = 50828\nTIFFTAG_ACTIVEAREA = 50829\nTIFFTAG_MASKEDAREAS = 50830\nTIFFTAG_ASSHOTICCPROFILE = 50831\nTIFFTAG_ASSHOTPREPROFILEMATRIX = 50832\nTIFFTAG_CURRENTICCPROFILE = 50833\nTIFFTAG_CURRENTPREPROFILEMATRIX = 50834\nTIFFTAG_DCSHUESHIFTVALUES = 65535\nTIFFTAG_FAXMODE = 65536\nFAXMODE_CLASSIC = 0x0000\nFAXMODE_NORTC = 0x0001\nFAXMODE_NOEOL = 0x0002\nFAXMODE_BYTEALIGN = 0x0004\nFAXMODE_WORDALIGN = 0x0008\nFAXMODE_CLASSF = FAXMODE_NORTC\nTIFFTAG_JPEGQUALITY = 65537\nTIFFTAG_JPEGCOLORMODE = 65538\nJPEGCOLORMODE_RAW = 0x0000\nJPEGCOLORMODE_RGB = 0x0001\nTIFFTAG_JPEGTABLESMODE = 65539\nJPEGTABLESMODE_QUANT = 0x0001\nJPEGTABLESMODE_HUFF = 0x0002\nTIFFTAG_FAXFILLFUNC = 65540\nTIFFTAG_PIXARLOGDATAFMT = 65549\nPIXARLOGDATAFMT_8BIT = 0\nPIXARLOGDATAFMT_8BITABGR = 1\nPIXARLOGDATAFMT_11BITLOG = 2\nPIXARLOGDATAFMT_12BITPICIO = 3\nPIXARLOGDATAFMT_16BIT = 4\nPIXARLOGDATAFMT_FLOAT = 5\nTIFFTAG_DCSIMAGERTYPE = 65550\nDCSIMAGERMODEL_M3 = 0\nDCSIMAGERMODEL_M5 = 1\nDCSIMAGERMODEL_M6 = 2\nDCSIMAGERFILTER_IR = 0\nDCSIMAGERFILTER_MONO = 1\nDCSIMAGERFILTER_CFA = 2\nDCSIMAGERFILTER_OTHER = 3\nTIFFTAG_DCSINTERPMODE = 65551\nDCSINTERPMODE_NORMAL = 0x0\nDCSINTERPMODE_PREVIEW = 0x1\nTIFFTAG_DCSBALANCEARRAY = 65552\nTIFFTAG_DCSCORRECTMATRIX = 65553\nTIFFTAG_DCSGAMMA = 65554\nTIFFTAG_DCSTOESHOULDERPTS = 65555\nTIFFTAG_DCSCALIBRATIONFD = 65556\nTIFFTAG_ZIPQUALITY = 65557\nTIFFTAG_PIXARLOGQUALITY = 65558\nTIFFTAG_DCSCLIPRECTANGLE = 65559\nTIFFTAG_SGILOGDATAFMT = 65560\nSGILOGDATAFMT_FLOAT = 0\nSGILOGDATAFMT_16BIT = 1\nSGILOGDATAFMT_RAW = 2\nSGILOGDATAFMT_8BIT = 3\nTIFFTAG_SGILOGENCODE = 65561\nSGILOGENCODE_NODITHER = 0\nSGILOGENCODE_RANDITHER = 1\nEXIFTAG_EXPOSURETIME = 33434\nEXIFTAG_FNUMBER = 33437\nEXIFTAG_EXPOSUREPROGRAM = 34850\nEXIFTAG_SPECTRALSENSITIVITY = 34852\nEXIFTAG_ISOSPEEDRATINGS = 34855\nEXIFTAG_OECF = 34856\nEXIFTAG_EXIFVERSION = 36864\nEXIFTAG_DATETIMEORIGINAL = 36867\nEXIFTAG_DATETIMEDIGITIZED = 36868\nEXIFTAG_COMPONENTSCONFIGURATION = 37121\nEXIFTAG_COMPRESSEDBITSPERPIXEL = 37122\nEXIFTAG_SHUTTERSPEEDVALUE = 37377\nEXIFTAG_APERTUREVALUE = 37378\nEXIFTAG_BRIGHTNESSVALUE = 37379\nEXIFTAG_EXPOSUREBIASVALUE = 37380\nEXIFTAG_MAXAPERTUREVALUE = 37381\nEXIFTAG_SUBJECTDISTANCE = 37382\nEXIFTAG_METERINGMODE = 37383\nEXIFTAG_LIGHTSOURCE = 37384\nEXIFTAG_FLASH = 37385\nEXIFTAG_FOCALLENGTH = 37386\nEXIFTAG_SUBJECTAREA = 37396\nEXIFTAG_MAKERNOTE = 37500\nEXIFTAG_USERCOMMENT = 37510\nEXIFTAG_SUBSECTIME = 37520\nEXIFTAG_SUBSECTIMEORIGINAL = 37521\nEXIFTAG_SUBSECTIMEDIGITIZED = 37522\nEXIFTAG_FLASHPIXVERSION = 40960\nEXIFTAG_COLORSPACE = 40961\nEXIFTAG_PIXELXDIMENSION = 40962\nEXIFTAG_PIXELYDIMENSION = 40963\nEXIFTAG_RELATEDSOUNDFILE = 40964\nEXIFTAG_FLASHENERGY = 41483\nEXIFTAG_SPATIALFREQUENCYRESPONSE = 41484\nEXIFTAG_FOCALPLANEXRESOLUTION = 41486\nEXIFTAG_FOCALPLANEYRESOLUTION = 41487\nEXIFTAG_FOCALPLANERESOLUTIONUNIT = 41488\nEXIFTAG_SUBJECTLOCATION = 41492\nEXIFTAG_EXPOSUREINDEX = 41493\nEXIFTAG_SENSINGMETHOD = 41495\nEXIFTAG_FILESOURCE = 41728\nEXIFTAG_SCENETYPE = 41729\nEXIFTAG_CFAPATTERN = 41730\nEXIFTAG_CUSTOMRENDERED = 41985\nEXIFTAG_EXPOSUREMODE = 41986\nEXIFTAG_WHITEBALANCE = 41987\nEXIFTAG_DIGITALZOOMRATIO = 41988\nEXIFTAG_FOCALLENGTHIN35MMFILM = 41989\nEXIFTAG_SCENECAPTURETYPE = 41990\nEXIFTAG_GAINCONTROL = 41991\nEXIFTAG_CONTRAST = 41992\nEXIFTAG_SATURATION = 41993\nEXIFTAG_SHARPNESS = 41994\nEXIFTAG_DEVICESETTINGDESCRIPTION = 41995\nEXIFTAG_SUBJECTDISTANCERANGE = 41996\nEXIFTAG_GAINCONTROL = 41991\nEXIFTAG_GAINCONTROL = 41991\nEXIFTAG_IMAGEUNIQUEID = 42016\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"TIF",
"F",
"\\u",
"VERSION_",
"=_",
"42_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"F",
"\\u",
"BIG",
"TIF",
"F",
"\\u",
"VERSION_",
"=_",
"43_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"F",
"\\u",
"BIG",
"ENDI",
"AN_",
"=_",
"0x4",
"d4",
"d_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"F",
"\\u",
"LIT",
"TLE",
"ENDI",
"AN_",
"=_",
"0x49",
"49_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"MD",
"I",
"\\u",
"LIT",
"TLE",
"ENDI",
"AN_",
"=_",
"0x5",
"045",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"MD",
"I",
"\\u",
"BIG",
"ENDI",
"AN_",
"=_",
"0x45",
"50_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"F",
"\\u",
"MAGIC",
"\\u",
"SIZE_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"F",
"\\u",
"VERSI",
"ON",
"\\u",
"SIZE_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"F",
"\\u",
"DIR",
"OFFSET",
"\\u",
"SIZE_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SUB",
"FILET",
"YPE_",
"=_",
"254_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FILET",
"YP",
"E",
"\\u",
"RED",
"UCE",
"DIM",
"AGE_",
"=_",
"0x1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FILET",
"YP",
"E",
"\\u",
"PAGE_",
"=_",
"0x2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FILET",
"YP",
"E",
"\\u",
"MASK_",
"=_",
"0x4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"OS",
"UB",
"FILET",
"YPE_",
"=_",
"255_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"OF",
"ILE",
"TYPE",
"\\u",
"IMAGE_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"OF",
"ILE",
"TYPE",
"\\u",
"RED",
"UCE",
"DIM",
"AGE_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"OF",
"ILE",
"TYPE",
"\\u",
"PAGE_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IMA",
"GE",
"WIDTH_",
"=_",
"256_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IMA",
"GE",
"LENGTH_",
"=_",
"257_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BITS",
"PERS",
"AMP",
"LE_",
"=_",
"258",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"COMPRESS",
"ION_",
"=_",
"259_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"NONE_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"CC",
"IT",
"TR",
"LE_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"CC",
"IT",
"TF",
"AX",
"3_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"CC",
"IT",
"T",
"\\u",
"T",
"4_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"CC",
"IT",
"TF",
"AX",
"4_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"CC",
"IT",
"T",
"\\u",
"T6",
"_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"LZ",
"W_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"OJ",
"PE",
"G_",
"=_",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"JP",
"EG",
"_",
"=_",
"7_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"NEXT",
"_",
"=_",
"3276",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"CC",
"IT",
"TR",
"LE",
"W_",
"=_",
"327",
"71_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"PACK",
"BITS_",
"=_",
"327",
"73_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"TH",
"UNDER",
"SCAN",
"_",
"=_",
"328",
"09_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"IT",
"8",
"CT",
"PAD",
"_",
"=_",
"328",
"95_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"IT",
"8",
"LW",
"_",
"=_",
"328",
"96_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"IT",
"8",
"MP_",
"=_",
"328",
"97_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"IT",
"8",
"BL",
"_",
"=_",
"328",
"98_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"PIX",
"AR",
"FIL",
"M_",
"=_",
"329",
"08_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"PIX",
"AR",
"LOG_",
"=_",
"329",
"09_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"DEF",
"LATE",
"_",
"=_",
"329",
"46_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"ADO",
"BE",
"\\u",
"DEF",
"LATE",
"_",
"=_",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"DC",
"S_",
"=_",
"329",
"47_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"JB",
"IG",
"_",
"=_",
"346",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"SGI",
"LOG_",
"=_",
"346",
"76_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"SGI",
"LOG",
"24_",
"=_",
"346",
"77_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COMPRESS",
"ION",
"\\u",
"JP",
"2000_",
"=_",
"347",
"12_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PHOTO",
"METRIC",
"_",
"=_",
"262",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"MINI",
"SW",
"HIT",
"E_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"MINI",
"SB",
"LAC",
"K_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"RGB_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"PAL",
"ETT",
"E_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"MASK_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"SEPA",
"RAT",
"ED_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"YC",
"BC",
"R_",
"=_",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"CIE",
"LAB",
"_",
"=_",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"IC",
"CLA",
"B_",
"=_",
"9_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"ITU",
"LAB",
"_",
"=_",
"10_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"LOG",
"L_",
"=_",
"328",
"44_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PHOTO",
"METRIC",
"\\u",
"LOG",
"LU",
"V_",
"=_",
"328",
"45_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"THRESH",
"HOLD",
"ING_",
"=_",
"263",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"THRESH",
"HOLD",
"\\u",
"BIL",
"EVE",
"L_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"THRESH",
"HOLD",
"\\u",
"HALF",
"TON",
"E_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"THRESH",
"HOLD",
"\\u",
"ERROR",
"DIFF",
"USE",
"_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CELL",
"WIDTH_",
"=_",
"264_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CELL",
"LENGTH_",
"=_",
"265_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FILL",
"ORDER_",
"=_",
"266_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FILL",
"ORDE",
"R",
"\\u",
"MS",
"B2",
"LS",
"B_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FILL",
"ORDE",
"R",
"\\u",
"LS",
"B2",
"MS",
"B_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DOCUMENT",
"NAME_",
"=_",
"269",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IMA",
"GE",
"DESCRIPTION_",
"=_",
"270_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MAKE",
"_",
"=_",
"271",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MODEL_",
"=_",
"272",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"STRIP",
"OFFSET",
"S_",
"=_",
"273",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ORIE",
"NTA",
"TION_",
"=_",
"274",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"TOP",
"LEFT_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"TOP",
"RIGHT_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"BOT",
"RIGHT_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"BOT",
"LEFT_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"LEF",
"TT",
"OP_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"RIG",
"HT",
"TOP_",
"=_",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"RIG",
"HT",
"BOT",
"_",
"=_",
"7_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ORIE",
"NTA",
"TIO",
"N",
"\\u",
"LEF",
"TB",
"OT",
"_",
"=_",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SAMPLES",
"PER",
"PIXEL",
"_",
"=_",
"277",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ROWS",
"PERS",
"TRI",
"P_",
"=_",
"278_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"STRIP",
"BYTE",
"COUNT",
"S_",
"=_",
"279",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MIN",
"SAMPLE",
"VALUE_",
"=_",
"280_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MAX",
"SAMPLE",
"VALUE_",
"=_",
"281",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"XR",
"ES",
"OLUT",
"ION_",
"=_",
"282",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"YR",
"ES",
"OLUT",
"ION_",
"=_",
"283",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PLAN",
"ARC",
"ONF",
"IG",
"_",
"=_",
"284",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PLAN",
"ARC",
"ONF",
"IG",
"\\u",
"CONTI",
"G_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PLAN",
"ARC",
"ONF",
"IG",
"\\u",
"SEPA",
"RATE_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PAGE",
"NAME_",
"=_",
"285",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"XP",
"OSI",
"TION_",
"=_",
"286",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"YP",
"OSI",
"TION_",
"=_",
"287",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FREE",
"OFFSET",
"S_",
"=_",
"288_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FREE",
"BYTE",
"COUNT",
"S_",
"=_",
"289",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"GRA",
"YR",
"ESP",
"ONS",
"EU",
"NIT",
"_",
"=_",
"290_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GRA",
"YR",
"ESP",
"ONS",
"EU",
"NIT",
"\\u",
"10",
"S_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GRA",
"YR",
"ESP",
"ONS",
"EU",
"NIT",
"\\u",
"100",
"S_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GRA",
"YR",
"ESP",
"ONS",
"EU",
"NIT",
"\\u",
"1000",
"S_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GRA",
"YR",
"ESP",
"ONS",
"EU",
"NIT",
"\\u",
"10000",
"S_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GRA",
"YR",
"ESP",
"ONS",
"EU",
"NIT",
"\\u",
"100000",
"S_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"GRA",
"YR",
"ESP",
"ONS",
"ECU",
"RV",
"E_",
"=_",
"291",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"GROU",
"P3",
"OPTIONS_",
"=_",
"292",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"T",
"4",
"OPTIONS_",
"=_",
"292",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GROU",
"P3",
"OPT",
"\\u",
"2",
"DEN",
"COD",
"ING_",
"=_",
"0x1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GROU",
"P3",
"OPT",
"\\u",
"UNC",
"OMP",
"RESS",
"ED_",
"=_",
"0x2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GROU",
"P3",
"OPT",
"\\u",
"FILL",
"BITS_",
"=_",
"0x4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"GROU",
"P4",
"OPTIONS_",
"=_",
"293",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"T6",
"OPTIONS_",
"=_",
"293",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"GROU",
"P4",
"OPT",
"\\u",
"UNC",
"OMP",
"RESS",
"ED_",
"=_",
"0x2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"RESOL",
"UTION",
"UNIT",
"_",
"=_",
"296",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"RESU",
"NIT",
"\\u",
"NONE_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"RESU",
"NIT",
"\\u",
"INC",
"H_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"RESU",
"NIT",
"\\u",
"CEN",
"TIME",
"TER_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PAGE",
"NUMBER_",
"=_",
"297",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"COLOR",
"RESPONSE",
"UNIT",
"_",
"=_",
"300_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COLOR",
"RESPONSE",
"UNIT",
"\\u",
"10",
"S_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COLOR",
"RESPONSE",
"UNIT",
"\\u",
"100",
"S_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COLOR",
"RESPONSE",
"UNIT",
"\\u",
"1000",
"S_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COLOR",
"RESPONSE",
"UNIT",
"\\u",
"10000",
"S_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"COLOR",
"RESPONSE",
"UNIT",
"\\u",
"100000",
"S_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TRANSFER",
"FUNCTION_",
"=_",
"301_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SOFT",
"WARE",
"_",
"=_",
"305_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DATETIME",
"_",
"=_",
"306",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ARTI",
"ST_",
"=_",
"315",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"HOST",
"COMPUTE",
"R_",
"=_",
"316",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PREDIC",
"TOR",
"_",
"=_",
"317",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PREDIC",
"TOR",
"\\u",
"NONE_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PREDIC",
"TOR",
"\\u",
"HORIZONTAL_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PREDIC",
"TOR",
"\\u",
"FLOAT",
"ING",
"POINT_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"WHITE",
"POINT_",
"=_",
"318",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PRIMA",
"RY",
"CHROM",
"ATI",
"CIT",
"IES_",
"=_",
"319",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"COLOR",
"MAP_",
"=_",
"320_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"HALF",
"TON",
"EH",
"INT",
"S_",
"=_",
"321_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TILE",
"WIDTH_",
"=_",
"322",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TILE",
"LENGTH_",
"=_",
"323",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TILE",
"OFFSET",
"S_",
"=_",
"324",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TILE",
"BYTE",
"COUNT",
"S_",
"=_",
"325_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BAD",
"FA",
"XL",
"INE",
"S_",
"=_",
"326",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CLEAN",
"FA",
"XD",
"ATA",
"_",
"=_",
"327",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"CLEAN",
"FA",
"XD",
"ATA",
"\\u",
"CLEAN",
"_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"CLEAN",
"FA",
"XD",
"ATA",
"\\u",
"REG",
"ENE",
"RAT",
"ED_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"CLEAN",
"FA",
"XD",
"ATA",
"\\u",
"UNC",
"LEA",
"N_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CONS",
"ECU",
"TIVE",
"BAD",
"FA",
"XL",
"INE",
"S_",
"=_",
"328",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SUB",
"IF",
"D_",
"=_",
"330_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"INK",
"SET_",
"=_",
"332",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"INK",
"SET",
"\\u",
"CM",
"YK",
"_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"INK",
"SET",
"\\u",
"MULTI",
"INK",
"_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"INK",
"NAMES_",
"=_",
"333_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"NUMB",
"ERO",
"FIN",
"KS",
"_",
"=_",
"334",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DOT",
"RANGE_",
"=_",
"336",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TARGET",
"PRINT",
"ER_",
"=_",
"337",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"EXTRA",
"SAMPLES",
"_",
"=_",
"338",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EXTRA",
"SAMPLE",
"\\u",
"UNSPEC",
"IFIED",
"_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EXTRA",
"SAMPLE",
"\\u",
"ASSOC",
"ALPHA_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EXTRA",
"SAMPLE",
"\\u",
"UNA",
"SSA",
"LP",
"HA",
"_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SAMPLE",
"FORMAT_",
"=_",
"339",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SAMPLE",
"FORMAT",
"\\u",
"UINT_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SAMPLE",
"FORMAT",
"\\u",
"INT_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SAMPLE",
"FORMAT",
"\\u",
"IE",
"EE",
"FP",
"_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SAMPLE",
"FORMAT",
"\\u",
"VOID",
"_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SAMPLE",
"FORMAT",
"\\u",
"COMPL",
"EX",
"INT_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SAMPLE",
"FORMAT",
"\\u",
"COMPL",
"EX",
"IE",
"EE",
"FP",
"_",
"=_",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SMI",
"NS",
"AMP",
"LE",
"VALUE_",
"=_",
"340_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SMA",
"XS",
"AMP",
"LE",
"VALUE_",
"=_",
"341",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CLIP",
"PATH_",
"=_",
"343",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"XC",
"LI",
"PP",
"ATH",
"UNITS_",
"=_",
"344",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"YC",
"LI",
"PP",
"ATH",
"UNITS_",
"=_",
"345",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"INDE",
"XE",
"D_",
"=_",
"346",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"TABLES",
"_",
"=_",
"347",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"OP",
"IP",
"RO",
"XY_",
"=_",
"351",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"PROC",
"_",
"=_",
"512_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"JP",
"EG",
"PROC",
"\\u",
"BASE",
"LINE_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"JP",
"EG",
"PROC",
"\\u",
"LOSS",
"LESS",
"_",
"=_",
"14_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"IF",
"OFFSET_",
"=_",
"513",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"IF",
"BYTE",
"COUNT_",
"=_",
"514",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"RESTA",
"RT",
"INTERVAL_",
"=_",
"515",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EGL",
"OSS",
"LESS",
"PREDIC",
"TOR",
"S_",
"=_",
"517",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"POINT",
"TRANSFORM",
"_",
"=_",
"518",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"QT",
"AB",
"LES",
"_",
"=_",
"519",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"DC",
"TABLES",
"_",
"=_",
"520",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EGA",
"CTA",
"BL",
"ES_",
"=_",
"521",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"YC",
"BC",
"RC",
"OE",
"FFI",
"CIE",
"NTS",
"_",
"=_",
"529",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"YC",
"BC",
"RS",
"UB",
"SAM",
"PLI",
"NG_",
"=_",
"530",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"YC",
"BC",
"RP",
"OSI",
"TIO",
"NING",
"_",
"=_",
"531",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"YC",
"BC",
"RP",
"OSI",
"TIO",
"N",
"\\u",
"CENTER",
"ED_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"YC",
"BC",
"RP",
"OSI",
"TIO",
"N",
"\\u",
"COS",
"ITE",
"D_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"REFERENCE",
"BLACK",
"WHITE_",
"=_",
"532",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"XML",
"PACKET",
"_",
"=_",
"700_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"OP",
"II",
"MAGE",
"ID_",
"=_",
"327",
"81_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"REF",
"PT",
"S_",
"=_",
"329",
"53_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"REGION",
"TACK",
"POINT_",
"=_",
"329",
"54_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"REGION",
"WAR",
"PC",
"OR",
"NER",
"S_",
"=_",
"329",
"55_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"REGION",
"AFF",
"INE",
"_",
"=_",
"329",
"56_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MAT",
"TE",
"ING_",
"=_",
"329",
"95_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DATA",
"TYPE_",
"=_",
"329",
"96_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IMA",
"GE",
"DEPTH",
"_",
"=_",
"329",
"97_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"TILE",
"DEPTH",
"_",
"=_",
"329",
"98_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"IMA",
"GE",
"FULL",
"WIDTH_",
"=_",
"333",
"00_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"IMA",
"GE",
"FULL",
"LENGTH_",
"=_",
"333",
"01_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"TEXT",
"URE",
"FORMAT_",
"=_",
"333",
"02_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"WRAP",
"MODES_",
"=_",
"333",
"03_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"FO",
"VC",
"OT",
"_",
"=_",
"333",
"04_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"MATRIX",
"\\u",
"WORLD",
"TOS",
"CRE",
"EN_",
"=_",
"333",
"05_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"\\u",
"MATRIX",
"\\u",
"WORLD",
"TOC",
"AME",
"RA_",
"=_",
"333",
"06_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"WRITE",
"RSE",
"RIA",
"LN",
"UM",
"BER",
"_",
"=_",
"334",
"05_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"COPY",
"RIGHT_",
"=_",
"334",
"32_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"RIC",
"HT",
"IF",
"FI",
"PT",
"C_",
"=_",
"337",
"23_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"SITE",
"_",
"=_",
"340",
"16_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"COLOR",
"SEQUENCE",
"_",
"=_",
"340",
"17_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"HEADER_",
"=_",
"340",
"18_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"RAS",
"TER",
"PADDING",
"_",
"=_",
"340",
"19_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"BITS",
"PER",
"RUN",
"LENGTH_",
"=_",
"340",
"20_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"BITS",
"PER",
"EXTEND",
"ED",
"RUN",
"LENGTH_",
"=_",
"340",
"21_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"COLOR",
"TABLE_",
"=_",
"340",
"22_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"IMA",
"GE",
"COLOR",
"INDIC",
"ATOR",
"_",
"=_",
"340",
"23_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"BK",
"GC",
"OLO",
"RIN",
"DI",
"CAT",
"OR_",
"=_",
"340",
"24_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"IMA",
"GE",
"COLOR",
"VALUE_",
"=_",
"340",
"25_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"BK",
"GC",
"OLO",
"RV",
"AL",
"UE",
"_",
"=_",
"340",
"26_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"PIXEL",
"INTEN",
"SIT",
"YR",
"ANGE",
"_",
"=_",
"340",
"27_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"TRANSP",
"ARE",
"NCY",
"INDIC",
"ATOR",
"_",
"=_",
"340",
"28_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"COLOR",
"CHARACTER",
"IZA",
"TION_",
"=_",
"340",
"29_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"HC",
"USAGE",
"_",
"=_",
"340",
"30_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"TRA",
"PIN",
"DI",
"CAT",
"OR_",
"=_",
"340",
"31_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IT",
"8",
"CM",
"YK",
"EQU",
"IV",
"ALE",
"NT_",
"=_",
"340",
"32_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FRAME",
"COUNT_",
"=_",
"342",
"32_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PHOTO",
"SHO",
"P_",
"=_",
"343",
"77_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"EX",
"IF",
"IF",
"D_",
"=_",
"346",
"65_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"IC",
"CP",
"RO",
"FILE_",
"=_",
"346",
"75_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JB",
"IG",
"OPTIONS_",
"=_",
"347",
"50_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"GPS",
"IF",
"D_",
"=_",
"348",
"53_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FA",
"XR",
"EC",
"VP",
"ARA",
"MS_",
"=_",
"349",
"08_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FA",
"XS",
"UB",
"ADDRESS_",
"=_",
"349",
"09_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FA",
"XR",
"EC",
"VT",
"IME",
"_",
"=_",
"349",
"10_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FA",
"XD",
"CS_",
"=_",
"349",
"11_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"STO",
"NIT",
"S_",
"=_",
"374",
"39_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FED",
"EX",
"\\u",
"ED",
"R_",
"=_",
"349",
"29_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"INTER",
"OPER",
"ABI",
"LIT",
"YI",
"FD_",
"=_",
"409",
"65_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DN",
"GV",
"ERS",
"ION_",
"=_",
"507",
"06_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DN",
"GB",
"AC",
"KW",
"ARD",
"VERSION_",
"=_",
"507",
"07_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"UNI",
"QUE",
"CAMER",
"AMO",
"DEL",
"_",
"=_",
"507",
"08_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"LOCAL",
"IZED",
"CAMER",
"AMO",
"DEL",
"_",
"=_",
"507",
"09_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CF",
"AP",
"LAN",
"ECO",
"LO",
"R_",
"=_",
"507",
"10_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CF",
"AL",
"AY",
"OUT_",
"=_",
"507",
"11_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"LINEAR",
"IZA",
"TIO",
"NTA",
"BLE_",
"=_",
"507",
"12_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BLACK",
"LE",
"VEL",
"REPEAT",
"DIM_",
"=_",
"507",
"13_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BLACK",
"LEVEL_",
"=_",
"507",
"14_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BLACK",
"LE",
"VEL",
"DELTA",
"H_",
"=_",
"507",
"15_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BLACK",
"LE",
"VEL",
"DELTA",
"V_",
"=_",
"507",
"16_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"WHITE",
"LEVEL_",
"=_",
"507",
"17_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DEF",
"AUL",
"TS",
"CAL",
"E_",
"=_",
"507",
"18_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DEF",
"AUL",
"TC",
"ROP",
"ORIGIN",
"_",
"=_",
"507",
"19_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DEF",
"AUL",
"TC",
"ROP",
"SIZE_",
"=_",
"5072",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"COLOR",
"MATRIX",
"1_",
"=_",
"5072",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"COLOR",
"MATRIX",
"2_",
"=_",
"5072",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CAMER",
"ACA",
"LIB",
"RATION",
"1_",
"=_",
"5072",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CAMER",
"ACA",
"LIB",
"RATION",
"2_",
"=_",
"5072",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"RED",
"UCT",
"ION",
"MATRIX",
"1_",
"=_",
"5072",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"RED",
"UCT",
"ION",
"MATRIX",
"2_",
"=_",
"5072",
"6_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ANA",
"LOG",
"BALA",
"NCE_",
"=_",
"5072",
"7_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ASS",
"HOT",
"NEU",
"TRA",
"L_",
"=_",
"5072",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ASS",
"HOT",
"WHITE",
"XY_",
"=_",
"5072",
"9_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BASE",
"LINE",
"EXP",
"OS",
"URE_",
"=_",
"507",
"30_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BASE",
"LINE",
"NO",
"ISE",
"_",
"=_",
"507",
"31_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BASE",
"LINES",
"HAR",
"PN",
"ESS",
"_",
"=_",
"507",
"32_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BA",
"YE",
"RG",
"REE",
"NS",
"PLI",
"T_",
"=_",
"507",
"33_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"LINEAR",
"RESPONSE",
"LIMIT_",
"=_",
"507",
"34_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CAMER",
"AS",
"ERI",
"AL",
"NUMBER_",
"=_",
"507",
"35_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"LEN",
"SIN",
"FO",
"_",
"=_",
"507",
"36_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CHROM",
"AB",
"LU",
"RR",
"AD",
"IU",
"S_",
"=_",
"507",
"37_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ANTI",
"ALIAS",
"STRE",
"NG",
"TH_",
"=_",
"507",
"38_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SHA",
"DO",
"WS",
"CAL",
"E_",
"=_",
"507",
"39_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DN",
"GPR",
"IV",
"ATED",
"ATA",
"_",
"=_",
"507",
"40_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MAKE",
"RN",
"OT",
"ES",
"AF",
"ET",
"Y_",
"=_",
"507",
"41_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CALI",
"BRA",
"TIO",
"NI",
"LL",
"UM",
"INA",
"NT",
"1_",
"=_",
"507",
"78_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CALI",
"BRA",
"TIO",
"NI",
"LL",
"UM",
"INA",
"NT",
"2_",
"=_",
"507",
"79_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"BES",
"TQ",
"UAL",
"IT",
"YS",
"CAL",
"E_",
"=_",
"507",
"80_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"RA",
"WD",
"ATA",
"UNI",
"QUE",
"ID_",
"=_",
"507",
"81_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ORIGIN",
"AL",
"RA",
"WF",
"ILE",
"NAME_",
"=_",
"508",
"27_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ORIGIN",
"AL",
"RA",
"WF",
"ILE",
"DATA_",
"=_",
"508",
"28_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ACTI",
"VE",
"AREA",
"_",
"=_",
"508",
"29_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"MASK",
"EDA",
"REA",
"S_",
"=_",
"508",
"30_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ASS",
"HOT",
"IC",
"CP",
"RO",
"FILE_",
"=_",
"508",
"31_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ASS",
"HOT",
"PREP",
"RO",
"FILE",
"MATRIX",
"_",
"=_",
"508",
"32_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CURREN",
"TIC",
"CP",
"RO",
"FILE_",
"=_",
"508",
"33_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"CURREN",
"TP",
"REP",
"RO",
"FILE",
"MATRIX",
"_",
"=_",
"508",
"34_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SHU",
"ES",
"HIFT",
"VALUES_",
"=_",
"65535_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FA",
"XM",
"ODE",
"_",
"=_",
"65536_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FA",
"XM",
"ODE",
"\\u",
"CLASS",
"IC_",
"=_",
"0x0000_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FA",
"XM",
"ODE",
"\\u",
"NOR",
"TC_",
"=_",
"0x0001",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FA",
"XM",
"ODE",
"\\u",
"NO",
"EO",
"L_",
"=_",
"0x000",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FA",
"XM",
"ODE",
"\\u",
"BYTE",
"ALIGN",
"_",
"=_",
"0x000",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FA",
"XM",
"ODE",
"\\u",
"WORD",
"ALIGN",
"_",
"=_",
"0x000",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FA",
"XM",
"ODE",
"\\u",
"CLASS",
"F_",
"=_",
"FA",
"XM",
"ODE",
"\\u",
"NOR",
"TC_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"QUALITY",
"_",
"=_",
"6553",
"7_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"COLOR",
"MODE_",
"=_",
"6553",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"JP",
"EG",
"COLOR",
"MODE",
"\\u",
"RAW_",
"=_",
"0x0000_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"JP",
"EG",
"COLOR",
"MODE",
"\\u",
"RGB_",
"=_",
"0x0001",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"JP",
"EG",
"TABLES",
"MODE_",
"=_",
"6553",
"9_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"JP",
"EG",
"TABLES",
"MODE",
"\\u",
"QUA",
"NT_",
"=_",
"0x0001",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"JP",
"EG",
"TABLES",
"MODE",
"\\u",
"HU",
"FF_",
"=_",
"0x000",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"FA",
"XF",
"ILL",
"FUNC",
"_",
"=_",
"655",
"40_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"LOG",
"DATA",
"FMT_",
"=_",
"655",
"49_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PIX",
"AR",
"LOG",
"DATA",
"FMT",
"\\u",
"8",
"BIT_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PIX",
"AR",
"LOG",
"DATA",
"FMT",
"\\u",
"8",
"BIT",
"AB",
"GR",
"_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PIX",
"AR",
"LOG",
"DATA",
"FMT",
"\\u",
"11",
"BIT",
"LOG_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PIX",
"AR",
"LOG",
"DATA",
"FMT",
"\\u",
"1",
"2",
"BIT",
"PIC",
"IO_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PIX",
"AR",
"LOG",
"DATA",
"FMT",
"\\u",
"16",
"BIT_",
"=_",
"4_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"PIX",
"AR",
"LOG",
"DATA",
"FMT",
"\\u",
"FLOAT_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SIM",
"AGE",
"RT",
"YPE_",
"=_",
"655",
"50_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RM",
"ODE",
"L",
"\\u",
"M3",
"_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RM",
"ODE",
"L",
"\\u",
"M",
"5_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RM",
"ODE",
"L",
"\\u",
"M6",
"_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RF",
"IL",
"TER",
"\\u",
"IR_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RF",
"IL",
"TER",
"\\u",
"MON",
"O_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RF",
"IL",
"TER",
"\\u",
"CF",
"A_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIM",
"AGE",
"RF",
"IL",
"TER",
"\\u",
"OTHER",
"_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SIN",
"TER",
"PM",
"ODE",
"_",
"=_",
"655",
"51_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIN",
"TER",
"PM",
"ODE",
"\\u",
"NORMAL_",
"=_",
"0x0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DC",
"SIN",
"TER",
"PM",
"ODE",
"\\u",
"PREVI",
"EW",
"_",
"=_",
"0x1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SB",
"AL",
"ANCE",
"ARRAY_",
"=_",
"655",
"52_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SCO",
"RR",
"ECT",
"MATRIX",
"_",
"=_",
"655",
"53_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SG",
"AM",
"MA_",
"=_",
"655",
"54_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"STO",
"ES",
"HO",
"UL",
"DER",
"PT",
"S_",
"=_",
"655",
"55_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SCAL",
"IB",
"RATION",
"FD_",
"=_",
"655",
"56_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"ZI",
"PQ",
"UAL",
"ITY_",
"=_",
"655",
"57_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"PIX",
"AR",
"LOG",
"QUALITY",
"_",
"=_",
"655",
"58_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"DC",
"SC",
"LI",
"PRE",
"CTA",
"NG",
"LE_",
"=_",
"655",
"59_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SGI",
"LOG",
"DATA",
"FMT_",
"=_",
"655",
"60_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SGI",
"LOG",
"DATA",
"FMT",
"\\u",
"FLOAT_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SGI",
"LOG",
"DATA",
"FMT",
"\\u",
"16",
"BIT_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SGI",
"LOG",
"DATA",
"FMT",
"\\u",
"RAW_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SGI",
"LOG",
"DATA",
"FMT",
"\\u",
"8",
"BIT_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIF",
"FT",
"AG",
"\\u",
"SGI",
"LOG",
"ENCODE",
"_",
"=_",
"655",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SGI",
"LOG",
"ENCODE",
"\\u",
"NOD",
"IT",
"HER",
"_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"SGI",
"LOG",
"ENCODE",
"\\u",
"RAN",
"DI",
"THER",
"_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"EXP",
"OS",
"URE",
"TIME_",
"=_",
"334",
"34_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FN",
"UM",
"BER",
"_",
"=_",
"334",
"37_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"EXP",
"OS",
"URE",
"PROGRAM",
"_",
"=_",
"348",
"50_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SPEC",
"TRA",
"LS",
"ENS",
"ITI",
"VIT",
"Y_",
"=_",
"348",
"52_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"ISO",
"SPEED",
"RAT",
"INGS",
"_",
"=_",
"348",
"55_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"OE",
"CF_",
"=_",
"348",
"56_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"EX",
"IF",
"VERSION_",
"=_",
"368",
"64_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"DATETIME",
"ORIGIN",
"AL_",
"=_",
"368",
"67_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"DATETIME",
"DIGIT",
"IZED",
"_",
"=_",
"368",
"68_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"COMPONENT",
"SCO",
"NF",
"IG",
"URA",
"TION_",
"=_",
"371",
"21_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"COMPRESS",
"ED",
"BITS",
"PER",
"PIXEL",
"_",
"=_",
"371",
"22_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SHU",
"TT",
"ERS",
"PE",
"ED",
"VALUE_",
"=_",
"373",
"77_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"AP",
"ERT",
"URE",
"VALUE_",
"=_",
"373",
"78_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"BRIGHT",
"NESS",
"VALUE_",
"=_",
"373",
"79_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"EXP",
"OS",
"URE",
"BIA",
"SV",
"AL",
"UE",
"_",
"=_",
"373",
"80_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"MAX",
"AP",
"ERT",
"URE",
"VALUE_",
"=_",
"373",
"81_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SUBJECT",
"DISTANCE",
"_",
"=_",
"373",
"82_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"METER",
"ING",
"MODE_",
"=_",
"373",
"83_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"LIGHT",
"SOURCE_",
"=_",
"373",
"84_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FLASH",
"_",
"=_",
"373",
"85_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FOC",
"ALL",
"ENG",
"TH_",
"=_",
"373",
"86_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SUBJECT",
"AREA",
"_",
"=_",
"373",
"96_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"MAKE",
"RN",
"OT",
"E_",
"=_",
"375",
"00_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"USER",
"COMMENT_",
"=_",
"375",
"10_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SUBS",
"ECTI",
"ME_",
"=_",
"375",
"20_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SUBS",
"ECTI",
"ME",
"ORIGIN",
"AL_",
"=_",
"375",
"21_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SUBS",
"ECTI",
"MED",
"IG",
"ITI",
"ZED",
"_",
"=_",
"375",
"22_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FLASH",
"PIX",
"VERSION_",
"=_",
"409",
"60_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"COLOR",
"SPACE_",
"=_",
"409",
"61_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"PIXEL",
"XD",
"IME",
"NS",
"ION_",
"=_",
"409",
"62_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"PIXEL",
"YD",
"IME",
"NS",
"ION_",
"=_",
"409",
"63_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"RELAT",
"ED",
"SOUND",
"FILE_",
"=_",
"409",
"64_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FLASH",
"ENE",
"RG",
"Y_",
"=_",
"414",
"83_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SPA",
"TI",
"AL",
"FREQUENCY",
"RESPONSE_",
"=_",
"414",
"84_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FOC",
"AL",
"PLAN",
"EX",
"RESOL",
"UTION",
"_",
"=_",
"414",
"86_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FOC",
"AL",
"PLAN",
"EY",
"RESOL",
"UTION",
"_",
"=_",
"414",
"87_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FOC",
"AL",
"PLAN",
"ERE",
"SOL",
"UTION",
"UNIT",
"_",
"=_",
"414",
"88_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SUBJECT",
"LOCATION_",
"=_",
"414",
"92_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"EXP",
"OS",
"URE",
"INDEX_",
"=_",
"414",
"93_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SENS",
"ING",
"METHOD_",
"=_",
"414",
"95_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FILE",
"SOURCE_",
"=_",
"417",
"28_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SCEN",
"ET",
"YPE_",
"=_",
"417",
"29_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"CF",
"AP",
"ATTE",
"RN",
"_",
"=_",
"417",
"30_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"CUSTOM",
"RENDER",
"ED_",
"=_",
"419",
"85_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"EXP",
"OS",
"URE",
"MODE_",
"=_",
"419",
"86_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"WHITE",
"BALA",
"NCE_",
"=_",
"419",
"87_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"DIGIT",
"AL",
"ZOO",
"MR",
"ATI",
"O_",
"=_",
"419",
"88_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"FOC",
"ALL",
"ENG",
"THI",
"N3",
"5",
"MM",
"FIL",
"M_",
"=_",
"419",
"89_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SCEN",
"EC",
"AP",
"TUR",
"ET",
"YPE_",
"=_",
"419",
"90_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"GAIN",
"CONTROL_",
"=_",
"419",
"91_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"CONTR",
"AST_",
"=_",
"419",
"92_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SAT",
"URA",
"TION_",
"=_",
"419",
"93_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"SHAR",
"PN",
"ESS",
"_",
"=_",
"419",
"94_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"EX",
"IF",
"TAG",
"\\u",
"DEVICES",
"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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | circuits/circuits/tests/core/test_feedback.py | [
{
"content": "def test_success():\n app = App()\n while len(app):\n app.flush()\n\n e = test()\n value = app.fire(e)\n\n while len(app):\n app.flush()\n\n # The Event\n s = value.value\n assert s == \"Hello World!\"\n\n while len(app):\n app.flush()\n\n assert app.e == e\n assert app.success\n assert app.e.value == value\n assert app.value == value.value",
"metadata": "root.test_success",
"header": "['module', '___EOS___']",
"index": 52
}
] | [] | [] | 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_",
"test\\u",
"success_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"=_",
"App_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"len_",
"(_",
"app_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"._",
"flush_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"e_",
"=_",
"test_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"value_",
"=_",
"app_",
"._",
"fire_",
"(_",
"e_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"while_",
"len_",
"(_",
"app_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"._",
"flush_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"Event_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"s_",
"=_",
"value_",
"._",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"s_",
"==_",
"\"",
"Hell",
"o",
" ",
"Wor",
"ld",
"!\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"while_",
"len_",
"(_",
"app_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"._",
"flush_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"app_",
"._",
"e_",
"==_",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"app_",
"._",
"success_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"app_",
"._",
"e_",
"._",
"value_",
"==_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"app_",
"._",
"value_",
"==_",
"value_",
"._",
"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
] |
Except block handles 'BaseException' | kuri65536/python-for-android/python-build/python-libs/gdata/tests/gdata_tests/data_test.py | [
{
"content": " def testAddBatchEntry(self):\n try:\n self.batch_feed.AddBatchEntry(batch_id_string='a')\n self.fail('AddBatchEntry with neither entry or URL should raise Error')\n except gdata.data.MissingRequiredParameters:\n pass\n\n new_entry = self.batch_feed.AddBatchEntry(\n id_url_string='http://example.com/1')\n self.assertEquals(len(self.batch_feed.entry), 1)\n self.assertEquals(self.batch_feed.entry[0].get_id(),\n 'http://example.com/1')\n self.assertEquals(self.batch_feed.entry[0].batch_id.text, '0')\n self.assertEquals(new_entry.id.text, 'http://example.com/1')\n self.assertEquals(new_entry.batch_id.text, '0')\n\n to_add = gdata.data.BatchEntry(id=atom.data.Id(text='originalId'))\n new_entry = self.batch_feed.AddBatchEntry(entry=to_add,\n batch_id_string='foo')\n self.assertEquals(new_entry.batch_id.text, 'foo')\n self.assertEquals(new_entry.id.text, 'originalId')\n\n to_add = gdata.data.BatchEntry(id=atom.data.Id(text='originalId'),\n batch_id=gdata.data.BatchId(text='bar'))\n new_entry = self.batch_feed.AddBatchEntry(entry=to_add,\n id_url_string='newId',\n batch_id_string='foo')\n self.assertEquals(new_entry.batch_id.text, 'foo')\n self.assertEquals(new_entry.id.text, 'originalId')\n\n to_add = gdata.data.BatchEntry(id=atom.data.Id(text='originalId'),\n batch_id=gdata.data.BatchId(text='bar'))\n new_entry = self.batch_feed.AddBatchEntry(entry=to_add,\n id_url_string='newId')\n self.assertEquals(new_entry.batch_id.text, 'bar')\n self.assertEquals(new_entry.id.text, 'originalId')\n\n to_add = gdata.data.BatchEntry(id=atom.data.Id(text='originalId'),\n batch_id=gdata.data.BatchId(text='bar'),\n batch_operation=gdata.data.BatchOperation(\n type=gdata.data.BATCH_INSERT))\n self.assertEquals(to_add.batch_operation.type, gdata.data.BATCH_INSERT)\n new_entry = self.batch_feed.AddBatchEntry(entry=to_add,\n id_url_string='newId', batch_id_string='foo',\n operation_string=gdata.data.BATCH_UPDATE)\n self.assertEquals(new_entry.batch_operation.type, gdata.data.BATCH_UPDATE)",
"metadata": "root.BatchFeedTest.testAddBatchEntry",
"header": "['class', 'BatchFeedTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 239
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Bat",
"ch",
"Feed",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"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_",
"._",
"batch",
"\\u",
"feed_",
"._",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"batch",
"\\u",
"id",
"\\u",
"string_",
"=_",
"'",
"a",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"fail_",
"(_",
"'",
"Add",
"Bat",
"ch",
"Entr",
"y",
" ",
"with",
" ",
"nei",
"ther",
" ",
"entry",
" ",
"or",
" ",
"URL",
" ",
"shou",
"ld",
" ",
"raise",
" ",
"Error",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"gdata_",
"._",
"data_",
"._",
"Missing",
"Requ",
"ired",
"Parameters_",
":_",
"\\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_",
"new",
"\\u",
"entry_",
"=_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"id",
"\\u",
"url",
"\\u",
"string_",
"=_",
"'",
"http",
"://",
"example",
".",
"com",
"/",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"len_",
"(_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"entry_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"entry_",
"[_",
"0_",
"]_",
"._",
"get",
"\\u",
"id_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"http",
"://",
"example",
".",
"com",
"/",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"entry_",
"[_",
"0_",
"]_",
"._",
"batch",
"\\u",
"id_",
"._",
"text_",
",_",
"'",
"0",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"id_",
"._",
"text_",
",_",
"'",
"http",
"://",
"example",
".",
"com",
"/",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"batch",
"\\u",
"id_",
"._",
"text_",
",_",
"'",
"0",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"to",
"\\u",
"add_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Entry_",
"(_",
"id_",
"=_",
"atom_",
"._",
"data_",
"._",
"Id_",
"(_",
"text_",
"=_",
"'",
"original",
"Id",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"entry_",
"=_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"entry_",
"=_",
"to",
"\\u",
"add_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"batch",
"\\u",
"id",
"\\u",
"string_",
"=_",
"'",
"foo",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"batch",
"\\u",
"id_",
"._",
"text_",
",_",
"'",
"foo",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"id_",
"._",
"text_",
",_",
"'",
"original",
"Id",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"to",
"\\u",
"add_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Entry_",
"(_",
"id_",
"=_",
"atom_",
"._",
"data_",
"._",
"Id_",
"(_",
"text_",
"=_",
"'",
"original",
"Id",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"batch",
"\\u",
"id_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Id_",
"(_",
"text_",
"=_",
"'",
"bar",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"entry_",
"=_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"entry_",
"=_",
"to",
"\\u",
"add_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"id",
"\\u",
"url",
"\\u",
"string_",
"=_",
"'",
"new",
"Id",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"batch",
"\\u",
"id",
"\\u",
"string_",
"=_",
"'",
"foo",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"batch",
"\\u",
"id_",
"._",
"text_",
",_",
"'",
"foo",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"id_",
"._",
"text_",
",_",
"'",
"original",
"Id",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"to",
"\\u",
"add_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Entry_",
"(_",
"id_",
"=_",
"atom_",
"._",
"data_",
"._",
"Id_",
"(_",
"text_",
"=_",
"'",
"original",
"Id",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"batch",
"\\u",
"id_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Id_",
"(_",
"text_",
"=_",
"'",
"bar",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"entry_",
"=_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"entry_",
"=_",
"to",
"\\u",
"add_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"id",
"\\u",
"url",
"\\u",
"string_",
"=_",
"'",
"new",
"Id",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"batch",
"\\u",
"id_",
"._",
"text_",
",_",
"'",
"bar",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"new",
"\\u",
"entry_",
"._",
"id_",
"._",
"text_",
",_",
"'",
"original",
"Id",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"to",
"\\u",
"add_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Entry_",
"(_",
"id_",
"=_",
"atom_",
"._",
"data_",
"._",
"Id_",
"(_",
"text_",
"=_",
"'",
"original",
"Id",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"batch",
"\\u",
"id_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Id_",
"(_",
"text_",
"=_",
"'",
"bar",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"batch",
"\\u",
"operation_",
"=_",
"gdata_",
"._",
"data_",
"._",
"Bat",
"ch",
"Operation_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"type_",
"=_",
"gdata_",
"._",
"data_",
"._",
"BATCH",
"\\u",
"INSERT",
"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"to",
"\\u",
"add_",
"._",
"batch",
"\\u",
"operation_",
"._",
"type_",
",_",
"gdata_",
"._",
"data_",
"._",
"BATCH",
"\\u",
"INSERT",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"entry_",
"=_",
"self_",
"._",
"batch",
"\\u",
"feed_",
"._",
"Add",
"Bat",
"ch",
"Entry_",
"(_",
"entry_",
"=_",
"to",
"\\u",
"add_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"id",
"\\u",
"url",
"\\u",
"string_",
"=_",
"'",
"new",
"Id",
"'_",
",_",
"batch",
"\\u",
"id",
"\\u",
"string_",
"=_",
"'",
"foo",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"operati",
"on",
"\\u",
"string_",
"=_",
"gdata_",
"._",
"data_",
"._",
"BATCH",
"\\u",
"UPDATE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"ass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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
] |
Unused import | getredash/redash/redash/handlers/base.py | [
{
"content": "import time\nfrom flask import request, Blueprint\nfrom flask_restful import Resource, abort\nfrom flask_login import current_user, login_required\nfrom peewee import DoesNotExist\n\nfrom redash import settings\nfrom redash.tasks import record_event as record_event_task\nfrom redash.models import ApiUser\nfrom redash.authentication import current_org\n\nroutes = Blueprint('redash', __name__, template_folder=settings.fix_assets_path('templates'))\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class BaseResource(Resource):\n decorators = [login_required]\n\n\n\n\n",
"metadata": "root.BaseResource",
"header": "['module', '___EOS___']",
"index": 14
},
{
"content": " def __init__(self, *args, **kwargs):\n super(BaseResource, self).__init__(*args, **kwargs)\n self._user = None",
"metadata": "root.BaseResource.__init__",
"header": "['class', 'BaseResource', '(', 'Resource', ')', ':', '___EOS___']",
"index": 17
},
{
"content": " def dispatch_request(self, *args, **kwargs):\n kwargs.pop('org_slug', None)\n\n return super(BaseResource, self).dispatch_request(*args, **kwargs)",
"metadata": "root.BaseResource.dispatch_request",
"header": "['class', 'BaseResource', '(', 'Resource', ')', ':', '___EOS___']",
"index": 21
},
{
"content": " @property\n def current_user(self):\n return current_user._get_current_object()",
"metadata": "root.BaseResource.current_user",
"header": "['class', 'BaseResource', '(', 'Resource', ')', ':', '___EOS___']",
"index": 26
},
{
"content": " @property\n def current_org(self):\n return current_org._get_current_object()",
"metadata": "root.BaseResource.current_org",
"header": "['class', 'BaseResource', '(', 'Resource', ')', ':', '___EOS___']",
"index": 30
},
{
"content": " def record_event(self, options):\n record_event(self.current_org, self.current_user, options)",
"metadata": "root.BaseResource.record_event",
"header": "['class', 'BaseResource', '(', 'Resource', ')', ':', '___EOS___']",
"index": 34
},
{
"content": "def record_event(org, user, options):\n if isinstance(user, ApiUser):\n options.update({\n 'api_key': user.name,\n 'org_id': org.id\n })\n else:\n options.update({\n 'user_id': user.id,\n 'org_id': org.id\n })\n\n options.update({\n 'user_agent': request.user_agent.string,\n 'ip': request.remote_addr\n })\n\n if 'timestamp' not in options:\n options['timestamp'] = int(time.time())\n\n record_event_task.delay(options)",
"metadata": "root.record_event",
"header": "['module', '___EOS___']",
"index": 38
},
{
"content": "def require_fields(req, fields):\n for f in fields:\n if f not in req:\n abort(400)",
"metadata": "root.require_fields",
"header": "['module', '___EOS___']",
"index": 61
},
{
"content": "def get_object_or_404(fn, *args, **kwargs):\n try:\n return fn(*args, **kwargs)\n except DoesNotExist:\n abort(404)",
"metadata": "root.get_object_or_404",
"header": "['module', '___EOS___']",
"index": 67
},
{
"content": "def org_scoped_rule(rule):\n if settings.MULTI_ORG:\n return \"/<org_slug:org_slug>{}\".format(rule)\n\n return rule",
"metadata": "root.org_scoped_rule",
"header": "['module', '___EOS___']",
"index": 74
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"time_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"flask_",
"import_",
"request_",
",_",
"Blueprint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"fla",
"sk",
"\\u",
"restful",
"_",
"import_",
"Resource_",
",_",
"abort_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"fla",
"sk",
"\\u",
"login_",
"import_",
"current",
"\\u",
"user_",
",_",
"login",
"\\u",
"required_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"peewee",
"_",
"import_",
"Do",
"es",
"Not",
"Exist_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"reda",
"sh_",
"import_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"reda",
"sh_",
"._",
"tasks_",
"import_",
"record",
"\\u",
"event_",
"as_",
"record",
"\\u",
"event",
"\\u",
"task_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"reda",
"sh_",
"._",
"models_",
"import_",
"Ap",
"i",
"User_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"reda",
"sh_",
"._",
"authentication_",
"import_",
"current",
"\\u",
"org_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"routes_",
"=_",
"Blueprint_",
"(_",
"'",
"reda",
"sh",
"'_",
",_",
"\\u\\u",
"name\\u\\u_",
",_",
"template",
"\\u",
"folder_",
"=_",
"settings_",
"._",
"fix",
"\\u",
"asset",
"s",
"\\u",
"path_",
"(_",
"'",
"template",
"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\\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_",
"Base",
"Resource_",
"(_",
"Resource_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"decorators_",
"=_",
"[_",
"login",
"\\u",
"required_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Resource_",
"(_",
"Resource_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Base",
"Resource_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"user_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Resource_",
"(_",
"Resource_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"dispatch",
"\\u",
"request_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kwargs_",
"._",
"pop_",
"(_",
"'",
"org",
"\\u",
"slug",
"'_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"super_",
"(_",
"Base",
"Resource_",
",_",
"self_",
")_",
"._",
"dispatch",
"\\u",
"request_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Resource_",
"(_",
"Resource_",
")_",
":_",
"\\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_",
"current",
"\\u",
"user_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"current",
"\\u",
"user_",
"._",
"\\u",
"get",
"\\u",
"current",
"\\u",
"object_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Resource_",
"(_",
"Resource_",
")_",
":_",
"\\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_",
"current",
"\\u",
"org_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"current",
"\\u",
"org_",
"._",
"\\u",
"get",
"\\u",
"current",
"\\u",
"object_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Base",
"Resource_",
"(_",
"Resource_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"record",
"\\u",
"event_",
"(_",
"self_",
",_",
"options_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"record",
"\\u",
"event_",
"(_",
"self_",
"._",
"current",
"\\u",
"org_",
",_",
"self_",
"._",
"current",
"\\u",
"user_",
",_",
"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_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"record",
"\\u",
"event_",
"(_",
"org_",
",_",
"user_",
",_",
"options_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"user_",
",_",
"Ap",
"i",
"User_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"options_",
"._",
"update_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"api",
"\\u",
"key",
"'_",
":_",
"user_",
"._",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"org",
"\\u",
"id",
"'_",
":_",
"org_",
"._",
"id_",
"\\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 ",
" _",
"options_",
"._",
"update_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"user",
"\\u",
"id",
"'_",
":_",
"user_",
"._",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"org",
"\\u",
"id",
"'_",
":_",
"org_",
"._",
"id_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"options_",
"._",
"update_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"user",
"\\u",
"agent",
"'_",
":_",
"request_",
"._",
"user",
"\\u",
"agent_",
"._",
"string_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ip",
"'_",
":_",
"request_",
"._",
"remote",
"\\u",
"addr_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"'",
"timestamp",
"'_",
"not_",
"in_",
"options_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"options_",
"[_",
"'",
"timestamp",
"'_",
"]_",
"=_",
"int_",
"(_",
"time_",
"._",
"time_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"record",
"\\u",
"event",
"\\u",
"task_",
"._",
"delay_",
"(_",
"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_",
"require",
"\\u",
"fields_",
"(_",
"req_",
",_",
"fields_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"f_",
"in_",
"fields_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"f_",
"not_",
"in_",
"req_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"abort_",
"(_",
"400_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"object\\u",
"or",
"\\u",
"404_",
"(_",
"fn_",
",_",
"*_",
"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_",
"fn_",
"(_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Do",
"es",
"Not",
"Exist_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"abort_",
"(_",
"404_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"org",
"\\u",
"scoped",
"\\u",
"rule_",
"(_",
"rule_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"settings_",
"._",
"MULTI",
"\\u",
"ORG",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"/",
"<",
"org",
"\\u",
"slug",
":",
"org",
"\\u",
"slug",
">",
"{}\"_",
"._",
"format_",
"(_",
"rule_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"rule_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | StackStorm/st2/st2common/st2common/models/utils/action_alias_utils.py | [
{
"content": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# 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 re\n\nfrom st2common.exceptions.content import ParseException\n\n__all__ = [\n 'ActionAliasFormatParser',\n\n 'extract_parameters_for_action_alias_db',\n 'extract_parameters',\n]\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class ActionAliasFormatParser(object):\n\n",
"metadata": "root.ActionAliasFormatParser",
"header": "['module', '___EOS___']",
"index": 27
},
{
"content": " def __init__(self, alias_format=None, param_stream=None):\n self._format = alias_format or ''\n self._param_stream = param_stream or ''",
"metadata": "root.ActionAliasFormatParser.__init__",
"header": "['class', 'ActionAliasFormatParser', '(', 'object', ')', ':', '___EOS___']",
"index": 29
},
{
"content": " def get_extracted_param_value(self):\n \"\"\"\n Match command against the format string and extract paramters from the command string.\n\n :rtype: ``dict``\n \"\"\"\n result = {}\n\n param_stream = self._param_stream\n\n # As there's a lot of questions about using regular expressions,\n # I'll try to be thorough when documenting this code.\n\n # I'll split the whole convoluted regex into snippets to make it\n # a bit more readable (hopefully).\n snippets = dict()\n\n # Formats for keys and values: key is a non-spaced string,\n # value is anything in quotes or curly braces, or a single word.\n snippets['key'] = r'\\s*(\\S+?)\\s*'\n snippets['value'] = r'\"\"|\\'\\'|\"(.+?)\"|\\'(.+?)\\'|({.+?})|(\\S+)'\n\n # Extended value: also matches unquoted text (caution).\n snippets['ext_value'] = r'\"\"|\\'\\'|\"(.+?)\"|\\'(.+?)\\'|({.+?})|(.+?)'\n\n # Key-value pair:\n snippets['pairs'] = r'(?:^|\\s+){key}=({value})'.format(**snippets)\n\n # End of string: multiple space-separated key-value pairs:\n snippets['ending'] = r'.*?(({pairs}\\s*)*)$'.format(**snippets)\n\n # Default value in optional parameters:\n snippets['default'] = r'\\s*=\\s*(?:{ext_value})\\s*'.format(**snippets)\n\n # Optional parameter (has a default value):\n snippets['optional'] = '{{' + snippets['key'] + snippets['default'] + '}}'\n\n # Required parameter (no default value):\n snippets['required'] = '{{' + snippets['key'] + '}}'\n\n # 1. Matching the arbitrary key-value pairs at the end of the command\n # to support extra parameters (not specified in the format string),\n # and cutting them from the command string afterwards.\n ending_pairs = re.match(snippets['ending'], param_stream, re.DOTALL)\n has_ending_pairs = ending_pairs and ending_pairs.group(1)\n if has_ending_pairs:\n kv_pairs = re.findall(snippets['pairs'], ending_pairs.group(1), re.DOTALL)\n param_stream = param_stream.replace(ending_pairs.group(1), '')\n param_stream = \" %s \" % (param_stream)\n\n # 2. Matching optional parameters (with default values).\n optional = re.findall(snippets['optional'], self._format, re.DOTALL)\n\n # Transforming our format string into a regular expression,\n # substituting {{ ... }} with regex named groups, so that param_stream\n # matched against this expression yields a dict of params with values.\n param_match = r'\\1[\"\\']?(?P<\\2>(?:(?<=\\').+?(?=\\')|(?<=\").+?(?=\")|{.+?}|.+?))[\"\\']?'\n reg = re.sub(r'(\\s*)' + snippets['optional'], r'(?:' + param_match + r')?', self._format)\n reg = re.sub(r'(\\s*)' + snippets['required'], param_match, reg)\n reg = '^\\s*' + reg + r'\\s*$'\n\n # 3. Matching the command against our regex to get the param values\n matched_stream = re.match(reg, param_stream, re.DOTALL)\n\n if not matched_stream:\n # If no match is found we throw since this indicates provided user string (command)\n # didn't match the provided format string\n raise ParseException('Command \"%s\" doesn\\'t match format string \"%s\"' %\n (self._param_stream, self._format))\n\n # Compiling results from the steps 1-3.\n if matched_stream:\n result = matched_stream.groupdict()\n\n for param in optional:\n matched_value = result[param[0]] if matched_stream else None\n matched_result = matched_value or ''.join(param[1:])\n if matched_result is not None:\n result[param[0]] = matched_result\n\n if has_ending_pairs:\n for pair in kv_pairs:\n result[pair[0]] = ''.join(pair[2:])\n\n if self._format and not (self._param_stream.strip() or any(result.values())):\n raise ParseException('No value supplied and no default value found.')\n\n return result",
"metadata": "root.ActionAliasFormatParser.get_extracted_param_value",
"header": "['class', 'ActionAliasFormatParser', '(', 'object', ')', ':', '___EOS___']",
"index": 33
},
{
"content": "def extract_parameters_for_action_alias_db(action_alias_db, format_str, param_stream):\n \"\"\"\n Extract parameters from the user input based on the provided format string.\n\n Note: This function makes sure that the provided format string is indeed available in the\n action_alias_db.formats.\n \"\"\"\n formats = []\n formats = action_alias_db.get_format_strings()\n\n if format_str not in formats:\n raise ValueError('Format string \"%s\" is not available on the alias \"%s\"' %\n (format_str, action_alias_db.name))\n\n result = extract_parameters(format_str=format_str, param_stream=param_stream)\n return result",
"metadata": "root.extract_parameters_for_action_alias_db",
"header": "['module', '___EOS___']",
"index": 123
},
{
"content": "def extract_parameters(format_str, param_stream):\n parser = ActionAliasFormatParser(alias_format=format_str, param_stream=param_stream)\n return parser.get_extracted_param_value()",
"metadata": "root.extract_parameters",
"header": "['module', '___EOS___']",
"index": 141
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"License",
"d",
" ",
"to",
" ",
"the",
" ",
"Stack",
"Stor",
"m",
",",
" ",
"Inc",
" ",
"('",
"Stack",
"Stor",
"m",
"')",
" ",
"under",
" ",
"one",
" ",
"or",
" ",
"more_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"contributor",
" ",
"license",
" ",
"agreement",
"s",
".",
" ",
" ",
"See",
" ",
"the",
" ",
"NOTICE",
" ",
"file",
" ",
"distributed",
" ",
"with_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"this",
" ",
"work",
" ",
"for",
" ",
"addition",
"al",
" ",
"informati",
"on",
" ",
"regarding",
" ",
"copyr",
"ight",
" ",
"owner",
"ship",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"AS",
"F",
" ",
"license",
"s",
" ",
"this",
" ",
"file",
" ",
"to",
" ",
"You",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"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_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"st2",
"common_",
"._",
"exceptions_",
"._",
"content_",
"import_",
"Pars",
"e",
"Exception_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u",
"all\\u\\u_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Action",
"Ali",
"as",
"Format",
"Parser",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"extract",
"\\u",
"parameter",
"s",
"\\u",
"for",
"\\u",
"action",
"\\u",
"alias",
"\\u",
"db",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"extract",
"\\u",
"parameter",
"s",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Action",
"Ali",
"as",
"Format",
"Parser_",
"(_",
"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_",
"Action",
"Ali",
"as",
"Format",
"Parser_",
"(_",
"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_",
",_",
"alias",
"\\u",
"format_",
"=_",
"None_",
",_",
"param",
"\\u",
"stream_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"format_",
"=_",
"alias",
"\\u",
"format_",
"or_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"param",
"\\u",
"stream_",
"=_",
"param",
"\\u",
"stream_",
"or_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Action",
"Ali",
"as",
"Format",
"Parser_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"extracted",
"\\u",
"param",
"\\u",
"value_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Match",
" ",
"command",
" ",
"against",
" ",
"the",
" ",
"format",
" ",
"string",
" ",
"and",
" ",
"extract",
" ",
"param",
"ters",
" ",
"from",
" ",
"the",
" ",
"command",
" ",
"string",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"rty",
"pe",
":",
" ",
"``",
"dict",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"param",
"\\u",
"stream_",
"=_",
"self_",
"._",
"\\u",
"param",
"\\u",
"stream_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"As",
" ",
"there",
"'",
"s",
" ",
"a",
" ",
"lot",
" ",
"of",
" ",
"question",
"s",
" ",
"abo",
"ut",
" ",
"usi",
"ng",
" ",
"regular",
" ",
"express",
"ion",
"s",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"I",
"'",
"ll",
" ",
"try",
" ",
"to",
" ",
"be",
" ",
"thor",
"ou",
"gh",
" ",
"whe",
"n",
" ",
"document",
"ing",
" ",
"this",
" ",
"code",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"I",
"'",
"ll",
" ",
"split",
" ",
"the",
" ",
"whole",
" ",
"conv",
"olute",
"d",
" ",
"regex",
" ",
"int",
"o",
" ",
"snippet",
"s",
" ",
"to",
" ",
"make",
" ",
"it_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"bit",
" ",
"more",
" ",
"reada",
"ble",
" ",
"(",
"hop",
"efu",
"ll",
"y",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"=_",
"dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Format",
"s",
" ",
"for",
" ",
"keys",
" ",
"and",
" ",
"values",
":",
" ",
"key",
" ",
"is",
" ",
"a",
" ",
"non",
"-",
"space",
"d",
" ",
"string",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"value",
" ",
"is",
" ",
"anyt",
"hing",
" ",
"in",
" ",
"quote",
"s",
" ",
"or",
" ",
"curl",
"y",
" ",
"braces",
",",
" ",
"or",
" ",
"a",
" ",
"single",
" ",
"word",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"key",
"'_",
"]_",
"=_",
"r",
"'\\\\",
"s",
"*(",
"\\\\",
"S",
"+?)",
"\\\\",
"s",
"*'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"snippets_",
"[_",
"'",
"value",
"'_",
"]_",
"=_",
"r",
"'\"",
"\"|",
"\\\\'\\\\",
"'|",
"\"(.",
"+?)",
"\"|",
"\\\\'",
"(.+?)",
"\\\\'",
"|(",
"{.",
"+?",
"})",
"|(",
"\\\\",
"S",
"+)'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Extend",
"ed",
" ",
"value",
":",
" ",
"als",
"o",
" ",
"matche",
"s",
" ",
"unqu",
"ote",
"d",
" ",
"text",
" ",
"(",
"cau",
"tion",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"ext",
"\\u",
"value",
"'_",
"]_",
"=_",
"r",
"'\"",
"\"|",
"\\\\'\\\\",
"'|",
"\"(.",
"+?)",
"\"|",
"\\\\'",
"(.+?)",
"\\\\'",
"|(",
"{.",
"+?",
"})",
"|(",
".+?)",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Key",
"-",
"value",
" ",
"pair",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"pair",
"s",
"'_",
"]_",
"=_",
"r",
"'(?:",
"^",
"|\\\\",
"s",
"+)",
"{",
"key",
"}=",
"({",
"value",
"})'_",
"._",
"format_",
"(_",
"**_",
"snippets_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"End",
" ",
"of",
" ",
"string",
":",
" ",
"multiple",
" ",
"space",
"-",
"separate",
"d",
" ",
"key",
"-",
"value",
" ",
"pair",
"s",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"ending",
"'_",
"]_",
"=_",
"r",
"'.*",
"?(",
"({",
"pair",
"s",
"}\\\\",
"s",
"*)",
"*)",
"$'_",
"._",
"format_",
"(_",
"**_",
"snippets_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Default",
" ",
"value",
" ",
"in",
" ",
"option",
"al",
" ",
"parameter",
"s",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"default",
"'_",
"]_",
"=_",
"r",
"'\\\\",
"s",
"*=",
"\\\\",
"s",
"*(",
"?:",
"{",
"ext",
"\\u",
"value",
"})\\\\",
"s",
"*'_",
"._",
"format_",
"(_",
"**_",
"snippets_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Optio",
"nal",
" ",
"parameter",
" ",
"(",
"has",
" ",
"a",
" ",
"default",
" ",
"value",
"):",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"option",
"al",
"'_",
"]_",
"=_",
"'{{",
"'_",
"+_",
"snippets_",
"[_",
"'",
"key",
"'_",
"]_",
"+_",
"snippets_",
"[_",
"'",
"default",
"'_",
"]_",
"+_",
"'}",
"}'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Requ",
"ired",
" ",
"parameter",
" ",
"(",
"no",
" ",
"default",
" ",
"value",
"):",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"snippets_",
"[_",
"'",
"require",
"d",
"'_",
"]_",
"=_",
"'{{",
"'_",
"+_",
"snippets_",
"[_",
"'",
"key",
"'_",
"]_",
"+_",
"'}",
"}'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"1",
".",
" ",
"Match",
"ing",
" ",
"the",
" ",
"arbitra",
"ry",
" ",
"key",
"-",
"value",
" ",
"pair",
"s",
" ",
"at",
" ",
"the",
" ",
"end",
" ",
"of",
" ",
"the",
" ",
"command_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"to",
" ",
"support",
" ",
"extra",
" ",
"parameter",
"s",
" ",
"(",
"not",
" ",
"specified",
" ",
"in",
" ",
"the",
" ",
"format",
" ",
"string",
"),",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"and",
" ",
"cutt",
"ing",
" ",
"them",
" ",
"from",
" ",
"the",
" ",
"command",
" ",
"string",
" ",
"after",
"ward",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"ending",
"\\u",
"pairs_",
"=_",
"re_",
"._",
"match_",
"(_",
"snippets_",
"[_",
"'",
"ending",
"'_",
"]_",
",_",
"param",
"\\u",
"stream_",
",_",
"re_",
"._",
"DOTALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"has",
"\\u",
"ending",
"\\u",
"pairs_",
"=_",
"ending",
"\\u",
"pairs_",
"and_",
"ending",
"\\u",
"pairs_",
"._",
"group_",
"(_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"has",
"\\u",
"ending",
"\\u",
"pairs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kv",
"\\u",
"pairs_",
"=_",
"re_",
"._",
"findall_",
"(_",
"snippets_",
"[_",
"'",
"pair",
"s",
"'_",
"]_",
",_",
"ending",
"\\u",
"pairs_",
"._",
"group_",
"(_",
"1_",
")_",
",_",
"re_",
"._",
"DOTALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"param",
"\\u",
"stream_",
"=_",
"param",
"\\u",
"stream_",
"._",
"replace_",
"(_",
"ending",
"\\u",
"pairs_",
"._",
"group_",
"(_",
"1_",
")_",
",_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"param",
"\\u",
"stream_",
"=_",
"\"",
" ",
"%",
"s",
" ",
"\"_",
"%_",
"(_",
"param",
"\\u",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"2",
".",
" ",
"Match",
"ing",
" ",
"option",
"al",
" ",
"parameter",
"s",
" ",
"(",
"with",
" ",
"default",
" ",
"values",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"optional_",
"=_",
"re_",
"._",
"findall_",
"(_",
"snippets_",
"[_",
"'",
"option",
"al",
"'_",
"]_",
",_",
"self_",
"._",
"\\u",
"format_",
",_",
"re_",
"._",
"DOTALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Transform",
"ing",
" ",
"our",
" ",
"format",
" ",
"string",
" ",
"int",
"o",
" ",
"a",
" ",
"regular",
" ",
"express",
"ion",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"subst",
"itut",
"ing",
" ",
"{{",
" ",
"...",
" ",
"}}",
" ",
"with",
" ",
"regex",
" ",
"named",
" ",
"group",
"s",
",",
" ",
"so",
" ",
"tha",
"t",
" ",
"param",
"\\u",
"stream_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"matche",
"d",
" ",
"against",
" ",
"this",
" ",
"express",
"ion",
" ",
"yield",
"s",
" ",
"a",
" ",
"dict",
" ",
"of",
" ",
"params",
" ",
"with",
" ",
"values",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"param",
"\\u",
"match_",
"=_",
"r",
"'\\\\",
"1",
"[\"",
"\\\\']",
"?(?",
"P",
"<\\\\",
"2",
">(",
"?:",
"(?",
"<=",
"\\\\')",
".+?",
"(?=",
"\\\\')",
"|(?",
"<=",
"\")",
".+?",
"(?=",
"\")",
"|",
"{.",
"+?",
"}|",
".+?)",
")[",
"\"\\\\'",
"]?",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"reg_",
"=_",
"re_",
"._",
"sub_",
"(_",
"r",
"'(\\\\",
"s",
"*)'_",
"+_",
"snippets_",
"[_",
"'",
"option",
"al",
"'_",
"]_",
",_",
"r",
"'(?:",
"'_",
"+_",
"param",
"\\u",
"match_",
"+_",
"r",
"')",
"?'_",
",_",
"self_",
"._",
"\\u",
"format_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"reg_",
"=_",
"re_",
"._",
"sub_",
"(_",
"r",
"'(\\\\",
"s",
"*)'_",
"+_",
"snippets_",
"[_",
"'",
"require",
"d",
"'_",
"]_",
",_",
"param",
"\\u",
"match_",
",_",
"reg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"reg_",
"=_",
"'",
"^",
"\\\\",
"s",
"*'_",
"+_",
"reg_",
"+_",
"r",
"'\\\\",
"s",
"*$'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"3",
".",
" ",
"Match",
"ing",
" ",
"the",
" ",
"command",
" ",
"against",
" ",
"our",
" ",
"regex",
" ",
"to",
" ",
"get",
" ",
"the",
" ",
"param",
" ",
"values_",
"\\u\\u\\uNL\\u\\u\\u_",
"matche",
"d\\u",
"stream_",
"=_",
"re_",
"._",
"match_",
"(_",
"reg_",
",_",
"param",
"\\u",
"stream_",
",_",
"re_",
"._",
"DOTALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"matche",
"d\\u",
"stream_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"no",
" ",
"match",
" ",
"is",
" ",
"found",
" ",
"we",
" ",
"throw",
" ",
"sinc",
"e",
" ",
"this",
" ",
"indicat",
"es",
" ",
"provided",
" ",
"user",
" ",
"string",
" ",
"(",
"command",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"did",
"n",
"'",
"t",
" ",
"match",
" ",
"the",
" ",
"provided",
" ",
"format",
" ",
"string_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Pars",
"e",
"Exception_",
"(_",
"'",
"Command",
" ",
"\"%",
"s",
"\"",
" ",
"doe",
"sn",
"\\\\'",
"t",
" ",
"match",
" ",
"format",
" ",
"string",
" ",
"\"%",
"s",
"\"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"self_",
"._",
"\\u",
"param",
"\\u",
"stream_",
",_",
"self_",
"._",
"\\u",
"format_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Compil",
"ing",
" ",
"results",
" ",
"from",
" ",
"the",
" ",
"step",
"s",
" ",
"1",
"-",
"3._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"matche",
"d\\u",
"stream_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"=_",
"matche",
"d\\u",
"stream_",
"._",
"groupdict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"param_",
"in_",
"optional_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"matche",
"d\\u",
"value_",
"=_",
"result_",
"[_",
"param_",
"[_",
"0_",
"]_",
"]_",
"if_",
"matche",
"d\\u",
"stream_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"matche",
"d\\u",
"result_",
"=_",
"matche",
"d\\u",
"value_",
"or_",
"''_",
"._",
"join_",
"(_",
"param_",
"[_",
"1_",
":_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"matche",
"d\\u",
"result_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"[_",
"param_",
"[_",
"0_",
"]_",
"]_",
"=_",
"matche",
"d\\u",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"has",
"\\u",
"ending",
"\\u",
"pairs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"pair_",
"in_",
"kv",
"\\u",
"pairs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"[_",
"pair_",
"[_",
"0_",
"]_",
"]_",
"=_",
"''_",
"._",
"join_",
"(_",
"pair_",
"[_",
"2_",
":_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"format_",
"and_",
"not_",
"(_",
"self_",
"._",
"\\u",
"param",
"\\u",
"stream_",
"._",
"strip_",
"(_",
")_",
"or_",
"any_",
"(_",
"result_",
"._",
"values_",
"(_",
")_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Pars",
"e",
"Exception_",
"(_",
"'",
"No",
" ",
"value",
" ",
"supplie",
"d",
" ",
"and",
" ",
"no",
" ",
"default",
" ",
"value",
" ",
"found",
".'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"extract",
"\\u",
"parameter",
"s",
"\\u",
"for",
"\\u",
"action",
"\\u",
"alias",
"\\u",
"db_",
"(_",
"action",
"\\u",
"alias",
"\\u",
"db_",
",_",
"format\\u",
"str_",
",_",
"param",
"\\u",
"stream_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Extract",
" ",
"parameter",
"s",
" ",
"from",
" ",
"the",
" ",
"user",
" ",
"input",
" ",
"based",
" ",
"on",
" ",
"the",
" ",
"provided",
" ",
"format",
" ",
"string",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"e",
":",
" ",
"Thi",
"s",
" ",
"function",
" ",
"make",
"s",
" ",
"sure",
" ",
"tha",
"t",
" ",
"the",
" ",
"provided",
" ",
"format",
" ",
"string",
" ",
"is",
" ",
"inde",
"ed",
" ",
"avail",
"able",
" ",
"in",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"action",
"\\u",
"alias",
"\\u",
"db",
".",
"formats",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"formats_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"formats_",
"=_",
"action",
"\\u",
"alias",
"\\u",
"db_",
"._",
"get",
"\\u",
"format\\u",
"strings_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"format\\u",
"str_",
"not_",
"in_",
"formats_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"'",
"Format",
" ",
"string",
" ",
"\"%",
"s",
"\"",
" ",
"is",
" ",
"not",
" ",
"avail",
"able",
" ",
"on",
" ",
"the",
" ",
"alias",
" ",
"\"%",
"s",
"\"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"format\\u",
"str_",
",_",
"action",
"\\u",
"alias",
"\\u",
"db_",
"._",
"name_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"result_",
"=_",
"extract",
"\\u",
"parameters_",
"(_",
"format\\u",
"str_",
"=_",
"format\\u",
"str_",
",_",
"param",
"\\u",
"stream_",
"=_",
"param",
"\\u",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"extract",
"\\u",
"parameters_",
"(_",
"format\\u",
"str_",
",_",
"param",
"\\u",
"stream_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"parser_",
"=_",
"Action",
"Ali",
"as",
"Format",
"Parser_",
"(_",
"alias",
"\\u",
"format_",
"=_",
"format\\u",
"str_",
",_",
"param",
"\\u",
"stream_",
"=_",
"param",
"\\u",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"parser_",
"._",
"get",
"\\u",
"extracted",
"\\u",
"param",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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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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' | istresearch/scrapy-cluster/redis-monitor/plugins/kafka_base_monitor.py | [
{
"content": " def setup(self, settings):\n '''\n Setup the handler\n\n @param settings: The loaded settings file\n '''\n @MethodTimer.timeout(settings['KAFKA_CONN_TIMEOUT'], False)\n def _hidden_setup():\n try:\n # set up kafka\n self.kafka_conn = KafkaClient(settings['KAFKA_HOSTS'])\n self.producer = SimpleProducer(self.kafka_conn)\n self.topic_prefix = settings['KAFKA_TOPIC_PREFIX']\n except KafkaUnavailableError as ex:\n message = \"An exception '{0}' occured while setting up kafka. \"\\\n \"Arguments:\\n{1!r}\".format(type(ex).__name__, ex.args)\n self.logger.error(message)\n return False\n return True\n ret_val = _hidden_setup()\n self.use_appid_topics = settings['KAFKA_APPID_TOPICS']\n\n if ret_val:\n self.logger.debug(\"Successfully connected to Kafka in {name}\"\n .format(name=self.__class__.__name__))\n else:\n self.logger.error(\"Failed to set up Kafka Connection in {name} \"\n \"within timeout\".format(name=self.__class__.__name__))\n # this is essential to running the redis monitor\n sys.exit(1)",
"metadata": "root.KafkaBaseMonitor.setup",
"header": "['class', 'KafkaBaseMonitor', '(', 'BaseMonitor', ')', ':', '___EOS___']",
"index": 14
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Ka",
"fk",
"a",
"Base",
"Monitor_",
"(_",
"Base",
"Monitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"setup_",
"(_",
"self_",
",_",
"settings_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Set",
"up",
" ",
"the",
" ",
"handler",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"settings",
":",
" ",
"The",
" ",
"load",
"ed",
" ",
"settings",
" ",
"file",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"Meth",
"od",
"Timer_",
"._",
"timeout_",
"(_",
"settings_",
"[_",
"'",
"KA",
"FK",
"A",
"\\u",
"CONN",
"\\u",
"TIME",
"OUT",
"'_",
"]_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u",
"hidden",
"\\u",
"setup_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"set",
" ",
"up",
" ",
"kaf",
"ka_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"kaf",
"ka",
"\\u",
"conn_",
"=_",
"Ka",
"fk",
"a",
"Client_",
"(_",
"settings_",
"[_",
"'",
"KA",
"FK",
"A",
"\\u",
"HOST",
"S",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"producer_",
"=_",
"Simple",
"Producer_",
"(_",
"self_",
"._",
"kaf",
"ka",
"\\u",
"conn_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"topic",
"\\u",
"prefix_",
"=_",
"settings_",
"[_",
"'",
"KA",
"FK",
"A",
"\\u",
"TOPIC",
"\\u",
"PREF",
"IX",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Ka",
"fk",
"a",
"Una",
"vail",
"able",
"Error_",
"as_",
"ex_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"\"",
"An",
" ",
"exception",
" ",
"'{",
"0",
"}'",
" ",
"occure",
"d",
" ",
"whi",
"le",
" ",
"setti",
"ng",
" ",
"up",
" ",
"kaf",
"ka",
".",
" ",
"\"_",
"\"",
"Arg",
"ument",
"s",
":\\\\",
"n",
"{",
"1",
"!",
"r",
"}\"_",
"._",
"format_",
"(_",
"type_",
"(_",
"ex_",
")_",
"._",
"\\u\\u",
"name\\u\\u_",
",_",
"ex_",
"._",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"logger_",
"._",
"error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"ret",
"\\u",
"val_",
"=_",
"\\u",
"hidden",
"\\u",
"setup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"use",
"\\u",
"appid",
"\\u",
"topics_",
"=_",
"settings_",
"[_",
"'",
"KA",
"FK",
"A",
"\\u",
"APP",
"ID",
"\\u",
"TOPIC",
"S",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"ret",
"\\u",
"val_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"logger_",
"._",
"debug_",
"(_",
"\"",
"Success",
"full",
"y",
" ",
"connect",
"ed",
" ",
"to",
" ",
"Ka",
"fk",
"a",
" ",
"in",
" ",
"{",
"name",
"}\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"._",
"format_",
"(_",
"name_",
"=_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
"._",
"\\u\\u",
"name\\u\\u_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"logger_",
"._",
"error_",
"(_",
"\"",
"Fail",
"ed",
" ",
"to",
" ",
"set",
" ",
"up",
" ",
"Ka",
"fk",
"a",
" ",
"Connect",
"ion",
" ",
"in",
" ",
"{",
"name",
"}",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"within",
" ",
"timeo",
"ut",
"\"_",
"._",
"format_",
"(_",
"name_",
"=_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
"._",
"\\u\\u",
"name\\u\\u_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"this",
" ",
"is",
" ",
"essential",
" ",
"to",
" ",
"runn",
"ing",
" ",
"the",
" ",
"redis",
" ",
"monitor_",
"\\u\\u\\uNL\\u\\u\\u_",
"sys_",
"._",
"exit_",
"(_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
First parameter of a method is not named 'self' | coleifer/django-generic-aggregation/generic_aggregation_tests/tests.py | [
{
"content": " def test_filter(self):\n ratings = self.generic_filter(Rating.objects.all(), Food.objects.filter(name='orange'))\n self.assertEqual(len(ratings), 3)\n\n for obj in ratings:\n self.assertEqual(obj.content_object.name, 'orange')",
"metadata": "root.SimpleTest.test_filter",
"header": "['class', 'SimpleTest', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 188
}
] | [] | [] | 0 | true | [
"[CLS]_",
"First_",
"parameter_",
"of_",
"a_",
"method_",
"is_",
"not_",
"named_",
"'",
"self",
"'_",
"[SEP]_",
"class_",
"Simple",
"Test_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"filter_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ratings_",
"=_",
"self_",
"._",
"gener",
"ic",
"\\u",
"filter_",
"(_",
"Rating_",
"._",
"objects_",
"._",
"all_",
"(_",
")_",
",_",
"Foo",
"d_",
"._",
"objects_",
"._",
"filter_",
"(_",
"name_",
"=_",
"'",
"orange",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"ratings_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"obj_",
"in_",
"ratings_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Equal_",
"(_",
"obj_",
"._",
"content",
"\\u",
"object_",
"._",
"name_",
",_",
"'",
"orange",
"'_",
")_",
"\\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
] |
Unused local variable | ofri/Open-Knesset/agendas/management/commands/send_email_to_editors.py | [
{
"content": "class Command(NoArgsCommand):\n\n from_email = getattr(settings, 'DEFAULT_FROM_EMAIL', '[email protected]')\n prefix = 'https://oknesset.org'\n lang = getattr(settings, 'LANGUAGE_CODE', 'he')\n",
"metadata": "root.Command",
"header": "['module', '___EOS___']",
"index": 9
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Command_",
"(_",
"No",
"Arg",
"s",
"Command_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from",
"\\u",
"email_",
"=_",
"getattr_",
"(_",
"settings_",
",_",
"'",
"DEF",
"AUL",
"T",
"\\u",
"FROM",
"\\u",
"EMA",
"IL",
"'_",
",_",
"'",
"email",
"@",
"example",
".",
"com",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"prefix_",
"=_",
"'",
"https",
"://",
"ok",
"ness",
"et",
".",
"org",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lang_",
"=_",
"getattr_",
"(_",
"settings_",
",_",
"'",
"LANGUAGE",
"\\u",
"CODE",
"'_",
",_",
"'",
"he",
"'_",
")_",
"\\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
] |
Unused import | kylewm/redwind/tests/views_test.py | [
{
"content": "import re\nimport pytest\nimport urllib\nimport datetime\nimport mf2py\n\nfrom redwind.models import User, Credential\nfrom testutil import FakeResponse, assert_urls_match\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def test_empty_db(client):\n \"\"\"Make sure there are no articles when the database is empty\"\"\"\n rv = client.get('/')\n assert '<article' not in rv.get_data(as_text=True)",
"metadata": "root.test_empty_db",
"header": "['module', '___EOS___']",
"index": 10
},
{
"content": "def test_create_post(client, auth, mocker):\n \"\"\"Create a simple post as the current user\"\"\"\n mocker.patch('requests.get').return_value = FakeResponse()\n mocker.patch('redwind.tasks.create_queue')\n rv = client.post('/save_new', data={\n 'post_type': 'note',\n 'content': 'This is a test note',\n 'action': 'publish_quietly',\n })\n assert 302 == rv.status_code\n assert re.match('.*/\\d+/\\d+/this-is-a-test-note$', rv.location)\n # follow the redirect\n rv = client.get(rv.location)\n assert 'This is a test note' in rv.get_data(as_text=True)",
"metadata": "root.test_create_post",
"header": "['module', '___EOS___']",
"index": 16
},
{
"content": "@pytest.fixture\ndef silly_posts(client, auth, mocker):\n mocker.patch('requests.get').return_value = FakeResponse()\n mocker.patch('redwind.tasks.create_queue')\n\n data = [\n {\n 'post_type': 'note',\n 'content': 'Probably a <i>dumb</i> joke',\n 'tags': ['dumbjoke'],\n },\n {\n 'post_type': 'article',\n 'title': 'First interesting article',\n 'content': 'Something really thoughtful and interesting',\n 'tags': ['thoughtful', 'interesting'],\n 'syndication': 'https://twitter.com/kylewm2/status/123456\\nhttps://facebook.com/kyle.mahan/status/123456',\n },\n {\n 'post_type': 'reply',\n 'in_reply_to': 'http://foo.com/bar',\n 'content': 'This foo article on bar is really great',\n 'tags': ['good'],\n },\n {\n 'post_type': 'like',\n 'like_of': 'https://mal.colm/reynolds',\n 'tags': ['firefly', 'interesting'],\n 'hidden': True,\n },\n {\n 'post_type': 'like',\n 'like_of': 'https://buf.fy/summers/',\n 'tags': ['buffy'],\n 'hidden': True,\n },\n {\n 'post_type': 'article',\n 'title': 'Second interesting article',\n 'content': 'With lots of interesting and good content',\n 'tags': ['interesting', 'good'],\n },\n ]\n\n for datum in data:\n datum['action'] = 'publish_quietly'\n rv = client.post('/save_new', data=datum)\n assert 302 == rv.status_code",
"metadata": "root.silly_posts",
"header": "['module', '___EOS___']",
"index": 32
},
{
"content": "def test_tagged_posts(client, silly_posts):\n text = client.get('/tags/interesting/').get_data(as_text=True)\n assert 'First interesting article' in text\n assert 'Second interesting article' in text",
"metadata": "root.test_tagged_posts",
"header": "['module', '___EOS___']",
"index": 82
},
{
"content": "def test_posts_by_type(client, silly_posts):\n text = client.get('/likes/').get_data(as_text=True)\n p = mf2py.parse(doc=text)\n feed = p['items'][0]['children']\n\n for item, expected in zip(feed, [\n 'https://buf.fy/summers/',\n 'https://mal.colm/reynolds',\n ]):\n assert item['properties']['like-of'][0]['properties']['url'][0] == expected",
"metadata": "root.test_posts_by_type",
"header": "['module', '___EOS___']",
"index": 88
},
{
"content": "def test_posts_everything(client, silly_posts):\n text = client.get('/everything/').get_data(as_text=True)\n assert 'https://mal.colm/reynolds' in text\n assert 'https://buf.fy/summers' in text",
"metadata": "root.test_posts_everything",
"header": "['module', '___EOS___']",
"index": 100
},
{
"content": "def test_post_permalink(client, silly_posts):\n today = datetime.date.today()\n rv = client.get('/{}/{:02d}/{}'.format(today.year, today.month,\n 'first-interesting-article'))\n assert 200 == rv.status_code\n content = rv.get_data(as_text=True)\n assert 'fa-twitter' in content\n assert 'Something really thoughtful and interesting' in content\n assert re.search('<a[^>]*class=\"p-category\"[^>]*>thoughtful', content)",
"metadata": "root.test_post_permalink",
"header": "['module', '___EOS___']",
"index": 106
},
{
"content": "def test_posts_atom(client, silly_posts):\n # check the main feed\n rv = client.get('/', query_string={'feed': 'atom'})\n assert 200 == rv.status_code\n assert rv.content_type.startswith('application/atom+xml')\n content = rv.get_data(as_text=True)\n assert 'Probably a <i>dumb</i> joke' in content\n assert 'First interesting article' in content\n\n # check the everything feed\n rv = client.get('/everything/', query_string={'feed': 'atom'})\n assert 200 == rv.status_code\n assert rv.content_type.startswith('application/atom+xml')\n content = rv.get_data(as_text=True)\n assert 'mal.colm/reynolds' in content # a hidden post\n assert 'First interesting article' in content\n\n # check the notes feed\n rv = client.get('/notes/', query_string={'feed': 'atom'})\n assert 200 == rv.status_code\n assert rv.content_type.startswith('application/atom+xml')\n content = rv.get_data(as_text=True)\n assert 'Probably a <i>dumb</i> joke' in content\n assert 'First interesting article' not in content",
"metadata": "root.test_posts_atom",
"header": "['module', '___EOS___']",
"index": 117
},
{
"content": "def test_tag_cloud(client, silly_posts):\n # check the tag cloud\n rv = client.get('/tags/')\n assert 200 == rv.status_code\n content = rv.get_data(as_text=True)\n print(content)\n assert re.search('<a[^>]*title=\"2\"[^>]*>#good', content, re.DOTALL)\n assert re.search('<a[^>]*title=\"3\"[^>]*>#interesting', content, re.DOTALL)",
"metadata": "root.test_tag_cloud",
"header": "['module', '___EOS___']",
"index": 143
},
{
"content": "def test_atom_redirects(client):\n rv = client.get('/all.atom')\n assert 302 == rv.status_code\n assert rv.location.endswith('/everything/?feed=atom')\n rv = client.get('/updates.atom')\n assert 302 == rv.status_code\n assert rv.location.endswith('/?feed=atom')\n rv = client.get('/articles.atom')\n assert 302 == rv.status_code\n assert rv.location.endswith('/articles/?feed=atom')",
"metadata": "root.test_atom_redirects",
"header": "['module', '___EOS___']",
"index": 153
},
{
"content": "def test_upload_image(client, mocker):\n today = datetime.date.today()\n mocker.patch('requests.get')\n mocker.patch('redwind.tasks.create_queue')\n\n rv = client.post('/save_new', data={\n 'photo': (open('tests/image.jpg', 'rb'), 'image.jpg', 'image/jpeg'),\n 'post_type': 'photo',\n 'content': 'High score',\n 'action': 'publish_quietly',\n })\n\n assert rv.status_code == 302\n assert (rv.location == 'http://example.com/{}/{:02d}/high-score'.format(\n today.year, today.month))\n permalink = rv.location\n\n rv = client.get(permalink)\n assert rv.status_code == 200\n content = rv.get_data(as_text=True)\n\n assert 'High score' in content\n assert '<img' in content\n\n rv = client.get(permalink + '/files/image.jpg')\n assert rv.status_code == 200\n # Removed depndency on PIL\n # im = Image.open(io.BytesIO(rv.data))\n # assert im.size[0] > 300 or im.size[1] > 300\n\n # FIXME resizing depends on an external service now;\n # we can only test that the proper url is constructed\n # rv = client.get(permalink + '/files/image.jpg',\n # query_string={'size': 'small'})\n # assert rv.status_code == 200\n # im = Image.open(io.BytesIO(rv.data))\n # assert im.size[0] <= 300 and im.size[1] <= 300",
"metadata": "root.test_upload_image",
"header": "['module', '___EOS___']",
"index": 165
},
{
"content": "def test_indieauth_login(app, client, mocker):\n mock_get = mocker.patch('requests.get')\n mock_post = mocker.patch('requests.post')\n mock_login = mocker.patch('flask.ext.login.login_user')\n mock_logout = mocker.patch('flask.ext.login.logout_user')\n\n user_html = '<html><a class=\"h-card\" href=\"/\" rel=\"me\">Example User</a></html>'\n mock_get.return_value = FakeResponse(user_html)\n rv = client.get('/login?me=http://example.com')\n\n assert rv.status_code == 302\n assert_urls_match(\n rv.location,\n 'https://indieauth.com/auth?' + urllib.parse.urlencode({\n 'state': None,\n 'me': 'http://example.com',\n 'client_id': 'http://example.com',\n 'redirect_uri': 'http://localhost/login_callback',\n }))\n mock_get.assert_called_once_with('http://example.com')\n mock_get.reset_mock()\n\n mock_post.return_value = FakeResponse(urllib.parse.urlencode({\n 'me': 'http://example.com',\n }))\n\n rv = client.get('/login_callback?' + urllib.parse.urlencode({\n 'code': 'abc123'\n }))\n assert rv.status_code == 302\n assert rv.location == 'http://localhost/'\n mock_post.assert_called_once_with('https://indieauth.com/auth', data={\n 'code': 'abc123',\n 'client_id': 'http://example.com',\n 'redirect_uri': 'http://localhost/login_callback',\n 'state': None,\n })\n\n mock_get.assert_called_once_with('http://example.com', headers={'User-Agent': mf2py.Parser.useragent})\n mock_login.assert_called_once_with(\n User(id=1, name='Example User'), remember=True)\n\n cred = Credential.query.filter_by(type='indieauth',\n value='http://example.com').first()\n assert cred\n assert cred.user\n assert cred.user.name == 'Example User'\n\n client.get('/logout')\n mock_logout.assert_called_once_with()",
"metadata": "root.test_indieauth_login",
"header": "['module', '___EOS___']",
"index": 204
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"pytest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"urllib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"datetime_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"mf",
"2py",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"red",
"wind_",
"._",
"models_",
"import_",
"User_",
",_",
"Cred",
"ential_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"testu",
"til_",
"import_",
"Fake",
"Response_",
",_",
"assert",
"\\u",
"urls",
"\\u",
"match_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"test\\u",
"empty",
"\\u",
"db_",
"(_",
"client_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Make",
" ",
"sure",
" ",
"there",
" ",
"are",
" ",
"no",
" ",
"article",
"s",
" ",
"whe",
"n",
" ",
"the",
" ",
"databa",
"se",
" ",
"is",
" ",
"empty",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'<",
"article",
"'_",
"not_",
"in_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"post_",
"(_",
"client_",
",_",
"auth_",
",_",
"mocker_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Creat",
"e",
" ",
"a",
" ",
"simple",
" ",
"post",
" ",
"as",
" ",
"the",
" ",
"current",
" ",
"user",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"request",
"s",
".",
"get",
"'_",
")_",
"._",
"return",
"\\u",
"value_",
"=_",
"Fake",
"Response_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"red",
"wind",
".",
"task",
"s",
".",
"create",
"\\u",
"queue",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"post_",
"(_",
"'/",
"save",
"\\u",
"new",
"'_",
",_",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"note",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"content",
"'_",
":_",
"'",
"Thi",
"s",
" ",
"is",
" ",
"a",
" ",
"test",
" ",
"note",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"action",
"'_",
":_",
"'",
"publi",
"sh",
"\\u",
"quie",
"tl",
"y",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"302_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"re_",
"._",
"match_",
"(_",
"'.*",
"/\\\\",
"d",
"+/",
"\\\\",
"d",
"+/",
"this",
"-",
"is",
"-",
"a",
"-",
"test",
"-",
"note",
"$'_",
",_",
"rv_",
"._",
"location_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"follow",
" ",
"the",
" ",
"redirect_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"rv_",
"._",
"location_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Thi",
"s",
" ",
"is",
" ",
"a",
" ",
"test",
" ",
"note",
"'_",
"in_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"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_",
"@_",
"pytest_",
"._",
"fixture_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"sil",
"ly",
"\\u",
"posts_",
"(_",
"client_",
",_",
"auth_",
",_",
"mocker_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mocker_",
"._",
"patch_",
"(_",
"'",
"request",
"s",
".",
"get",
"'_",
")_",
"._",
"return",
"\\u",
"value_",
"=_",
"Fake",
"Response_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"red",
"wind",
".",
"task",
"s",
".",
"create",
"\\u",
"queue",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"note",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"content",
"'_",
":_",
"'",
"Prob",
"abl",
"y",
" ",
"a",
" ",
"<",
"i",
">",
"dumb",
"</",
"i",
">",
" ",
"joke",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tags",
"'_",
":_",
"[_",
"'",
"dumb",
"joke",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"article",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"title",
"'_",
":_",
"'",
"Fi",
"rst",
" ",
"interesting",
" ",
"article",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"content",
"'_",
":_",
"'",
"Some",
"thing",
" ",
"reall",
"y",
" ",
"thought",
"ful",
" ",
"and",
" ",
"interesting",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tags",
"'_",
":_",
"[_",
"'",
"thought",
"ful",
"'_",
",_",
"'",
"interesting",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"syn",
"dicat",
"ion",
"'_",
":_",
"'",
"https",
"://",
"twit",
"ter",
".",
"com",
"/",
"ky",
"le",
"wm",
"2",
"/",
"status",
"/",
"12345",
"6",
"\\\\",
"nh",
"ttp",
"s",
"://",
"facebook",
".",
"com",
"/",
"ky",
"le",
".",
"mah",
"an",
"/",
"status",
"/",
"12345",
"6",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"repl",
"y",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"in",
"\\u",
"repl",
"y",
"\\u",
"to",
"'_",
":_",
"'",
"http",
"://",
"foo",
".",
"com",
"/",
"bar",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"content",
"'_",
":_",
"'",
"Thi",
"s",
" ",
"foo",
" ",
"article",
" ",
"on",
" ",
"bar",
" ",
"is",
" ",
"reall",
"y",
" ",
"great",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tags",
"'_",
":_",
"[_",
"'",
"good",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"like",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"like",
"\\u",
"of",
"'_",
":_",
"'",
"https",
"://",
"mal",
".",
"col",
"m",
"/",
"rey",
"nol",
"ds",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tags",
"'_",
":_",
"[_",
"'",
"fire",
"fly",
"'_",
",_",
"'",
"interesting",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"hidden",
"'_",
":_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"like",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"like",
"\\u",
"of",
"'_",
":_",
"'",
"https",
"://",
"buf",
".",
"fy",
"/",
"summer",
"s",
"/'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tags",
"'_",
":_",
"[_",
"'",
"buff",
"y",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"hidden",
"'_",
":_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"article",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"title",
"'_",
":_",
"'",
"Second",
" ",
"interesting",
" ",
"article",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"content",
"'_",
":_",
"'",
"With",
" ",
"lots",
" ",
"of",
" ",
"interesting",
" ",
"and",
" ",
"good",
" ",
"content",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tags",
"'_",
":_",
"[_",
"'",
"interesting",
"'_",
",_",
"'",
"good",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"datum_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"datum_",
"[_",
"'",
"action",
"'_",
"]_",
"=_",
"'",
"publi",
"sh",
"\\u",
"quie",
"tl",
"y",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"post_",
"(_",
"'/",
"save",
"\\u",
"new",
"'_",
",_",
"data_",
"=_",
"datum_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"302_",
"==_",
"rv_",
"._",
"status",
"\\u",
"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_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"tagg",
"ed",
"\\u",
"posts_",
"(_",
"client_",
",_",
"sil",
"ly",
"\\u",
"posts_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"text_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"tags",
"/",
"interesting",
"/'_",
")_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Fi",
"rst",
" ",
"interesting",
" ",
"article",
"'_",
"in_",
"text_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Second",
" ",
"interesting",
" ",
"article",
"'_",
"in_",
"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_",
"test\\u",
"posts",
"\\u",
"by",
"\\u",
"type_",
"(_",
"client_",
",_",
"sil",
"ly",
"\\u",
"posts_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"text_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"likes",
"/'_",
")_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"p_",
"=_",
"mf",
"2py",
"_",
"._",
"parse_",
"(_",
"doc_",
"=_",
"text_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"feed_",
"=_",
"p_",
"[_",
"'",
"items",
"'_",
"]_",
"[_",
"0_",
"]_",
"[_",
"'",
"child",
"ren",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"item_",
",_",
"expected_",
"in_",
"zip_",
"(_",
"feed_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"https",
"://",
"buf",
".",
"fy",
"/",
"summer",
"s",
"/'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"https",
"://",
"mal",
".",
"col",
"m",
"/",
"rey",
"nol",
"ds",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert_",
"item_",
"[_",
"'",
"proper",
"ties",
"'_",
"]_",
"[_",
"'",
"like",
"-",
"of",
"'_",
"]_",
"[_",
"0_",
"]_",
"[_",
"'",
"proper",
"ties",
"'_",
"]_",
"[_",
"'",
"url",
"'_",
"]_",
"[_",
"0_",
"]_",
"==_",
"expected_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"posts",
"\\u",
"every",
"thing_",
"(_",
"client_",
",_",
"sil",
"ly",
"\\u",
"posts_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"text_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"every",
"thing",
"/'_",
")_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"https",
"://",
"mal",
".",
"col",
"m",
"/",
"rey",
"nol",
"ds",
"'_",
"in_",
"text_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"https",
"://",
"buf",
".",
"fy",
"/",
"summer",
"s",
"'_",
"in_",
"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_",
"test\\u",
"post",
"\\u",
"permalink",
"_",
"(_",
"client_",
",_",
"sil",
"ly",
"\\u",
"posts_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"today_",
"=_",
"datetime_",
"._",
"date_",
"._",
"today_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/{",
"}/",
"{:",
"02",
"d",
"}/",
"{}'_",
"._",
"format_",
"(_",
"today_",
"._",
"year_",
",_",
"today_",
"._",
"month_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"first",
"-",
"interesting",
"-",
"article",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"200_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"content_",
"=_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"fa",
"-",
"twit",
"ter",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Some",
"thing",
" ",
"reall",
"y",
" ",
"thought",
"ful",
" ",
"and",
" ",
"interesting",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"re_",
"._",
"search_",
"(_",
"'<",
"a",
"[",
"^",
">]",
"*",
"class",
"=\"",
"p",
"-",
"category",
"\"[",
"^",
">]",
"*>",
"thought",
"ful",
"'_",
",_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"posts",
"\\u",
"atom_",
"(_",
"client_",
",_",
"sil",
"ly",
"\\u",
"posts_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"check",
" ",
"the",
" ",
"main",
" ",
"feed_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/'_",
",_",
"query",
"\\u",
"string_",
"=_",
"{_",
"'",
"feed",
"'_",
":_",
"'",
"atom",
"'_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"200_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"content",
"\\u",
"type_",
"._",
"startswith_",
"(_",
"'",
"applica",
"tion",
"/",
"atom",
"+",
"xml",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"content_",
"=_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Prob",
"abl",
"y",
" ",
"a",
" ",
"&",
"lt",
";",
"i",
"&",
"gt",
";",
"dumb",
"&",
"lt",
";",
"/",
"i",
"&",
"gt",
";",
" ",
"joke",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Fi",
"rst",
" ",
"interesting",
" ",
"article",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"check",
" ",
"the",
" ",
"every",
"thing",
" ",
"feed_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"every",
"thing",
"/'_",
",_",
"query",
"\\u",
"string_",
"=_",
"{_",
"'",
"feed",
"'_",
":_",
"'",
"atom",
"'_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"200_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"content",
"\\u",
"type_",
"._",
"startswith_",
"(_",
"'",
"applica",
"tion",
"/",
"atom",
"+",
"xml",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"content_",
"=_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"mal",
".",
"col",
"m",
"/",
"rey",
"nol",
"ds",
"'_",
"in_",
"content_",
"#",
" ",
"a",
" ",
"hidden",
" ",
"post_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Fi",
"rst",
" ",
"interesting",
" ",
"article",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"check",
" ",
"the",
" ",
"note",
"s",
" ",
"feed_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"note",
"s",
"/'_",
",_",
"query",
"\\u",
"string_",
"=_",
"{_",
"'",
"feed",
"'_",
":_",
"'",
"atom",
"'_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"200_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"content",
"\\u",
"type_",
"._",
"startswith_",
"(_",
"'",
"applica",
"tion",
"/",
"atom",
"+",
"xml",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"content_",
"=_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Prob",
"abl",
"y",
" ",
"a",
" ",
"&",
"lt",
";",
"i",
"&",
"gt",
";",
"dumb",
"&",
"lt",
";",
"/",
"i",
"&",
"gt",
";",
" ",
"joke",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'",
"Fi",
"rst",
" ",
"interesting",
" ",
"article",
"'_",
"not_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"tag",
"\\u",
"cloud_",
"(_",
"client_",
",_",
"sil",
"ly",
"\\u",
"posts_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"check",
" ",
"the",
" ",
"tag",
" ",
"cloud_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"tags",
"/'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"200_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"content_",
"=_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"print_",
"(_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"re_",
"._",
"search_",
"(_",
"'<",
"a",
"[",
"^",
">]",
"*",
"title",
"=\"",
"2",
"\"[",
"^",
">]",
"*>",
"#",
"good",
"'_",
",_",
"content_",
",_",
"re_",
"._",
"DOTALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"re_",
"._",
"search_",
"(_",
"'<",
"a",
"[",
"^",
">]",
"*",
"title",
"=\"",
"3",
"\"[",
"^",
">]",
"*>",
"#",
"interesting",
"'_",
",_",
"content_",
",_",
"re_",
"._",
"DOTALL_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"atom",
"\\u",
"redirects_",
"(_",
"client_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"all",
".",
"atom",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"302_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"location_",
"._",
"endswith_",
"(_",
"'/",
"every",
"thing",
"/?",
"feed",
"=",
"atom",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"update",
"s",
".",
"atom",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"302_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"location_",
"._",
"endswith_",
"(_",
"'/",
"?",
"feed",
"=",
"atom",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"article",
"s",
".",
"atom",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"302_",
"==_",
"rv_",
"._",
"status",
"\\u",
"code_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"location_",
"._",
"endswith_",
"(_",
"'/",
"article",
"s",
"/?",
"feed",
"=",
"atom",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"upload",
"\\u",
"image_",
"(_",
"client_",
",_",
"mocker_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"today_",
"=_",
"datetime_",
"._",
"date_",
"._",
"today_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"request",
"s",
".",
"get",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"red",
"wind",
".",
"task",
"s",
".",
"create",
"\\u",
"queue",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"post_",
"(_",
"'/",
"save",
"\\u",
"new",
"'_",
",_",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"photo",
"'_",
":_",
"(_",
"open_",
"(_",
"'",
"tests",
"/",
"image",
".",
"jp",
"g",
"'_",
",_",
"'",
"rb",
"'_",
")_",
",_",
"'",
"image",
".",
"jp",
"g",
"'_",
",_",
"'",
"image",
"/",
"jpeg",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"post",
"\\u",
"type",
"'_",
":_",
"'",
"photo",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"content",
"'_",
":_",
"'",
"Hig",
"h",
" ",
"score",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"action",
"'_",
":_",
"'",
"publi",
"sh",
"\\u",
"quie",
"tl",
"y",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"rv_",
"._",
"status",
"\\u",
"code_",
"==_",
"302_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"(_",
"rv_",
"._",
"location_",
"==_",
"'",
"http",
"://",
"example",
".",
"com",
"/{}/",
"{:",
"02",
"d",
"}/",
"high",
"-",
"score",
"'_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"today_",
"._",
"year_",
",_",
"today_",
"._",
"month_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"permalink",
"_",
"=_",
"rv_",
"._",
"location_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"permalink",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"status",
"\\u",
"code_",
"==_",
"200_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"content_",
"=_",
"rv_",
"._",
"get",
"\\u",
"data_",
"(_",
"as",
"\\u",
"text_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"'",
"Hig",
"h",
" ",
"score",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"'<",
"img",
"'_",
"in_",
"content_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"permalink",
"_",
"+_",
"'/",
"files",
"/",
"image",
".",
"jp",
"g",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"status",
"\\u",
"code_",
"==_",
"200_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Remove",
"d",
" ",
"dep",
"nden",
"cy",
" ",
"on",
" ",
"PIL_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"im",
" ",
"=",
" ",
"Image",
".",
"open",
"(",
"io",
".",
"Byte",
"s",
"IO",
"(",
"rv",
".",
"data",
"))",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"assert",
" ",
"im",
".",
"size",
"[",
"0",
"]",
" ",
">",
" ",
"300",
" ",
"or",
" ",
"im",
".",
"size",
"[",
"1",
"]",
" ",
">",
" ",
"300_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"FIX",
"ME",
" ",
"resiz",
"ing",
" ",
"depend",
"s",
" ",
"on",
" ",
"an",
" ",
"external",
" ",
"service",
" ",
"now",
";_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"we",
" ",
"can",
" ",
"only",
" ",
"test",
" ",
"tha",
"t",
" ",
"the",
" ",
"proper",
" ",
"url",
" ",
"is",
" ",
"construct",
"ed_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"rv",
" ",
"=",
" ",
"client",
".",
"get",
"(",
"permalink",
" ",
"+",
" ",
"'/",
"files",
"/",
"image",
".",
"jp",
"g",
"',",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
" ",
"query",
"\\u",
"string",
"={",
"'",
"size",
"':",
" ",
"'",
"small",
"'})",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"assert",
" ",
"rv",
".",
"status",
"\\u",
"code",
" ",
"==",
" ",
"200_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"im",
" ",
"=",
" ",
"Image",
".",
"open",
"(",
"io",
".",
"Byte",
"s",
"IO",
"(",
"rv",
".",
"data",
"))",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"assert",
" ",
"im",
".",
"size",
"[",
"0",
"]",
" ",
"<=",
" ",
"300",
" ",
"and",
" ",
"im",
".",
"size",
"[",
"1",
"]",
" ",
"<=",
" ",
"300_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"indi",
"eau",
"th",
"\\u",
"login_",
"(_",
"app_",
",_",
"client_",
",_",
"mocker_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mock",
"\\u",
"get_",
"=_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"request",
"s",
".",
"get",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"post_",
"=_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"request",
"s",
".",
"post",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"login_",
"=_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"fla",
"sk",
".",
"ext",
".",
"login",
".",
"login",
"\\u",
"user",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"logout_",
"=_",
"mocker_",
"._",
"patch_",
"(_",
"'",
"fla",
"sk",
".",
"ext",
".",
"login",
".",
"logo",
"ut",
"\\u",
"user",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"user",
"\\u",
"html_",
"=_",
"'<",
"html",
"><",
"a",
" ",
"class",
"=\"",
"h",
"-",
"card",
"\"",
" ",
"href",
"=\"",
"/\"",
" ",
"rel",
"=\"",
"me",
"\">",
"Exam",
"ple",
" ",
"User",
"</",
"a",
"><",
"/",
"html",
">'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"get_",
"._",
"return",
"\\u",
"value_",
"=_",
"Fake",
"Response_",
"(_",
"user",
"\\u",
"html_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"login",
"?",
"me",
"=",
"http",
"://",
"example",
".",
"com",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"rv_",
"._",
"status",
"\\u",
"code_",
"==_",
"302_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"urls",
"\\u",
"match_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"._",
"location_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"https",
"://",
"indi",
"eau",
"th",
".",
"com",
"/",
"auth",
"?'_",
"+_",
"urllib_",
"._",
"parse_",
"._",
"urlencode_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"state",
"'_",
":_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"me",
"'_",
":_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"client",
"\\u",
"id",
"'_",
":_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"redirec",
"t",
"\\u",
"uri",
"'_",
":_",
"'",
"http",
"://",
"local",
"host",
"/",
"login",
"\\u",
"callback",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"get_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"get_",
"._",
"reset",
"\\u",
"mock_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"mock",
"\\u",
"post_",
"._",
"return",
"\\u",
"value_",
"=_",
"Fake",
"Response_",
"(_",
"urllib_",
"._",
"parse_",
"._",
"urlencode_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"me",
"'_",
":_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rv_",
"=_",
"client_",
"._",
"get_",
"(_",
"'/",
"login",
"\\u",
"callback",
"?'_",
"+_",
"urllib_",
"._",
"parse_",
"._",
"urlencode_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"code",
"'_",
":_",
"'",
"abc",
"123",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"status",
"\\u",
"code_",
"==_",
"302_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"rv_",
"._",
"location_",
"==_",
"'",
"http",
"://",
"local",
"host",
"/'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"post_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"'",
"https",
"://",
"indi",
"eau",
"th",
".",
"com",
"/",
"auth",
"'_",
",_",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"code",
"'_",
":_",
"'",
"abc",
"123",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"client",
"\\u",
"id",
"'_",
":_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"redirec",
"t",
"\\u",
"uri",
"'_",
":_",
"'",
"http",
"://",
"local",
"host",
"/",
"login",
"\\u",
"callback",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"state",
"'_",
":_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"mock",
"\\u",
"get_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
",_",
"headers_",
"=_",
"{_",
"'",
"User",
"-",
"Agent",
"'_",
":_",
"mf",
"2py",
"_",
"._",
"Parser_",
"._",
"usera",
"gent",
"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"login_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"User_",
"(_",
"id_",
"=_",
"1_",
",_",
"name_",
"=_",
"'",
"Exam",
"ple",
" ",
"User",
"'_",
")_",
",_",
"remember",
"_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"cred_",
"=_",
"Cred",
"ential_",
"._",
"query_",
"._",
"filter",
"\\u",
"by_",
"(_",
"type_",
"=_",
"'",
"indi",
"eau",
"th",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"value_",
"=_",
"'",
"http",
"://",
"example",
".",
"com",
"'_",
")_",
"._",
"first_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"cred_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"cred_",
"._",
"user_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"cred_",
"._",
"user_",
"._",
"name_",
"==_",
"'",
"Exam",
"ple",
" ",
"User",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"client_",
"._",
"get_",
"(_",
"'/",
"logo",
"ut",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"logout_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Except block handles 'BaseException' | tweetdeck/txAMQP/src/txamqp/contrib/thrift/protocol.py | [
{
"content": " def parseClientUnrouteableMessage(self, msg, channel, queue, thriftClient,\n iprot_factory=None):\n tr = TTransport.TMemoryBuffer(msg.content.body)\n if iprot_factory is None:\n iprot = self.factory.iprot_factory.getProtocol(tr)\n else:\n iprot = iprot_factory.getProtocol(tr)\n (fname, mtype, rseqid) = iprot.readMessageBegin()\n\n # log.msg('Got unroutable. fname = %r, rseqid = %s, mtype = %r, routing key = %r, client = %r, msg.content.body = %r' % (fname, rseqid, mtype, msg.routing_key, thriftClient, msg.content.body))\n\n try:\n d = thriftClient._reqs.pop(rseqid)\n except KeyError:\n # KeyError will occur if the remote Thrift method is oneway,\n # since there is no outstanding local request deferred for\n # oneway calls.\n pass\n else:\n d.errback(TTransport.TTransportException(\n type=TTransport.TTransportException.NOT_OPEN,\n message='Unrouteable message, routing key = %r calling function %r'\n % (msg.routing_key, fname)))\n\n d = queue.get()\n d.addCallback(self.parseClientUnrouteableMessage, channel, queue,\n thriftClient, iprot_factory=iprot_factory)\n d.addErrback(self.catchClosedClientQueue)\n d.addErrback(self.handleClientQueueError)",
"metadata": "root.ThriftAMQClient.parseClientUnrouteableMessage",
"header": "['class', 'ThriftAMQClient', '(', 'AMQClient', ')', ':', '___EOS___']",
"index": 115
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Thri",
"ft",
"AMQ",
"Client_",
"(_",
"AMQ",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"parse",
"Client",
"Un",
"route",
"able",
"Message_",
"(_",
"self_",
",_",
"msg_",
",_",
"channel_",
",_",
"queue_",
",_",
"thrift",
"Client_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ipr",
"ot",
"\\u",
"factory_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tr_",
"=_",
"TT",
"rans",
"port_",
"._",
"TM",
"emo",
"ry",
"Buffer_",
"(_",
"msg_",
"._",
"content_",
"._",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"ipr",
"ot",
"\\u",
"factory_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"iprot_",
"=_",
"self_",
"._",
"factory_",
"._",
"ipr",
"ot",
"\\u",
"factory_",
"._",
"get",
"Protocol_",
"(_",
"tr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"iprot_",
"=_",
"ipr",
"ot",
"\\u",
"factory_",
"._",
"get",
"Protocol_",
"(_",
"tr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"(_",
"fname_",
",_",
"mtype_",
",_",
"rse",
"qid_",
")_",
"=_",
"iprot_",
"._",
"read",
"Messag",
"e",
"Begin_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"log",
".",
"msg",
"('",
"Got",
" ",
"unr",
"out",
"able",
".",
" ",
"fname",
" ",
"=",
" ",
"%",
"r",
",",
" ",
"rse",
"qid",
" ",
"=",
" ",
"%",
"s",
",",
" ",
"mt",
"ype",
" ",
"=",
" ",
"%",
"r",
",",
" ",
"routin",
"g",
" ",
"key",
" ",
"=",
" ",
"%",
"r",
",",
" ",
"client",
" ",
"=",
" ",
"%",
"r",
",",
" ",
"msg",
".",
"content",
".",
"body",
" ",
"=",
" ",
"%",
"r",
"'",
" ",
"%",
" ",
"(",
"fname",
",",
" ",
"rse",
"qid",
",",
" ",
"mt",
"ype",
",",
" ",
"msg",
".",
"routin",
"g",
"\\u",
"key",
",",
" ",
"thrift",
"Client",
",",
" ",
"msg",
".",
"content",
".",
"body",
"))",
"_",
"\\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 ",
" _",
"d_",
"=_",
"thrift",
"Client_",
"._",
"\\u",
"reqs_",
"._",
"pop_",
"(_",
"rse",
"qid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Key",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Key",
"Error",
" ",
"will",
" ",
"occur",
" ",
"if",
" ",
"the",
" ",
"remote",
" ",
"Thri",
"ft",
" ",
"method",
" ",
"is",
" ",
"one",
"way",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"sinc",
"e",
" ",
"there",
" ",
"is",
" ",
"no",
" ",
"outstanding",
" ",
"local",
" ",
"request",
" ",
"defer",
"red",
" ",
"for_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"one",
"way",
" ",
"calls",
"._",
"\\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 ",
" _",
"d_",
"._",
"errback",
"_",
"(_",
"TT",
"rans",
"port_",
"._",
"TT",
"rans",
"port",
"Exception_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"type_",
"=_",
"TT",
"rans",
"port_",
"._",
"TT",
"rans",
"port",
"Exception_",
"._",
"NOT",
"\\u",
"OPEN_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"message_",
"=_",
"'",
"Un",
"route",
"able",
" ",
"message",
",",
" ",
"routin",
"g",
" ",
"key",
" ",
"=",
" ",
"%",
"r",
" ",
"calling",
" ",
"function",
" ",
"%",
"r",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"%_",
"(_",
"msg_",
"._",
"routin",
"g",
"\\u",
"key_",
",_",
"fname_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"d_",
"=_",
"queue_",
"._",
"get_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"d_",
"._",
"add",
"Callback_",
"(_",
"self_",
"._",
"parse",
"Client",
"Un",
"route",
"able",
"Message_",
",_",
"channel_",
",_",
"queue_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"thrift",
"Client_",
",_",
"ipr",
"ot",
"\\u",
"factory_",
"=_",
"ipr",
"ot",
"\\u",
"factory_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"d_",
"._",
"add",
"Errback_",
"(_",
"self_",
"._",
"catch",
"Clos",
"ed",
"Client",
"Queue_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"d_",
"._",
"add",
"Errback_",
"(_",
"self_",
"._",
"handle",
"Client",
"Queue",
"Error_",
")_",
"\\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,
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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
] |
Unused local variable | openstack/ironic/ironic/objects/chassis.py | [
{
"content": " @classmethod\n def get_by_id(cls, context, chassis_id):\n \"\"\"Find a chassis based on its integer id and return a Chassis object.\n\n :param chassis_id: the id of a chassis.\n :returns: a :class:`Chassis` object.\n \"\"\"\n db_chassis = cls.dbapi.get_chassis_by_id(chassis_id)\n chassis = Chassis._from_db_object(cls(context), db_chassis)\n return chassis",
"metadata": "root.Chassis.get_by_id",
"header": "['class', 'Chassis', '(', 'base', '.', 'IronicObject', ',', 'object_base', '.', 'VersionedObjectDictCompat', ')', ':', '___NEWLINE___', '# Version 1.0: Initial version', '___NL___', '# Version 1.1: Add get() and get_by_id() and make get_by_uuid()', '___NL___', '# only work with a uuid', '___NL___', '# Version 1.2: Add create() and destroy()', '___NL___', '# Version 1.3: Add list()', '___NL___', '___EOS___']",
"index": 65
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Chas",
"sis_",
"(_",
"base_",
"._",
"Iron",
"ic",
"Object_",
",_",
"object\\u",
"base_",
"._",
"Versione",
"d",
"Object",
"Dict",
"Compat",
"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Version",
" ",
"1.0",
":",
" ",
"Initial",
" ",
"version_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Version",
" ",
"1.1",
":",
" ",
"Add",
" ",
"get",
"()",
" ",
"and",
" ",
"get",
"\\u",
"by",
"\\u",
"id",
"()",
" ",
"and",
" ",
"make",
" ",
"get",
"\\u",
"by",
"\\u",
"uuid",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
" ",
" ",
"only",
" ",
"work",
" ",
"with",
" ",
"a",
" ",
"uuid_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Version",
" ",
"1.2",
":",
" ",
"Add",
" ",
"create",
"()",
" ",
"and",
" ",
"destroy",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Version",
" ",
"1.3",
":",
" ",
"Add",
" ",
"list",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"classmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"get",
"\\u",
"by",
"\\u",
"id_",
"(_",
"cls_",
",_",
"context_",
",_",
"chassis",
"\\u",
"id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Fin",
"d",
" ",
"a",
" ",
"chassis",
" ",
"based",
" ",
"on",
" ",
"its",
" ",
"integ",
"er",
" ",
"id",
" ",
"and",
" ",
"return",
" ",
"a",
" ",
"Chas",
"sis",
" ",
"object",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"chassis",
"\\u",
"id",
":",
" ",
"the",
" ",
"id",
" ",
"of",
" ",
"a",
" ",
"chassis",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
"s",
":",
" ",
"a",
" ",
":",
"class",
":`",
"Chas",
"sis",
"`",
" ",
"object",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"db",
"\\u",
"chassis",
"_",
"=_",
"cls_",
"._",
"dbapi_",
"._",
"get",
"\\u",
"chassis",
"\\u",
"by",
"\\u",
"id_",
"(_",
"chassis",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"chassis",
"_",
"=_",
"Chas",
"sis_",
"._",
"\\u",
"from",
"\\u",
"db",
"\\u",
"object_",
"(_",
"cls_",
"(_",
"context_",
")_",
",_",
"db",
"\\u",
"chassis",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"chassis",
"_",
"\\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
] |
Comparison of constants | RDFLib/rdfextras/rdfextras/sparql/graph.py | [
{
"content": " def _generatePattern(self, tupl):\n \"\"\"\n Append a tuple to the local patterns. Possible type literals\n are converted to real literals on the fly. Each tuple should\n be contain either 3 elements (for an RDF Triplet pattern) or\n four, where the fourth element is a per-pattern constraint\n (filter). (The general constraint of SPARQL can be optimized\n by assigning a constraint to a specific pattern; because it\n stops the graph expansion, its usage might be much more\n optimal than the the 'global' constraint).\n\n :param tupl: either a three- or four-element tuple\n\n \"\"\"\n\n if type(tupl) != tuple:\n raise SPARQLError(\n \"illegal argument, pattern must be a tuple, got %s\" % type(tupl))\n\n if len(tupl) != 3 and len(tupl) != 4:\n raise SPARQLError(\n \"illegal argument, pattern must be a tuple of 3 or 4 element, got %s\" % len(tupl))\n\n if len(tupl) == 3:\n (s,p,o) = tupl\n f = None\n else:\n (s,p,o,f) = tupl\n\n final = []\n for c in (s,p,o):\n\n if _isResQuest(c):\n if not c in self.unbounds:\n self.unbounds.append(c)\n final.append(c)\n\n elif isinstance(c, BNode):\n # Do nothing - BNode name management is handled by SPARQL parser\n # if not c in self.bnodes:\n # self.bnodes[c] = BNode()\n final.append(c)\n\n else:\n final.append(_createResource(c))\n\n final.append(f)\n\n return tuple(final)",
"metadata": "root.GraphPattern._generatePattern",
"header": "['class', 'GraphPattern', ':', '___EOS___']",
"index": 268
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"Graph",
"Pattern_",
":_",
"\\u\\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",
"generat",
"e",
"Pattern_",
"(_",
"self_",
",_",
"tup",
"l_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Append",
" ",
"a",
" ",
"tuple",
" ",
"to",
" ",
"the",
" ",
"local",
" ",
"pattern",
"s",
".",
" ",
"Poss",
"ibl",
"e",
" ",
"type",
" ",
"literal",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"are",
" ",
"convert",
"ed",
" ",
"to",
" ",
"real",
" ",
"literal",
"s",
" ",
"on",
" ",
"the",
" ",
"fly",
".",
" ",
" ",
"Ea",
"ch",
" ",
"tuple",
" ",
"shou",
"ld",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"be",
" ",
"contain",
" ",
"eit",
"her",
" ",
"3",
" ",
"element",
"s",
" ",
"(",
"for",
" ",
"an",
" ",
"RDF",
" ",
"Triple",
"t",
" ",
"pattern",
")",
" ",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"four",
",",
" ",
"where",
" ",
"the",
" ",
"fourth",
" ",
"element",
" ",
"is",
" ",
"a",
" ",
"per",
"-",
"pattern",
" ",
"constraint",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"filter",
").",
" ",
"(",
"The",
" ",
"genera",
"l",
" ",
"constraint",
" ",
"of",
" ",
"SPAR",
"QL",
" ",
"can",
" ",
"be",
" ",
"optimize",
"d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"by",
" ",
"assign",
"ing",
" ",
"a",
" ",
"constraint",
" ",
"to",
" ",
"a",
" ",
"specific",
" ",
"pattern",
";",
" ",
"bec",
"aus",
"e",
" ",
"it",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"stop",
"s",
" ",
"the",
" ",
"graph",
" ",
"expansion",
",",
" ",
"its",
" ",
"usage",
" ",
"mig",
"ht",
" ",
"be",
" ",
"muc",
"h",
" ",
"more",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"optim",
"al",
" ",
"than",
" ",
"the",
" ",
"the",
" ",
"'",
"global",
"'",
" ",
"constraint",
").",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"tup",
"l",
":",
" ",
"eit",
"her",
" ",
"a",
" ",
"three",
"-",
" ",
"or",
" ",
"four",
"-",
"element",
" ",
"tuple",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"type_",
"(_",
"tup",
"l_",
")_",
"!=_",
"tuple_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"SPAR",
"QL",
"Error_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"ille",
"gal",
" ",
"argu",
"ment",
",",
" ",
"pattern",
" ",
"must",
" ",
"be",
" ",
"a",
" ",
"tuple",
",",
" ",
"got",
" ",
"%",
"s",
"\"_",
"%_",
"type_",
"(_",
"tup",
"l_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"tup",
"l_",
")_",
"!=_",
"3_",
"and_",
"len_",
"(_",
"tup",
"l_",
")_",
"!=_",
"4_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"SPAR",
"QL",
"Error_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"ille",
"gal",
" ",
"argu",
"ment",
",",
" ",
"pattern",
" ",
"must",
" ",
"be",
" ",
"a",
" ",
"tuple",
" ",
"of",
" ",
"3",
" ",
"or",
" ",
"4",
" ",
"element",
",",
" ",
"got",
" ",
"%",
"s",
"\"_",
"%_",
"len_",
"(_",
"tup",
"l_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"tup",
"l_",
")_",
"==_",
"3_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"(_",
"s_",
",_",
"p_",
",_",
"o_",
")_",
"=_",
"tup",
"l_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"f_",
"=_",
"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 ",
" _",
"(_",
"s_",
",_",
"p_",
",_",
"o_",
",_",
"f_",
")_",
"=_",
"tup",
"l_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"final_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"c_",
"in_",
"(_",
"s_",
",_",
"p_",
",_",
"o_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"\\u",
"is",
"Res",
"Quest",
"_",
"(_",
"c_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"c_",
"in_",
"self_",
"._",
"unbound",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"unbound",
"s_",
"._",
"append_",
"(_",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"final_",
"._",
"append_",
"(_",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"isinstance_",
"(_",
"c_",
",_",
"BN",
"ode_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Do",
" ",
"not",
"hing",
" ",
"-",
" ",
"BN",
"ode",
" ",
"name",
" ",
"manage",
"ment",
" ",
"is",
" ",
"handle",
"d",
" ",
"by",
" ",
"SPAR",
"QL",
" ",
"parser_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"if",
" ",
"not",
" ",
"c",
" ",
"in",
" ",
"self",
".",
"bn",
"odes",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"self",
".",
"bn",
"odes",
"[",
"c",
"]",
" ",
"=",
" ",
"BN",
"ode",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"final_",
"._",
"append_",
"(_",
"c_",
")_",
"\\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 ",
" _",
"final_",
"._",
"append_",
"(_",
"\\u",
"create",
"Resource_",
"(_",
"c_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"final_",
"._",
"append_",
"(_",
"f_",
")_",
"\\u\\u\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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | adieu/django-nonrel/django/test/utils.py | [
{
"content": "import sys\nimport time\nimport os\nimport warnings\nfrom django.conf import settings\nfrom django.core import mail\nfrom django.core.mail.backends import locmem\nfrom django.test import signals\nfrom django.template import Template\nfrom django.utils.translation import deactivate\n\n__all__ = ('Approximate', 'ContextList', 'setup_test_environment',\n 'teardown_test_environment', 'get_runner')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class Approximate(object):\n\n",
"metadata": "root.Approximate",
"header": "['module', '___EOS___']",
"index": 15
},
{
"content": " def __init__(self, val, places=7):\n self.val = val\n self.places = places",
"metadata": "root.Approximate.__init__",
"header": "['class', 'Approximate', '(', 'object', ')', ':', '___EOS___']",
"index": 16
},
{
"content": " def __repr__(self):\n return repr(self.val)",
"metadata": "root.Approximate.__repr__",
"header": "['class', 'Approximate', '(', 'object', ')', ':', '___EOS___']",
"index": 20
},
{
"content": " def __eq__(self, other):\n if self.val == other:\n return True\n return round(abs(self.val-other), self.places) == 0",
"metadata": "root.Approximate.__eq__",
"header": "['class', 'Approximate', '(', 'object', ')', ':', '___EOS___']",
"index": 23
},
{
"content": "class ContextList(list):\n \"\"\"A wrapper that provides direct key access to context items contained\n in a list of context objects.\n \"\"\"\n",
"metadata": "root.ContextList",
"header": "['module', '___EOS___']",
"index": 29
},
{
"content": " def __getitem__(self, key):\n if isinstance(key, basestring):\n for subcontext in self:\n if key in subcontext:\n return subcontext[key]\n raise KeyError(key)\n else:\n return super(ContextList, self).__getitem__(key)",
"metadata": "root.ContextList.__getitem__",
"header": "['class', 'ContextList', '(', 'list', ')', ':', '___EOS___']",
"index": 33
},
{
"content": " def __contains__(self, key):\n try:\n value = self[key]\n except KeyError:\n return False\n return True",
"metadata": "root.ContextList.__contains__",
"header": "['class', 'ContextList', '(', 'list', ')', ':', '___EOS___']",
"index": 42
},
{
"content": "def instrumented_test_render(self, context):\n \"\"\"\n An instrumented Template render method, providing a signal\n that can be intercepted by the test system Client\n \"\"\"\n signals.template_rendered.send(sender=self, template=self, context=context)\n return self.nodelist.render(context)",
"metadata": "root.instrumented_test_render",
"header": "['module', '___EOS___']",
"index": 50
},
{
"content": "def setup_test_environment():\n \"\"\"Perform any global pre-test setup. This involves:\n\n - Installing the instrumented test renderer\n - Set the email backend to the locmem email backend.\n - Setting the active locale to match the LANGUAGE_CODE setting.\n \"\"\"\n Template.original_render = Template._render\n Template._render = instrumented_test_render\n\n mail.original_SMTPConnection = mail.SMTPConnection\n mail.SMTPConnection = locmem.EmailBackend\n\n mail.original_email_backend = settings.EMAIL_BACKEND\n settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'\n\n mail.outbox = []\n\n deactivate()",
"metadata": "root.setup_test_environment",
"header": "['module', '___EOS___']",
"index": 59
},
{
"content": "def teardown_test_environment():\n \"\"\"Perform any global post-test teardown. This involves:\n\n - Restoring the original test renderer\n - Restoring the email sending functions\n\n \"\"\"\n Template._render = Template.original_render\n del Template.original_render\n\n mail.SMTPConnection = mail.original_SMTPConnection\n del mail.original_SMTPConnection\n\n settings.EMAIL_BACKEND = mail.original_email_backend\n del mail.original_email_backend\n\n del mail.outbox",
"metadata": "root.teardown_test_environment",
"header": "['module', '___EOS___']",
"index": 80
},
{
"content": "def get_warnings_state():\n \"\"\"\n Returns an object containing the state of the warnings module\n \"\"\"\n # There is no public interface for doing this, but this implementation of\n # get_warnings_state and restore_warnings_state appears to work on Python\n # 2.4 to 2.7.\n return warnings.filters[:]",
"metadata": "root.get_warnings_state",
"header": "['module', '___EOS___']",
"index": 99
},
{
"content": "def restore_warnings_state(state):\n \"\"\"\n Restores the state of the warnings module when passed an object that was\n returned by get_warnings_state()\n \"\"\"\n warnings.filters = state[:]",
"metadata": "root.restore_warnings_state",
"header": "['module', '___EOS___']",
"index": 109
},
{
"content": "def get_runner(settings):\n test_path = settings.TEST_RUNNER.split('.')\n # Allow for Python 2.5 relative paths\n if len(test_path) > 1:\n test_module_name = '.'.join(test_path[:-1])\n else:\n test_module_name = '.'\n test_module = __import__(test_module_name, {}, {}, test_path[-1])\n test_runner = getattr(test_module, test_path[-1])\n return test_runner",
"metadata": "root.get_runner",
"header": "['module', '___EOS___']",
"index": 117
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"time_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"warnings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"conf_",
"import_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"import_",
"mail_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"mail_",
"._",
"backends_",
"import_",
"loc",
"mem_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"test_",
"import_",
"signals_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"template_",
"import_",
"Template_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"._",
"translation_",
"import_",
"deactivate_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u",
"all\\u\\u_",
"=_",
"(_",
"'",
"Approx",
"imat",
"e",
"'_",
",_",
"'",
"Context",
"List",
"'_",
",_",
"'",
"setup",
"\\u",
"test\\u",
"environ",
"ment",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"tear",
"down",
"\\u",
"test\\u",
"environ",
"ment",
"'_",
",_",
"'",
"get",
"\\u",
"runn",
"er",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"Approx",
"imat",
"e_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Approx",
"imat",
"e_",
"(_",
"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_",
",_",
"val_",
",_",
"places_",
"=_",
"7_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"val_",
"=_",
"val_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"places_",
"=_",
"places_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Approx",
"imat",
"e_",
"(_",
"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_",
"repr_",
"(_",
"self_",
"._",
"val_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Approx",
"imat",
"e_",
"(_",
"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_",
"self_",
"._",
"val_",
"==_",
"other_",
":_",
"\\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_",
"round_",
"(_",
"abs_",
"(_",
"self_",
"._",
"val_",
"-_",
"other_",
")_",
",_",
"self_",
"._",
"places_",
")_",
"==_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Context",
"List_",
"(_",
"list_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"A",
" ",
"wrapp",
"er",
" ",
"tha",
"t",
" ",
"provide",
"s",
" ",
"direct",
" ",
"key",
" ",
"access",
" ",
"to",
" ",
"context",
" ",
"items",
" ",
"contain",
"ed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"in",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"context",
" ",
"object",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Context",
"List_",
"(_",
"list_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"getitem\\u\\u_",
"(_",
"self_",
",_",
"key_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"key_",
",_",
"basestring_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"subcon",
"text_",
"in_",
"self_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"key_",
"in_",
"subcon",
"text_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"subcon",
"text_",
"[_",
"key_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"raise_",
"Key",
"Error_",
"(_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"super_",
"(_",
"Context",
"List_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"getitem\\u\\u_",
"(_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Context",
"List_",
"(_",
"list_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"contains\\u\\u_",
"(_",
"self_",
",_",
"key_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"self_",
"[_",
"key_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Key",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"instrument",
"ed",
"\\u",
"test\\u",
"render_",
"(_",
"self_",
",_",
"context_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"An",
" ",
"instrument",
"ed",
" ",
"Templa",
"te",
" ",
"render",
" ",
"method",
",",
" ",
"provi",
"ding",
" ",
"a",
" ",
"signal",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"tha",
"t",
" ",
"can",
" ",
"be",
" ",
"intercept",
"ed",
" ",
"by",
" ",
"the",
" ",
"test",
" ",
"system",
" ",
"Client",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"signals_",
"._",
"template",
"\\u",
"rendered_",
"._",
"send_",
"(_",
"sender_",
"=_",
"self_",
",_",
"template_",
"=_",
"self_",
",_",
"context_",
"=_",
"context_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"nodelist_",
"._",
"render_",
"(_",
"context_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"setup",
"\\u",
"test\\u",
"environment_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Perform",
" ",
"any",
" ",
"global",
" ",
"pre",
"-",
"test",
" ",
"setup",
".",
" ",
"Thi",
"s",
" ",
"involv",
"es",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"Install",
"ing",
" ",
"the",
" ",
"instrument",
"ed",
" ",
"test",
" ",
"render",
"er",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"Set",
" ",
"the",
" ",
"email",
" ",
"back",
"end",
" ",
"to",
" ",
"the",
" ",
"loc",
"mem",
" ",
"email",
" ",
"back",
"end",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"Sett",
"ing",
" ",
"the",
" ",
"active",
" ",
"locale",
" ",
"to",
" ",
"match",
" ",
"the",
" ",
"LANGUAGE",
"\\u",
"CODE",
" ",
"setti",
"ng",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Template_",
"._",
"original",
"\\u",
"render_",
"=_",
"Template_",
"._",
"\\u",
"render_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Template_",
"._",
"\\u",
"render_",
"=_",
"instrument",
"ed",
"\\u",
"test\\u",
"render_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"mail_",
"._",
"original",
"\\u",
"SMT",
"PC",
"onnect",
"ion_",
"=_",
"mail_",
"._",
"SMT",
"PC",
"onnect",
"ion_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mail_",
"._",
"SMT",
"PC",
"onnect",
"ion_",
"=_",
"loc",
"mem_",
"._",
"Ema",
"il",
"Backend_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"mail_",
"._",
"original",
"\\u",
"email",
"\\u",
"backend_",
"=_",
"settings_",
"._",
"EMA",
"IL",
"\\u",
"BACKEND_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"settings_",
"._",
"EMA",
"IL",
"\\u",
"BACKEND_",
"=_",
"'",
"django",
".",
"core",
".",
"mail",
".",
"back",
"ends",
".",
"loc",
"mem",
".",
"Ema",
"il",
"Back",
"end",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"mail_",
"._",
"outbox_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"deactivate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"tear",
"down",
"\\u",
"test\\u",
"environment_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Perform",
" ",
"any",
" ",
"global",
" ",
"post",
"-",
"test",
" ",
"tear",
"down",
".",
" ",
"Thi",
"s",
" ",
"involv",
"es",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"Restor",
"ing",
" ",
"the",
" ",
"original",
" ",
"test",
" ",
"render",
"er",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-",
" ",
"Restor",
"ing",
" ",
"the",
" ",
"email",
" ",
"sendin",
"g",
" ",
"function",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Template_",
"._",
"\\u",
"render_",
"=_",
"Template_",
"._",
"original",
"\\u",
"render_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"del_",
"Template_",
"._",
"original",
"\\u",
"render_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"mail_",
"._",
"SMT",
"PC",
"onnect",
"ion_",
"=_",
"mail_",
"._",
"original",
"\\u",
"SMT",
"PC",
"onnect",
"ion_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"del_",
"mail_",
"._",
"original",
"\\u",
"SMT",
"PC",
"onnect",
"ion_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"settings_",
"._",
"EMA",
"IL",
"\\u",
"BACKEND_",
"=_",
"mail_",
"._",
"original",
"\\u",
"email",
"\\u",
"backend_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"del_",
"mail_",
"._",
"original",
"\\u",
"email",
"\\u",
"backend_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"del_",
"mail_",
"._",
"outbox_",
"\\u\\u\\uNEWLINE\\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",
"warn",
"ings",
"\\u",
"state_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
" ",
"an",
" ",
"object",
" ",
"contain",
"ing",
" ",
"the",
" ",
"state",
" ",
"of",
" ",
"the",
" ",
"warn",
"ings",
" ",
"module",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"There",
" ",
"is",
" ",
"no",
" ",
"public",
" ",
"interface",
" ",
"for",
" ",
"doi",
"ng",
" ",
"this",
",",
" ",
"but",
" ",
"this",
" ",
"implementation",
" ",
"of_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"get",
"\\u",
"warn",
"ings",
"\\u",
"state",
" ",
"and",
" ",
"restore",
"\\u",
"warn",
"ings",
"\\u",
"state",
" ",
"appear",
"s",
" ",
"to",
" ",
"work",
" ",
"on",
" ",
"Python_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"2.4",
" ",
"to",
" ",
"2.7",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"warnings_",
"._",
"filters_",
"[_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"restore",
"\\u",
"warn",
"ings",
"\\u",
"state_",
"(_",
"state_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Restor",
"es",
" ",
"the",
" ",
"state",
" ",
"of",
" ",
"the",
" ",
"warn",
"ings",
" ",
"module",
" ",
"whe",
"n",
" ",
"pass",
"ed",
" ",
"an",
" ",
"object",
" ",
"tha",
"t",
" ",
"was",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"return",
"ed",
" ",
"by",
" ",
"get",
"\\u",
"warn",
"ings",
"\\u",
"state",
"()",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"warnings_",
"._",
"filters_",
"=_",
"state_",
"[_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"runner_",
"(_",
"settings_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"test\\u",
"path_",
"=_",
"settings_",
"._",
"TEST",
"\\u",
"RUNN",
"ER_",
"._",
"split_",
"(_",
"'.'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"All",
"ow",
" ",
"for",
" ",
"Pyth",
"on",
" ",
"2.5",
" ",
"relative",
" ",
"paths_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"len_",
"(_",
"test\\u",
"path_",
")_",
">_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"test\\u",
"module",
"\\u",
"name_",
"=_",
"'.'_",
"._",
"join_",
"(_",
"test\\u",
"path_",
"[_",
":_",
"-_",
"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 ",
" _",
"test\\u",
"module",
"\\u",
"name_",
"=_",
"'.'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"test\\u",
"module_",
"=_",
"\\u\\u",
"import\\u\\u_",
"(_",
"test\\u",
"module",
"\\u",
"name_",
",_",
"{_",
"}_",
",_",
"{_",
"}_",
",_",
"test\\u",
"path_",
"[_",
"-_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"test\\u",
"runner_",
"=_",
"getattr_",
"(_",
"test\\u",
"module_",
",_",
"test\\u",
"path_",
"[_",
"-_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"test\\u",
"runner_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Unused local variable | GoogleCloudPlatform/PerfKitBenchmarker/tests/providers/aws/aws_disk_test.py | [
{
"content": " def testNonPresentFlagsDoNotOverrideConfigs(self):\n flags = mock_flags.MockFlags()\n flags['aws_provisioned_iops'].value = 2000\n flags['data_disk_size'].value = 100\n spec = aws_disk.AwsDiskSpec(_COMPONENT, flags, disk_size=75, iops=1000)\n self.assertEqual(spec.disk_size, 75)\n self.assertEqual(spec.iops, 1000)",
"metadata": "root.AwsDiskSpecTestCase.testNonPresentFlagsDoNotOverrideConfigs",
"header": "['class', 'AwsDiskSpecTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 58
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Aw",
"s",
"Disk",
"Spec",
"Test",
"Case_",
"(_",
"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",
"Non",
"Present",
"Fla",
"gs",
"Do",
"Not",
"Override",
"Configs",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"flags_",
"=_",
"mock",
"\\u",
"flags_",
"._",
"Moc",
"k",
"Flags_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"flags_",
"[_",
"'",
"aws",
"\\u",
"provisioned",
"\\u",
"iops",
"'_",
"]_",
"._",
"value_",
"=_",
"2000_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"flags_",
"[_",
"'",
"data\\u",
"disk",
"\\u",
"size",
"'_",
"]_",
"._",
"value_",
"=_",
"100_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"spec_",
"=_",
"aws",
"\\u",
"disk_",
"._",
"Aw",
"s",
"Disk",
"Spec_",
"(_",
"\\u",
"COMPONENT",
"_",
",_",
"flags_",
",_",
"disk",
"\\u",
"size_",
"=_",
"75_",
",_",
"iops",
"_",
"=_",
"1000_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"spec_",
"._",
"disk",
"\\u",
"size_",
",_",
"75_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"spec_",
"._",
"iops",
"_",
",_",
"1000_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | google/grr/grr/lib/flow_utils_test.py | [
{
"content": "#!/usr/bin/env python\n\"\"\"Tests for flow utils classes.\"\"\"\n\n\nfrom grr.lib import aff4\nfrom grr.lib import flags\nfrom grr.lib import flow_utils\nfrom grr.lib import rdfvalue\nfrom grr.lib import test_lib\nfrom grr.lib.rdfvalues import client as rdf_client\n\n\n\n\n\nif __name__ == \"__main__\":\n flags.StartMain(main)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TestInterpolatePath(test_lib.FlowTestsBaseclass):\n \"\"\"Tests for path interpolation.\"\"\"\n\n\n",
"metadata": "root.TestInterpolatePath",
"header": "['module', '___EOS___']",
"index": 12
},
{
"content": " def setUp(self):\n super(TestInterpolatePath, self).setUp()\n # Set up client info\n self.client = aff4.FACTORY.Open(self.client_id, mode=\"rw\", token=self.token)\n self.client.Set(self.client.Schema.SYSTEM(\"Windows\"))\n kb = self.client.Get(self.client.Schema.KNOWLEDGE_BASE)\n kb.users.Append(\n rdf_client.User(\n username=\"test\", userdomain=\"TESTDOMAIN\", full_name=\"test user\",\n homedir=\"c:\\\\Users\\\\test\",\n last_logon=rdfvalue.RDFDatetime(\"2012-11-10\")))\n\n kb.users.Append(rdf_client.User(username=\"test2\", userdomain=\"TESTDOMAIN\",\n full_name=\"test user 2\",\n homedir=\"c:\\\\Users\\\\test2\", last_logon=100))\n self.client.Set(kb)\n self.client.Flush()",
"metadata": "root.TestInterpolatePath.setUp",
"header": "['class', 'TestInterpolatePath', '(', 'test_lib', '.', 'FlowTestsBaseclass', ')', ':', '___EOS___']",
"index": 15
},
{
"content": " def testBasicInterpolation(self):\n \"\"\"Test Basic.\"\"\"\n path = \"{systemroot}\\\\test\"\n new_path = flow_utils.InterpolatePath(path, self.client, users=None)\n self.assertEqual(new_path.lower(), \"c:\\\\windows\\\\test\")\n\n new_path = flow_utils.InterpolatePath(\"{does_not_exist}\", self.client)\n self.assertEqual(new_path, \"\")",
"metadata": "root.TestInterpolatePath.testBasicInterpolation",
"header": "['class', 'TestInterpolatePath', '(', 'test_lib', '.', 'FlowTestsBaseclass', ')', ':', '___EOS___']",
"index": 33
},
{
"content": " def testUserInterpolation(self):\n \"\"\"User interpolation returns a list of paths.\"\"\"\n path = \"{homedir}\\\\dir\"\n new_path = flow_utils.InterpolatePath(path, self.client, users=[\"test\"])\n self.assertEqual(new_path[0].lower(), \"c:\\\\users\\\\test\\\\dir\")\n\n path = \"{systemroot}\\\\{last_logon}\\\\dir\"\n new_path = flow_utils.InterpolatePath(path, self.client, users=[\"test\"])\n self.assertEqual(new_path[0].lower(),\n \"c:\\\\windows\\\\2012-11-10 00:00:00\\\\dir\")\n\n path = \"{homedir}\\\\a\"\n new_path = flow_utils.InterpolatePath(path, self.client,\n users=[\"test\", \"test2\"])\n self.assertEqual(len(new_path), 2)\n self.assertEqual(new_path[0].lower(), \"c:\\\\users\\\\test\\\\a\")\n self.assertEqual(new_path[1].lower(), \"c:\\\\users\\\\test2\\\\a\")\n\n new_path = flow_utils.InterpolatePath(\"{does_not_exist}\", self.client,\n users=[\"test\"])\n self.assertEqual(new_path, [])",
"metadata": "root.TestInterpolatePath.testUserInterpolation",
"header": "['class', 'TestInterpolatePath', '(', 'test_lib', '.', 'FlowTestsBaseclass', ')', ':', '___EOS___']",
"index": 42
},
{
"content": "def main(argv):\n test_lib.main(argv)",
"metadata": "root.main",
"header": "['module', '___EOS___']",
"index": 65
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#!",
"/",
"usr",
"/",
"bin",
"/",
"env",
" ",
"python_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\"\"",
"Test",
"s",
" ",
"for",
" ",
"flow",
" ",
"util",
"s",
" ",
"classe",
"s",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"grr_",
"._",
"lib_",
"import_",
"aff4",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"grr_",
"._",
"lib_",
"import_",
"flags_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"grr_",
"._",
"lib_",
"import_",
"flow",
"\\u",
"utils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"grr_",
"._",
"lib_",
"import_",
"rdfvalue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"grr_",
"._",
"lib_",
"import_",
"test\\u",
"lib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"grr_",
"._",
"lib_",
"._",
"rdf",
"values_",
"import_",
"client_",
"as_",
"rdf",
"\\u",
"client_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"\"\\u\\u",
"main",
"\\u\\u\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"flags_",
"._",
"Start",
"Main_",
"(_",
"main_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Test",
"Interpolate",
"Path_",
"(_",
"test\\u",
"lib_",
"._",
"Flow",
"Test",
"s",
"Base",
"class_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Test",
"s",
" ",
"for",
" ",
"path",
" ",
"interpolati",
"on",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\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",
"Interpolate",
"Path_",
"(_",
"test\\u",
"lib_",
"._",
"Flow",
"Test",
"s",
"Base",
"class_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Test",
"Interpolate",
"Path_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Set",
" ",
"up",
" ",
"client",
" ",
"info_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"client_",
"=_",
"aff4",
"_",
"._",
"FACTORY",
"_",
"._",
"Open_",
"(_",
"self_",
"._",
"client",
"\\u",
"id_",
",_",
"mode_",
"=_",
"\"",
"rw",
"\"_",
",_",
"token_",
"=_",
"self_",
"._",
"token_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"client_",
"._",
"Set_",
"(_",
"self_",
"._",
"client_",
"._",
"Schema_",
"._",
"SYSTEM",
"_",
"(_",
"\"",
"Window",
"s",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kb_",
"=_",
"self_",
"._",
"client_",
"._",
"Get_",
"(_",
"self_",
"._",
"client_",
"._",
"Schema_",
"._",
"KN",
"OWL",
"EDGE",
"\\u",
"BASE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kb_",
"._",
"users_",
"._",
"Append_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"rdf",
"\\u",
"client_",
"._",
"User_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"username_",
"=_",
"\"",
"test",
"\"_",
",_",
"userd",
"omain",
"_",
"=_",
"\"",
"TEST",
"DOM",
"AIN",
"\"_",
",_",
"full",
"\\u",
"name_",
"=_",
"\"",
"test",
" ",
"user",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"homedir_",
"=_",
"\"",
"c",
":\\\\",
"\\\\",
"User",
"s",
"\\\\\\\\",
"test",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"last",
"\\u",
"logo",
"n_",
"=_",
"rdfvalue_",
"._",
"RDF",
"Datetime_",
"(_",
"\"",
"2012",
"-1",
"1",
"-1",
"0",
"\"_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"kb_",
"._",
"users_",
"._",
"Append_",
"(_",
"rdf",
"\\u",
"client_",
"._",
"User_",
"(_",
"username_",
"=_",
"\"",
"test",
"2",
"\"_",
",_",
"userd",
"omain",
"_",
"=_",
"\"",
"TEST",
"DOM",
"AIN",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"full",
"\\u",
"name_",
"=_",
"\"",
"test",
" ",
"user",
" ",
"2",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"homedir_",
"=_",
"\"",
"c",
":\\\\",
"\\\\",
"User",
"s",
"\\\\\\\\",
"test",
"2",
"\"_",
",_",
"last",
"\\u",
"logo",
"n_",
"=_",
"100_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"client_",
"._",
"Set_",
"(_",
"kb_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"client_",
"._",
"Flu",
"sh_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Interpolate",
"Path_",
"(_",
"test\\u",
"lib_",
"._",
"Flow",
"Test",
"s",
"Base",
"class_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Basic",
"Interpolation",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Test",
" ",
"Basic",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"path_",
"=_",
"\"{",
"system",
"root",
"}\\\\",
"\\\\",
"test",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"path_",
"=_",
"flow",
"\\u",
"utils_",
"._",
"Interpolate",
"Path_",
"(_",
"path_",
",_",
"self_",
"._",
"client_",
",_",
"users_",
"=_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
"._",
"lower_",
"(_",
")_",
",_",
"\"",
"c",
":\\\\",
"\\\\",
"windows",
"\\\\\\\\",
"test",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"new",
"\\u",
"path_",
"=_",
"flow",
"\\u",
"utils_",
"._",
"Interpolate",
"Path_",
"(_",
"\"{",
"doe",
"s",
"\\u",
"not",
"\\u",
"exist",
"}\"_",
",_",
"self_",
"._",
"client_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
",_",
"\"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Interpolate",
"Path_",
"(_",
"test\\u",
"lib_",
"._",
"Flow",
"Test",
"s",
"Base",
"class_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"User",
"Interpolation",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"User",
" ",
"interpolati",
"on",
" ",
"return",
"s",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"path",
"s",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"path_",
"=_",
"\"{",
"home",
"dir",
"}\\\\",
"\\\\",
"dir",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"path_",
"=_",
"flow",
"\\u",
"utils_",
"._",
"Interpolate",
"Path_",
"(_",
"path_",
",_",
"self_",
"._",
"client_",
",_",
"users_",
"=_",
"[_",
"\"",
"test",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
"[_",
"0_",
"]_",
"._",
"lower_",
"(_",
")_",
",_",
"\"",
"c",
":\\\\",
"\\\\",
"users",
"\\\\\\\\",
"test",
"\\\\\\\\",
"dir",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"path_",
"=_",
"\"{",
"system",
"root",
"}\\\\",
"\\\\{",
"last",
"\\u",
"logo",
"n",
"}\\\\",
"\\\\",
"dir",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"path_",
"=_",
"flow",
"\\u",
"utils_",
"._",
"Interpolate",
"Path_",
"(_",
"path_",
",_",
"self_",
"._",
"client_",
",_",
"users_",
"=_",
"[_",
"\"",
"test",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
"[_",
"0_",
"]_",
"._",
"lower_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"c",
":\\\\",
"\\\\",
"windows",
"\\\\\\\\",
"2012",
"-1",
"1",
"-1",
"0",
" ",
"00",
":",
"00",
":",
"00",
"\\\\\\\\",
"dir",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"path_",
"=_",
"\"{",
"home",
"dir",
"}\\\\",
"\\\\",
"a",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"path_",
"=_",
"flow",
"\\u",
"utils_",
"._",
"Interpolate",
"Path_",
"(_",
"path_",
",_",
"self_",
"._",
"client_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"users_",
"=_",
"[_",
"\"",
"test",
"\"_",
",_",
"\"",
"test",
"2",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"new",
"\\u",
"path_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
"[_",
"0_",
"]_",
"._",
"lower_",
"(_",
")_",
",_",
"\"",
"c",
":\\\\",
"\\\\",
"users",
"\\\\\\\\",
"test",
"\\\\\\\\",
"a",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
"[_",
"1_",
"]_",
"._",
"lower_",
"(_",
")_",
",_",
"\"",
"c",
":\\\\",
"\\\\",
"users",
"\\\\\\\\",
"test",
"2",
"\\\\\\\\",
"a",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"new",
"\\u",
"path_",
"=_",
"flow",
"\\u",
"utils_",
"._",
"Interpolate",
"Path_",
"(_",
"\"{",
"doe",
"s",
"\\u",
"not",
"\\u",
"exist",
"}\"_",
",_",
"self_",
"._",
"client_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"users_",
"=_",
"[_",
"\"",
"test",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"new",
"\\u",
"path_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"main_",
"(_",
"argv_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"test\\u",
"lib_",
"._",
"main_",
"(_",
"argv_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Unused local variable | yosinski/deep-visualization-toolbox/input_fetcher.py | [
{
"content": " def toggle_input_mode(self):\n with self.lock:\n if self.static_file_mode:\n self.set_mode_cam()\n else:\n self.set_mode_static()",
"metadata": "root.InputImageFetcher.toggle_input_mode",
"header": "['class', 'InputImageFetcher', '(', 'CodependentThread', ')', ':', '___EOS___']",
"index": 77
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Inp",
"ut",
"Image",
"Fetcher_",
"(_",
"Code",
"pend",
"ent",
"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_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"toggle",
"\\u",
"input",
"\\u",
"mode_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"self_",
"._",
"lock_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"static",
"\\u",
"file",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"set\\u",
"mode",
"\\u",
"cam_",
"(_",
")_",
"\\u\\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_",
"._",
"set\\u",
"mode",
"\\u",
"static_",
"(_",
")_",
"\\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
] |
Imprecise assert | AppScale/appscale/AppServer/lib/django-1.2/django/contrib/auth/tests/forms.py | [
{
"content": " def test_success(self):\n # The success case\n data = {\n 'username': 'testclient',\n 'password': 'password',\n }\n form = AuthenticationForm(None, data)\n self.assertTrue(form.is_valid())\n self.assertEqual(form.non_field_errors(), [])",
"metadata": "root.AuthenticationFormTest.test_success",
"header": "['class', 'AuthenticationFormTest', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 104
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Auth",
"entica",
"tion",
"Form",
"Test_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"success_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"success",
" ",
"case_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"user",
"name",
"'_",
":_",
"'",
"testc",
"lien",
"t",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"password",
"'_",
":_",
"'",
"password",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"form_",
"=_",
"Auth",
"entica",
"tion",
"Form_",
"(_",
"None_",
",_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"form_",
"._",
"is",
"\\u",
"valid_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"form_",
"._",
"non",
"\\u",
"field",
"\\u",
"errors_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\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
] |
Comparison of identical values | garethr/django-test-extensions/src/test_extensions/testrunners/xmlunit/unittest.py | [
{
"content": " def failIfEqual(self, first, second, msg=None):\n \"\"\"Fail if the two objects are equal as determined by the '=='\n operator.\n \"\"\"\n if first == second:\n raise self.failureException, (msg or '%s == %s' % (first, second))",
"metadata": "root.TestCase.failIfEqual",
"header": "['class', 'TestCase', ':', '___EOS___']",
"index": 308
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"identical_",
"values_",
"[SEP]_",
"class_",
"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_",
"fail",
"If",
"Equal_",
"(_",
"self_",
",_",
"first_",
",_",
"second_",
",_",
"msg_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Fail",
" ",
"if",
" ",
"the",
" ",
"two",
" ",
"object",
"s",
" ",
"are",
" ",
"equal",
" ",
"as",
" ",
"dete",
"rmin",
"ed",
" ",
"by",
" ",
"the",
" ",
"'=",
"='",
"\\",
"10",
";",
" ",
" ",
" ",
"opera",
"tor",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"first_",
"==_",
"second_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"self_",
"._",
"fail",
"ure",
"Exception_",
",_",
"(_",
"msg_",
"or_",
"'%",
"s",
" ",
"==",
" ",
"%",
"s",
"'_",
"%_",
"(_",
"first_",
",_",
"second_",
")_",
")_",
"\\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
] |
Unused local variable | nathanborror/django-registration/registration/tests/views.py | [
{
"content": " def setUp(self):\n \"\"\"\n These tests use the default backend, since we know it's\n available; that needs to have ``ACCOUNT_ACTIVATION_DAYS`` set.\n\n \"\"\"\n self.old_activation = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', None)\n if self.old_activation is None:\n settings.ACCOUNT_ACTIVATION_DAYS = 7",
"metadata": "root.RegistrationViewTests.setUp",
"header": "['class', 'RegistrationViewTests', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 19
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Registration",
"View",
"Tests_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
"se",
" ",
"tests",
" ",
"use",
" ",
"the",
" ",
"default",
" ",
"back",
"end",
",",
" ",
"sinc",
"e",
" ",
"we",
" ",
"know",
" ",
"it",
"'",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"avail",
"able",
";",
" ",
"tha",
"t",
" ",
"need",
"s",
" ",
"to",
" ",
"have",
" ",
"``",
"ACCOUNT",
"\\u",
"ACTIVAT",
"ION",
"\\u",
"DAY",
"S",
"``",
" ",
"set",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"old",
"\\u",
"activation_",
"=_",
"getattr_",
"(_",
"settings_",
",_",
"'",
"ACCOUNT",
"\\u",
"ACTIVAT",
"ION",
"\\u",
"DAY",
"S",
"'_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"old",
"\\u",
"activation_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"settings_",
"._",
"ACCOUNT",
"\\u",
"ACTIVAT",
"ION",
"\\u",
"DAYS_",
"=_",
"7_",
"\\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
] |
Unnecessary 'else' clause in loop | OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/container.py | [
{
"content": " @rbac(('owner', 'user'))\n def _alltraits(self, traits=None, events=False, **metadata):\n \"\"\"This returns a dict that contains traits (class and instance)\n that match the given metadata. If the 'traits' argument is not\n None, then it is assumed to be the dict of traits to be filtered.\n \"\"\"\n if traits is None:\n if self._cached_traits_:\n traits = self._cached_traits_\n else:\n traits = self.traits() # don't pass **metadata here\n traits.update(self._instance_traits())\n self._cached_traits_ = traits\n\n result = {}\n for name, trait in traits.items():\n if not events and trait.type is 'event':\n continue\n for meta_name, meta_eval in metadata.items():\n if type(meta_eval) is FunctionType:\n if not meta_eval(getattr(trait, meta_name)):\n break\n elif meta_eval != getattr(trait, meta_name):\n break\n else:\n result[name] = trait\n\n return result",
"metadata": "root.Container._alltraits",
"header": "['class', 'Container', '(', 'SafeHasTraits', ')', ':', '___EOS___']",
"index": 805
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"necessar",
"y_",
"'",
"else",
"'_",
"clause_",
"in_",
"loop_",
"[SEP]_",
"class_",
"Container_",
"(_",
"Safe",
"Has",
"Trait",
"s_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"rbac",
"_",
"(_",
"(_",
"'",
"owner",
"'_",
",_",
"'",
"user",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u",
"allt",
"rai",
"ts_",
"(_",
"self_",
",_",
"traits_",
"=_",
"None_",
",_",
"events_",
"=_",
"False_",
",_",
"**_",
"metadata_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Thi",
"s",
" ",
"return",
"s",
" ",
"a",
" ",
"dict",
" ",
"tha",
"t",
" ",
"contain",
"s",
" ",
"traits",
" ",
"(",
"class",
" ",
"and",
" ",
"instance",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"tha",
"t",
" ",
"match",
" ",
"the",
" ",
"give",
"n",
" ",
"metadata",
".",
" ",
" ",
"If",
" ",
"the",
" ",
"'",
"traits",
"'",
" ",
"argu",
"ment",
" ",
"is",
" ",
"not",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Non",
"e",
",",
" ",
"then",
" ",
"it",
" ",
"is",
" ",
"assume",
"d",
" ",
"to",
" ",
"be",
" ",
"the",
" ",
"dict",
" ",
"of",
" ",
"traits",
" ",
"to",
" ",
"be",
" ",
"filter",
"ed",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"traits_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"\\u",
"cache",
"d\\u",
"traits",
"\\u_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"traits_",
"=_",
"self_",
"._",
"\\u",
"cache",
"d\\u",
"traits",
"\\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 ",
" _",
"traits_",
"=_",
"self_",
"._",
"traits_",
"(_",
")_",
"#",
" ",
"don",
"'",
"t",
" ",
"pass",
" ",
"**",
"metadata",
" ",
"here_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"traits_",
"._",
"update_",
"(_",
"self_",
"._",
"\\u",
"instance",
"\\u",
"traits_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"cache",
"d\\u",
"traits",
"\\u_",
"=_",
"traits_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"result_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"name_",
",_",
"trait_",
"in_",
"traits_",
"._",
"items_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"events_",
"and_",
"trait_",
"._",
"type_",
"is_",
"'",
"event",
"'_",
":_",
"\\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_",
"for_",
"meta",
"\\u",
"name_",
",_",
"meta",
"\\u",
"eval_",
"in_",
"metadata_",
"._",
"items_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"type_",
"(_",
"meta",
"\\u",
"eval_",
")_",
"is_",
"Function",
"Type_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"not_",
"meta",
"\\u",
"eval_",
"(_",
"getattr_",
"(_",
"trait_",
",_",
"meta",
"\\u",
"name_",
")_",
")_",
":_",
"\\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_",
"elif_",
"meta",
"\\u",
"eval_",
"!=_",
"getattr_",
"(_",
"trait_",
",_",
"meta",
"\\u",
"name_",
")_",
":_",
"\\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 ",
" _",
"result_",
"[_",
"name_",
"]_",
"=_",
"trait_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | mimecuvalo/helloworld/controllers/push.py | [
{
"content": " def check_xsrf_cookie(self):\n pass",
"metadata": "root.PushHandler.check_xsrf_cookie",
"header": "['class', 'PushHandler', '(', 'BaseHandler', ')', ':', '___EOS___']",
"index": 16
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"necessar",
"y_",
"pass_",
"[SEP]_",
"class_",
"Push",
"Handler_",
"(_",
"Base",
"Handler_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"xsrf",
"\\u",
"cookie_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
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
] |
Unused local variable | rougier/freetype-py/examples/wordle.py | [
{
"content": "def make_label(text, filename, size=12, angle=0):\n '''\n Parameters:\n -----------\n text : string\n Text to be displayed\n filename : string\n Path to a font\n size : int\n Font size in 1/64th points\n angle : float\n Text angle in degrees\n '''\n face = Face(filename)\n face.set_char_size( size*64 )\n angle = (angle/180.0)*math.pi\n matrix = FT_Matrix( (int)( math.cos( angle ) * 0x10000 ),\n (int)(-math.sin( angle ) * 0x10000 ),\n (int)( math.sin( angle ) * 0x10000 ),\n (int)( math.cos( angle ) * 0x10000 ))\n flags = FT_LOAD_RENDER\n pen = FT_Vector(0,0)\n FT_Set_Transform( face._FT_Face, byref(matrix), byref(pen) )\n previous = 0\n xmin, xmax = 0, 0\n ymin, ymax = 0, 0\n for c in text:\n face.load_char(c, flags)\n kerning = face.get_kerning(previous, c)\n previous = c\n bitmap = face.glyph.bitmap\n pitch = face.glyph.bitmap.pitch\n width = face.glyph.bitmap.width\n rows = face.glyph.bitmap.rows\n top = face.glyph.bitmap_top\n left = face.glyph.bitmap_left\n pen.x += kerning.x\n x0 = (pen.x >> 6) + left\n x1 = x0 + width\n y0 = (pen.y >> 6) - (rows - top)\n y1 = y0 + rows\n xmin, xmax = min(xmin, x0), max(xmax, x1)\n ymin, ymax = min(ymin, y0), max(ymax, y1)\n pen.x += face.glyph.advance.x\n pen.y += face.glyph.advance.y\n\n L = np.zeros((ymax-ymin, xmax-xmin),dtype=np.ubyte)\n previous = 0\n pen.x, pen.y = 0, 0\n for c in text:\n face.load_char(c, flags)\n kerning = face.get_kerning(previous, c)\n previous = c\n bitmap = face.glyph.bitmap\n pitch = face.glyph.bitmap.pitch\n width = face.glyph.bitmap.width\n rows = face.glyph.bitmap.rows\n top = face.glyph.bitmap_top\n left = face.glyph.bitmap_left\n pen.x += kerning.x\n x = (pen.x >> 6) - xmin + left\n y = (pen.y >> 6) - ymin - (rows - top)\n data = []\n for j in range(rows):\n data.extend(bitmap.buffer[j*pitch:j*pitch+width])\n if len(data):\n Z = np.array(data,dtype=np.ubyte).reshape(rows, width)\n L[y:y+rows,x:x+width] |= Z[::-1,::1]\n pen.x += face.glyph.advance.x\n pen.y += face.glyph.advance.y\n\n return L",
"metadata": "root.make_label",
"header": "['module', '___EOS___']",
"index": 14
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"make",
"\\u",
"label_",
"(_",
"text_",
",_",
"filename_",
",_",
"size_",
"=_",
"12_",
",_",
"angle_",
"=_",
"0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"text",
" ",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Text",
" ",
"to",
" ",
"be",
" ",
"displaye",
"d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"filename",
" ",
":",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Path",
" ",
"to",
" ",
"a",
" ",
"font",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"size",
" ",
":",
" ",
"int",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Font",
" ",
"size",
" ",
"in",
" ",
"1",
"/",
"64",
"th",
" ",
"points",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"angle",
" ",
":",
" ",
"float",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Text",
" ",
"angle",
" ",
"in",
" ",
"degr",
"ees",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"face_",
"=_",
"Face_",
"(_",
"filename_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"face_",
"._",
"set\\u",
"char",
"\\u",
"size_",
"(_",
"size_",
"*_",
"64_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"angle_",
"=_",
"(_",
"angle_",
"/_",
"180.0_",
")_",
"*_",
"math_",
"._",
"pi_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"matrix_",
"=_",
"FT",
"\\u",
"Matrix_",
"(_",
"(_",
"int_",
")_",
"(_",
"math_",
"._",
"cos_",
"(_",
"angle_",
")_",
"*_",
"0x10000",
"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"int_",
")_",
"(_",
"-_",
"math_",
"._",
"sin_",
"(_",
"angle_",
")_",
"*_",
"0x10000",
"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"int_",
")_",
"(_",
"math_",
"._",
"sin_",
"(_",
"angle_",
")_",
"*_",
"0x10000",
"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"int_",
")_",
"(_",
"math_",
"._",
"cos_",
"(_",
"angle_",
")_",
"*_",
"0x10000",
"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"flags_",
"=_",
"FT",
"\\u",
"LOAD",
"\\u",
"RENDER",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"=_",
"FT",
"\\u",
"Vector_",
"(_",
"0_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"FT",
"\\u",
"Set",
"\\u",
"Transform_",
"(_",
"face_",
"._",
"\\u",
"FT",
"\\u",
"Face_",
",_",
"byref_",
"(_",
"matrix_",
")_",
",_",
"byref_",
"(_",
"pen_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"previous_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"xmin_",
",_",
"xmax_",
"=_",
"0_",
",_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ymin_",
",_",
"ymax_",
"=_",
"0_",
",_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"c_",
"in_",
"text_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"face_",
"._",
"load",
"\\u",
"char_",
"(_",
"c_",
",_",
"flags_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kern",
"ing_",
"=_",
"face_",
"._",
"get",
"\\u",
"kern",
"ing_",
"(_",
"previous_",
",_",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"previous_",
"=_",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bitmap_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pitch_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"._",
"pitch_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"width_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"._",
"width_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rows_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"._",
"rows_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"top_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap",
"\\u",
"top_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"left_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap",
"\\u",
"left_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"._",
"x_",
"+=_",
"kern",
"ing_",
"._",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x0_",
"=_",
"(_",
"pen_",
"._",
"x_",
">>_",
"6_",
")_",
"+_",
"left_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x1_",
"=_",
"x0_",
"+_",
"width_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y0_",
"=_",
"(_",
"pen_",
"._",
"y_",
">>_",
"6_",
")_",
"-_",
"(_",
"rows_",
"-_",
"top_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y1_",
"=_",
"y0_",
"+_",
"rows_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"xmin_",
",_",
"xmax_",
"=_",
"min_",
"(_",
"xmin_",
",_",
"x0_",
")_",
",_",
"max_",
"(_",
"xmax_",
",_",
"x1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ymin_",
",_",
"ymax_",
"=_",
"min_",
"(_",
"ymin_",
",_",
"y0_",
")_",
",_",
"max_",
"(_",
"ymax_",
",_",
"y1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"._",
"x_",
"+=_",
"face_",
"._",
"glyph_",
"._",
"advance_",
"._",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"._",
"y_",
"+=_",
"face_",
"._",
"glyph_",
"._",
"advance_",
"._",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"L_",
"=_",
"np_",
"._",
"zeros_",
"(_",
"(_",
"ymax_",
"-_",
"ymin_",
",_",
"xmax_",
"-_",
"xmin_",
")_",
",_",
"dtype_",
"=_",
"np_",
"._",
"ubyte_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"previous_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"._",
"x_",
",_",
"pen_",
"._",
"y_",
"=_",
"0_",
",_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"c_",
"in_",
"text_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"face_",
"._",
"load",
"\\u",
"char_",
"(_",
"c_",
",_",
"flags_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"kern",
"ing_",
"=_",
"face_",
"._",
"get",
"\\u",
"kern",
"ing_",
"(_",
"previous_",
",_",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"previous_",
"=_",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bitmap_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pitch_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"._",
"pitch_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"width_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"._",
"width_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rows_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap_",
"._",
"rows_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"top_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap",
"\\u",
"top_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"left_",
"=_",
"face_",
"._",
"glyph_",
"._",
"bitmap",
"\\u",
"left_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"._",
"x_",
"+=_",
"kern",
"ing_",
"._",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"x_",
"=_",
"(_",
"pen_",
"._",
"x_",
">>_",
"6_",
")_",
"-_",
"xmin_",
"+_",
"left_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y_",
"=_",
"(_",
"pen_",
"._",
"y_",
">>_",
"6_",
")_",
"-_",
"ymin_",
"-_",
"(_",
"rows_",
"-_",
"top_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"j_",
"in_",
"range_",
"(_",
"rows_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"._",
"extend_",
"(_",
"bitmap_",
"._",
"buffer_",
"[_",
"j_",
"*_",
"pitch_",
":_",
"j_",
"*_",
"pitch_",
"+_",
"width_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"data_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"Z_",
"=_",
"np_",
"._",
"array_",
"(_",
"data_",
",_",
"dtype_",
"=_",
"np_",
"._",
"ubyte_",
")_",
"._",
"reshape_",
"(_",
"rows_",
",_",
"width_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"L_",
"[_",
"y_",
":_",
"y_",
"+_",
"rows_",
",_",
"x_",
":_",
"x_",
"+_",
"width_",
"]_",
"|=_",
"Z_",
"[_",
":_",
":_",
"-_",
"1_",
",_",
":_",
":_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"pen_",
"._",
"x_",
"+=_",
"face_",
"._",
"glyph_",
"._",
"advance_",
"._",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pen_",
"._",
"y_",
"+=_",
"face_",
"._",
"glyph_",
"._",
"advance_",
"._",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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/kivy/kivy/uix/behaviors/focus.py | [
{
"content": " def keyboard_on_key_down(self, window, keycode, text, modifiers):\n '''The method bound to the keyboard when the instance has focus.\n\n When the instance becomes focused, this method is bound to the\n keyboard and will be called for every input press. The parameters are\n the same as :meth:`kivy.core.window.WindowBase.on_key_down`.\n\n When overwriting the method in the derived widget, super should be\n called to enable tab cycling. If the derived widget wishes to use tab\n for its own purposes, it can call super after it has processed the\n character (if it does not wish to consume the tab).\n\n Similar to other keyboard functions, it should return True if the\n key was consumed.\n '''\n if keycode[1] == 'tab': # deal with cycle\n if ['shift'] == modifiers:\n next = self._get_focus_next('focus_previous')\n else:\n next = self._get_focus_next('focus_next')\n if next:\n self.focus = False\n\n next.focus = True\n\n return True\n return False",
"metadata": "root.FocusBehavior.keyboard_on_key_down",
"header": "['class', 'FocusBehavior', '(', 'object', ')', ':', '___EOS___']",
"index": 493
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Foc",
"us",
"Behavior_",
"(_",
"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_",
"keyb",
"oard",
"\\u",
"on",
"\\u",
"key",
"\\u",
"down_",
"(_",
"self_",
",_",
"window_",
",_",
"keycode_",
",_",
"text_",
",_",
"modifiers_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"The",
" ",
"method",
" ",
"bound",
" ",
"to",
" ",
"the",
" ",
"keyb",
"oard",
" ",
"whe",
"n",
" ",
"the",
" ",
"instance",
" ",
"has",
" ",
"foc",
"us",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Whe",
"n",
" ",
"the",
" ",
"instance",
" ",
"bec",
"ome",
"s",
" ",
"focused",
",",
" ",
"this",
" ",
"method",
" ",
"is",
" ",
"bound",
" ",
"to",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"keyb",
"oard",
" ",
"and",
" ",
"will",
" ",
"be",
" ",
"call",
"ed",
" ",
"for",
" ",
"every",
" ",
"input",
" ",
"press",
".",
" ",
"The",
" ",
"parameter",
"s",
" ",
"are",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"same",
" ",
"as",
" ",
":",
"meth",
":`",
"ki",
"vy",
".",
"core",
".",
"window",
".",
"Window",
"Base",
".",
"on",
"\\u",
"key",
"\\u",
"down",
"`.",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Whe",
"n",
" ",
"overwrit",
"ing",
" ",
"the",
" ",
"method",
" ",
"in",
" ",
"the",
" ",
"derive",
"d",
" ",
"widget",
",",
" ",
"super",
" ",
"shou",
"ld",
" ",
"be",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"call",
"ed",
" ",
"to",
" ",
"enable",
" ",
"tab",
" ",
"cycl",
"ing",
".",
" ",
"If",
" ",
"the",
" ",
"derive",
"d",
" ",
"widget",
" ",
"wish",
"es",
" ",
"to",
" ",
"use",
" ",
"tab",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"for",
" ",
"its",
" ",
"own",
" ",
"purpose",
"s",
",",
" ",
"it",
" ",
"can",
" ",
"call",
" ",
"super",
" ",
"after",
" ",
"it",
" ",
"has",
" ",
"process",
"ed",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"character",
" ",
"(",
"if",
" ",
"it",
" ",
"doe",
"s",
" ",
"not",
" ",
"wish",
" ",
"to",
" ",
"consume",
" ",
"the",
" ",
"tab",
").",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Simil",
"ar",
" ",
"to",
" ",
"other",
" ",
"keyb",
"oard",
" ",
"function",
"s",
",",
" ",
"it",
" ",
"shou",
"ld",
" ",
"return",
" ",
"Tru",
"e",
" ",
"if",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"key",
" ",
"was",
" ",
"consume",
"d",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"keycode_",
"[_",
"1_",
"]_",
"==_",
"'",
"tab",
"'_",
":_",
"#",
" ",
"deal",
" ",
"with",
" ",
"cycle_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"[_",
"'",
"shift",
"'_",
"]_",
"==_",
"modifiers_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"next_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"foc",
"us",
"\\u",
"next_",
"(_",
"'",
"foc",
"us",
"\\u",
"previ",
"ous",
"'_",
")_",
"\\u\\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_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"foc",
"us",
"\\u",
"next_",
"(_",
"'",
"foc",
"us",
"\\u",
"next",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"next_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"focus_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"next_",
"._",
"focus_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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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
] |
Nested loops with same variable | ioam/holoviews/holoviews/plotting/plot.py | [
{
"content": " def _get_norm_opts(self, obj):\n \"\"\"\n Gets the normalization options for a LabelledData object by\n traversing the object for to find elements and their ids.\n The id is then used to select the appropriate OptionsTree,\n accumulating the normalization options into a dictionary.\n Returns a dictionary of normalization options for each\n element in the tree.\n \"\"\"\n norm_opts = {}\n\n # Get all elements' type.group.label specs and ids\n type_val_fn = lambda x: (x.id, (type(x).__name__, util.group_sanitizer(x.group, escape=False),\n util.label_sanitizer(x.label, escape=False))) \\\n if isinstance(x, Element) else None\n element_specs = {(idspec[0], idspec[1]) for idspec in obj.traverse(type_val_fn)\n if idspec is not None}\n\n # Group elements specs by ID and override normalization\n # options sequentially\n key_fn = lambda x: -1 if x[0] is None else x[0]\n id_groups = groupby(sorted(element_specs, key=key_fn), key_fn)\n for gid, element_spec_group in id_groups:\n gid = None if gid == -1 else gid\n group_specs = [el for _, el in element_spec_group]\n\n backend = self.renderer.backend\n optstree = Store.custom_options(\n backend=backend).get(gid, Store.options(backend=backend))\n # Get the normalization options for the current id\n # and match against customizable elements\n for opts in optstree:\n path = tuple(opts.path.split('.')[1:])\n applies = any(path == spec[:i] for spec in group_specs\n for i in range(1, 4))\n if applies and 'norm' in opts.groups:\n nopts = opts['norm'].options\n if 'axiswise' in nopts or 'framewise' in nopts:\n norm_opts.update({path: (nopts.get('axiswise', False),\n nopts.get('framewise', False))})\n element_specs = [spec for eid, spec in element_specs]\n norm_opts.update({spec: (False, False) for spec in element_specs\n if not any(spec[:i] in norm_opts.keys() for i in range(1, 4))})\n return norm_opts",
"metadata": "root.DimensionedPlot._get_norm_opts",
"header": "['class', 'DimensionedPlot', '(', 'Plot', ')', ':', '___EOS___']",
"index": 338
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Nest",
"ed_",
"loops_",
"with_",
"same_",
"variable_",
"[SEP]_",
"class_",
"Dimen",
"sion",
"ed",
"Plot_",
"(_",
"Plot_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"norm",
"\\u",
"opts_",
"(_",
"self_",
",_",
"obj_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
"s",
" ",
"the",
" ",
"normaliza",
"tion",
" ",
"options",
" ",
"for",
" ",
"a",
" ",
"Label",
"led",
"Data",
" ",
"object",
" ",
"by",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"trav",
"ersi",
"ng",
" ",
"the",
" ",
"object",
" ",
"for",
" ",
"to",
" ",
"find",
" ",
"element",
"s",
" ",
"and",
" ",
"thei",
"r",
" ",
"ids",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"id",
" ",
"is",
" ",
"then",
" ",
"used",
" ",
"to",
" ",
"select",
" ",
"the",
" ",
"appropr",
"iate",
" ",
"Optio",
"ns",
"Tree",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"accum",
"ulati",
"ng",
" ",
"the",
" ",
"normaliza",
"tion",
" ",
"options",
" ",
"int",
"o",
" ",
"a",
" ",
"dictionar",
"y",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
" ",
"a",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"normaliza",
"tion",
" ",
"options",
" ",
"for",
" ",
"each",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"element",
" ",
"in",
" ",
"the",
" ",
"tree",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"norm",
"\\u",
"opts_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Get",
" ",
"all",
" ",
"element",
"s",
"'",
" ",
"type",
".",
"group",
".",
"label",
" ",
"spec",
"s",
" ",
"and",
" ",
"ids_",
"\\u\\u\\uNL\\u\\u\\u_",
"type",
"\\u",
"val",
"\\u",
"fn_",
"=_",
"lambda_",
"x_",
":_",
"(_",
"x_",
"._",
"id_",
",_",
"(_",
"type_",
"(_",
"x_",
")_",
"._",
"\\u\\u",
"name\\u\\u_",
",_",
"util_",
"._",
"group",
"\\u",
"sanitize",
"r_",
"(_",
"x_",
"._",
"group_",
",_",
"escape_",
"=_",
"False_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"util_",
"._",
"label",
"\\u",
"sanitize",
"r_",
"(_",
"x_",
"._",
"label_",
",_",
"escape_",
"=_",
"False_",
")_",
")_",
")_",
"if_",
"isinstance_",
"(_",
"x_",
",_",
"Element_",
")_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"element",
"\\u",
"specs_",
"=_",
"{_",
"(_",
"ids",
"pec_",
"[_",
"0_",
"]_",
",_",
"ids",
"pec_",
"[_",
"1_",
"]_",
")_",
"for_",
"ids",
"pec_",
"in_",
"obj_",
"._",
"traverse_",
"(_",
"type",
"\\u",
"val",
"\\u",
"fn_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"ids",
"pec_",
"is_",
"not_",
"None_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Group",
" ",
"element",
"s",
" ",
"spec",
"s",
" ",
"by",
" ",
"ID",
" ",
"and",
" ",
"override",
" ",
"normalization_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"options",
" ",
"sequential",
"ly_",
"\\u\\u\\uNL\\u\\u\\u_",
"key",
"\\u",
"fn_",
"=_",
"lambda_",
"x_",
":_",
"-_",
"1_",
"if_",
"x_",
"[_",
"0_",
"]_",
"is_",
"None_",
"else_",
"x_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"id",
"\\u",
"groups_",
"=_",
"groupby_",
"(_",
"sorted_",
"(_",
"element",
"\\u",
"specs_",
",_",
"key_",
"=_",
"key",
"\\u",
"fn_",
")_",
",_",
"key",
"\\u",
"fn_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"gid_",
",_",
"element",
"\\u",
"spec",
"\\u",
"group_",
"in_",
"id",
"\\u",
"groups_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"gid_",
"=_",
"None_",
"if_",
"gid_",
"==_",
"-_",
"1_",
"else_",
"gid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"group",
"\\u",
"specs_",
"=_",
"[_",
"el_",
"for_",
"\\u_",
",_",
"el_",
"in_",
"element",
"\\u",
"spec",
"\\u",
"group_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"backend_",
"=_",
"self_",
"._",
"renderer_",
"._",
"backend_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"opts",
"tree_",
"=_",
"Store_",
"._",
"custom",
"\\u",
"options_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"backend_",
"=_",
"backend_",
")_",
"._",
"get_",
"(_",
"gid_",
",_",
"Store_",
"._",
"options_",
"(_",
"backend_",
"=_",
"backend_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Get",
" ",
"the",
" ",
"normaliza",
"tion",
" ",
"options",
" ",
"for",
" ",
"the",
" ",
"current",
" ",
"id_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"and",
" ",
"match",
" ",
"against",
" ",
"customi",
"zab",
"le",
" ",
"elements_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"opts_",
"in_",
"opts",
"tree_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"path_",
"=_",
"tuple_",
"(_",
"opts_",
"._",
"path_",
"._",
"split_",
"(_",
"'.'_",
")_",
"[_",
"1_",
":_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"appli",
"es_",
"=_",
"any_",
"(_",
"path_",
"==_",
"spec_",
"[_",
":_",
"i_",
"]_",
"for_",
"spec_",
"in_",
"group",
"\\u",
"specs_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"i_",
"in_",
"range_",
"(_",
"1_",
",_",
"4_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"appli",
"es_",
"and_",
"'",
"norm",
"'_",
"in_",
"opts_",
"._",
"groups_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"nop",
"ts_",
"=_",
"opts_",
"[_",
"'",
"norm",
"'_",
"]_",
"._",
"options_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"'",
"axis",
"wis",
"e",
"'_",
"in_",
"nop",
"ts_",
"or_",
"'",
"frame",
"wis",
"e",
"'_",
"in_",
"nop",
"ts_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"norm",
"\\u",
"opts_",
"._",
"update_",
"(_",
"{_",
"path_",
":_",
"(_",
"nop",
"ts_",
"._",
"get_",
"(_",
"'",
"axis",
"wis",
"e",
"'_",
",_",
"False_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"nop",
"ts_",
"._",
"get_",
"(_",
"'",
"frame",
"wis",
"e",
"'_",
",_",
"False_",
")_",
")_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"element",
"\\u",
"specs_",
"=_",
"[_",
"spec_",
"for_",
"eid_",
",_",
"spec_",
"in_",
"element",
"\\u",
"specs_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"norm",
"\\u",
"opts_",
"._",
"update_",
"(_",
"{_",
"spec_",
":_",
"(_",
"False_",
",_",
"False_",
")_",
"for_",
"spec_",
"in_",
"element",
"\\u",
"specs_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"any_",
"(_",
"spec_",
"[_",
":_",
"i_",
"]_",
"in_",
"norm",
"\\u",
"opts_",
"._",
"keys_",
"(_",
")_",
"for_",
"i_",
"in_",
"range_",
"(_",
"1_",
",_",
"4_",
")_",
")_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"norm",
"\\u",
"opts_",
"\\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,
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | lionheart/django-pyodbc/django_pyodbc/base.py | [
{
"content": " def fetchone(self):\n row = self.cursor.fetchone()\n if row is not None:\n return self.format_results(row)\n return []",
"metadata": "root.CursorWrapper.fetchone",
"header": "['class', 'CursorWrapper', '(', 'object', ')', ':', '___EOS___']",
"index": 482
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Curs",
"or",
"Wrapper_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"fetchone_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"row_",
"=_",
"self_",
"._",
"cursor_",
"._",
"fetchone_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"row_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"format\\u",
"results_",
"(_",
"row_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Imprecise assert | NeuralEnsemble/python-neo/neo/test/coretest/test_eventarray.py | [
{
"content": " def test_EventArray_creation(self):\n params = {'test2': 'y1', 'test3': True}\n evta = EventArray([1.1, 1.5, 1.7]*pq.ms,\n labels=np.array(['test event 1',\n 'test event 2',\n 'test event 3'], dtype='S'),\n name='test', description='tester',\n file_origin='test.file',\n test1=1, **params)\n evta.annotate(test1=1.1, test0=[1, 2])\n assert_neo_object_is_compliant(evta)\n\n assert_arrays_equal(evta.times, [1.1, 1.5, 1.7]*pq.ms)\n assert_arrays_equal(evta.labels, np.array(['test event 1',\n 'test event 2',\n 'test event 3'], dtype='S'))\n self.assertEqual(evta.name, 'test')\n self.assertEqual(evta.description, 'tester')\n self.assertEqual(evta.file_origin, 'test.file')\n self.assertEqual(evta.annotations['test0'], [1, 2])\n self.assertEqual(evta.annotations['test1'], 1.1)\n self.assertEqual(evta.annotations['test2'], 'y1')\n self.assertTrue(evta.annotations['test3'])",
"metadata": "root.TestEventArray.test_EventArray_creation",
"header": "['class', 'TestEventArray', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 90
},
{
"content": " def test__children(self):\n params = {'test2': 'y1', 'test3': True}\n evta = EventArray([1.1, 1.5, 1.7]*pq.ms,\n labels=np.array(['test event 1',\n 'test event 2',\n 'test event 3'], dtype='S'),\n name='test', description='tester',\n file_origin='test.file',\n test1=1, **params)\n evta.annotate(test1=1.1, test0=[1, 2])\n assert_neo_object_is_compliant(evta)\n\n segment = Segment(name='seg1')\n segment.eventarrays = [evta]\n segment.create_many_to_one_relationship()\n\n self.assertEqual(evta._single_parent_objects, ('Segment',))\n self.assertEqual(evta._multi_parent_objects, ())\n\n self.assertEqual(evta._single_parent_containers, ('segment',))\n self.assertEqual(evta._multi_parent_containers, ())\n\n self.assertEqual(evta._parent_objects, ('Segment',))\n self.assertEqual(evta._parent_containers, ('segment',))\n\n self.assertEqual(len(evta.parents), 1)\n self.assertEqual(evta.parents[0].name, 'seg1')\n\n assert_neo_object_is_compliant(evta)",
"metadata": "root.TestEventArray.test__children",
"header": "['class', 'TestEventArray', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 172
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Test",
"Event",
"Array_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test\\u",
"Event",
"Array",
"\\u",
"creation_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"params_",
"=_",
"{_",
"'",
"test",
"2",
"'_",
":_",
"'",
"y1",
"'_",
",_",
"'",
"test",
"3",
"'_",
":_",
"True_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"evt",
"a_",
"=_",
"Event",
"Array_",
"(_",
"[_",
"1.1_",
",_",
"1.5_",
",_",
"1.7",
"_",
"]_",
"*_",
"pq_",
"._",
"ms_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"labels_",
"=_",
"np_",
"._",
"array_",
"(_",
"[_",
"'",
"test",
" ",
"event",
" ",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
" ",
"event",
" ",
"2",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
" ",
"event",
" ",
"3",
"'_",
"]_",
",_",
"dtype_",
"=_",
"'",
"S",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"'",
"test",
"'_",
",_",
"description_",
"=_",
"'",
"teste",
"r",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"file",
"\\u",
"origin_",
"=_",
"'",
"test",
".",
"file",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"test1_",
"=_",
"1_",
",_",
"**_",
"params_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"evt",
"a_",
"._",
"annotate_",
"(_",
"test1_",
"=_",
"1.1_",
",_",
"test0",
"_",
"=_",
"[_",
"1_",
",_",
"2_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"neo",
"\\u",
"object\\u",
"is",
"\\u",
"compliant",
"_",
"(_",
"evt",
"a_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert",
"\\u",
"arrays",
"\\u",
"equal_",
"(_",
"evt",
"a_",
"._",
"times_",
",_",
"[_",
"1.1_",
",_",
"1.5_",
",_",
"1.7",
"_",
"]_",
"*_",
"pq_",
"._",
"ms_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"arrays",
"\\u",
"equal_",
"(_",
"evt",
"a_",
"._",
"labels_",
",_",
"np_",
"._",
"array_",
"(_",
"[_",
"'",
"test",
" ",
"event",
" ",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
" ",
"event",
" ",
"2",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
" ",
"event",
" ",
"3",
"'_",
"]_",
",_",
"dtype_",
"=_",
"'",
"S",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"name_",
",_",
"'",
"test",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"description_",
",_",
"'",
"teste",
"r",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"file",
"\\u",
"origin_",
",_",
"'",
"test",
".",
"file",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"annotations_",
"[_",
"'",
"test0",
"'_",
"]_",
",_",
"[_",
"1_",
",_",
"2_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"annotations_",
"[_",
"'",
"test",
"1",
"'_",
"]_",
",_",
"1.1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"annotations_",
"[_",
"'",
"test",
"2",
"'_",
"]_",
",_",
"'",
"y1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"evt",
"a_",
"._",
"annotations_",
"[_",
"'",
"test",
"3",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Event",
"Array_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"\\u",
"children_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"params_",
"=_",
"{_",
"'",
"test",
"2",
"'_",
":_",
"'",
"y1",
"'_",
",_",
"'",
"test",
"3",
"'_",
":_",
"True_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"evt",
"a_",
"=_",
"Event",
"Array_",
"(_",
"[_",
"1.1_",
",_",
"1.5_",
",_",
"1.7",
"_",
"]_",
"*_",
"pq_",
"._",
"ms_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"labels_",
"=_",
"np_",
"._",
"array_",
"(_",
"[_",
"'",
"test",
" ",
"event",
" ",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
" ",
"event",
" ",
"2",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"test",
" ",
"event",
" ",
"3",
"'_",
"]_",
",_",
"dtype_",
"=_",
"'",
"S",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"'",
"test",
"'_",
",_",
"description_",
"=_",
"'",
"teste",
"r",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"file",
"\\u",
"origin_",
"=_",
"'",
"test",
".",
"file",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"test1_",
"=_",
"1_",
",_",
"**_",
"params_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"evt",
"a_",
"._",
"annotate_",
"(_",
"test1_",
"=_",
"1.1_",
",_",
"test0",
"_",
"=_",
"[_",
"1_",
",_",
"2_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert",
"\\u",
"neo",
"\\u",
"object\\u",
"is",
"\\u",
"compliant",
"_",
"(_",
"evt",
"a_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"segment_",
"=_",
"Segment_",
"(_",
"name_",
"=_",
"'",
"seg",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"segment_",
"._",
"event",
"arrays_",
"=_",
"[_",
"evt",
"a_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"segment_",
"._",
"create",
"\\u",
"many",
"\\u",
"to",
"\\u",
"one",
"\\u",
"relationship_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"\\u",
"single",
"\\u",
"parent",
"\\u",
"objects_",
",_",
"(_",
"'",
"Segme",
"nt",
"'_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"\\u",
"multi",
"\\u",
"parent",
"\\u",
"objects_",
",_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"\\u",
"single",
"\\u",
"parent",
"\\u",
"containers_",
",_",
"(_",
"'",
"segment",
"'_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"\\u",
"multi",
"\\u",
"parent",
"\\u",
"containers_",
",_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"\\u",
"parent",
"\\u",
"objects_",
",_",
"(_",
"'",
"Segme",
"nt",
"'_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"\\u",
"parent",
"\\u",
"containers_",
",_",
"(_",
"'",
"segment",
"'_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"evt",
"a_",
"._",
"parents_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"evt",
"a_",
"._",
"parents_",
"[_",
"0_",
"]_",
"._",
"name_",
",_",
"'",
"seg",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert",
"\\u",
"neo",
"\\u",
"object\\u",
"is",
"\\u",
"compliant",
"_",
"(_",
"evt",
"a_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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feed/tests/transitfeed/testschedule.py | [
{
"content": " def setUp(self):\n super(ServiceGapsTestCase, self).setUp()\n self.SetArchiveContents(\"calendar.txt\",\n \"service_id,monday,tuesday,wednesday,thursday,friday,\"\n \"saturday,sunday,start_date,end_date\\n\"\n \"FULLW,1,1,1,1,1,1,1,20090601,20090610\\n\"\n \"WE,0,0,0,0,0,1,1,20090718,20101231\\n\")\n self.SetArchiveContents(\"calendar_dates.txt\",\n \"service_id,date,exception_type\\n\"\n \"WE,20090815,2\\n\"\n \"WE,20090816,2\\n\"\n \"WE,20090822,2\\n\"\n # The following two lines are a 12-day service gap.\n # Shouldn't issue a warning\n \"WE,20090829,2\\n\"\n \"WE,20090830,2\\n\"\n \"WE,20100102,2\\n\"\n \"WE,20100103,2\\n\"\n \"WE,20100109,2\\n\"\n \"WE,20100110,2\\n\"\n \"WE,20100612,2\\n\"\n \"WE,20100613,2\\n\"\n \"WE,20100619,2\\n\"\n \"WE,20100620,2\\n\")\n self.SetArchiveContents(\"trips.txt\",\n \"route_id,service_id,trip_id\\n\"\n \"AB,WE,AB1\\n\"\n \"AB,FULLW,AB2\\n\")\n self.SetArchiveContents(\n \"stop_times.txt\",\n \"trip_id,arrival_time,departure_time,stop_id,stop_sequence\\n\"\n \"AB1,10:00:00,10:00:00,BEATTY_AIRPORT,1\\n\"\n \"AB1,10:20:00,10:20:00,BULLFROG,2\\n\"\n \"AB2,10:25:00,10:25:00,STAGECOACH,1\\n\"\n \"AB2,10:55:00,10:55:00,BULLFROG,2\\n\")\n self.schedule = self.MakeLoaderAndLoad(extra_validation=False)",
"metadata": "root.ServiceGapsTestCase.setUp",
"header": "['class', 'ServiceGapsTestCase', '(', 'util', '.', 'MemoryZipTestCase', ')', ':', '___EOS___']",
"index": 863
}
] | [] | [] | 0 | true | [
"[CLS]_",
"First_",
"argument_",
"to_",
"super_",
"(_",
")_",
"is_",
"not_",
"encl",
"osin",
"g_",
"class_",
"[SEP]_",
"class_",
"Service",
"Gap",
"s",
"Test",
"Case_",
"(_",
"util_",
"._",
"Memo",
"ry",
"Zip",
"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 ",
" _",
"super_",
"(_",
"Service",
"Gap",
"s",
"Test",
"Case_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"Set",
"Archive",
"Contents_",
"(_",
"\"",
"calendar",
".",
"txt",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"service",
"\\u",
"id",
",",
"mond",
"ay",
",",
"tu",
"esd",
"ay",
",",
"wed",
"nes",
"day",
",",
"thu",
"rsd",
"ay",
",",
"fri",
"day",
",\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"satur",
"day",
",",
"sund",
"ay",
",",
"start",
"\\u",
"date",
",",
"end",
"\\u",
"date",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"FULL",
"W",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"20090",
"601",
",",
"20090",
"610",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"20090",
"718",
",",
"2010",
"1231",
"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"Set",
"Archive",
"Contents_",
"(_",
"\"",
"calendar",
"\\u",
"dates",
".",
"txt",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"service",
"\\u",
"id",
",",
"date",
",",
"exception",
"\\u",
"type",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20090",
"815",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20090",
"816",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20090",
"822",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"follow",
"ing",
" ",
"two",
" ",
"lines",
" ",
"are",
" ",
"a",
" ",
"1",
"2",
"-",
"day",
" ",
"service",
" ",
"gap",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Sho",
"ul",
"dn",
"'",
"t",
" ",
"issue",
" ",
"a",
" ",
"warning_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20090",
"829",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20090",
"830",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"102",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"103",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"109",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"110",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"612",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"613",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"619",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"WE",
",",
"20100",
"620",
",",
"2",
"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"Set",
"Archive",
"Contents_",
"(_",
"\"",
"trips",
".",
"txt",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"route",
"\\u",
"id",
",",
"service",
"\\u",
"id",
",",
"trip",
"\\u",
"id",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"AB",
",",
"WE",
",",
"AB",
"1",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"AB",
",",
"FULL",
"W",
",",
"AB",
"2",
"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"Set",
"Archive",
"Contents_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"stop",
"\\u",
"times",
".",
"txt",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"trip",
"\\u",
"id",
",",
"arrival",
"\\u",
"time",
",",
"departure",
"\\u",
"time",
",",
"stop",
"\\u",
"id",
",",
"stop",
"\\u",
"sequence",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"AB",
"1",
",",
"10",
":",
"00",
":",
"00",
",",
"10",
":",
"00",
":",
"00",
",",
"BEA",
"TTY",
"\\u",
"AIR",
"PORT",
",",
"1",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"AB",
"1",
",",
"10",
":",
"20",
":",
"00",
",",
"10",
":",
"20",
":",
"00",
",",
"BUL",
"LF",
"RO",
"G",
",",
"2",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"AB",
"2",
",",
"10",
":",
"25",
":",
"00",
",",
"10",
":",
"25",
":",
"00",
",",
"STAGE",
"COA",
"CH",
",",
"1",
"\\\\",
"n",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"AB",
"2",
",",
"10",
":",
"5",
"5",
":",
"00",
",",
"10",
":",
"5",
"5",
":",
"00",
",",
"BUL",
"LF",
"RO",
"G",
",",
"2",
"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"schedule_",
"=_",
"self_",
"._",
"Make",
"Load",
"er",
"And",
"Load_",
"(_",
"extra",
"\\u",
"validation_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Unused import | karanlyons/django-save-the-change/tests/manage.py | [
{
"content": "# -*- coding: utf-8 -*-\n\nfrom __future__ import division, absolute_import, print_function, unicode_literals\n\nimport os\nimport sys\n\n\nif __name__ == \"__main__\":\n\tos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproject.settings')\n\tfrom django.core.management import execute_from_command_line\n\texecute_from_command_line(sys.argv)\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_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"division_",
",_",
"abs",
"olute",
"\\u",
"import_",
",_",
"print",
"\\u",
"function_",
",_",
"unicode",
"\\u",
"literals_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"\"\\u\\u",
"main",
"\\u\\u\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u\t",
"_",
"os_",
"._",
"environ_",
"._",
"setdefault_",
"(_",
"'",
"DJANGO",
"\\u",
"SETTING",
"S",
"\\u",
"MODUL",
"E",
"'_",
",_",
"'",
"testpro",
"ject",
".",
"settings",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"management_",
"import_",
"execute",
"\\u",
"from",
"\\u",
"command",
"\\u",
"line_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"execute",
"\\u",
"from",
"\\u",
"command",
"\\u",
"line_",
"(_",
"sys_",
"._",
"argv_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unreachable code | sassoftware/conary/conary_test/clienttest/modelupdatetest.py | [
{
"content": " @testhelp.context('sysmodel')\n def testIncludeErrors(self):\n self.addComponent(\"inctrove:cml\", fileContents = [\n ( \"/some/path/to.cml\",\n \"search foo=localhost@other:label\\n\" ),\n ( \"/some/more.cml\", \"\\n\") ] )\n\n e = self.assertRaises(troveset.IncludeException,\n self._applyModel, [ 'include inctrove:cml' ])\n self.assertEquals(str(e),\n 'Too many cml files found in '\n 'inctrove:cml=/localhost@rpl:linux/1.0-1-1[]: '\n '/some/more.cml /some/path/to.cml')\n\n self.addComponent(\"inctrove:cml=2.0\", fileContents = [ ])\n e = self.assertRaises(troveset.IncludeException,\n self._applyModel, [ 'include inctrove:cml' ])\n self.assertEquals(str(e),\n 'No cml files found in '\n 'inctrove:cml=/localhost@rpl:linux/2.0-1-1[]')\n\n self.addComponent('inctrove:runtime=3.0')\n self.addCollection('inctrove=3.0', [ ':runtime' ])\n e = self.assertRaises(troveset.IncludeException,\n self._applyModel, [ 'include inctrove' ])\n self.assertEquals(str(e),\n 'Package inctrove=/localhost@rpl:linux/3.0-1-1[] does not '\n 'contain a cml component for inclusion')\n\n e = self.assertRaises(troveset.IncludeException,\n self._applyModel, [ 'include inctrove:runtime' ])\n self.assertEquals(str(e), 'Include only supports source and cml '\n 'components')",
"metadata": "root.ModelUpdateTest.testIncludeErrors",
"header": "['class', 'ModelUpdateTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']",
"index": 367
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"class_",
"Model",
"Update",
"Test_",
"(_",
"rep",
"help_",
"._",
"Repos",
"itor",
"y",
"Helper_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"testh",
"elp",
"_",
"._",
"context_",
"(_",
"'",
"sys",
"model",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test",
"Include",
"Errors_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"add",
"Component_",
"(_",
"\"",
"inc",
"trove",
":",
"cml",
"\"_",
",_",
"file",
"Contents_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"\"/",
"some",
"/",
"path",
"/",
"to",
".",
"cml",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"search",
" ",
"foo",
"=",
"local",
"host",
"@",
"other",
":",
"label",
"\\\\",
"n",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"\"/",
"some",
"/",
"more",
".",
"cml",
"\"_",
",_",
"\"\\\\",
"n",
"\"_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"e_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"trove",
"set_",
"._",
"Include",
"Exception_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"appl",
"y",
"Model_",
",_",
"[_",
"'",
"include",
" ",
"inc",
"trove",
":",
"cml",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"str_",
"(_",
"e_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Too",
" ",
"many",
" ",
"cml",
" ",
"files",
" ",
"found",
" ",
"in",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"inc",
"trove",
":",
"cml",
"=",
"/",
"local",
"host",
"@",
"rpl",
":",
"linux",
"/",
"1.0",
"-1",
"-1",
"[]",
":",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'/",
"some",
"/",
"more",
".",
"cml",
" ",
"/",
"some",
"/",
"path",
"/",
"to",
".",
"cml",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"add",
"Component_",
"(_",
"\"",
"inc",
"trove",
":",
"cml",
"=",
"2.0",
"\"_",
",_",
"file",
"Contents_",
"=_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"e_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"trove",
"set_",
"._",
"Include",
"Exception_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"appl",
"y",
"Model_",
",_",
"[_",
"'",
"include",
" ",
"inc",
"trove",
":",
"cml",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"str_",
"(_",
"e_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"No",
" ",
"cml",
" ",
"files",
" ",
"found",
" ",
"in",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"inc",
"trove",
":",
"cml",
"=",
"/",
"local",
"host",
"@",
"rpl",
":",
"linux",
"/",
"2.0",
"-1",
"-1",
"[]'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"add",
"Component_",
"(_",
"'",
"inc",
"trove",
":",
"runt",
"ime",
"=",
"3.0",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"add",
"Collection_",
"(_",
"'",
"inc",
"trove",
"=",
"3.0",
"'_",
",_",
"[_",
"':",
"runt",
"ime",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"e_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"trove",
"set_",
"._",
"Include",
"Exception_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"appl",
"y",
"Model_",
",_",
"[_",
"'",
"include",
" ",
"inc",
"trove",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"str_",
"(_",
"e_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Packa",
"ge",
" ",
"inc",
"trove",
"=",
"/",
"local",
"host",
"@",
"rpl",
":",
"linux",
"/",
"3.0",
"-1",
"-1",
"[]",
" ",
"doe",
"s",
" ",
"not",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"contain",
" ",
"a",
" ",
"cml",
" ",
"component",
" ",
"for",
" ",
"inclusion",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"e_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"trove",
"set_",
"._",
"Include",
"Exception_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"appl",
"y",
"Model_",
",_",
"[_",
"'",
"include",
" ",
"inc",
"trove",
":",
"runt",
"ime",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"str_",
"(_",
"e_",
")_",
",_",
"'",
"Include",
" ",
"only",
" ",
"support",
"s",
" ",
"source",
" ",
"and",
" ",
"cml",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"component",
"s",
"'_",
")_",
"\\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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | openstack/rally/rally/osclients.py | [
{
"content": " def _create_keystone_client(self, args, version=None):\n from keystoneclient.auth import identity\n from keystoneclient import client\n auth_arg_list = [\n \"username\", \"project_name\", \"tenant_name\", \"auth_url\",\n \"password\",\n ]\n # NOTE(bigjools): If forcing a v2.0 URL then you cannot specify\n # domain-related info, or the service discovery will fail.\n if \"v2.0\" not in args[\"auth_url\"] and version != \"2\":\n auth_arg_list.extend(\n [\"user_domain_name\", \"domain_name\", \"project_domain_name\"])\n auth_args = {key: args.get(key) for key in auth_arg_list}\n auth = identity.Password(**auth_args)\n session = self._get_session(auth=auth)\n args[\"session\"] = session\n # NOTE(bigjools): When using sessions, keystoneclient no longer\n # does any pre-auth and calling client.authenticate() with\n # sessions is deprecated (it's still possible to call it but if\n # endpoint is defined it'll crash). We're forcing that pre-auth\n # here because the use of the service_catalog depends on doing\n # this. Also note that while the API has got the\n # endpoints.list() equivalent, there is no service_type in that\n # list which is why we need to ensure service_catalog is still\n # present.\n auth_ref = auth.get_access(session)\n ks = client.Client(version=version, **args)\n ks.auth_ref = auth_ref\n return ks",
"metadata": "root.Keystone._create_keystone_client",
"header": "['class', 'Keystone', '(', 'OSClient', ')', ':', '___EOS___']",
"index": 221
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"Keys",
"tone_",
"(_",
"OSC",
"lient_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"create",
"\\u",
"keystone",
"\\u",
"client_",
"(_",
"self_",
",_",
"args_",
",_",
"version_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"keystone",
"client_",
"._",
"auth_",
"import_",
"identity_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"keystone",
"client_",
"import_",
"client_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"auth",
"\\u",
"arg",
"\\u",
"list_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"user",
"name",
"\"_",
",_",
"\"",
"project",
"\\u",
"name",
"\"_",
",_",
"\"",
"tenan",
"t",
"\\u",
"name",
"\"_",
",_",
"\"",
"auth",
"\\u",
"url",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"password",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"NOTE",
"(",
"big",
"jo",
"ols",
"):",
" ",
"If",
" ",
"forcing",
" ",
"a",
" ",
"v2",
".0",
" ",
"URL",
" ",
"then",
" ",
"you",
" ",
"cann",
"ot",
" ",
"speci",
"fy_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"domain",
"-",
"relate",
"d",
" ",
"info",
",",
" ",
"or",
" ",
"the",
" ",
"service",
" ",
"discove",
"ry",
" ",
"will",
" ",
"fail",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"\"",
"v2",
".0",
"\"_",
"not_",
"in_",
"args_",
"[_",
"\"",
"auth",
"\\u",
"url",
"\"_",
"]_",
"and_",
"version_",
"!=_",
"\"",
"2",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"auth",
"\\u",
"arg",
"\\u",
"list_",
"._",
"extend_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"\"",
"user",
"\\u",
"domain",
"\\u",
"name",
"\"_",
",_",
"\"",
"domain",
"\\u",
"name",
"\"_",
",_",
"\"",
"project",
"\\u",
"domain",
"\\u",
"name",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"auth",
"\\u",
"args_",
"=_",
"{_",
"key_",
":_",
"args_",
"._",
"get_",
"(_",
"key_",
")_",
"for_",
"key_",
"in_",
"auth",
"\\u",
"arg",
"\\u",
"list_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"auth_",
"=_",
"identity_",
"._",
"Password_",
"(_",
"**_",
"auth",
"\\u",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"session_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"session_",
"(_",
"auth_",
"=_",
"auth_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"args_",
"[_",
"\"",
"session",
"\"_",
"]_",
"=_",
"session_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"NOTE",
"(",
"big",
"jo",
"ols",
"):",
" ",
"Whe",
"n",
" ",
"usi",
"ng",
" ",
"session",
"s",
",",
" ",
"keystone",
"client",
" ",
"no",
" ",
"long",
"er_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"doe",
"s",
" ",
"any",
" ",
"pre",
"-",
"auth",
" ",
"and",
" ",
"calling",
" ",
"client",
".",
"authenticat",
"e",
"()",
" ",
"with_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"session",
"s",
" ",
"is",
" ",
"depre",
"cated",
" ",
"(",
"it",
"'",
"s",
" ",
"still",
" ",
"possib",
"le",
" ",
"to",
" ",
"call",
" ",
"it",
" ",
"but",
" ",
"if_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"endpoint",
" ",
"is",
" ",
"defin",
"ed",
" ",
"it",
"'",
"ll",
" ",
"crash",
").",
" ",
"We",
"'",
"re",
" ",
"forcing",
" ",
"tha",
"t",
" ",
"pre",
"-",
"auth_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"here",
" ",
"bec",
"aus",
"e",
" ",
"the",
" ",
"use",
" ",
"of",
" ",
"the",
" ",
"service",
"\\u",
"catal",
"og",
" ",
"depend",
"s",
" ",
"on",
" ",
"doi",
"ng_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"this",
".",
" ",
"Al",
"so",
" ",
"note",
" ",
"tha",
"t",
" ",
"whi",
"le",
" ",
"the",
" ",
"API",
" ",
"has",
" ",
"got",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"endpoint",
"s",
".",
"list",
"()",
" ",
"equivalent",
",",
" ",
"there",
" ",
"is",
" ",
"no",
" ",
"service",
"\\u",
"type",
" ",
"in",
" ",
"that_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"list",
" ",
"whi",
"ch",
" ",
"is",
" ",
"wh",
"y",
" ",
"we",
" ",
"need",
" ",
"to",
" ",
"ensure",
" ",
"service",
"\\u",
"catal",
"og",
" ",
"is",
" ",
"still",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"presen",
"t",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"auth",
"\\u",
"ref_",
"=_",
"auth_",
"._",
"get",
"\\u",
"access_",
"(_",
"session_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ks_",
"=_",
"client_",
"._",
"Client_",
"(_",
"version_",
"=_",
"version_",
",_",
"**_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ks_",
"._",
"auth",
"\\u",
"ref_",
"=_",
"auth",
"\\u",
"ref_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"ks_",
"\\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,
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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
] |
Unused local variable | ExCiteS/geokey/geokey/contributions/tests/comments/test_views.py | [
{
"content": " def test_delete_review_comment_with_comment_creator(self):\n self.comment_to_remove.review_status = 'open'\n self.comment_to_remove.save()\n self.contribution.status = 'review'\n self.contribution.save()\n\n response = self.get_response(self.contributor)\n self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)\n\n contribution = Observation.objects.get(pk=self.contribution.id)\n self.assertEqual(contribution.status, 'active')\n\n self.assertIn(self.comment, contribution.comments.all())\n self.assertNotIn(self.comment_to_remove, contribution.comments.all())",
"metadata": "root.DeleteProjectCommentTest.test_delete_review_comment_with_comment_creator",
"header": "['class', 'DeleteProjectCommentTest', '(', 'APITestCase', ')', ':', '___EOS___']",
"index": 786
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Delete",
"Project",
"Comme",
"nt",
"Test_",
"(_",
"API",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"delete",
"\\u",
"review",
"\\u",
"comment",
"\\u",
"with",
"\\u",
"comment",
"\\u",
"creator_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"comment",
"\\u",
"to",
"\\u",
"remove_",
"._",
"review",
"\\u",
"status_",
"=_",
"'",
"open",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"comment",
"\\u",
"to",
"\\u",
"remove_",
"._",
"save_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"contribution",
"_",
"._",
"status_",
"=_",
"'",
"review",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"contribution",
"_",
"._",
"save_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"get",
"\\u",
"response_",
"(_",
"self_",
"._",
"contributor_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"response_",
"._",
"status",
"\\u",
"code_",
",_",
"status_",
"._",
"HTTP",
"\\u",
"204",
"\\u",
"NO",
"\\u",
"CONTENT_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"contribution",
"_",
"=_",
"Observation",
"_",
"._",
"objects_",
"._",
"get_",
"(_",
"pk_",
"=_",
"self_",
"._",
"contribution",
"_",
"._",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"contribution",
"_",
"._",
"status_",
",_",
"'",
"active",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"In_",
"(_",
"self_",
"._",
"comment_",
",_",
"contribution",
"_",
"._",
"comments_",
"._",
"all_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Not",
"In_",
"(_",
"self_",
"._",
"comment",
"\\u",
"to",
"\\u",
"remove_",
",_",
"contribution",
"_",
"._",
"comments_",
"._",
"all_",
"(_",
")_",
")_",
"\\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
] |
Unused import | sympy/sympy/sympy/physics/quantum/tests/test_qexpr.py | [
{
"content": "from sympy import Symbol, Integer\nfrom sympy.physics.quantum.qexpr import QExpr, _qsympify_sequence\nfrom sympy.physics.quantum.hilbert import HilbertSpace\nfrom sympy.core.containers import Tuple\n\nx = Symbol('x')\ny = Symbol('y')\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def test_qexpr_new():\n q = QExpr(0)\n assert q.label == (0,)\n assert q.hilbert_space == HilbertSpace()\n assert q.is_commutative is False\n\n q = QExpr(0, 1)\n assert q.label == (Integer(0), Integer(1))\n\n q = QExpr._new_rawargs(HilbertSpace(), Integer(0), Integer(1))\n assert q.label == (Integer(0), Integer(1))\n assert q.hilbert_space == HilbertSpace()",
"metadata": "root.test_qexpr_new",
"header": "['module', '___EOS___']",
"index": 9
},
{
"content": "def test_qexpr_commutative():\n q1 = QExpr(x)\n q2 = QExpr(y)\n assert q1.is_commutative is False\n assert q2.is_commutative is False\n assert q1*q2 != q2*q1\n\n q = QExpr._new_rawargs(0, 1, HilbertSpace())\n assert q.is_commutative is False",
"metadata": "root.test_qexpr_commutative",
"header": "['module', '___EOS___']",
"index": 23
},
{
"content": "def test_qexpr_commutative_free_symbols():\n q1 = QExpr(x)\n assert q1.free_symbols.pop().is_commutative is False\n\n q2 = QExpr('q2')\n assert q2.free_symbols.pop().is_commutative is False",
"metadata": "root.test_qexpr_commutative_free_symbols",
"header": "['module', '___EOS___']",
"index": 33
},
{
"content": "def test_qexpr_subs():\n q1 = QExpr(x, y)\n assert q1.subs(x, y) == QExpr(y, y)\n assert q1.subs({x: 1, y: 2}) == QExpr(1, 2)",
"metadata": "root.test_qexpr_subs",
"header": "['module', '___EOS___']",
"index": 40
},
{
"content": "def test_qsympify():\n assert _qsympify_sequence([[1, 2], [1, 3]]) == (Tuple(1, 2), Tuple(1, 3))\n assert _qsympify_sequence(([1, 2, [3, 4, [2, ]], 1], 3)) == \\\n (Tuple(1, 2, Tuple(3, 4, Tuple(2,)), 1), 3)\n assert _qsympify_sequence((1,)) == (1,)",
"metadata": "root.test_qsympify",
"header": "['module', '___EOS___']",
"index": 46
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"sympy_",
"import_",
"Symbol_",
",_",
"Integer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"sympy_",
"._",
"physics_",
"._",
"quantum",
"_",
"._",
"qe",
"xpr",
"_",
"import_",
"QE",
"xpr",
"_",
",_",
"\\u",
"qs",
"ym",
"pif",
"y",
"\\u",
"sequence_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"sympy_",
"._",
"physics_",
"._",
"quantum",
"_",
"._",
"hil",
"bert",
"_",
"import_",
"Hi",
"lb",
"ert",
"Space_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"sympy_",
"._",
"core_",
"._",
"containers_",
"import_",
"Tuple_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"x_",
"=_",
"Symbol_",
"(_",
"'",
"x",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"y_",
"=_",
"Symbol_",
"(_",
"'",
"y",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"test\\u",
"qe",
"xpr",
"\\u",
"new_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"q_",
"=_",
"QE",
"xpr",
"_",
"(_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"label_",
"==_",
"(_",
"0_",
",_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"hil",
"bert",
"\\u",
"space_",
"==_",
"Hi",
"lb",
"ert",
"Space_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
"is_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"q_",
"=_",
"QE",
"xpr",
"_",
"(_",
"0_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"label_",
"==_",
"(_",
"Integer_",
"(_",
"0_",
")_",
",_",
"Integer_",
"(_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"q_",
"=_",
"QE",
"xpr",
"_",
"._",
"\\u",
"new",
"\\u",
"raw",
"args_",
"(_",
"Hi",
"lb",
"ert",
"Space_",
"(_",
")_",
",_",
"Integer_",
"(_",
"0_",
")_",
",_",
"Integer_",
"(_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"label_",
"==_",
"(_",
"Integer_",
"(_",
"0_",
")_",
",_",
"Integer_",
"(_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"hil",
"bert",
"\\u",
"space_",
"==_",
"Hi",
"lb",
"ert",
"Space_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"qe",
"xpr",
"\\u",
"commu",
"tative",
"_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"q1_",
"=_",
"QE",
"xpr",
"_",
"(_",
"x_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"q2_",
"=_",
"QE",
"xpr",
"_",
"(_",
"y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q1_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
"is_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q2_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
"is_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q1_",
"*_",
"q2_",
"!=_",
"q2_",
"*_",
"q1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"q_",
"=_",
"QE",
"xpr",
"_",
"._",
"\\u",
"new",
"\\u",
"raw",
"args_",
"(_",
"0_",
",_",
"1_",
",_",
"Hi",
"lb",
"ert",
"Space_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
"is_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"qe",
"xpr",
"\\u",
"commu",
"tative",
"\\u",
"free",
"\\u",
"symbols_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"q1_",
"=_",
"QE",
"xpr",
"_",
"(_",
"x_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q1_",
"._",
"free",
"\\u",
"symbols_",
"._",
"pop_",
"(_",
")_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
"is_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"q2_",
"=_",
"QE",
"xpr",
"_",
"(_",
"'",
"q2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q2_",
"._",
"free",
"\\u",
"symbols_",
"._",
"pop_",
"(_",
")_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
"is_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"qe",
"xpr",
"\\u",
"subs_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"q1_",
"=_",
"QE",
"xpr",
"_",
"(_",
"x_",
",_",
"y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q1_",
"._",
"subs_",
"(_",
"x_",
",_",
"y_",
")_",
"==_",
"QE",
"xpr",
"_",
"(_",
"y_",
",_",
"y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"q1_",
"._",
"subs_",
"(_",
"{_",
"x_",
":_",
"1_",
",_",
"y_",
":_",
"2_",
"}_",
")_",
"==_",
"QE",
"xpr",
"_",
"(_",
"1_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"qs",
"ym",
"pif",
"y_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert_",
"\\u",
"qs",
"ym",
"pif",
"y",
"\\u",
"sequence_",
"(_",
"[_",
"[_",
"1_",
",_",
"2_",
"]_",
",_",
"[_",
"1_",
",_",
"3_",
"]_",
"]_",
")_",
"==_",
"(_",
"Tuple_",
"(_",
"1_",
",_",
"2_",
")_",
",_",
"Tuple_",
"(_",
"1_",
",_",
"3_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"\\u",
"qs",
"ym",
"pif",
"y",
"\\u",
"sequence_",
"(_",
"(_",
"[_",
"1_",
",_",
"2_",
",_",
"[_",
"3_",
",_",
"4_",
",_",
"[_",
"2_",
",_",
"]_",
"]_",
",_",
"1_",
"]_",
",_",
"3_",
")_",
")_",
"==_",
"(_",
"Tuple_",
"(_",
"1_",
",_",
"2_",
",_",
"Tuple_",
"(_",
"3_",
",_",
"4_",
",_",
"Tuple_",
"(_",
"2_",
",_",
")_",
")_",
",_",
"1_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"\\u",
"qs",
"ym",
"pif",
"y",
"\\u",
"sequence_",
"(_",
"(_",
"1_",
",_",
")_",
")_",
"==_",
"(_",
"1_",
",_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | eldarion/brabeion/brabeion/views.py | [
{
"content": "from collections import defaultdict\n\nfrom django.db.models import Count\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\n\nfrom brabeion import badges\nfrom brabeion.models import BadgeAward\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def badge_list(request):\n if request.user.is_authenticated():\n user_badges = set(\n (slug, level) for slug, level in\n BadgeAward.objects.filter(\n user=request.user\n ).values_list(\"slug\", \"level\"))\n else:\n user_badges = []\n badges_awarded = BadgeAward.objects.values(\"slug\", \"level\").annotate(\n num=Count(\"pk\")\n )\n badges_dict = defaultdict(list)\n for badge in badges_awarded:\n badges_dict[badge[\"slug\"]].append({\n \"level\": badge[\"level\"],\n \"name\": badges._registry[badge[\"slug\"]].levels[badge[\"level\"]].name,\n \"description\": badges._registry[badge[\"slug\"]].levels[badge[\"level\"]].description,\n \"count\": badge[\"num\"],\n \"user_has\": (badge[\"slug\"], badge[\"level\"]) in user_badges\n })\n\n for badge_group in badges_dict.values():\n badge_group.sort(key=lambda o: o[\"level\"])\n\n return render_to_response(\"brabeion/badges.html\", {\n \"badges\": sorted(badges_dict.items()),\n }, context_instance=RequestContext(request))",
"metadata": "root.badge_list",
"header": "['module', '___EOS___']",
"index": 10
},
{
"content": "def badge_detail(request, slug, level):\n\n badge = badges._registry[slug].levels[int(level)]\n\n badge_awards = BadgeAward.objects.filter(\n slug=slug,\n level=level\n ).order_by(\"-awarded_at\")\n\n badge_count = badge_awards.count()\n latest_awards = badge_awards[:50]\n\n return render_to_response(\"brabeion/badge_detail.html\", {\n \"badge\": badge,\n \"badge_count\": badge_count,\n \"latest_awards\": latest_awards,\n }, context_instance=RequestContext(request))",
"metadata": "root.badge_detail",
"header": "['module', '___EOS___']",
"index": 40
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"collections_",
"import_",
"defaultdict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"django_",
"._",
"db_",
"._",
"models_",
"import_",
"Count_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"shortcuts_",
"import_",
"render",
"\\u",
"to",
"\\u",
"response_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"template_",
"import_",
"Request",
"Context_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"bra",
"bei",
"on_",
"import_",
"badge",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"bra",
"bei",
"on_",
"._",
"models_",
"import_",
"Badge",
"Award",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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_",
"badge",
"\\u",
"list_",
"(_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"request_",
"._",
"user_",
"._",
"is",
"\\u",
"authenticated_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"user",
"\\u",
"badge",
"s_",
"=_",
"set_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"slug_",
",_",
"level_",
")_",
"for_",
"slug_",
",_",
"level_",
"in_",
"\\u\\u\\uNL\\u\\u\\u_",
"Badge",
"Award",
"_",
"._",
"objects_",
"._",
"filter_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"user_",
"=_",
"request_",
"._",
"user_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"._",
"values",
"\\u",
"list_",
"(_",
"\"",
"slug",
"\"_",
",_",
"\"",
"level",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"user",
"\\u",
"badge",
"s_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"badge",
"s",
"\\u",
"award",
"ed_",
"=_",
"Badge",
"Award",
"_",
"._",
"objects_",
"._",
"values_",
"(_",
"\"",
"slug",
"\"_",
",_",
"\"",
"level",
"\"_",
")_",
"._",
"annotate_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"num_",
"=_",
"Count_",
"(_",
"\"",
"pk",
"\"_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"badge",
"s",
"\\u",
"dict_",
"=_",
"defaultdict_",
"(_",
"list_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"badge",
"_",
"in_",
"badge",
"s",
"\\u",
"award",
"ed_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"badge",
"s",
"\\u",
"dict_",
"[_",
"badge",
"_",
"[_",
"\"",
"slug",
"\"_",
"]_",
"]_",
"._",
"append_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"level",
"\"_",
":_",
"badge",
"_",
"[_",
"\"",
"level",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"name",
"\"_",
":_",
"badge",
"s_",
"._",
"\\u",
"registry_",
"[_",
"badge",
"_",
"[_",
"\"",
"slug",
"\"_",
"]_",
"]_",
"._",
"levels_",
"[_",
"badge",
"_",
"[_",
"\"",
"level",
"\"_",
"]_",
"]_",
"._",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"description",
"\"_",
":_",
"badge",
"s_",
"._",
"\\u",
"registry_",
"[_",
"badge",
"_",
"[_",
"\"",
"slug",
"\"_",
"]_",
"]_",
"._",
"levels_",
"[_",
"badge",
"_",
"[_",
"\"",
"level",
"\"_",
"]_",
"]_",
"._",
"description_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"count",
"\"_",
":_",
"badge",
"_",
"[_",
"\"",
"num",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"user",
"\\u",
"has",
"\"_",
":_",
"(_",
"badge",
"_",
"[_",
"\"",
"slug",
"\"_",
"]_",
",_",
"badge",
"_",
"[_",
"\"",
"level",
"\"_",
"]_",
")_",
"in_",
"user",
"\\u",
"badge",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"badge",
"\\u",
"group_",
"in_",
"badge",
"s",
"\\u",
"dict_",
"._",
"values_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"badge",
"\\u",
"group_",
"._",
"sort_",
"(_",
"key_",
"=_",
"lambda_",
"o_",
":_",
"o_",
"[_",
"\"",
"level",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"render",
"\\u",
"to",
"\\u",
"response_",
"(_",
"\"",
"bra",
"bei",
"on",
"/",
"badge",
"s",
".",
"html",
"\"_",
",_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"badge",
"s",
"\"_",
":_",
"sorted_",
"(_",
"badge",
"s",
"\\u",
"dict_",
"._",
"items_",
"(_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"context",
"\\u",
"instance_",
"=_",
"Request",
"Context_",
"(_",
"request_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"badge",
"\\u",
"detail_",
"(_",
"request_",
",_",
"slug_",
",_",
"level_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"badge",
"_",
"=_",
"badge",
"s_",
"._",
"\\u",
"registry_",
"[_",
"slug_",
"]_",
"._",
"levels_",
"[_",
"int_",
"(_",
"level_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"badge",
"\\u",
"awards",
"_",
"=_",
"Badge",
"Award",
"_",
"._",
"objects_",
"._",
"filter_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"slug_",
"=_",
"slug_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"level_",
"=_",
"level_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"._",
"order",
"\\u",
"by_",
"(_",
"\"-",
"award",
"ed",
"\\u",
"at",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"badge",
"\\u",
"count_",
"=_",
"badge",
"\\u",
"awards",
"_",
"._",
"count_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"late",
"st",
"\\u",
"awards",
"_",
"=_",
"badge",
"\\u",
"awards",
"_",
"[_",
":_",
"50_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"render",
"\\u",
"to",
"\\u",
"response_",
"(_",
"\"",
"bra",
"bei",
"on",
"/",
"badge",
"\\u",
"deta",
"il",
".",
"html",
"\"_",
",_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"badge",
"\"_",
":_",
"badge",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"badge",
"\\u",
"count",
"\"_",
":_",
"badge",
"\\u",
"count_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"late",
"st",
"\\u",
"awards",
"\"_",
":_",
"late",
"st",
"\\u",
"awards",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"context",
"\\u",
"instance_",
"=_",
"Request",
"Context_",
"(_",
"request_",
")_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,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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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | erkyrath/tworld/lib/twest/test_propcache.py | [
{
"content": " @tornado.testing.gen_test\n def test_simple_ops(self):\n yield self.resetTables()\n \n # Fresh propcache for each test (don't use app.propcache).\n cache = two.propcache.PropCache(self.app)\n deps = set()\n\n instq = lambda key: ('instanceprop', self.exiid, self.exlocid, key)\n\n # Get some values.\n\n res = yield cache.get(instq('x'), dependencies=deps)\n self.assertEqual(res.val, 1)\n self.assertTrue(res.found)\n self.assertFalse(res.dirty)\n self.assertFalse(res.haschanged())\n self.assertEqual(res.key, 'x')\n self.assertFalse(res.mutable)\n self.assertTrue(instq('x') in deps)\n self.assertTrue(cache.get_by_object(res.val) is None)\n \n res = yield cache.get(instq('qqq'), dependencies=deps)\n self.assertTrue(res is None)\n res = yield cache.get(instq('qqq'), dependencies=deps)\n self.assertTrue(res is None)\n self.assertTrue(instq('qqq') in deps)\n # Peek into cache internals for additional testing\n res = cache.propmap[instq('qqq')]\n self.assertFalse(res.found)\n self.assertFalse(res.dirty)\n self.assertFalse(res.haschanged())\n self.assertEqual(res.key, 'qqq')\n \n res = yield cache.get(instq('ls'), dependencies=deps)\n self.assertEqual(res.val, [1,2,3])\n self.assertTrue(res.found)\n self.assertFalse(res.dirty)\n self.assertFalse(res.haschanged())\n self.assertEqual(res.key, 'ls')\n self.assertTrue(res.mutable)\n self.assertTrue(instq('ls') in deps)\n self.assertTrue(cache.get_by_object(res.val) is res)\n\n res2 = yield cache.get(instq('ls'), dependencies=deps)\n self.assertTrue(res is res2)\n\n res = yield cache.get(instq('map'), dependencies=deps)\n self.assertEqual(res.val, {'one':1, 'two':2, 'three':3})\n self.assertTrue(res.found)\n self.assertFalse(res.dirty)\n self.assertFalse(res.haschanged())\n self.assertEqual(res.key, 'map')\n self.assertTrue(res.mutable)\n self.assertTrue(instq('map') in deps)\n self.assertTrue(cache.get_by_object(res.val) is res)\n\n self.assertEqual(cache.note_changed_entries(), [])\n self.assertEqual(cache.dirty_entries(), [])\n\n # Set some values.\n\n yield cache.set(instq('y'), 7)\n res = yield cache.get(instq('y'), dependencies=deps)\n self.assertEqual(res.val, 7)\n self.assertTrue(res.dirty)\n self.assertFalse(res.haschanged())\n \n res = yield self.get_db_prop(instq('y'))\n self.assertEqual(res, 2)\n\n yield cache.set(instq('z'), 3)\n res = yield cache.get(instq('z'), dependencies=deps)\n self.assertEqual(res.val, 3)\n self.assertTrue(res.dirty)\n self.assertFalse(res.haschanged())\n \n res = yield self.get_db_prop(instq('z'))\n self.assertEqual(res, NotFound)\n\n self.assertEqual(cache.note_changed_entries(), [])\n self.assertEqual(len(cache.dirty_entries()), 2)\n\n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n \n res = yield cache.get(instq('y'), dependencies=deps)\n self.assertEqual(res.val, 7)\n res = yield self.get_db_prop(instq('y'))\n self.assertEqual(res, 7)\n \n res = yield cache.get(instq('z'), dependencies=deps)\n self.assertEqual(res.val, 3)\n res = yield self.get_db_prop(instq('z'))\n self.assertEqual(res, 3)\n\n yield cache.set(instq('listtuple'), (1,2,3))\n res = yield cache.get(instq('listtuple'), dependencies=deps)\n self.assertEqual(res.val, (1,2,3))\n \n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n\n res = yield self.get_db_prop(instq('listtuple'))\n self.assertEqual(res, [1,2,3])\n \n # Delete some values.\n\n yield cache.delete(instq('x'))\n res = yield cache.get(instq('x'), dependencies=deps)\n self.assertTrue(res is None)\n\n res = yield self.get_db_prop(instq('x'))\n self.assertEqual(res, 1)\n \n yield cache.delete(instq('qqqq'))\n res = yield cache.get(instq('qqqq'), dependencies=deps)\n self.assertTrue(res is None)\n \n yield cache.delete(instq('map'))\n res = yield cache.get(instq('map'), dependencies=deps)\n self.assertTrue(res is None)\n\n res = yield self.get_db_prop(instq('map'))\n self.assertEqual(res, {'one':1, 'two':2, 'three':3})\n \n self.assertEqual(cache.note_changed_entries(), [])\n self.assertEqual(len(cache.dirty_entries()), 3)\n\n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n \n res = yield self.get_db_prop(instq('x'))\n self.assertEqual(res, NotFound)\n res = yield self.get_db_prop(instq('qqqq'))\n self.assertEqual(res, NotFound)\n res = yield self.get_db_prop(instq('map'))\n self.assertEqual(res, NotFound)\n \n yield cache.delete(instq('x'))\n res = yield cache.get(instq('x'), dependencies=deps)\n self.assertTrue(res is None)",
"metadata": "root.TestPropcache.test_simple_ops",
"header": "['class', 'TestPropcache', '(', 'twest', '.', 'mock', '.', 'MockAppTestCase', ')', ':', '___EOS___']",
"index": 48
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"Test",
"Prop",
"cache_",
"(_",
"twe",
"st_",
"._",
"mock_",
"._",
"Moc",
"k",
"App",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"tornado_",
"._",
"testing_",
"._",
"gen",
"\\u",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"simple",
"\\u",
"ops_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"self_",
"._",
"reset",
"Tables_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Fre",
"sh",
" ",
"prop",
"cache",
" ",
"for",
" ",
"each",
" ",
"test",
" ",
"(",
"don",
"'",
"t",
" ",
"use",
" ",
"app",
".",
"prop",
"cache",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"cache_",
"=_",
"two_",
"._",
"prop",
"cache_",
"._",
"Prop",
"Cache_",
"(_",
"self_",
"._",
"app_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"deps_",
"=_",
"set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"inst",
"q_",
"=_",
"lambda_",
"key_",
":_",
"(_",
"'",
"instance",
"prop",
"'_",
",_",
"self_",
"._",
"exi",
"id_",
",_",
"self_",
"._",
"ex",
"loci",
"d_",
",_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Get",
" ",
"some",
" ",
"values",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"dirty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"has",
"changed_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"key_",
",_",
"'",
"x",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"mutable",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
"in_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"cache_",
"._",
"get",
"\\u",
"by",
"\\u",
"object_",
"(_",
"res_",
"._",
"val_",
")_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"qq",
"q",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"qq",
"q",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"inst",
"q_",
"(_",
"'",
"qq",
"q",
"'_",
")_",
"in_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Pe",
"ek",
" ",
"int",
"o",
" ",
"cache",
" ",
"internals",
" ",
"for",
" ",
"addition",
"al",
" ",
"testing_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"cache_",
"._",
"prop",
"map_",
"[_",
"inst",
"q_",
"(_",
"'",
"qq",
"q",
"'_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"dirty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"has",
"changed_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"key_",
",_",
"'",
"qq",
"q",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"ls",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"[_",
"1_",
",_",
"2_",
",_",
"3_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"dirty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"has",
"changed_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"key_",
",_",
"'",
"ls",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"mutable",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"inst",
"q_",
"(_",
"'",
"ls",
"'_",
")_",
"in_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"cache_",
"._",
"get",
"\\u",
"by",
"\\u",
"object_",
"(_",
"res_",
"._",
"val_",
")_",
"is_",
"res_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res2_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"ls",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"res2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"{_",
"'",
"one",
"'_",
":_",
"1_",
",_",
"'",
"two",
"'_",
":_",
"2_",
",_",
"'",
"three",
"'_",
":_",
"3_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"dirty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"has",
"changed_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"key_",
",_",
"'",
"map",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"mutable",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
"in_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"cache_",
"._",
"get",
"\\u",
"by",
"\\u",
"object_",
"(_",
"res_",
"._",
"val_",
")_",
"is_",
"res_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Set",
" ",
"some",
" ",
"values",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"y",
"'_",
")_",
",_",
"7_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"y",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"7_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"dirty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"has",
"changed_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"y",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"z",
"'_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"z",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"dirty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"res_",
"._",
"has",
"changed_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"z",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"Not",
"Found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
")_",
",_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"y",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"7_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"y",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"7_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"z",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"z",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"list",
"tuple",
"'_",
")_",
",_",
"(_",
"1_",
",_",
"2_",
",_",
"3_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"list",
"tuple",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"(_",
"1_",
",_",
"2_",
",_",
"3_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"list",
"tuple",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"[_",
"1_",
",_",
"2_",
",_",
"3_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Delete",
" ",
"some",
" ",
"values",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"qq",
"qq",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"qq",
"qq",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"{_",
"'",
"one",
"'_",
":_",
"1_",
",_",
"'",
"two",
"'_",
":_",
"2_",
",_",
"'",
"three",
"'_",
":_",
"3_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"Not",
"Found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"qq",
"qq",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"Not",
"Found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"self_",
"._",
"get",
"\\u",
"db",
"\\u",
"prop_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"Not",
"Found_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"x",
"'_",
")_",
",_",
"dependencies_",
"=_",
"deps_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"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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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/admin/networks/ports/urls.py | [
{
"content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2012 NEC Corporation\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\nfrom django.conf.urls.defaults import patterns # noqa\nfrom django.conf.urls.defaults import url # noqa\n\nfrom openstack_dashboard.dashboards.project.networks.ports import views\n\nPORTS = r'^(?P<port_id>[^/]+)/%s$'\nVIEW_MOD = 'openstack_dashboard.dashboards.admin.networks.ports.views'\n\n\nurlpatterns = patterns(VIEW_MOD,\n url(PORTS % 'detail', views.DetailView.as_view(), name='detail')\n)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"vim",
":",
" ",
"tabs",
"top",
"=",
"4",
" ",
"shift",
"widt",
"h",
"=",
"4",
" ",
"soft",
"tabs",
"top",
"=",
"4_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"2012",
" ",
"NE",
"C",
" ",
"Cor",
"porat",
"ion_",
"\\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_",
"from_",
"django_",
"._",
"conf_",
"._",
"urls_",
"._",
"defaults_",
"import_",
"patterns_",
"#",
" ",
"no",
"qa_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"conf_",
"._",
"urls_",
"._",
"defaults_",
"import_",
"url_",
"#",
" ",
"no",
"qa_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"openst",
"ack",
"\\u",
"dashboard_",
"._",
"dashboards",
"_",
"._",
"project_",
"._",
"networks_",
"._",
"ports_",
"import_",
"views_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"PORTS",
"_",
"=_",
"r",
"'",
"^",
"(?",
"P",
"<",
"port",
"\\u",
"id",
">[",
"^",
"/]+)/",
"%",
"s",
"$'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"VIEW",
"\\u",
"MOD",
"_",
"=_",
"'",
"openst",
"ack",
"\\u",
"dash",
"board",
".",
"dashboards",
".",
"admin",
".",
"network",
"s",
".",
"port",
"s",
".",
"views",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"urlpatterns_",
"=_",
"patterns_",
"(_",
"VIEW",
"\\u",
"MOD",
"_",
",_",
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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
] |
Except block handles 'BaseException' | rapidsms/rapidsms/docs/_ext/rapidsmsdocs.py | [
{
"content": "\"\"\"\nSphinx plugins for RapidSMS documentation.\n\"\"\"\n\ntry:\n import json\nexcept ImportError:\n try:\n import simplejson as json\n except ImportError:\n try:\n from django.utils import simplejson as json\n except ImportError:\n json = None\n\nfrom sphinx import addnodes, roles\nfrom sphinx.util.compat import Directive\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_",
"\"\"\"",
"\\",
"10",
";",
"Sph",
"inx",
" ",
"plugin",
"s",
" ",
"for",
" ",
"Rapid",
"SMS",
" ",
"documentation",
".",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"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 ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"simplejson_",
"as_",
"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 ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"django_",
"._",
"utils_",
"import_",
"simplejson_",
"as_",
"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 ",
" _",
"json_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"sphinx_",
"import_",
"addn",
"odes_",
",_",
"roles_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"sphinx_",
"._",
"util_",
"._",
"compat_",
"import_",
"Directive",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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 | scrapy/scrapy/scrapy/core/scheduler.py | [
{
"content": "import os\nimport json\nimport logging\nfrom os.path import join, exists\n\nfrom scrapy.utils.reqser import request_to_dict, request_from_dict\nfrom scrapy.utils.misc import load_object\nfrom scrapy.utils.job import job_dir\n\nlogger = logging.getLogger(__name__)\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class Scheduler(object):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.Scheduler",
"header": "['module', '___EOS___']",
"index": 12
},
{
"content": " def __init__(self, dupefilter, jobdir=None, dqclass=None, mqclass=None,\n logunser=False, stats=None, pqclass=None):\n self.df = dupefilter\n self.dqdir = self._dqdir(jobdir)\n self.pqclass = pqclass\n self.dqclass = dqclass\n self.mqclass = mqclass\n self.logunser = logunser\n self.stats = stats",
"metadata": "root.Scheduler.__init__",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 14
},
{
"content": " @classmethod\n def from_crawler(cls, crawler):\n settings = crawler.settings\n dupefilter_cls = load_object(settings['DUPEFILTER_CLASS'])\n dupefilter = dupefilter_cls.from_settings(settings)\n pqclass = load_object(settings['SCHEDULER_PRIORITY_QUEUE'])\n dqclass = load_object(settings['SCHEDULER_DISK_QUEUE'])\n mqclass = load_object(settings['SCHEDULER_MEMORY_QUEUE'])\n logunser = settings.getbool('LOG_UNSERIALIZABLE_REQUESTS')\n return cls(dupefilter, jobdir=job_dir(settings), logunser=logunser,\n stats=crawler.stats, pqclass=pqclass, dqclass=dqclass, mqclass=mqclass)",
"metadata": "root.Scheduler.from_crawler",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 24
},
{
"content": " def has_pending_requests(self):\n return len(self) > 0",
"metadata": "root.Scheduler.has_pending_requests",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 36
},
{
"content": " def open(self, spider):\n self.spider = spider\n self.mqs = self.pqclass(self._newmq)\n self.dqs = self._dq() if self.dqdir else None\n return self.df.open()",
"metadata": "root.Scheduler.open",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 39
},
{
"content": " def close(self, reason):\n if self.dqs:\n prios = self.dqs.close()\n with open(join(self.dqdir, 'active.json'), 'w') as f:\n json.dump(prios, f)\n return self.df.close(reason)",
"metadata": "root.Scheduler.close",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 45
},
{
"content": " def enqueue_request(self, request):\n if not request.dont_filter and self.df.request_seen(request):\n self.df.log(request, self.spider)\n return False\n dqok = self._dqpush(request)\n if dqok:\n self.stats.inc_value('scheduler/enqueued/disk', spider=self.spider)\n else:\n self._mqpush(request)\n self.stats.inc_value('scheduler/enqueued/memory', spider=self.spider)\n self.stats.inc_value('scheduler/enqueued', spider=self.spider)\n return True",
"metadata": "root.Scheduler.enqueue_request",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 52
},
{
"content": " def next_request(self):\n request = self.mqs.pop()\n if request:\n self.stats.inc_value('scheduler/dequeued/memory', spider=self.spider)\n else:\n request = self._dqpop()\n if request:\n self.stats.inc_value('scheduler/dequeued/disk', spider=self.spider)\n if request:\n self.stats.inc_value('scheduler/dequeued', spider=self.spider)\n return request",
"metadata": "root.Scheduler.next_request",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 65
},
{
"content": " def __len__(self):\n return len(self.dqs) + len(self.mqs) if self.dqs else len(self.mqs)",
"metadata": "root.Scheduler.__len__",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 77
},
{
"content": " def _dqpush(self, request):\n if self.dqs is None:\n return\n try:\n reqd = request_to_dict(request, self.spider)\n self.dqs.push(reqd, -request.priority)\n except ValueError as e: # non serializable request\n if self.logunser:\n logger.error(\"Unable to serialize request: %(request)s - reason: %(reason)s\",\n {'request': request, 'reason': e},\n exc_info=True, extra={'spider': self.spider})\n return\n else:\n return True",
"metadata": "root.Scheduler._dqpush",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 80
},
{
"content": " def _mqpush(self, request):\n self.mqs.push(request, -request.priority)",
"metadata": "root.Scheduler._mqpush",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 95
},
{
"content": " def _dqpop(self):\n if self.dqs:\n d = self.dqs.pop()\n if d:\n return request_from_dict(d, self.spider)",
"metadata": "root.Scheduler._dqpop",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 98
},
{
"content": " def _newmq(self, priority):\n return self.mqclass()",
"metadata": "root.Scheduler._newmq",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 104
},
{
"content": " def _newdq(self, priority):\n return self.dqclass(join(self.dqdir, 'p%s' % priority))",
"metadata": "root.Scheduler._newdq",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 107
},
{
"content": " def _dq(self):\n activef = join(self.dqdir, 'active.json')\n if exists(activef):\n with open(activef) as f:\n prios = json.load(f)\n else:\n prios = ()\n q = self.pqclass(self._newdq, startprios=prios)\n if q:\n logger.info(\"Resuming crawl (%(queuesize)d requests scheduled)\",\n {'queuesize': len(q)}, extra={'spider': self.spider})\n return q",
"metadata": "root.Scheduler._dq",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 110
},
{
"content": " def _dqdir(self, jobdir):\n if jobdir:\n dqdir = join(jobdir, 'requests.queue')\n if not exists(dqdir):\n os.makedirs(dqdir)\n return dqdir",
"metadata": "root.Scheduler._dqdir",
"header": "['class', 'Scheduler', '(', 'object', ')', ':', '___EOS___']",
"index": 123
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"json_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"logging_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"os_",
"._",
"path_",
"import_",
"join_",
",_",
"exists_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"scrapy_",
"._",
"utils_",
"._",
"reqs",
"er_",
"import_",
"request",
"\\u",
"to",
"\\u",
"dict_",
",_",
"request",
"\\u",
"from",
"\\u",
"dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"scrapy_",
"._",
"utils_",
"._",
"misc_",
"import_",
"load",
"\\u",
"object_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"scrapy_",
"._",
"utils_",
"._",
"job_",
"import_",
"job",
"\\u",
"dir_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"logger_",
"=_",
"logging_",
"._",
"get",
"Logger_",
"(_",
"\\u\\u",
"name\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\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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_",
",_",
"dupe",
"filter_",
",_",
"job",
"dir_",
"=_",
"None_",
",_",
"dq",
"class_",
"=_",
"None_",
",_",
"mq",
"class_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"logu",
"nse",
"r_",
"=_",
"False_",
",_",
"stats_",
"=_",
"None_",
",_",
"pq",
"class_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"df_",
"=_",
"dupe",
"filter_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"dq",
"dir_",
"=_",
"self_",
"._",
"\\u",
"dq",
"dir_",
"(_",
"job",
"dir_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"pq",
"class_",
"=_",
"pq",
"class_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"dq",
"class_",
"=_",
"dq",
"class_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"mq",
"class_",
"=_",
"mq",
"class_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"logu",
"nse",
"r_",
"=_",
"logu",
"nse",
"r_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stats_",
"=_",
"stats_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"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_",
"from",
"\\u",
"crawler_",
"(_",
"cls_",
",_",
"crawler_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"settings_",
"=_",
"crawler_",
"._",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dupe",
"filter",
"\\u",
"cls_",
"=_",
"load",
"\\u",
"object_",
"(_",
"settings_",
"[_",
"'",
"DU",
"PE",
"FILTER",
"\\u",
"CLASS",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dupe",
"filter_",
"=_",
"dupe",
"filter",
"\\u",
"cls_",
"._",
"from",
"\\u",
"settings_",
"(_",
"settings_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pq",
"class_",
"=_",
"load",
"\\u",
"object_",
"(_",
"settings_",
"[_",
"'",
"SCHEDULE",
"R",
"\\u",
"PRIORITY",
"\\u",
"QUEUE",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dq",
"class_",
"=_",
"load",
"\\u",
"object_",
"(_",
"settings_",
"[_",
"'",
"SCHEDULE",
"R",
"\\u",
"DISK",
"\\u",
"QUEUE",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mq",
"class_",
"=_",
"load",
"\\u",
"object_",
"(_",
"settings_",
"[_",
"'",
"SCHEDULE",
"R",
"\\u",
"MEM",
"ORY",
"\\u",
"QUEUE",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logu",
"nse",
"r_",
"=_",
"settings_",
"._",
"getb",
"ool_",
"(_",
"'",
"LOG",
"\\u",
"UNS",
"ERI",
"ALI",
"ZA",
"BL",
"E",
"\\u",
"REQUEST",
"S",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"cls_",
"(_",
"dupe",
"filter_",
",_",
"job",
"dir_",
"=_",
"job",
"\\u",
"dir_",
"(_",
"settings_",
")_",
",_",
"logu",
"nse",
"r_",
"=_",
"logu",
"nse",
"r_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"stats_",
"=_",
"crawler_",
"._",
"stats_",
",_",
"pq",
"class_",
"=_",
"pq",
"class_",
",_",
"dq",
"class_",
"=_",
"dq",
"class_",
",_",
"mq",
"class_",
"=_",
"mq",
"class_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"has",
"\\u",
"pend",
"ing",
"\\u",
"requests_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"len_",
"(_",
"self_",
")_",
">_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"open_",
"(_",
"self_",
",_",
"spider_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"spider_",
"=_",
"spider_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"mq",
"s_",
"=_",
"self_",
"._",
"pq",
"class_",
"(_",
"self_",
"._",
"\\u",
"newm",
"q_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"dq",
"s_",
"=_",
"self_",
"._",
"\\u",
"dq_",
"(_",
")_",
"if_",
"self_",
"._",
"dq",
"dir_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"df_",
"._",
"open_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"close_",
"(_",
"self_",
",_",
"reason_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"dq",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"prio",
"s_",
"=_",
"self_",
"._",
"dq",
"s_",
"._",
"close_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"open_",
"(_",
"join_",
"(_",
"self_",
"._",
"dq",
"dir_",
",_",
"'",
"active",
".",
"json",
"'_",
")_",
",_",
"'",
"w",
"'_",
")_",
"as_",
"f_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"json_",
"._",
"dump_",
"(_",
"prio",
"s_",
",_",
"f_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"self_",
"._",
"df_",
"._",
"close_",
"(_",
"reason_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"enqueue",
"\\u",
"request_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"request_",
"._",
"don",
"t",
"\\u",
"filter_",
"and_",
"self_",
"._",
"df_",
"._",
"request",
"\\u",
"seen_",
"(_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"df_",
"._",
"log_",
"(_",
"request_",
",_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"dq",
"ok_",
"=_",
"self_",
"._",
"\\u",
"dq",
"push_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"dq",
"ok_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stats_",
"._",
"inc",
"\\u",
"value_",
"(_",
"'",
"schedule",
"r",
"/",
"enqueue",
"d",
"/",
"disk",
"'_",
",_",
"spider_",
"=_",
"self_",
"._",
"spider_",
")_",
"\\u\\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",
"mq",
"push_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stats_",
"._",
"inc",
"\\u",
"value_",
"(_",
"'",
"schedule",
"r",
"/",
"enqueue",
"d",
"/",
"memory",
"'_",
",_",
"spider_",
"=_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"stats_",
"._",
"inc",
"\\u",
"value_",
"(_",
"'",
"schedule",
"r",
"/",
"enqueue",
"d",
"'_",
",_",
"spider_",
"=_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"next",
"\\u",
"request_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"self_",
"._",
"mq",
"s_",
"._",
"pop_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"request_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stats_",
"._",
"inc",
"\\u",
"value_",
"(_",
"'",
"schedule",
"r",
"/",
"dequeue",
"d",
"/",
"memory",
"'_",
",_",
"spider_",
"=_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"self_",
"._",
"\\u",
"dq",
"pop_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"request_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stats_",
"._",
"inc",
"\\u",
"value_",
"(_",
"'",
"schedule",
"r",
"/",
"dequeue",
"d",
"/",
"disk",
"'_",
",_",
"spider_",
"=_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"request_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stats_",
"._",
"inc",
"\\u",
"value_",
"(_",
"'",
"schedule",
"r",
"/",
"dequeue",
"d",
"'_",
",_",
"spider_",
"=_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"len\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"len_",
"(_",
"self_",
"._",
"dq",
"s_",
")_",
"+_",
"len_",
"(_",
"self_",
"._",
"mq",
"s_",
")_",
"if_",
"self_",
"._",
"dq",
"s_",
"else_",
"len_",
"(_",
"self_",
"._",
"mq",
"s_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"dq",
"push_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"dq",
"s_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"req",
"d_",
"=_",
"request",
"\\u",
"to",
"\\u",
"dict_",
"(_",
"request_",
",_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"dq",
"s_",
"._",
"push_",
"(_",
"req",
"d_",
",_",
"-_",
"request_",
"._",
"priority_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Value",
"Error_",
"as_",
"e_",
":_",
"#",
" ",
"non",
" ",
"serializable",
" ",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"logu",
"nse",
"r_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"error_",
"(_",
"\"",
"Una",
"ble",
" ",
"to",
" ",
"serialize",
" ",
"request",
":",
" ",
"%",
"(",
"request",
")",
"s",
" ",
"-",
" ",
"reason",
":",
" ",
"%",
"(",
"reason",
")",
"s",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"'",
"request",
"'_",
":_",
"request_",
",_",
"'",
"reason",
"'_",
":_",
"e_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc",
"\\u",
"info_",
"=_",
"True_",
",_",
"extra_",
"=_",
"{_",
"'",
"spider",
"'_",
":_",
"self_",
"._",
"spider_",
"}_",
")_",
"\\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_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"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",
"mq",
"push_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"mq",
"s_",
"._",
"push_",
"(_",
"request_",
",_",
"-_",
"request_",
"._",
"priority_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"dq",
"pop_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"dq",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"d_",
"=_",
"self_",
"._",
"dq",
"s_",
"._",
"pop_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"d_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"request",
"\\u",
"from",
"\\u",
"dict_",
"(_",
"d_",
",_",
"self_",
"._",
"spider_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"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",
"newm",
"q_",
"(_",
"self_",
",_",
"priority_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"mq",
"class_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"newd",
"q_",
"(_",
"self_",
",_",
"priority_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"dq",
"class_",
"(_",
"join_",
"(_",
"self_",
"._",
"dq",
"dir_",
",_",
"'",
"p",
"%",
"s",
"'_",
"%_",
"priority_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"dq_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"active",
"f_",
"=_",
"join_",
"(_",
"self_",
"._",
"dq",
"dir_",
",_",
"'",
"active",
".",
"json",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"exists_",
"(_",
"active",
"f_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"open_",
"(_",
"active",
"f_",
")_",
"as_",
"f_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"prio",
"s_",
"=_",
"json_",
"._",
"load_",
"(_",
"f_",
")_",
"\\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 ",
" _",
"prio",
"s_",
"=_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"q_",
"=_",
"self_",
"._",
"pq",
"class_",
"(_",
"self_",
"._",
"\\u",
"newd",
"q_",
",_",
"startp",
"rio",
"s_",
"=_",
"prio",
"s_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"q_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"info_",
"(_",
"\"",
"Resu",
"ming",
" ",
"crawl",
" ",
"(%",
"(",
"queue",
"size",
")",
"d",
" ",
"request",
"s",
" ",
"schedule",
"d",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"'",
"queue",
"size",
"'_",
":_",
"len_",
"(_",
"q_",
")_",
"}_",
",_",
"extra_",
"=_",
"{_",
"'",
"spider",
"'_",
":_",
"self_",
"._",
"spider_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"q_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Scheduler_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"dq",
"dir_",
"(_",
"self_",
",_",
"job",
"dir_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"job",
"dir_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"dq",
"dir_",
"=_",
"join_",
"(_",
"job",
"dir_",
",_",
"'",
"request",
"s",
".",
"queue",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"exists_",
"(_",
"dq",
"dir_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"os_",
"._",
"makedirs_",
"(_",
"dq",
"dir_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"dq",
"dir_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
] |
Comparison of constants | babble/babble/include/jython/Lib/test/test_email_renamed.py | [
{
"content": "# Copyright (C) 2001-2006 Python Software Foundation\n# email package unit tests\n\nimport unittest\n# The specific tests now live in Lib/email/test\nfrom email.test.test_email_renamed import suite\nfrom test.test_support import run_suite\n\n\nif __name__ == '__main__':\n test_main()\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"C",
")",
" ",
"200",
"1",
"-",
"2006",
" ",
"Pyth",
"on",
" ",
"Sof",
"twa",
"re",
" ",
"Foun",
"dati",
"on_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"email",
" ",
"package",
" ",
"unit",
" ",
"tests_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"unittest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"specific",
" ",
"tests",
" ",
"now",
" ",
"live",
" ",
"in",
" ",
"Lib",
"/",
"email",
"/",
"test_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"email_",
"._",
"test_",
"._",
"test\\u",
"email",
"\\u",
"renamed",
"_",
"import_",
"suite_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"test_",
"._",
"test\\u",
"support_",
"import_",
"run",
"\\u",
"suite_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"'\\u",
"\\u",
"main",
"\\u\\u'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"test\\u",
"main_",
"(_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | twilio/twilio-python/twilio/rest/task_router.py | [
{
"content": "from twilio.rest.base import TwilioClient\nfrom twilio.rest.resources import (\n UNSET_TIMEOUT,\n Activities,\n Events,\n Reservations,\n TaskQueues,\n Tasks,\n Workers,\n Workflows,\n Workspaces,\n)\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TwilioTaskRouterClient(TwilioClient):\n \"\"\"\n A client for accessing the Twilio TaskRouter API\n\n :param str account: Your Account SID from `your dashboard\n <https://twilio.com/user/account>`_\n :param str token: Your Auth Token from `your dashboard\n <https://twilio.com/user/account>`_\n :param float timeout: The socket and read timeout for requests to Twilio\n \"\"\"\n\n\n\n\n\n\n\n\n",
"metadata": "root.TwilioTaskRouterClient",
"header": "['module', '___EOS___']",
"index": 14
},
{
"content": " def __init__(self, account=None, token=None,\n base=\"https://taskrouter.twilio.com\", version=\"v1\",\n timeout=UNSET_TIMEOUT, request_account=None):\n \"\"\"\n Create a Twilio REST API client.\n \"\"\"\n super(TwilioTaskRouterClient, self).__init__(account, token, base,\n version, timeout,\n request_account)\n self.base_uri = \"{0}/{1}\".format(base, version)\n self.workspace_uri = \"{0}/Workspaces\".format(self.base_uri)\n\n self.workspaces = Workspaces(self.base_uri, self.auth, timeout)",
"metadata": "root.TwilioTaskRouterClient.__init__",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 25
},
{
"content": " def activities(self, workspace_sid):\n \"\"\"\n Return a :class:`Activities` instance for the :class:`Activity`\n with the given workspace_sid\n \"\"\"\n base_uri = \"{0}/{1}\".format(self.workspace_uri, workspace_sid)\n return Activities(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.activities",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 39
},
{
"content": " def events(self, workspace_sid):\n \"\"\"\n Return a :class:`Events` instance for the :class:`Event` with the given\n workspace_sid\n \"\"\"\n base_uri = \"{0}/{1}\".format(self.workspace_uri, workspace_sid)\n return Events(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.events",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 47
},
{
"content": " def reservations(self, workspace_sid, task_sid):\n \"\"\"\n Return a :class:`Reservations` instance for the :class:`Reservation`\n with the given workspace_sid ans task_sid\n \"\"\"\n base_uri = \"{0}/{1}/Tasks/{2}\".format(self.workspace_uri,\n workspace_sid, task_sid)\n return Reservations(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.reservations",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 55
},
{
"content": " def worker_reservations(self, workspace_sid, worker_sid):\n \"\"\"\n Return a :class:`Reservations` instance for the :class:`Reservation`\n with the given workspace_sid ans worker_sid\n \"\"\"\n base_uri = \"{0}/{1}/Workers/{2}\".format(self.workspace_uri,\n workspace_sid, worker_sid)\n return Reservations(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.worker_reservations",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 64
},
{
"content": " def task_queues(self, workspace_sid):\n \"\"\"\n Return a :class:`TaskQueues` instance for the :class:`TaskQueue` with\n the given workspace_sid\n \"\"\"\n base_uri = \"{0}/{1}\".format(self.workspace_uri, workspace_sid)\n return TaskQueues(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.task_queues",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 73
},
{
"content": " def tasks(self, workspace_sid):\n \"\"\"\n Return a :class:`Tasks` instance for the :class:`Task` with the given\n workspace_sid\n \"\"\"\n base_uri = \"{0}/{1}\".format(self.workspace_uri, workspace_sid)\n return Tasks(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.tasks",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 81
},
{
"content": " def workers(self, workspace_sid):\n \"\"\"\n Return a :class:`Workers` instance for the :class:`Worker` with the\n given workspace_sid\n \"\"\"\n base_uri = \"{0}/{1}\".format(self.workspace_uri, workspace_sid)\n return Workers(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.workers",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 89
},
{
"content": " def workflows(self, workspace_sid):\n \"\"\"\n Return a :class:`Workflows` instance for the :class:`Workflow` with the\n given workspace_sid\n \"\"\"\n base_uri = \"{0}/{1}\".format(self.workspace_uri, workspace_sid)\n return Workflows(base_uri, self.auth, self.timeout)",
"metadata": "root.TwilioTaskRouterClient.workflows",
"header": "['class', 'TwilioTaskRouterClient', '(', 'TwilioClient', ')', ':', '___EOS___']",
"index": 97
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"twilio",
"_",
"._",
"rest_",
"._",
"base_",
"import_",
"Twi",
"lio",
"Client_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"twilio",
"_",
"._",
"rest_",
"._",
"resources_",
"import_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"UNS",
"ET",
"\\u",
"TIMEOUT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Activ",
"ities_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Events_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Reserva",
"tions_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Task",
"Queue",
"s_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Tasks_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Worke",
"rs_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Work",
"flows_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Works",
"paces",
"_",
",_",
"\\u\\u\\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_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"client",
" ",
"for",
" ",
"accessi",
"ng",
" ",
"the",
" ",
"Twi",
"lio",
" ",
"Task",
"Route",
"r",
" ",
"API",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"str",
" ",
"account",
":",
" ",
"You",
"r",
" ",
"Account",
" ",
"SID",
" ",
"from",
" ",
"`",
"your",
" ",
"dash",
"board",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"https",
"://",
"twilio",
".",
"com",
"/",
"user",
"/",
"account",
">`\\u",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"str",
" ",
"token",
":",
" ",
"You",
"r",
" ",
"Auth",
" ",
"Token",
" ",
"from",
" ",
"`",
"your",
" ",
"dash",
"board",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"https",
"://",
"twilio",
".",
"com",
"/",
"user",
"/",
"account",
">`\\u",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"float",
" ",
"timeo",
"ut",
":",
" ",
"The",
" ",
"socket",
" ",
"and",
" ",
"read",
" ",
"timeo",
"ut",
" ",
"for",
" ",
"request",
"s",
" ",
"to",
" ",
"Twi",
"lio",
"\\",
"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_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"account_",
"=_",
"None_",
",_",
"token_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"base_",
"=_",
"\"",
"https",
"://",
"task",
"router",
".",
"twilio",
".",
"com",
"\"_",
",_",
"version_",
"=_",
"\"",
"v1",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"timeout_",
"=_",
"UNS",
"ET",
"\\u",
"TIMEOUT_",
",_",
"request",
"\\u",
"account_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Creat",
"e",
" ",
"a",
" ",
"Twi",
"lio",
" ",
"REST",
" ",
"API",
" ",
"client",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"account_",
",_",
"token_",
",_",
"base_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"version_",
",_",
"timeout_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"request",
"\\u",
"account_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"base_",
",_",
"version_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"Works",
"paces",
"\"_",
"._",
"format_",
"(_",
"self_",
"._",
"base",
"\\u",
"uri_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"workspaces",
"_",
"=_",
"Works",
"paces",
"_",
"(_",
"self_",
"._",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"activities_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Activ",
"iti",
"es",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Activ",
"it",
"y",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
" ",
"works",
"pace\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"works",
"pace\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Activ",
"ities_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"events_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Event",
"s",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Event",
"`",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"works",
"pace\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"works",
"pace\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Events_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"reservations_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
",_",
"task",
"\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Reserva",
"tion",
"s",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Reserva",
"tion",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
" ",
"works",
"pace\\u",
"sid",
" ",
"ans",
" ",
"task",
"\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}/",
"Task",
"s",
"/{",
"2",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"works",
"pace\\u",
"sid_",
",_",
"task",
"\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Reserva",
"tions_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"worker",
"\\u",
"reservations_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
",_",
"worker",
"\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Reserva",
"tion",
"s",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Reserva",
"tion",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
" ",
"works",
"pace\\u",
"sid",
" ",
"ans",
" ",
"worker",
"\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}/",
"Worke",
"rs",
"/{",
"2",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"works",
"pace\\u",
"sid_",
",_",
"worker",
"\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Reserva",
"tions_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"task",
"\\u",
"queues_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Task",
"Queue",
"s",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Task",
"Queue",
"`",
" ",
"with",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"give",
"n",
" ",
"works",
"pace\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"works",
"pace\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Task",
"Queue",
"s_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"tasks_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Task",
"s",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Task",
"`",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"works",
"pace\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"works",
"pace\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Tasks_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"workers_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Worke",
"rs",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Worke",
"r",
"`",
" ",
"with",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"give",
"n",
" ",
"works",
"pace\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"works",
"pace\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Worke",
"rs_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Twi",
"lio",
"Task",
"Route",
"r",
"Client_",
"(_",
"Twi",
"lio",
"Client_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"workflows_",
"(_",
"self_",
",_",
"works",
"pace\\u",
"sid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
":",
"class",
":`",
"Work",
"flow",
"s",
"`",
" ",
"instance",
" ",
"for",
" ",
"the",
" ",
":",
"class",
":`",
"Work",
"flow",
"`",
" ",
"with",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"give",
"n",
" ",
"works",
"pace\\u",
"sid",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"base",
"\\u",
"uri_",
"=_",
"\"{",
"0",
"}/",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"self_",
"._",
"works",
"pace\\u",
"uri_",
",_",
"works",
"pace\\u",
"sid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Work",
"flows_",
"(_",
"base",
"\\u",
"uri_",
",_",
"self_",
"._",
"auth_",
",_",
"self_",
"._",
"timeout_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,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