Search is not available for this dataset
id
int64
0
10.8M
vector
listlengths
1.54k
1.54k
ast_depth
int64
3
164
ast_data
stringlengths
297
510k
full_path
stringlengths
0
319
code
stringlengths
60
56.5k
9,501
[ 0.004217423498630524, 0.03988966718316078, 0.0015290104784071445, -0.01751709170639515, -0.014964849688112736, 0.0187994372099638, 0.006196966860443354, 0.02756420709192753, 0.011927059851586819, 0.021887026727199554, -0.045591745525598526, 0.01583634689450264, -0.052289824932813644, -0.00...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loss", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_updates(self, loss, params): grads = self.get_gradients(loss, params) if self.decay is not None: lr = self.lr * (1./(1. + self.decay*self.iterations)) #decay_factor = int(self.n_iter/self.n_batchs/self.decay_freq) #lr = self.lr * (1. / (1. + self.decay * decay...
9,502
[ 0.0038416003808379173, 0.019075116142630577, 0.020403971895575523, -0.004524149000644684, -0.014714054763317108, 0.00017073150957003236, 0.018857667222619057, 0.01617579534649849, 0.027760999277234077, 0.019969074055552483, -0.04810456931591034, -0.0020687864162027836, -0.02070598490536213, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loss", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_updates(self, loss, params): grads = self.get_gradients(loss, params) caches = [shared_zeros(p.get_value().shape) for p in params] updates = [] for p,g,c in zip(params, grads, caches): new_c = c + g **2 updates.append((c, new_c)) new_p = p - ...
9,503
[ 0.0041059935465455055, 0.028242412954568863, 0.015814775601029396, 0.0063478415831923485, -0.003077972214668989, -0.013438904657959938, 0.002279923064634204, 0.012549475766718388, 0.02936333604156971, 0.009923833422362804, -0.05170871317386627, 0.004425822291523218, -0.01926283724606037, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loss", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_updates(self, loss, params): grads = self.get_gradients(loss, params) caches = [shared_zeros(p.get_value().shape) for p in params] updates = [] for p,g,c in zip(params, grads, caches): new_c = self.rho * c + (1 - self.rho) * g ** 2 updates.append((c,new_c...
9,504
[ -0.001128994394093752, 0.022941526025533676, 0.02218836359679699, -0.0005570253706537187, -0.0009638668270781636, -0.005750325042754412, 0.005878840573132038, 0.03287607803940773, 0.005562034901231527, 0.024627171456813812, -0.04679162800312042, 0.008709171786904335, -0.025224918499588966, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loss", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_updates(self, loss, params): grads = self.get_gradients(loss, params) caches = [shared_zeros(p.get_value().shape) for p in params] delta_caches = [shared_zeros(p.get_value().shape) for p in params] updates = [] if not self.lr is list: self.lr = np.one...
9,505
[ -0.015614984557032585, 0.0035853658337146044, -0.012379550375044346, -0.017691629007458687, 0.014938067644834518, 0.0042823608964681625, 0.028407569974660873, -0.01916019432246685, 0.04139519855380058, 0.03253791108727455, 0.020525502040982246, 0.022315315902233124, 0.030793989077210426, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestIndent(TestCase): def test_indent(self): h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth', {'nifty': 87}, {'field': 'yes', 'morefield': False} ] expect = textwrap.dedent("""\ [ \t[ \t\t"blorpie" \t], ...
9,506
[ 0.017016245052218437, 0.002297133905813098, 0.0025974030140787363, -0.014614090323448181, 0.03668314218521118, 0.011626189574599266, 0.042718108743429184, 0.007585126906633377, 0.07161495834589005, 0.00833062268793583, 0.03658847510814667, 0.018897734582424164, 0.011430940590798855, 0.0211...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_indent0(self): h = {3: 1} def check(indent, expected): d1 = json.dumps(h, indent=indent) self.assertEqual(d1, expected) sio = StringIO() json.dump(h, sio, indent=indent) self.assertEqual(sio.getvalue(), expected) # indent=0 s...
9,507
[ 0.0009097211295738816, 0.009695340879261494, -0.01027781330049038, -0.009494921192526817, 0.018037844449281693, 0.004017804749310017, 0.03950788825750351, -0.030138231813907623, 0.05160827562212944, 0.015996061265468597, 0.03023844212293625, 0.008486554957926273, 0.022885514423251152, 0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_indent(self): h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth', {'nifty': 87}, {'field': 'yes', 'morefield': False} ] expect = textwrap.dedent("""\ [ \t[ \t\t"blorpie" \t], \t[ \t\t"whoops" ...
9,508
[ 0.0095332907512784, -0.03348277881741524, 0.037066977471113205, -0.02663196623325348, 0.01090572215616703, 0.005231684073805809, 0.01354283094406128, -0.014586332254111767, 0.04954362288117409, 0.06374431401491165, -0.014892577193677425, -0.014552305452525616, 0.026790760457515717, 0.01232...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_separators(self): lst = [1,2,3,4] expect = '[\n1,\n2,\n3,\n4\n]' expect_spaces = '[\n1, \n2, \n3, \n4\n]' # Ensure that separators still works self.assertEqual( expect_spaces, json.dumps(lst, indent=0, separators=(', ', ': '))) # Force the...
9,509
[ 0.014446998946368694, 0.056042563170194626, 0.002318890765309334, -0.009806268848478794, 0.001051830011419952, -0.009240183047950268, -0.020390907302498817, -0.008125700056552887, 0.03358779847621918, 0.07307232916355133, -0.04177246615290642, -0.009641160257160664, 0.0026019341312348843, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _check_input(self): if all([self.project_id, self.location, self.body]): if isinstance(self.body, dict) \ and 'name' in self.body \ and 'initial_node_count' in self.body: # Don't throw error return # If not dict,...
9,510
[ 0.008868951350450516, 0.010972610674798489, 0.032986968755722046, -0.0070319524966180325, -0.0003277709474787116, 0.0112985298037529, 0.024532822892069817, 0.02761423960328102, 0.04799899831414223, 0.031070956960320473, -0.015851521864533424, -0.0034567180555313826, 0.02127363160252571, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "match", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def replace_escapes(match): m = match.group(1) if m == 'n': return '\n' elif m == 't': return '\t' elif m == 'r': return '\r' # m is \ or " return m
9,511
[ 0.030494479462504387, 0.007489127106964588, 0.013810290023684502, 0.015615325421094894, -0.023557482287287712, -0.0019519156776368618, -0.005531902424991131, -0.036978449672460556, -0.028300123289227486, 0.02144806832075119, -0.008119120262563229, -0.010511676780879498, -0.02708260901272297,...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def _add_message(): translations.sort() if len(messages) > 1: msgid = tuple([denormalize(m) for m in messages]) else: msgid = denormalize(messages[0]) if isinstance(msgid, (list, tuple)): string = [] for idx in range(catalog.num_plurals): ...
9,512
[ 0.0034812786616384983, 0.00450309831649065, 0.025993546470999718, 0.007684600073844194, -0.009405898861587048, -0.020152734592556953, 0.045462921261787415, -0.029088016599416733, -0.012113559991121292, 0.026161164045333862, 0.01175253838300705, 0.025310184806585312, -0.003320108400657773, ...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lineno", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "line", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _process_message_line(lineno, line): if line.startswith('msgid_plural'): in_msgid[0] = True msg = line[12:].lstrip() messages.append(msg) elif line.startswith('msgid'): in_msgid[0] = True offset[0] = lineno txt = line[5:].lstrip...
9,513
[ 0.04733411595225334, 0.03195949271321297, -0.01633833907544613, 0.012158502824604511, 0.018052855506539345, 0.030233770608901978, 0.030457889661192894, 0.017302053049206734, 0.04312066361308098, 0.020462144166231155, -0.02637890912592411, 0.0601537711918354, 0.022759372368454933, 0.0286649...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "comment", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "prefix", "annotation": null, "type_comment": null}}], "kwarg":...
def _write_comment(comment, prefix=''): # xgettext always wraps comments even if --no-wrap is passed; # provide the same behaviour if width and width > 0: _width = width else: _width = 76 for line in wraptext(comment, _width): _write('#%s %s\n'...
9,514
[ 0.03750777244567871, -0.005899248644709587, 0.03640228137373924, -0.04045575112104416, 0.039034403860569, 0.036112748086452484, 0.01828010380268097, -0.040324147790670395, 0.016871917992830276, 0.009238756261765957, 0.02217564731836319, -0.0631183460354805, -0.014266114681959152, 0.0045798...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "merged_iobs", "annotation": null, "type_comment": null}}], "kwarg": ...
def eval_cc_with_original_file(f, merged_iobs): print("reading",f) xac = xds_ascii.XDS_ASCII(f) iobs = xac.i_obs(anomalous_flag=merged_iobs.anomalous_flag()).merge_equivalents(use_internal_variance=False).array() n_all = iobs.size() m, i = merged_iobs.common_sets(iobs, assert_is_similar_symmetry=...
9,515
[ 0.06017213314771652, -0.016290320083498955, -0.012926425784826279, 0.02930493839085102, -0.0057702758349478245, -0.01887308619916439, -0.0007110479054972529, -0.0034174395259469748, -0.009342051111161709, 0.03230346366763115, -0.01557218562811613, 0.004626929759979248, 0.019981784746050835, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "message", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "prefix", "annotation": null, "type_comment": null}}], "kwarg":...
def _write_message(message, prefix=''): if isinstance(message.id, (list, tuple)): if message.context: _write('%smsgctxt %s\n' % (prefix, _normalize(message.context, prefix))) _write('%smsgid %s\n' % (prefix, _normalize(message.id...
9,516
[ 0.003937066998332739, 0.009889964014291763, 0.04412646219134331, -0.04423084110021591, 0.014326095581054688, -0.012395073659718037, 0.009407208301126957, -0.010281387716531754, 0.017614051699638367, -0.015213321894407272, 0.022598177194595337, -0.01381724514067173, 0.003985994961112738, 0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "hklin", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "output_dir", "annotation": null, "type_comment": null}}, {"_type...
def run(hklin, output_dir=None, eval_internal=True): if output_dir is None: output_dir = os.getcwd() merged = xds_ascii.XDS_ASCII(hklin) merged_iobs = merged.i_obs().merge_equivalents(use_internal_variance=False).array() fwidth = max([len(x[0]) for x in list(merged.input_files.values())]) formatf ...
9,517
[ 0.05300126224756241, -0.03032590262591839, 0.04056913033127785, -0.025841834023594856, 0.025161786004900932, -0.0457332469522953, 0.013005922548472881, -0.01503544207662344, 0.008383720181882381, 0.021368391811847687, -0.01930699497461319, -0.02248409576714039, 0.03160099312663078, 0.02650...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class CustomFieldTest(SimpleTestCase): def test_none_column(self): class NoColumnField(models.AutoField): def db_type(self, connection): # None indicates not to create a column in the database. return None class Model(models.Model): field = No...
9,518
[ 0.0477406270802021, 0.006838522385805845, 0.04455791786313057, -0.021934883669018745, 0.022687550634145737, -0.031095921993255615, -0.002822503447532654, -0.02735408954322338, -0.01137603260576725, 0.02954757772386074, -0.003911183215677738, -0.00012684465036727488, 0.042643994092941284, 0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_none_column(self): class NoColumnField(models.AutoField): def db_type(self, connection): # None indicates not to create a column in the database. return None class Model(models.Model): field = NoColumnField(primary_key=True, db_column="ot...
9,519
[ 0.009077463299036026, 0.04760949686169624, 0.044881999492645264, 0.0069526913575828075, 0.030854851007461548, 0.05576764792203903, 0.009168785996735096, -0.014684668742120266, -0.005945099052041769, -0.010088100098073483, 0.04135086014866829, -0.03377717360854149, 0.037405725568532944, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class Pattern: # master pattern object. keeps track of global attributes def __init__(self): self.flags = 0 self.open = [] self.groups = 1 self.groupdict = {} def opengroup(self, name=None): gid = self.groups self.groups = gid + 1 if name is not None:...
9,520
[ 0.0038818332832306623, 0.05820588394999504, 0.05736590176820755, -0.01941843144595623, 0.025397134944796562, 0.035798098891973495, 0.012735624797642231, -0.04160386696457863, -0.002990895416587591, 0.04224620759487152, 0.023593641817569733, -0.039380382746458054, 0.015267927199602127, 0.01...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pattern", "annotation"...
class SubPattern: # a subpattern, in intermediate form def __init__(self, pattern, data=None): self.pattern = pattern if data is None: data = [] self.data = data self.width = None def dump(self, level=0): nl = 1 seqtypes = (tuple, list) for...
9,521
[ 0.05144201219081879, 0.003967477008700371, 0.08285267651081085, 0.0025582879316061735, -0.005707289092242718, 0.03430251032114029, -0.003523707389831543, -0.012707681395113468, -0.021101100370287895, -0.04029780998826027, 0.05557994544506073, 0.012742948718369007, 0.020242949947714806, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def opengroup(self, name=None): gid = self.groups self.groups = gid + 1 if name is not None: ogid = self.groupdict.get(name, None) if ogid is not None: raise error("redefinition of group name %s as group %d; " "was group %d" % (...
9,522
[ 0.009527304209768772, 0.045720525085926056, 0.06515701860189438, -0.04969736933708191, 0.005609719082713127, 0.013576573692262173, -0.009040075354278088, 0.010376662947237492, -0.015064597129821777, 0.034817129373550415, 0.04832785949110985, -0.017869457602500916, -0.005425361916422844, 0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "level", "annotation": null, "type_comment": null}}], "kwarg": nul...
def dump(self, level=0): nl = 1 seqtypes = (tuple, list) for op, av in self.data: print(level*" " + op, end=' '); nl = 0 if op == "in": # member sublanguage print(); nl = 1 for op, a in av: print((level+...
9,523
[ 0.007070817518979311, 0.0430419035255909, 0.06466157734394073, -0.012241275981068611, -0.01751045323908329, 0.019756333902478218, 0.004531863611191511, -0.05311134085059166, 0.007780367508530617, 0.048915743827819824, -0.002432521665468812, -0.024272771552205086, 0.007977806963026524, 0.01...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def getwidth(self): # determine the width (min, max) for this subpattern if self.width: return self.width lo = hi = 0 UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) REPEATCODES = (MIN_REPEAT, MAX_REPEAT) for op, av in self.data: if op...
9,524
[ 0.05609525740146637, 0.024616142734885216, -0.006374461110681295, -0.016978705301880836, -0.005060845520347357, 0.041821230202913284, 0.029572732746601105, 0.05547568202018738, 0.009442542679607868, 0.0389854870736599, -0.012117433361709118, -0.022638272494077682, -0.017717426642775536, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __next(self): if self.index >= len(self.string): self.next = None return char = self.string[self.index:self.index+1] # Special case for the str8, since indexing returns a integer # XXX This is only needed for test_bug_926075 in test_re.py if char and n...
9,525
[ 0.005862845107913017, 0.01999480277299881, -0.04779191315174103, -0.045969150960445404, -0.02860845997929573, 0.005862845107913017, 0.02889743447303772, 0.06188496947288513, -0.013892997987568378, 0.060729071497917175, -0.010553120635449886, -0.012503697536885738, 0.00452911714091897, 0.02...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "string", "annotation":...
class Tokenizer: def __init__(self, string): self.istext = isinstance(string, str) self.string = string self.index = 0 self.__next() def __next(self): if self.index >= len(self.string): self.next = None return char = self.string[self.index:...
9,526
[ 0.06968611478805542, -0.014222861267626286, 0.012228119187057018, -0.004193088039755821, -0.0019165452104061842, 0.030239809304475784, 0.0104871466755867, 0.02237887494266033, -0.03335585445165634, 0.03427650406956673, 0.0036058789119124413, -0.020266100764274597, -0.06302911043167114, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def getwhile(self, n, charset): result = '' for _ in range(n): c = self.next if c not in charset: break result += c self.__next() return result
9,527
[ -0.0008894703933037817, 0.010747886262834072, -0.05084972083568573, -0.03396834433078766, -0.01704128086566925, 0.0073270658031105995, -0.013786076568067074, 0.016059009358286858, 0.03508767858147621, -0.012689586728811264, -0.009245922788977623, -0.06012419983744621, 0.008954668417572975, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "escape", "annotation": null, "type_comment": null}}], "kwarg": ...
def _class_escape(source, escape): # handle escape code inside character class code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) if code and code[0] == IN: return code try: c = escape[1:2] if c == "x": # hexadecimal escape (...
9,528
[ 0.0019270670600235462, 0.03781672939658165, 0.026473993435502052, -0.01629520021378994, -0.010794999077916145, 0.014412350952625275, 0.049250755459070206, -0.01831498183310032, 0.03453030437231064, 0.02537851780653, 0.0032921324018388987, -0.05915568023920059, 0.07481185346841812, 0.036652...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "state", "annotation": null, "type_comment": null}}, {"_type": "...
def _parse_sub(source, state, nested=1): # parse an alternation: a|b|c items = [] itemsappend = items.append sourcematch = source.match while 1: itemsappend(_parse(source, state)) if sourcematch("|"): continue if not nested: break if not sourc...
9,529
[ 0.001151190372183919, 0.008196474984288216, -0.04733694717288017, -0.022828103974461555, -0.013802772387862206, 0.005341522861272097, -0.0215042345225811, 0.003804683918133378, 0.031059114262461662, 0.0020275339484214783, 0.021250972524285316, -0.05000770837068558, 0.040844231843948364, 0....
17
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "escape", "annotation": null, "type_comment": null}}, {"_type": ...
def _escape(source, escape, state): # handle escape code in expression code = CATEGORIES.get(escape) if code: return code code = ESCAPES.get(escape) if code: return code try: c = escape[1:2] if c == "x": # hexadecimal escape escape += sourc...
9,530
[ 0.005975833162665367, 0.05491084232926369, -0.01249678898602724, 0.0005048245657235384, -0.012660911306738853, 0.03392655402421951, 0.026822375133633614, -0.026845822110772133, 0.04360980540513992, 0.009935298934578896, 0.02244967222213745, -0.019483735784888268, 0.048533495515584946, 0.03...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "state", "annotation": null, "type_comment": null}}, {"_type": "...
def _parse_sub_cond(source, state, condgroup): item_yes = _parse(source, state) if source.match("|"): item_no = _parse(source, state) if source.match("|"): raise error("conditional backref with more than two branches") else: item_no = None if source.next and not sourc...
9,531
[ -0.006773584522306919, 0.03521817550063133, -0.006701050326228142, -0.01248705293983221, -0.015287990681827068, 0.033343441784381866, 0.030352799221873283, -0.03537440299987793, 0.01917136460542679, 0.06713324785232544, 0.028924433514475822, -0.02484019659459591, 0.061196599155664444, 0.04...
21
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "state", "annotation": null, "type_comment": null}}], "kwarg": n...
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) # precompute constants into local variables subpatternappend = subpattern.append sourceget = source.get sourcematch = source.match _len = len PATTERNENDERS = _PATTERNENDERS ASSERTCHARS = _ASSERTCHARS ...
9,532
[ 0.026336798444390297, 0.046984847635030746, -0.0505245141685009, -0.004395611584186554, 0.04403512552380562, 0.05756170675158501, -0.022438952699303627, -0.03232051804661751, 0.04178069531917572, 0.05895229056477547, -0.0030524348840117455, -0.035228099673986435, 0.08604758977890015, 0.057...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "str", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flags", "annotation": null, "type_comment": null}}, {"_type": "arg...
def parse(str, flags=0, pattern=None): # parse 're' pattern into list of (opcode, argument) tuples source = Tokenizer(str) if pattern is None: pattern = Pattern() pattern.flags = flags pattern.str = str p = _parse_sub(source, pattern, 0) p.pattern.flags = fix_flags(str, p.pattern....
9,533
[ 0.015407109633088112, 0.0320897102355957, -0.005355033557862043, 0.0034822903107851744, -0.031705036759376526, 0.02476070262491703, 0.0315430723130703, -0.020164890214800835, 0.01665223017334938, 0.03630085289478302, -0.004664143081754446, -0.004575567319989204, 0.059036966413259506, 0.042...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "src", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flags", "annotation": null, "type_comment": null}}], "kwarg": null...
def fix_flags(src, flags): # Check and fix flags according to the type of pattern (str or bytes) if isinstance(src, str): if not flags & SRE_FLAG_ASCII: flags |= SRE_FLAG_UNICODE elif flags & SRE_FLAG_UNICODE: raise ValueError("ASCII and UNICODE flags are incompatible") ...
9,534
[ -0.0006572154816240072, -0.007479561958462, 0.003954710904508829, -0.06009441241621971, -0.002995586022734642, 0.021858375519514084, 0.003350220387801528, -0.015464209020137787, -0.006104010157287121, 0.02540471963584423, -0.018849356099963188, -0.018591439351439476, 0.05510803684592247, 0...
17
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pattern", "annotation": null, "type_comment": null}}], "kwarg":...
def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) sget = s.get groups = [] literals = [] literal = [] lappend = literal.append def addgroup(index): if literal: literals.append(''...
9,535
[ 0.03274396061897278, 0.014267301186919212, 0.05403360724449158, -0.010948382318019867, -0.03966512158513069, 0.00918267760425806, -0.004287779331207275, -0.015056556090712547, 0.0035617658868432045, 0.015481539070606232, -0.0013913147849962115, -0.010543636046350002, 0.033027283847332, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "template", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "match", "annotation": null, "type_comment": null}}], "kwarg":...
def expand_template(template, match): g = match.group sep = match.string[:0] groups, literals = template literals = literals[:] try: for index, group in groups: literals[index] = s = g(group) if s is None: raise error("unmatched group") except Inde...
9,536
[ -0.04266703128814697, -0.015152879059314728, -0.012002818286418915, -0.010015021078288555, -0.0012865011813119054, -0.027155697345733643, -0.0122961001470685, 0.024244606494903564, 0.0007508550188504159, 0.042232539504766464, 0.0013584637781605124, -0.03004506416618824, 0.04405740275979042, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "template_name", "annotation": null, "type_comment": null}}, {"...
def job_list(request, template_name="simple_jobs/job_list.html", extra_context=None): context = dict( jobs = Job.objects.all() ) # push extra_context into context dict if extra_context is None: extra_context = {} for key, value in extra_context.items(): context[key] = value()...
9,537
[ 0.01731366664171219, 0.05041879788041115, -0.012845623306930065, -0.013458884321153164, 0.003915013279765844, 0.020347116515040398, -0.007222240790724754, -0.03460542857646942, 0.017357470467686653, 0.030487822368741035, 0.011465786956250668, -0.009987389668822289, -0.012133803218603134, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def _parse_args(): zinc_port_var = "ZINC_PORT" zinc_port_option = "--zinc-port" parser = argparse.ArgumentParser() parser.add_argument(zinc_port_option, type=int, default=int(os.environ.get(zinc_port_var, "0")), help="Specify zinc p...
9,538
[ -0.025356877595186234, -0.027935929596424103, -0.03003568947315216, -0.02442111447453499, 0.02286911942064762, -0.009734210558235645, -0.030925804749131203, -0.017676780000329018, 0.06536642462015152, 0.002648949157446623, 0.008758507668972015, -0.03886837139725685, 0.003651755629107356, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class UriTest(unittest.TestCase): def test_parse_uri(self): uri = atom.http_core.parse_uri('http://www.google.com/test?q=foo&z=bar') self.assert_(uri.scheme == 'http') self.assert_(uri.host == 'www.google.com') self.assert_(uri.port is None) self.assert_(uri.path == '/test') self.assert_(ur...
9,539
[ 0.013904713094234467, 0.02110452577471733, 0.025217020884156227, -0.0033789630979299545, -0.010251780040562153, 0.01756943017244339, -0.04237402230501175, 0.006752034183591604, 0.02135198377072811, 0.03443184122443199, 0.026560358703136444, 0.03103814646601677, 0.028327906504273415, 0.0368...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "port", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _yield_processes_listening_on_port(port): pattern = re.compile(r":{0} \(LISTEN\)".format(port)) innocuous_errors = re.compile( r"^\s*Output information may be incomplete.\s*$" r"|^lsof: WARNING: can't stat\(\) (?:tracefs|nsfs|overlay|tmpfs|aufs|zfs) file system .*$" r"|^\s*$") ls...
9,540
[ 0.0006607982213608921, 0.009178065694868565, -0.03207824006676674, -0.01916596107184887, 0.03189827501773834, -0.026386938989162445, -0.02266397327184677, -0.013845831155776978, 0.03722965344786644, -0.0034980126656591892, 0.0006463871686719358, -0.02571208029985428, 0.015071823261678219, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_modify_request_no_request(self): uri = atom.http_core.parse_uri('http://www.google.com/test?q=foo&z=bar') request = uri.modify_request() self.assert_(request.uri.scheme == 'http') self.assert_(request.uri.host == 'www.google.com') # If no port was provided, the HttpClient is responsible for...
9,541
[ -0.011075599119067192, -0.023086341097950935, -0.012367265298962593, -0.002691458212211728, 0.01547661516815424, 0.0004105861880816519, -0.017335211858153343, -0.006920057348906994, 0.06372998654842377, 0.032402701675891876, 0.005295246839523315, -0.022116130217909813, 0.005210499279201031, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_modify_request_http_with_set_port(self): request = atom.http_core.HttpRequest(uri=atom.http_core.Uri(port=8080), method='POST') request.add_body_part('hello', 'text/plain') uri = atom.http_core.parse_uri('//example.com/greet') self.assert_(uri.query == ...
9,542
[ 0.004782200325280428, -0.009592597372829914, 0.004187244921922684, 0.0012477143900468946, 0.02490353398025036, -0.0017693577101454139, -0.036836475133895874, -0.01936565525829792, 0.058424051851034164, 0.00392219377681613, 0.004034981597214937, -0.009547482244670391, 0.007150742691010237, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_modify_request_use_default_ssl_port(self): request = atom.http_core.HttpRequest( uri=atom.http_core.Uri(scheme='https'), method='PUT') request.add_body_part('hello', 'text/plain') uri = atom.http_core.parse_uri('/greet') uri.modify_request(request) self.assert_(request.uri.host is N...
9,543
[ 0.012753202579915524, -0.0165008045732975, 0.005910990294069052, -0.027141721919178963, 0.014967694878578186, -0.026392202824354172, -0.036113254725933075, -0.013230170123279095, 0.030707621946930885, 0.009618844836950302, 0.01788628101348877, -0.019907714799046516, -0.022621886804699898, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class HttpRequestTest(unittest.TestCase): def test_request_with_one_body_part(self): request = atom.http_core.HttpRequest() self.assert_(len(request._body_parts) == 0) self.assert_('Content-Length' not in request.headers) self.assert_(not 'Content-Type' in request.headers) self.assert_(not 'Conte...
9,544
[ 0.012047940865159035, -0.003619284136220813, 0.0028131832368671894, -0.006998916622251272, 0.023616578429937363, -0.030762553215026855, -0.052069760859012604, -0.010441184975206852, 0.047058865427970886, 0.022832263261079788, 0.011067547835409641, -0.041220080107450485, 0.006410680711269379,...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_request_with_one_body_part(self): request = atom.http_core.HttpRequest() self.assert_(len(request._body_parts) == 0) self.assert_('Content-Length' not in request.headers) self.assert_(not 'Content-Type' in request.headers) self.assert_(not 'Content-Length' in request.headers) request.ad...
9,545
[ 0.008959179744124413, -0.0022814220283180475, -0.014394845813512802, -0.043915022164583206, -0.011483649723231792, -0.02640487439930439, -0.015812845900654793, -0.008894725702702999, 0.03413941711187363, 0.02756505459547043, 0.006268203258514404, -0.0015737648354843259, -0.014169255271553993...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_add_file_without_size(self): virtual_file = StringIO.StringIO('this is a test') request = atom.http_core.HttpRequest() try: request.add_body_part(virtual_file, 'text/plain') self.fail('We should have gotten an UnknownSize error.') except atom.http_core.UnknownSize: pass re...
9,546
[ 0.00513906916603446, -0.02176903560757637, -0.014419712126255035, -0.02554071880877018, 0.02242392487823963, -0.00026263826293870807, -0.025031358003616333, -0.035194285213947296, 0.027699429541826248, -0.00010232659406028688, 0.049626123160123825, -0.03567938879132271, -0.010587391443550587...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_copy(self): request = atom.http_core.HttpRequest( uri=atom.http_core.Uri(scheme='https', host='www.google.com'), method='POST', headers={'test':'1', 'ok':'yes'}) request.add_body_part('body1', 'text/plain') request.add_body_part('<html>body2</html>', 'text/html') copied = reques...
9,547
[ 0.01210278645157814, 0.043637875467538834, 0.007965547032654285, -0.06701963394880295, 0.009485967457294464, 0.016900287941098213, -0.024048078805208206, -0.026652783155441284, 0.02798542194068432, 0.04533395916223526, 0.049816474318504333, -0.014646915718913078, -0.07554852217435837, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tree", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def functional_fail(f, tree, treeVal, key): print("FAIL: Value mismatch") print("\tFound f({}) == {}, not {}".format(key, f[key], treeVal)) #print("Samples:") #print(Samples.terminal_plot(f)) #print("Tree:") #brancher.print_tree(tree) exit(1)
9,548
[ -0.00949394516646862, 0.016752509400248528, 0.05303248390555382, -0.037693146616220474, -0.01981009915471077, 0.011382455937564373, 0.034507084637880325, -0.013849083334207535, 0.011395303532481194, 0.07394742220640182, 0.030164794996380806, -0.006394602358341217, 0.001629162230528891, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "length", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "count", "annotation": null, "type_comment": null}}], "kwarg": n...
def rand_brancher_test(length, count): trans, depths, comps, totmisses = 0,0,0,0 for sample in gen_brancher_tests(length, count): tree = brancher.make_decision_tree(sample) comparisons, misses = test_decision_tree(sample, tree) trans += Samples.count_transitions(sample) depths...
9,549
[ -0.02988690324127674, -0.00020375082385726273, 0.007991909049451351, -0.04688744246959686, 0.027025893330574036, 0.0024649600964039564, 0.005624483339488506, 0.0013713926309719682, 0.06327322125434875, 0.07632509618997574, 0.0449012890458107, -0.01515625324100256, -0.05868614837527275, -0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tree", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def test_decision_tree(f, tree): comparisons = 0 misses = 0 for key,fv in enumerate(f): tv, comp, miss = get_value_from_tree(tree, key) if tv != fv: functional_fail(f, tree, tv, key) comparisons += comp misses += miss return comparisons, misses
9,550
[ -0.012032393366098404, -0.019424650818109512, 0.00936313159763813, -0.02143695577979088, -0.0015728522557765245, 0.0212712362408638, -0.040009334683418274, -0.005814966280013323, 0.036221470683813095, 0.06321001797914505, -0.0031989712733775377, -0.03823377564549446, 0.017187442630529404, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestParameters(unittest.TestCase): def test_module_parameters(self): args = dict( state='present', address='1.1.1.1', netmask='2.2.2.2', connection_limit='10', arp_state='enabled', auto_delete='enabled', icmp_echo='ena...
9,551
[ -0.032648202031850815, -0.0072214421816170216, 0.029978087171912193, -0.06432545185089111, -0.013471934013068676, 0.01553520280867815, 0.006972636096179485, 0.009054110385477543, 0.026676855981349945, 0.07791875302791595, 0.023764006793498993, -0.004621115978807211, -0.00996437668800354, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c...
def brancher_test(): tests = [ (((0,1,0,1), (0,0.5,1.0,1.0)), BranchNode(BranchData(1,2,0,0), BranchNode(BranchData(0,1,1,1), None, None), BranchNode(BranchData(2,3,0,1), None, No...
9,552
[ 0.0005102954455651343, 0.022704903036355972, 0.018906503915786743, -0.038545817136764526, -0.022228576242923737, 0.022875891998410225, -0.01193259283900261, -0.0002679337339941412, 0.008518919348716736, 0.03988930210471153, 0.008164727129042149, -0.04338236525654793, -0.00429609976708889, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestManager(unittest.TestCase): def setUp(self): self.spec = ArgumentSpec() def test_create_virtual_address(self, *args): set_module_args(dict( state='present', address='1.1.1.1', netmask='2.2.2.2', connection_limit='10', arp_st...
9,553
[ 0.00021687260596081614, 0.006539102643728256, 0.0246676467359066, 0.006716609001159668, -0.024690551683306694, -0.009425011463463306, -0.004552177153527737, 0.00031510944245383143, -0.00009322659025201574, 0.04983918368816376, 0.029981384053826332, -0.0071403332985937595, 0.02164431475102901...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen...
def test_create_virtual_address(self, *args): set_module_args(dict( state='present', address='1.1.1.1', netmask='2.2.2.2', connection_limit='10', arp_state='enabled', auto_delete='enabled', icmp_echo='enabled', adver...
9,554
[ 0.0108040114864707, 0.04707751423120499, 0.0012117661535739899, -0.010734643787145615, -0.024764250963926315, 0.029828090220689774, 0.006925203837454319, 0.008763446472585201, 0.018717704340815544, 0.05840756371617317, 0.01937669701874256, -0.03195536509156227, 0.02631346322596073, 0.01000...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): argument_spec = vmware_argument_spec() argument_spec.update(dict( state=dict(type='str', default='present', choices=['absent', 'present']), vm_group_name=dict(type='str', required=True), host_group_name=dict(type='str', required=True), cluster_name=dict(type='str', ...
9,555
[ 0.010882984846830368, 0.01300032064318657, 0.019691843539476395, -0.020123952999711037, -0.04437146708369255, 0.042272649705410004, -0.019642461091279984, 0.030173584818840027, 0.024161091074347496, 0.035136669874191284, 0.050816070288419724, -0.04135904461145401, 0.005768660921603441, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen...
def test_delete_virtual_address(self, *args): set_module_args(dict( state='absent', address='1.1.1.1', password='admin', server='localhost', user='admin', )) module = AnsibleModule( argument_spec=self.spec.argument_spec, ...
9,556
[ 0.010772469453513622, 0.01498426217585802, 0.008359945379197598, 0.027978336438536644, 0.0058461762964725494, 0.02557159774005413, 0.0037923490162938833, 0.03901693597435951, 0.04693140462040901, 0.04396926239132881, 0.03496713563799858, -0.04595945030450821, 0.01773812621831894, 0.0458206...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "py_exp", "annotation": null, "type_comment": null}}, {"_type": "a...
def verifyExceptionHandling(self, py_exp, tf_exp, eager=False): def inner_exception(): raise py_exp("blah") # pylint: disable=not-callable def raise_exception(): inner_exception() expected_regexp = r": blah.*" # Error at the top expected_regexp += r"in raise_exception.*" #...
9,557
[ 0.005029431544244289, 0.005250659305602312, 0.0033268178813159466, -0.00661443080753088, -0.009067539125680923, 0.00513304490596056, -0.0225372314453125, 0.0337386392056942, 0.05287064239382744, 0.02260443940758705, 0.03503800183534622, -0.03192400932312012, 0.018191084265708923, 0.0295493...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "py_exp", "annotation":...
class PyFuncTestBase(test.TestCase): def verifyExceptionHandling(self, py_exp, tf_exp, eager=False): def inner_exception(): raise py_exp("blah") # pylint: disable=not-callable def raise_exception(): inner_exception() expected_regexp = r": blah.*" # Error at the top expec...
9,558
[ 0.028299709782004356, 0.014345263130962849, 0.012092321179807186, -0.04882906749844551, 0.002688300097361207, 0.00015158505993895233, 0.0038909227587282658, -0.013873984105885029, 0.0030000910628587008, 0.0357712022960186, 0.010500318370759487, 0.005890983622521162, -0.0207937341183424, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "make_graph", "annotation": null, "type_comment": null}}], "kwarg"...
def verifyPyFuncsNoIncrease(self, make_graph): ops.reset_default_graph() gc.collect() initial_size = script_ops._py_funcs.size() for _ in range(1000): make_graph() ops.reset_default_graph() gc.collect() self.assertEqual(initial_size, script_ops._py_funcs.size())
9,559
[ 0.03262905776500702, 0.012185080908238888, 0.011692970991134644, -0.04805564880371094, 0.04501740261912346, 0.019876981154084206, -0.009826160967350006, 0.04403318092226982, 0.02417759783565998, 0.0013339134166017175, 0.0027413759380578995, 0.026039058342576027, 0.017052695155143738, -0.02...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testRealDataTypes(self): def sum_func(x, y): return x + y for dtype in [dtypes.float16, dtypes.float32, dtypes.float64, dtypes.uint8, dtypes.int8, dtypes.uint16, dtypes.int16, dtypes.int32, dtypes.int64]: with self.cached_session(): x = constant_op.con...
9,560
[ 0.03028949536383152, 0.014647571370005608, 0.0017815474420785904, -0.05430692061781883, -0.0002457993687130511, 0.03332354500889778, -0.0065780216827988625, 0.02192673832178116, 0.026439568027853966, 0.02098337933421135, 0.04714248701930046, -0.003939163871109486, -0.009363481774926186, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testCleanup(self): def make_graph(): g = ops.Graph() with g.as_default(): c = constant_op.constant([1.], dtypes.float32) _ = script_ops.py_func(lambda x: x + 1, [c], [dtypes.float32]) _ = script_ops.eager_py_func(lambda x: x + 1, [c], [dtypes.float32]) # These ops ha...
9,561
[ 0.021827630698680878, 0.01690702885389328, 0.016920436173677444, -0.04373570531606674, 0.011731681413948536, 0.03815812990069389, 0.005225625820457935, 0.012120502069592476, 0.007199900224804878, -0.0029982824344187975, 0.019347216933965683, -0.014346170239150524, -0.024804124608635902, 0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testCleanupInTfFunction(self): self.skipTest("b/144098211") def make_graph(): g = ops.Graph() with g.as_default(): @def_function.function def fn(): c = constant_op.constant([1.], dtypes.float32) _ = script_ops.py_func(lambda x: x + 1, [c], [dtypes.float32]) ...
9,562
[ 0.010064641013741493, 0.03473905101418495, 0.010681955143809319, -0.058487486094236374, 0.030526788905262947, 0.023869479075074196, -0.022344350814819336, 0.01098456047475338, 0.0043817199766635895, 0.009840713813900948, 0.026677653193473816, 0.01167449913918972, 0.019039904698729515, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def make_graph(): g = ops.Graph() with g.as_default(): @def_function.function def fn(): c = constant_op.constant([1.], dtypes.float32) _ = script_ops.py_func(lambda x: x + 1, [c], [dtypes.float32]) _ = script_ops.eager_py_func(lambda x: x + 1, [c], [dtypes.float...
9,563
[ 0.026944927871227264, 0.031105542555451393, 0.012618052773177624, -0.05354313924908638, 0.020406819880008698, 0.031105542555451393, -0.014636445790529251, 0.02382446825504303, 0.005126470699906349, 0.010810166597366333, 0.024183567613363266, 0.015305115841329098, 0.018710380420088768, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def make_graph(): g = ops.Graph() with g.as_default(): c = constant_op.constant([1.], dtypes.float32) _ = script_ops.py_func(lambda x: x + 1, [c], [dtypes.float32]) _ = script_ops.eager_py_func(lambda x: x + 1, [c], [dtypes.float32]) # These ops have a reference to 'c' which ...
9,564
[ 0.057385098189115524, 0.026284240186214447, 0.01801053062081337, -0.03822220489382744, 0.010617279447615147, 0.04301292821764946, -0.020833173766732216, 0.04241732507944107, 0.01577054336667061, 0.0064124478958547115, 0.019978610798716545, 0.020224621519446373, 0.0012179119512438774, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def fn(): c = constant_op.constant([1.], dtypes.float32) _ = script_ops.py_func(lambda x: x + 1, [c], [dtypes.float32]) _ = script_ops.eager_py_func(lambda x: x + 1, [c], [dtypes.float32]) # These ops have a reference to 'c' which has a reference to the # graph. ...
9,565
[ 0.010862796567380428, -0.007735527586191893, 0.012357009574770927, -0.004809911362826824, 0.0348561555147171, 0.003338838927447796, 0.02044294960796833, -0.023537160828709602, 0.0024925589095801115, 0.019437992945313454, 0.019266091287136078, 0.05744124948978424, -0.005180158652365208, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testRenamedDeviceInTestClusterCorrectlyIdentifiedAsLocalhost(self): if context.executing_eagerly(): self.skipTest("b/126565353: We don't test eager's remote execution.") workers, _ = test_util.create_local_cluster(num_workers=1, num_ps=0) worker = workers[0] session = session_lib.Session(work...
9,566
[ 0.03686301037669182, -0.03910420835018158, -0.0005176200647838414, -0.017661094665527344, 0.023404160514473915, -0.015326514840126038, 0.00571680162101984, 0.014310972765088081, 0.05925162881612778, 0.017182504758238792, 0.023427505046129227, 0.003224638057872653, 0.01121181808412075, 0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testEagerArrayOutput(self): with test_util.device(use_gpu=True): a = array_ops.ones((3, 3), dtype=dtypes.float32) x = array_ops.ones((3, 1), dtype=dtypes.float32) output = script_ops.eager_py_func( lambda a, x: [matmul(a, x)], inp=[a, x], Tout=[dtypes.float32]) ret = self.evalu...
9,567
[ 0.03667798265814781, 0.023817192763090134, -0.013837714679539204, -0.015568975359201431, -0.008396611548960209, -0.0029771490953862667, -0.0006345377769321203, 0.05312495306134224, 0.04513642564415932, 0.016001790761947632, 0.017498092725872993, 0.0025288762990385294, 0.002980240620672703, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testEagerReturnNone(self): with test_util.device(use_gpu=True): def no_return_value(): return output = script_ops.eager_py_func(no_return_value, inp=[], Tout=[]) ret = self.evaluate(output) if context.executing_eagerly(): self.assertEqual(len(ret), 0) else: ...
9,568
[ 0.02524757944047451, -0.005758725106716156, 0.011965101584792137, 0.02987758256494999, -0.0003859001153614372, -0.007277544587850571, -0.004594829399138689, 0.02701260894536972, 0.03427736461162567, 0.02043851651251316, 0.02808697335422039, 0.00711127370595932, -0.013877215795218945, 0.004...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testEagerExceptionHandling(self): with test_util.device(use_gpu=True): self.verifyExceptionHandling( ValueError, errors.InvalidArgumentError, eager=True) self.verifyExceptionHandling( TypeError, errors.InvalidArgumentError, eager=True) self.verifyExceptionHandling( ...
9,569
[ 0.01575862057507038, -0.012213519774377346, 0.013214628212153912, 0.010770746506750584, 0.028643472120165825, -0.014380625449120998, -0.010311414487659931, 0.02831369638442993, 0.05681583657860756, 0.03750033676624298, 0.027536364272236824, 0.010470414534211159, 0.046074531972408295, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testEagerPyFuncInDefun(self): with test_util.device(use_gpu=True): def wrapper(): a = array_ops.ones((3, 3), dtype=dtypes.float32) x = array_ops.ones((3, 1), dtype=dtypes.float32) return script_ops.eager_py_func(matmul, inp=[a, x], Tout=dtypes.float32) wrapped = def_function...
9,570
[ 0.05593995749950409, 0.018112048506736755, 0.028246499598026276, -0.04792088270187378, 0.009871757589280605, 0.042501095682382584, 0.01930108293890953, -0.003542910097166896, 0.013563296757638454, -0.06890873610973358, 0.028426237404346466, -0.013272951357066631, 0.002526699798181653, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testTapeCache(self): # Testing for b/198962664 (gh:#51839) old_cache_size = len(script_ops.tape_cache) def f(x): return x**2 x = constant_op.constant(3.0) y = script_ops.eager_py_func(f, inp=[x], Tout=dtypes.float32) # No cache if there is no active tape self.assertEqual(len(sc...
9,571
[ 0.020030144602060318, 0.042966343462467194, 0.026514723896980286, -0.005556924268603325, 0.002607341157272458, 0.016139397397637367, 0.017400287091732025, 0.021351078525185585, 0.03408006578683853, -0.014410176314413548, 0.01985001750290394, -0.010909704491496086, 0.0021104903426021338, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testEagerReturningVariableRaisesError(self): def return_variable(): return resource_variable_ops.ResourceVariable(0.0) with self.assertRaisesRegex(errors.UnknownError, "Attempting to return a variable"): output = script_ops.eager_py_func( return_variabl...
9,572
[ -0.008662821725010872, -0.04377239942550659, -0.008137463591992855, -0.00011876449570991099, 0.03270634263753891, -0.04533729702234268, 0.0029565372969955206, 0.051239192485809326, 0.03424888476729393, -0.011216957122087479, 0.021114930510520935, -0.01227326225489378, -0.009372614324092865, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_create_user_201_1(self): count = User.objects.count() data = { 'producer': 'DabAppsfsbkf', 'p_iva': '1367687423', 'c_fiscale': '763geed77', 'cell': '0825623410', 'mail': 'dargeniovittorio@me.com' } response = self.clien...
9,573
[ -0.013754932209849358, -0.04206559807062149, 0.02132721245288849, -0.02052641101181507, 0.028028029948472977, -0.05544368550181389, 0.007248425390571356, 0.04397339001297951, 0.03297415375709534, 0.0038950718007981777, -0.003315080190077424, -0.01595713570713997, 0.0004416181182023138, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class UserTestsCreate(APITestCase): def test_create_user_201_1(self): count = User.objects.count() data = { 'producer': 'DabAppsfsbkf', 'p_iva': '1367687423', 'c_fiscale': '763geed77', 'cell': '0825623410', 'mail': 'dargeniovittorio@me.com'...
9,574
[ 0.010757802054286003, -0.0157399233430624, 0.021754268556833267, -0.052506186068058014, -0.01256568543612957, -0.018114633858203888, 0.01862776279449463, 0.030549054965376854, 0.013043014332652092, 0.01679004728794098, 0.03162304311990738, -0.024797240272164345, -0.015083595179021358, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class uploadTestCase(PyPIRCCommandTestCase): def setUp(self): super(uploadTestCase, self).setUp() self.old_open = upload_mod.urlopen upload_mod.urlopen = self._urlopen self.last_open = None def tearDown(self): upload_mod.urlopen = self.old_open super(uploadTestC...
9,575
[ -0.00503941997885704, -0.04718524217605591, -0.008101489394903183, -0.006045043934136629, 0.03254154697060585, -0.03821371868252754, 0.0028530347626656294, 0.05274442210793495, 0.035727906972169876, -0.006677796132862568, 0.021536175161600113, -0.014926174655556679, -0.008412215858697891, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_create_user_201_2(self): count = User.objects.count() data = { 'producer': 'DabAppsfsbkdddf', 'p_iva': '1367687423', 'c_fiscale': '763geed77', 'cell': '082562341770', 'mail': 'dargeniovittorio@me.com' } response = self....
9,576
[ 0.05108324810862541, -0.008795554749667645, 0.0288503710180521, -0.023553995415568352, 0.01236614491790533, -0.001476587844081223, 0.012961243279278278, 0.05441579595208168, 0.002140866592526436, -0.011741291731595993, 0.028255272656679153, 0.02806483954191208, 0.03361115604639053, 0.00107...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_saved_password(self): # file with no password self.write_file(self.rc, PYPIRC_NOPASSWORD) # make sure it passes dist = Distribution() cmd = upload(dist) cmd.finalize_options() self.assertEqual(cmd.password, None) # make sure we get it as well, i...
9,577
[ 0.01301052886992693, -0.010113577358424664, 0.03759598359465599, -0.03651445731520653, -0.016428930684924126, -0.03326987102627754, 0.024617645889520645, 0.032651856541633606, 0.013416101224720478, 0.048334017395973206, 0.048462770879268646, 0.0060964724980294704, -0.057475507259368896, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_finalize_options(self): # new format self.write_file(self.rc, PYPIRC) dist = Distribution() cmd = upload(dist) cmd.finalize_options() for attr, waited in (('username', 'me'), ('password', 'secret'), ('realm', 'pypi'), ...
9,578
[ 0.04326181858778, 0.003917779307812452, 0.031517889350652695, -0.07698796689510345, 0.02230844274163246, -0.023588230833411217, 0.019259538501501083, 0.05109110102057457, -0.03580893948674202, 0.048305682837963104, 0.02602233551442623, -0.008349982090294361, -0.02717665210366249, -0.040476...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_upload(self): tmp = self.mkdtemp() path = os.path.join(tmp, 'xxx') self.write_file(path) command, pyversion, filename = 'xxx', '2.6', path dist_files = [(command, pyversion, filename)] self.write_file(self.rc, PYPIRC_LONG_PASSWORD) # lets run it ...
9,579
[ -0.0042229462414979935, 0.005447728093713522, -0.026690039783716202, -0.06532170623540878, -0.037662044167518616, -0.011877833865582943, -0.027481045573949814, -0.026511427015066147, -0.011335612274706364, 0.0340387336909771, -0.01367673184722662, -0.07062909752130508, 0.012554015032947063, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "matches", "annotation": null, "type_comment": null}}, {"_type": "...
def when(self, matches, context): # pylint:disable=too-many-return-statements option_type = context.get('type', None) if option_type: return option_type episode = matches.named('episode') season = matches.named('season') episode_details = matches.named('episode_deta...
9,580
[ 0.022126195952296257, 0.02532348968088627, 0.008074323646724224, -0.015140805393457413, 0.010646060109138489, -0.03422030434012413, 0.00430360296741128, 0.06793089956045151, 0.014190885238349438, 0.03644451126456261, 0.02745501883327961, -0.010118969716131687, -0.02199876867234707, 0.04358...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testReadInput(self): cgiFilename = os.path.abspath(self.mktemp()) cgiFile = file(cgiFilename, 'wt') cgiFile.write(READINPUT_CGI) cgiFile.close() portnum = self.startServer(cgiFilename) d = client.getPage("http://localhost:%d/cgi" % portnum, ...
9,581
[ 0.0207668524235487, 0.023246124386787415, 0.025996936485171318, -0.026327505707740784, 0.030412402004003525, -0.04198233783245087, 0.010507389903068542, 0.0640832707285881, 0.02798035368323326, 0.04715339094400406, 0.023458633571863174, -0.03005822002887726, -0.030672134831547737, 0.028122...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testReadEmptyInput(self): cgiFilename = os.path.abspath(self.mktemp()) cgiFile = file(cgiFilename, 'wt') cgiFile.write(READINPUT_CGI) cgiFile.close() portnum = self.startServer(cgiFilename) d = client.getPage("http://localhost:%d/cgi" % portnum) d.addCallback...
9,582
[ 0.00559167331084609, 0.019608277827501297, -0.022730205208063126, -0.013642399571835995, -0.006479070987552404, 0.003512169700115919, -0.008200407959520817, -0.03665058687329292, -0.021960414946079254, -0.0696660503745079, -0.011290262453258038, -0.05102001130580902, 0.07578160613775253, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bind_vars", "annotatio...
class BindVarsProxy(object): def __init__(self, bind_vars): self.bind_vars = bind_vars self.accessed_keys = set() def __getitem__(self, name): self.bind_vars[name] self.accessed_keys.add(name) return ':%s' % name def export_bind_vars(self): return dict([(k, self.bind_vars[k]) for k in se...
9,583
[ 0.03822498023509979, 0.043220154941082, 0.011619728058576584, -0.007457082625478506, 0.008271771483123302, -0.0385579913854599, 0.0037880076561123133, 0.05423332750797272, 0.0164365042001009, 0.03249242156744003, 0.04096043482422829, -0.009669231250882149, -0.02081322856247425, 0.041293445...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testReadAllInput(self): cgiFilename = os.path.abspath(self.mktemp()) cgiFile = file(cgiFilename, 'wt') cgiFile.write(READALLINPUT_CGI) cgiFile.close() portnum = self.startServer(cgiFilename) d = client.getPage("http://localhost:%d/cgi" % portnum, ...
9,584
[ -0.0003517325094435364, -0.003450132440775633, 0.07665985822677612, -0.028171509504318237, 0.01661987416446209, 0.02200624905526638, -0.03008032776415348, 0.00491191353648901, -0.04416608437895775, 0.023783424869179726, -0.003515953663736582, -0.061213795095682144, 0.03668439760804176, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parameters", "annotation": null, "type_comment": null}}], "kwarg"...
def getSrid(self, parameters = dict()): if parameters == dict(): sql = "SELECT DISTINCT srid from geometry_columns WHERE f_table_schema <> \'tiger\' and f_table_schema <> \'topology\' LIMIT 1" else: whereClauseList = [] if 'tableSchema' in list(parameters.keys()): ...
9,585
[ 0.012012534774839878, 0.029758090153336525, 0.0010021185735240579, -0.006372314412146807, -0.02895381674170494, -0.01759088784456253, 0.003536737523972988, -0.017467152327299118, -0.008640775457024574, -0.05947493389248848, 0.010192609392106533, -0.0669814795255661, 0.08038602769374847, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bind_vars", "annotation": null, "type_comment": null}}], "kwarg"...
def prepare_query_bind_vars(query, bind_vars): bind_vars_proxy = BindVarsProxy(bind_vars) try: query = query % bind_vars_proxy except KeyError as e: raise dbexceptions.InterfaceError(e[0], query, bind_vars) return query, bind_vars_proxy.export_bind_vars()
9,586
[ 0.03615142032504082, 0.056565284729003906, 0.02888966165482998, -0.0057891737669706345, -0.02258339710533619, 0.037950001657009125, -0.02192017249763012, -0.01758110150694847, -0.004426188766956329, 0.006351229269057512, 0.012859834358096123, -0.03187979757785797, 0.04842671751976013, 0.01...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "role", "annotation": null, "type_comment": null}}], "kwarg": null...
def dropRole(self, role): sql = '''CREATE OR REPLACE FUNCTION droprole(name text) RETURNS void AS $BODY$ DECLARE s text; BEGIN FOR s in SELECT DISTINCT 'REVOKE ALL ON ALL TABLES IN SCHEMA ' || table_schema || ' FROM ' || nam...
9,587
[ 0.05975272133946419, 0.04201510176062584, 0.021031076088547707, 0.0012563656782731414, -0.01117422990500927, 0.008562988601624966, 0.03930976241827011, -0.015196952037513256, -0.054059747606515884, 0.03434605151414871, 0.03244055435061455, -0.03486359491944313, 0.04789627715945244, -0.0008...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "roleName", "annotation": null, "type_comment": null}}, {"_type": ...
def createRole(self, roleName, mydict): sql = """CREATE ROLE "{0}" with NOLOGIN REPLICATION;\n""".format(roleName) for db in list(mydict.keys()): for schema in list(mydict[db].keys()): for cat in list(mydict[db][schema].keys()): for tableName in list(mydic...
9,588
[ 0.01201136689633131, 0.001874540001153946, 0.07204776257276535, -0.025126758962869644, 0.027355249971151352, 0.020874222740530968, -0.026005888357758522, -0.014147857204079628, -0.02269381657242775, 0.03393850103020668, 0.005525229033082724, -0.03377494215965271, 0.05397448316216469, -0.02...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tableList", "annotation": null, "type_comment": null}}], "kwarg":...
def getTableDomains(self,tableList): schemas = '\''+'\',\''.join(tableList)+'\'' sql = '''SELECT tc.table_schema,tc.table_name, kcu.column_name, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name, 'SELECT ' || ccu...
9,589
[ 0.029024282470345497, 0.02245573326945305, 0.09449213743209839, -0.04166676104068756, 0.007800152059644461, 0.021387353539466858, -0.00865089800208807, -0.011663131415843964, -0.03594895824790001, 0.05013464763760567, 0.0022826697677373886, -0.026155486702919006, 0.015313424170017242, 0.02...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "schemaList", "annotation": null, "type_comment": null}}], "kwarg"...
def validateWithDomain(self,schemaList): schemas = '\''+'\',\''.join(schemaList)+'\'' sql = '''SELECT tc.table_schema,tc.table_name, kcu.column_name, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name, 'SELECT ' |...
9,590
[ 0.04071420431137085, 0.029114453122019768, 0.014752857387065887, 0.012554888613522053, 0.020472178235650063, 0.02955174446105957, -0.007969074882566929, -0.028055746108293533, -0.02066780999302864, 0.01380922645330429, 0.02132374793291092, -0.013164795935153961, 0.0036939680576324463, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "layer", "annotation": null, "type_comment": null}}, {"_type": "ar...
def insertFlagIntoDb(self, layer, feat_id, reason, geom, srid, processName, dimension, geometryColumn, flagSRID): if dimension == 0: tableName = 'aux_flags_validacao_p' elif dimension == 1: tableName = 'aux_flags_validacao_l' elif dimension == 2: tableName = '...
9,591
[ 0.009623886086046696, -0.020533153787255287, 0.09579940885305405, -0.028278404846787453, -0.004663629457354546, 0.027157815173268318, -0.027553316205739975, -0.033881351351737976, -0.05189867317676544, 0.011414632201194763, 0.01886325515806675, -0.04662530869245529, 0.05137133598327637, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "edgvVersion", "annotation": null, "type_comment": null}}], "kwarg...
def getStructure(self,edgvVersion): sql = '' if edgvVersion == '2.1.3': sql = 'SELECT table_schema, table_name, column_name FROM INFORMATION_SCHEMA.COLUMNS where table_schema in (\'cb\',\'complexos\',\'public\')' elif edgvVersion == 'FTer_2a_Ed': sql = 'SELECT table_schem...
9,592
[ 0.04602596536278725, 0.0474822036921978, -0.008185826241970062, -0.004705195315182209, 0.007987248711287975, 0.05207156389951706, -0.011660940945148468, 0.00032803291105665267, 0.006128337699919939, 0.03967146947979927, 0.03777394816279411, -0.03080165386199951, -0.0004992030444554985, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "processName", "annotation": null, "type_comment": null}}, {"_type...
def deleteFlags(self, processName=None, className=None, flagId=None): if not processName and not className and not flagId: whereClause = '' else: clauseList = [] if processName: processClause = """process_name = '{0}'""".format(processName) ...
9,593
[ 0.0021238073240965605, 0.022602222859859467, 0.07458216696977615, -0.052109245210886, -0.025821877643465996, 0.0464198999106884, 0.013156614266335964, -0.038609977811574936, -0.02123160846531391, 0.021632447838783264, -0.0027234514709562063, -0.08239208906888962, 0.010796829126775265, 0.04...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "class_a", "annotation": null, "type_comment": null}}, {"_type": "...
def testSpatialRule(self, class_a, necessity, predicate_function, class_b, min_card, max_card, aKeyColumn, bKeyColumn, aGeomColumn, bGeomColumn): #TODO: Add SRIDS class_a = '"'+'"."'.join(class_a.replace('"','').split('.'))+'"' class_b = '"'+'"."'.join(class_b.replace('"','').split('.'))+'"' ...
9,594
[ -0.01924576424062252, 0.02989877201616764, 0.07833980768918991, -0.006475973874330521, -0.008354068733751774, 0.028039520606398582, -0.012223321944475174, -0.08180706202983856, -0.05693329498171806, 0.010175632312893867, -0.002350759692490101, -0.027386270463466644, 0.06507380306720734, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tableSchema", "annotation": null, "type_comment": null}}, {"_type...
def getOutofBoundsAngles(self, tableSchema, tableName, angle, geometryColumn, geomType, keyColumn): if 'LINESTRING' in geomType: sql = """ WITH result AS (SELECT points."{4}", points.anchor, (degrees ( ST...
9,595
[ -0.029423248022794724, 0.03709576278924942, 0.09699394553899765, -0.016360856592655182, -0.01173583697527647, 0.02478627860546112, 0.004015520680695772, -0.012584354728460312, -0.032052457332611084, 0.011622303165495396, 0.023459723219275475, -0.02025686763226986, 0.07098866999149323, -0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tableSchema", "annotation": null, "type_comment": null}}, {"_type...
def prepareVertexNearEdgesStruct(self, tableSchema, tableName, geometryColumn, keyColumn, geomType): if 'POLYGON' in geomType: sql = """drop table if exists seg# create temp table seg as ( SELECT segments."{3}" as "{3}", ST_MakeLine(sp,ep) as "{2}" FROM ...
9,596
[ 0.032935455441474915, -0.015124727971851826, 0.05222774296998978, 0.01858881302177906, -0.018855281174182892, 0.0011364864185452461, 0.049627017229795456, -0.007764880079776049, -0.06113843619823456, -0.011735253967344761, 0.013803046196699142, -0.033233899623155594, 0.027265014126896858, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tableSchema", "annotation": null, "type_comment": null}}, {"_type...
def updateOriginalTable(self, tableSchema, tableName, result, epsg): #TODO: Put original id sqls = [] for key in list(result.keys()): geoms = [] for wkb in result[key]: geoms.append("ST_SetSRID(ST_Multi('{0}'), {1})".format(wkb, epsg)) array = ...
9,597
[ -0.015315113589167595, 0.02290772646665573, 0.04761028289794922, -0.06078812852501869, 0.007338738068938255, 0.046925414353609085, 0.030890004709362984, -0.052191827446222305, -0.06768406182527542, -0.00674242852255702, 0.006317336577922106, -0.03950992226600647, 0.028056060895323753, 0.04...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cl", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def snapLinesToFrame(self, cl, frameTable, tol, geometryColumn, keyColumn, frameGeometryColumn): schema, table = cl.split('.') frameSchema, frameTable = frameTable.split('.') sql = """ update "{0}"."{1}" as classe set "{5}" = ST_Multi(agrupado."{5}") from ( ...
9,598
[ -0.00395658053457737, 0.0189350638538599, 0.017134714871644974, -0.018484976142644882, -0.008944174274802208, 0.011566193774342537, -0.015030818060040474, -0.03353672847151756, -0.06276099383831024, 0.013649155385792255, -0.003912094980478287, 0.01170226652175188, 0.002523889997974038, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "styleName", "annotation": null, "type_comment": null}}, {"_type":...
def importStyle(self, styleName, table_name, parsedQml, tableSchema, dbName): #TODO:REDO it if table_name[-1] == 'c': geomColumn = 'centroid' else: geomColumn = 'geom' sql = """INSERT INTO public.layer_styles (styleqml, f_table_name, description, f_geometry_colum...
9,599
[ 0.006451105698943138, 0.03209289535880089, 0.014685150235891342, -0.0027165720239281654, 0.003710439894348383, 0.059126101434230804, 0.04471803084015846, -0.047320157289505005, -0.022310826927423477, -0.006270402576774359, 0.013914150185883045, -0.0036803227849304676, 0.04498306289315224, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cl", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def densifyFrame(self, cl, frameTable, snapTolerance, geometryColumn, frameGeometryColumn): cl = '"'+'"."'.join(cl.replace('"','').split('.'))+'"' frameTable = '"'+'"."'.join(frameTable.replace('"','').split('.'))+'"' sql = """ update {2} m set {4} = st_multi(st_snap(m.{4}, foo....
9,600
[ -0.021893691271543503, 0.03087715432047844, 0.04240015149116516, -0.02931092120707035, 0.021558070555329323, 0.053251903504133224, -0.029333297163248062, -0.02164757065474987, -0.06112781539559364, 0.049627192318439484, 0.037701454013586044, -0.03864119201898575, 0.028147434815764427, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "layerFilter", "annotation": null, "type_comment": null}}], "kwarg...
def getGeomTablesDomains(self, layerFilter = None): inClause = """'{text}'""".format( text='","'.join(layerFilter) ) if layerFilter \ else """select f_table_name from public.geometry_columns where f_table_schema <> 'views'""" sql = """select distinct case ...