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 |
|---|---|---|---|---|---|
18,501 | [
0.03627839311957359,
0.007249652873724699,
0.02762461081147194,
-0.013077096082270145,
-0.007261705119162798,
0.060697007924318314,
0.002455721842125058,
0.028805768117308617,
0.01747630350291729,
0.07188184559345245,
0.022466089576482773,
-0.06865174323320389,
0.01982656493782997,
0.00143... | 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 main():
argument_spec = ec2_argument_spec()
argument_spec.update(
dict(
eni_id=dict(default=None, type='str'),
instance_id=dict(default=None, type='str'),
private_ip_address=dict(type='str'),
subnet_id=dict(type='str'),
description=dict(typ... | |
18,502 | [
0.01080014556646347,
0.018728140741586685,
0.05073056370019913,
-0.026354936882853508,
-0.009191956371068954,
0.005706650670617819,
-0.03272315114736557,
0.0063359420746564865,
0.04952576756477356,
0.026914305984973907,
-0.010590381920337677,
-0.010595760308206081,
-0.01124118734151125,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _add_api_output_arguments(parser):
group = parser.add_argument_group('Output arguments')
group.add_argument('--format', default='jsonv2',
choices=['xml', 'json', 'jsonv2', 'geojson', 'geocodejson'],
help='Format of result')
for name, desc in EXTRADATA_PARAMS... | |
18,503 | [
0.010730797424912453,
0.02508268691599369,
0.030536405742168427,
0.004749923478811979,
-0.05387478694319725,
0.02013680525124073,
-0.05228503793478012,
-0.0068061077035963535,
0.005746275652199984,
0.02430989407002926,
-0.02313966304063797,
-0.05727507919073105,
0.030713044106960297,
0.032... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def add_args(parser):
group = parser.add_argument_group('Query arguments')
group.add_argument('--query',
help='Free-form query string')
for name, desc in STRUCTURED_QUERY:
group.add_argument('--' + name, help='Structured query: ' + desc)
_add_api_o... | |
18,504 | [
-0.04047207161784172,
0.026954112574458122,
0.03167824074625969,
-0.07194580137729645,
-0.048182010650634766,
-0.06957351416349411,
-0.01917259581387043,
0.01877380535006523,
0.012597673572599888,
-0.01862042397260666,
-0.04855012521147728,
0.006989050190895796,
0.004445485770702362,
-0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "endpoint", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type": ... | def _run_api(endpoint, args, params):
script_file = args.project_dir / 'website' / (endpoint + '.php')
if not script_file.exists():
LOG.error("Cannot find API script file.\n\n"
"Make sure to run 'nominatim' from the project directory \n"
"or use the option --project-... | |
18,505 | [
-0.019590293988585472,
0.02259349822998047,
0.06352684646844864,
-0.0077003855258226395,
-0.03099391795694828,
-0.01668327860534191,
-0.05219803377985954,
-0.01583896204829216,
-0.005557530093938112,
0.029369410127401352,
-0.0348200649023056,
-0.044588491320610046,
0.013348760083317757,
0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def add_args(parser):
group = parser.add_argument_group('Query arguments')
group.add_argument('--lat', type=float, required=True,
help='Latitude of coordinate to look up (in WGS84)')
group.add_argument('--lon', type=float, required=True,
help... | |
18,506 | [
-0.0033344135154038668,
0.08394072949886322,
0.00213664211332798,
-0.02772229164838791,
-0.05212154984474182,
-0.021474534645676613,
-0.026447704061865807,
0.02446753904223442,
0.0011401588562875986,
0.019539890810847282,
-0.0029816257301717997,
-0.03744102641940117,
0.052485719323158264,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(args):
if args.query:
params = dict(q=args.query)
else:
params = {k: getattr(args, k) for k, _ in STRUCTURED_QUERY if getattr(args, k)}
for param, _ in EXTRADATA_PARAMS:
if getattr(args, param):
params[param] = '1'
for param in... | |
18,507 | [
-0.01552615873515606,
0.03904355689883232,
0.034613873809576035,
-0.06161491945385933,
-0.06989553570747375,
-0.0401788055896759,
-0.005467545241117477,
0.00850321538746357,
0.004613328259438276,
0.02597709931433201,
0.002056242199614644,
-0.05195419862866402,
0.06838187575340271,
-0.04013... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(args):
params = dict(osm_ids=','.join(args.ids))
for param, _ in EXTRADATA_PARAMS:
if getattr(args, param):
params[param] = '1'
if args.format:
params['format'] = args.format
if args.lang:
params['accept-language'] = args.lang
... | |
18,508 | [
0.003236284013837576,
0.06338415294885635,
0.042584795504808426,
-0.044763337820768356,
-0.04081903025507927,
-0.055174484848976135,
-0.0024279295466840267,
0.007544640451669693,
0.021579047664999962,
0.01374775730073452,
-0.018689611926674843,
-0.03256349638104439,
0.060632310807704926,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(args):
params = dict(lat=args.lat, lon=args.lon)
if args.zoom is not None:
params['zoom'] = args.zoom
for param, _ in EXTRADATA_PARAMS:
if getattr(args, param):
params[param] = '1'
if args.format:
params['format'] = args.format... | |
18,509 | [
0.0132107213139534,
0.024959737434983253,
0.031913913786411285,
-0.03038576804101467,
-0.059885650873184204,
0.015956956893205643,
-0.043363943696022034,
-0.016399897634983063,
-0.007446949370205402,
0.024007413536310196,
-0.0007571526220999658,
-0.06480229645967484,
0.01184867788106203,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def add_args(parser):
group = parser.add_argument_group('Query arguments')
objs = group.add_mutually_exclusive_group(required=True)
objs.add_argument('--node', '-n', type=int,
help="Look up the OSM node with the given ID.")
objs.add_argument('--way', '-w', type=... | |
18,510 | [
-0.023303957656025887,
0.04085589572787285,
0.004432367626577616,
-0.0632011890411377,
-0.09615101665258408,
-0.054490309208631516,
-0.00350624555721879,
0.011273245327174664,
0.023363135755062103,
-0.004251877311617136,
-0.008941666223108768,
-0.04061918705701828,
0.01507833506911993,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(args):
if args.node:
params = dict(osmtype='N', osmid=args.node)
elif args.way:
params = dict(osmtype='W', osmid=args.node)
elif args.relation:
params = dict(osmtype='R', osmid=args.node)
else:
params = dict(place_id=args.place_id)
... | |
18,511 | [
0.0006327065057121217,
-0.03415469080209732,
0.05505610629916191,
-0.024476656690239906,
-0.008237462490797043,
0.01215320359915495,
0.021058568730950356,
0.005346492864191532,
0.014327160082757473,
0.012899682857096195,
0.03389276936650276,
-0.031142583116889,
-0.03420707583427429,
0.0078... | 13 | {"_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": "use_locking", "annotat... | class AdagradOptimizerTest(tf.test.TestCase):
def doTestBasic(self, use_locking=False):
for dtype in [tf.half, tf.float32, tf.float64]:
with self.test_session():
var0 = tf.Variable([1.0, 2.0], dtype=dtype)
var1 = tf.Variable([3.0, 4.0], dtype=dtype)
grads0 = tf.constant([0.1, 0.1], ... | |
18,512 | [
-0.0205781701952219,
0.0015667752595618367,
0.04152845963835716,
-0.052047017961740494,
-0.008856427855789661,
-0.012577615678310394,
0.015070811845362186,
0.008682772517204285,
0.015901876613497734,
0.026916593313217163,
0.029571041464805603,
-0.0011411643354222178,
-0.030389701947569847,
... | 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": "use_locking", "annotation": null, "type_comment": null}}], "kwarg... | def doTestBasic(self, use_locking=False):
for dtype in [tf.half, tf.float32, tf.float64]:
with self.test_session():
var0 = tf.Variable([1.0, 2.0], dtype=dtype)
var1 = tf.Variable([3.0, 4.0], dtype=dtype)
grads0 = tf.constant([0.1, 0.1], dtype=dtype)
grads1 = tf.constant([0.01, ... | |
18,513 | [
-0.016020651906728745,
-0.016600752249360085,
0.02727707289159298,
-0.04640805348753929,
-0.01625516079366207,
-0.006856296211481094,
0.012935010716319084,
0.0030301001388579607,
0.029375309124588966,
0.02294483222067356,
0.022833749651908875,
-0.004026762675493956,
-0.02777077630162239,
0... | 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 testSparseBasic(self):
for dtype in [tf.half, tf.float32, tf.float64]:
with self.test_session():
var0 = tf.Variable([[1.0], [2.0]], dtype=dtype)
var1 = tf.Variable([[3.0], [4.0]], dtype=dtype)
grads0 = tf.IndexedSlices(
tf.constant([0.1], shape=[1, 1], dtype=dtype),
... | |
18,514 | [
-0.0003917138383258134,
-0.02322392165660858,
0.03609754517674446,
-0.06841010600328445,
-0.010636509396135807,
0.007867862470448017,
0.018107183277606964,
0.021728618070483208,
0.03654146194458008,
0.041985299438238144,
0.018527736887335777,
0.0019625849090516567,
-0.02053705044090748,
-0... | 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 testTensorLearningRate(self):
for dtype in [tf.half, tf.float32, tf.float64]:
with self.test_session():
var0 = tf.Variable([1.0, 2.0], dtype=dtype)
var1 = tf.Variable([3.0, 4.0], dtype=dtype)
grads0 = tf.constant([0.1, 0.1], dtype=dtype)
grads1 = tf.constant([0.01, 0.01], d... | |
18,515 | [
0.004331870935857296,
0.004141120705753565,
0.037756193429231644,
-0.02584354765713215,
-0.016035305336117744,
0.03039693459868431,
0.016133757308125496,
-0.004125737585127354,
0.030003126710653305,
-0.016724467277526855,
0.014337015338242054,
0.00772229814901948,
-0.034458063542842865,
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 testSparseStability(self):
for dtype in [tf.half, tf.float32, tf.float64]:
with self.test_session():
shape = [1, 6]
var0 = tf.Variable(
[[0.00872496, -0.106952, 0.110467, 0.226505, -0.0147257,
-0.0105945]],
dtype=dtype)
grads0 = tf.IndexedSlice... | |
18,516 | [
0.009695203974843025,
-0.03749753534793854,
0.05184463784098625,
-0.04088540002703667,
-0.006227131467312574,
-0.0002865330607164651,
0.032159075140953064,
0.0008293217397294939,
0.020750688388943672,
0.012877746485173702,
0.03713821619749069,
-0.019967885687947273,
-0.02871987782418728,
-... | 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 testSharing(self):
for dtype in [tf.half, tf.float32, tf.float64]:
with self.test_session():
var0 = tf.Variable([1.0, 2.0], dtype=dtype)
var1 = tf.Variable([3.0, 4.0], dtype=dtype)
grads0 = tf.constant([0.1, 0.1], dtype=dtype)
grads1 = tf.constant([0.01, 0.01], dtype=dtype)... | |
18,517 | [
-0.02119010128080845,
0.02527829073369503,
0.0872860923409462,
0.05175521597266197,
-0.029387887567281723,
0.01601029746234417,
-0.005056728608906269,
-0.019745320081710815,
0.026990622282028198,
0.018899857997894287,
0.003973143640905619,
-0.018514582887291908,
0.061429888010025024,
-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}}, {"_type": "arg", "_fields": {"arg": "clob", "annotation": null, "type_comment": null}}], "kwarg": null... | def convert_extent(self, clob):
if clob:
# Generally, Oracle returns a polygon for the extent -- however,
# it can return a single point if there's only one Point in the
# table.
ext_geom = Geometry(clob.read())
gtype = str(ext_geom.geom_type)
... | |
18,518 | [
-0.016514930874109268,
-0.01669522374868393,
0.03204425424337387,
-0.04694855585694313,
0.023738710209727287,
0.018089497461915016,
0.0011230813106521964,
-0.017813047394156456,
0.036299191415309906,
0.007440132088959217,
0.0003254682233091444,
0.004465281497687101,
0.010354884900152683,
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 SummariesTest(test.TestCase):
def testStructure(self):
with self.cached_session():
inputs_shape = (1, 18, 19, 5)
inputs = constant_op.constant(_rand(*inputs_shape))
spec = "net = Cr(64, [5, 5])"
outputs = specs.create_net(spec, inputs)
variables.global_variables_initializer().... | |
18,519 | [
-0.0022828758228570223,
0.0035277914721518755,
0.0512230210006237,
-0.03489584103226662,
0.011564023792743683,
0.021841740235686302,
0.02086109109222889,
0.008405568078160286,
0.028069501742720604,
0.004674005322158337,
0.007437653839588165,
-0.0014009280130267143,
-0.005505010019987822,
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 testStructure(self):
with self.cached_session():
inputs_shape = (1, 18, 19, 5)
inputs = constant_op.constant(_rand(*inputs_shape))
spec = "net = Cr(64, [5, 5])"
outputs = specs.create_net(spec, inputs)
variables.global_variables_initializer().run()
result = outputs.eval()
... | |
18,520 | [
-0.010206681676208973,
-0.006984164007008076,
0.03117142617702484,
-0.04107178747653961,
0.01920032501220703,
0.007890880107879639,
0.01099086832255125,
0.0047326902858912945,
0.027176974341273308,
0.004781701602041721,
0.004288521595299244,
0.026123223826289177,
0.02419951558113098,
0.004... | 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 testStructureFromTensor(self):
with self.cached_session():
inputs = constant_op.constant(_rand(1, 18, 19, 5))
spec = "net = Cr(64, [5, 5])"
outputs = specs.create_net(spec, inputs)
variables.global_variables_initializer().run()
result = outputs.eval()
self.assertEqual(tuple(r... | |
18,521 | [
0.00913990568369627,
0.0033232916612178087,
0.05224364995956421,
-0.05645155906677246,
0.008791523985564709,
0.0016104131937026978,
-0.006622674874961376,
0.025438722223043442,
0.022200819104909897,
-0.007138417102396488,
0.006820774637162685,
0.01430415827780962,
-0.03270692750811577,
-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 testPrint(self):
with self.cached_session():
inputs = constant_op.constant(_rand(1, 18, 19, 5))
spec = "net = Cr(64, [5, 5])"
outputs = specs.create_net(spec, inputs)
variables.global_variables_initializer().run()
result = outputs.eval()
self.assertEqual(tuple(result.shape), ... | |
18,522 | [
-0.001653615152463317,
-0.0025318257976323366,
0.04064861312508583,
-0.05369631573557854,
0.013688935898244381,
0.0019655192736536264,
0.018972139805555344,
0.018512126058340073,
0.06239478290081024,
0.006879317574203014,
0.015110800974071026,
0.014302290044724941,
-0.008754228241741657,
-... | 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 testSummary(self):
with self.cached_session():
inputs = constant_op.constant(_rand(1, 18, 19, 5))
spec = "net = Cr(64, [5, 5])"
outputs = specs.create_net(spec, inputs)
variables.global_variables_initializer().run()
result = outputs.eval()
self.assertEqual(tuple(result.shape)... | |
18,523 | [
-0.041387755423784256,
0.019250119104981422,
-0.029476745054125786,
-0.03803903982043266,
0.016643332317471504,
-0.04916801303625107,
0.036073923110961914,
-0.010176495648920536,
0.00629639346152544,
0.046882063150405884,
0.021355601027607918,
-0.006782659329473972,
-0.036294497549533844,
... | 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": "sourcefile", "annotati... | class MinifiedJSNode(Node):
def __init__(self, sourcefile):
# type: (str) -> None
self.sourcefile = sourcefile
def render(self, context):
# type: (Dict[str, Any]) -> str
if settings.DEBUG:
source_files = settings.JS_SPECS[self.sourcefile]
normal_source = ... | |
18,524 | [
-0.010997814126312733,
-0.0015342999249696732,
0.005160281900316477,
-0.05696088448166847,
-0.022606950253248215,
-0.04713177680969238,
0.00822888221591711,
-0.036823198199272156,
0.015426905825734138,
0.04871402308344841,
-0.021252451464533806,
-0.012070625089108944,
-0.0000993586509139277,... | 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": "context", "annotation": null, "type_comment": null}}], "kwarg": n... | def render(self, context):
# type: (Dict[str, Any]) -> str
if settings.DEBUG:
source_files = settings.JS_SPECS[self.sourcefile]
normal_source = source_files['source_filenames']
minified_source = source_files.get('minifed_source_filenames', [])
# Minified ... | |
18,525 | [
-0.044174667447805405,
0.008934598416090012,
-0.05331563949584961,
-0.04085250571370125,
-0.001151430536992848,
-0.04469815641641617,
0.01570475846529007,
0.008939631283283234,
0.05794652923941612,
-0.001944218878634274,
-0.0024828114546835423,
-0.009427888318896294,
-0.00603022426366806,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "token", "annotation": null, "type_comment": null}}], "kwarg": n... | def minified_js(parser, token):
# type: (Parser, Token) -> MinifiedJSNode
try:
tag_name, sourcefile = token.split_contents()
except ValueError:
raise TemplateSyntaxError("%s tag requires an argument" % (tag_name,))
if not (sourcefile[0] == sourcefile[-1] and sourcefile[0] in ('"', "'")):... | |
18,526 | [
0.017111342400312424,
0.05864199623465538,
0.037208255380392075,
0.018849212676286697,
0.031593598425388336,
-0.02150058001279831,
0.019695866852998734,
0.014660499058663845,
0.0055673131719231606,
0.03756474331021309,
-0.0425109900534153,
-0.013078590855002403,
0.009235222823917866,
-0.05... | 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": "kind", "annotation": null, "type_comment": null}}], "kwarg": null... | def get_path(self, kind):
if not self.initialized:
self.initialize_paths()
if kind not in self.paths:
raise SchemeException("Path cannot be found for : %s" % kind.tostring())
return self.paths[kind] | |
18,527 | [
0.0264910776168108,
0.010586762800812721,
0.06956861913204193,
0.01447018701583147,
0.012214256450533867,
0.021366890519857407,
-0.002669518580660224,
0.004047248046845198,
-0.0320986770093441,
0.01260098721832037,
-0.005183270666748285,
0.03237798437476158,
-0.01148376427590847,
-0.013224... | 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": "target", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, target):
super(PowerDNSBackend, self).__init__(target)
self.host = self.options.get('host', '127.0.0.1')
self.port = int(self.options.get('port', 53))
self.local_store = threading.local()
default_connection = 'sqlite:///%(state_path)s/powerdns.sqlite' % {
... | |
18,528 | [
0.029486792162060738,
0.05054878816008568,
0.07797836512327194,
-0.025225412100553513,
0.01986195147037506,
0.05990423262119293,
-0.022506944835186005,
0.011192246340215206,
-0.0050450824201107025,
0.02211509458720684,
0.03242567554116249,
-0.008767667226493359,
-0.025960132479667664,
0.01... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "powerdns"}}, "targets": [{"_type": "Name", "_fields": {"id": "__plugin_name__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen... | class PowerDNSBackend(base.Backend):
__plugin_name__ = 'powerdns'
__backend_status__ = 'integrated'
@classmethod
def get_cfg_opts(cls):
group = cfg.OptGroup('backend:powerdns')
opts = copy.deepcopy(options.database_opts)
# Strip connection options
discard_opts = ('sqli... | |
18,529 | [
0.04363327473402023,
0.0001456277968827635,
0.05675571784377098,
-0.021805046126246452,
0.058007679879665375,
0.002277879510074854,
0.03222648799419403,
0.03992375358939171,
-0.00933756772428751,
-0.02237306721508503,
0.04632268100976944,
0.010357686318457127,
-0.011470544151961803,
-0.010... | 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 session(self):
# NOTE: This uses a thread local store, allowing each greenthread to
# have it's own session stored correctly. Without this, each
# greenthread may end up using a single global session, which
# leads to bad things happening.
if not hasattr(sel... | |
18,530 | [
0.06144411489367485,
0.0017688855296000838,
0.0478927418589592,
0.0022949480917304754,
0.029585761949419975,
-0.012551854364573956,
0.02590332366526127,
-0.0035956380888819695,
-0.02663981169462204,
-0.035561833530664444,
0.04326339066028595,
0.007601604796946049,
0.043095048516988754,
-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": "table", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _create(self, table, values):
query = table.insert()
resultproxy = self.session.execute(query, values)
# Refetch the row, for generated columns etc
query = select([table])\
.where(table.c.id == resultproxy.inserted_primary_key[0])
resultproxy = self.session.exec... | |
18,531 | [
0.0461558997631073,
0.029375704005360603,
0.010042223148047924,
0.006867451127618551,
0.019556181505322456,
0.036315660923719406,
-0.012129389680922031,
0.031695928424596786,
-0.016873421147465706,
-0.019338659942150116,
0.05340660363435745,
-0.06061587482690811,
0.05481531098484993,
0.025... | 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": "table", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _delete(self, table, id_, exc_notfound, id_col=None):
if id_col is None:
id_col = table.c.id
query = table.delete()\
.where(id_col == id_)
resultproxy = self.session.execute(query)
if resultproxy.rowcount != 1:
raise exc_notfound() | |
18,532 | [
0.03868946060538292,
-0.0049910289235413074,
0.02703174389898777,
0.019986236467957497,
0.039684902876615524,
0.007930343970656395,
-0.017044156789779663,
-0.0017530816840007901,
-0.03780462592840195,
-0.03192046284675598,
0.021833332255482674,
-0.04888719692826271,
0.07326443493366241,
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": "table", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _get(self, table, id_, exc_notfound, id_col=None):
if id_col is None:
id_col = table.c.id
query = select([table])\
.where(id_col == id_)
resultproxy = self.session.execute(query)
results = resultproxy.fetchall()
if len(results) != 1:
ra... | |
18,533 | [
0.0314498245716095,
0.04505093768239021,
0.013876216486096382,
-0.0066850134171545506,
0.018486950546503067,
0.05176346004009247,
-0.006558465771377087,
0.024737300351262093,
-0.01756260171532631,
0.04285011067986488,
0.03781021386384964,
-0.025683656334877014,
-0.018894102424383163,
-0.01... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_domain(self, context, domain):
# TODO(kiall): We should make this match create_domain with regard to
# transactions.
try:
self._get(tables.domains, domain['id'], exceptions.DomainNotFound,
id_col=tables.domains.c.designate_id)
exc... | |
18,534 | [
0.020558450371026993,
0.027592850849032402,
0.06072795391082764,
-0.01720704324543476,
-0.008680497296154499,
0.015454364940524101,
0.009077218361198902,
0.028374450281262398,
-0.017680739983916283,
0.009479861706495285,
0.039340537041425705,
-0.0016046485397964716,
-0.008710104040801525,
... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def create_domain(self, context, domain):
try:
self.session.begin()
def _parse_master(master):
return '%s:%d' % (master.host, master.port)
masters = six.moves.map(_parse_master, self.masters)
domain_values = {
'designate_id': doma... | |
18,535 | [
0.018835321068763733,
0.002565220231190324,
0.0524219274520874,
-0.05189364403486252,
-0.015878967940807343,
0.025377901270985603,
-0.04142957553267479,
0.03212366998195648,
0.02795836143195629,
0.07960817962884903,
0.04774865508079529,
-0.0682297796010971,
-0.013765835203230381,
-0.022370... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "packages", "annotation": null, "type_comment": null}}, {"_type"... | def remove_packages(module, packages, root):
remove_c = 0
# Using a for loop in case of error, we can report the package that failed
for package in packages:
# Query the package first, to see if we even need to remove
if not query_package(module, package, root):
continue
... | |
18,536 | [
-0.028950517997145653,
0.02039695717394352,
0.025040319189429283,
-0.011467413045465946,
0.03600015863776207,
0.0021783385891467333,
-0.042636219412088394,
0.013253321871161461,
-0.0016578402137383819,
-0.009333722293376923,
0.03054843656718731,
-0.03556777909398079,
0.017812088131904602,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "a... | def query_package(module, name, root):
# rpm -q returns 0 if the package is installed,
# 1 if it is not installed
cmd = "rpm -q %s %s" % (name, root_option(root))
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
if rc == 0:
return True
else:
return False | |
18,537 | [
-0.01882668398320675,
0.01778009720146656,
0.015722600743174553,
-0.03165927529335022,
-0.032753437757492065,
0.038081519305706024,
-0.01653132773935795,
0.008800850249826908,
0.015199307352304459,
0.08777064830064774,
0.006559012457728386,
-0.06598259508609772,
0.010584807023406029,
0.005... | 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 main():
module = AnsibleModule(
argument_spec = dict(
state = dict(default='installed', choices=['installed', 'removed', 'absent', 'present']),
update_cache = dict(default=False, aliases=['update-cache'], type='bool'),
force = dict(default=True, t... | |
18,538 | [
0.006051925476640463,
0.031195491552352905,
0.02897210232913494,
-0.015643121674656868,
0.005413835868239403,
-0.006119987927377224,
-0.03784296661615372,
0.031354304403066635,
0.03650439530611038,
0.07795469462871552,
0.009732993319630623,
-0.035483453422784805,
-0.022630911320447922,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pkgspec", "annotation": null, "type_comment": null}}, {"_type":... | def install_packages(module, pkgspec, root, force=True, no_recommends=True):
packages = ""
for package in pkgspec:
if not query_package_provides(module, package, root):
packages += "'%s' " % package
if len(packages) != 0:
if no_recommends:
no_recommends_yes = '--no-... | |
18,539 | [
0.04794062301516533,
-0.02324501983821392,
-0.011895980685949326,
0.03260247781872749,
0.00992223434150219,
-0.008721341378986835,
-0.005870705004781485,
0.03295917809009552,
0.06715492159128189,
0.001936589484103024,
0.022174915298819542,
-0.036930449306964874,
-0.0035610655322670937,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_handleEvent_no_api_key_should_set_errorState(self):
sf = SpiderFoot(self.default_options)
module = sfp_fsecure_riddler()
module.setup(sf, dict())
target_value = 'example target value'
target_type = 'IP_ADDRESS'
target = SpiderFootTarget(target_value, target_typ... | |
18,540 | [
0.03335218131542206,
-0.008605100214481354,
0.03285367786884308,
-0.03857458755373955,
0.006008733995258808,
0.014622735790908337,
-0.00459927786141634,
0.025209976360201836,
0.04913809150457382,
0.00028634213958866894,
0.013827505521476269,
-0.05507264286279678,
-0.009257900528609753,
0.0... | 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 TestModuleFsecureRiddler(unittest.TestCase):
def test_opts(self):
module = sfp_fsecure_riddler()
self.assertEqual(len(module.opts), len(module.optdescs))
def test_setup(self):
sf = SpiderFoot(self.default_options)
module = sfp_fsecure_riddler()
module.setup(sf, di... | |
18,541 | [
-0.003368373727425933,
0.0324137918651104,
-0.0005087332683615386,
0.02364513650536537,
0.008405815809965134,
-0.018529077991843224,
-0.009566906839609146,
0.02111734449863434,
0.030744723975658417,
0.02187930978834629,
0.01120573841035366,
-0.029317550361156464,
0.002096918411552906,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "xapi", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "if_name", "annotation": null, "type_comment": null}}, {"_type": "... | def add_dhcp_if(xapi, if_name, zone_name, create_default_route):
if_xml = [
'<entry name="%s">',
'<layer3>',
'<dhcp-client>',
'<create-default-route>%s</create-default-route>',
'</dhcp-client>'
'</layer3>'
'</entry>'
]
cdr = 'yes'
if not create_def... | |
18,542 | [
0.0028048695530742407,
0.02751586027443409,
0.011560732498764992,
-0.009597024880349636,
-0.019888531416654587,
0.03939389809966087,
-0.006807122379541397,
0.025791628286242485,
0.049667444080114365,
0.029503516852855682,
0.022822119295597076,
-0.053115908056497574,
0.03070089966058731,
0.... | 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 = dict(
ip_address=dict(required=True),
password=dict(required=True, no_log=True),
username=dict(default='admin'),
if_name=dict(required=True),
zone_name=dict(required=True),
create_default_route=dict(type='bool', default=False),
comm... | |
18,543 | [
-0.017564626410603523,
-0.006987726781517267,
-0.018699027597904205,
-0.03578013554215431,
0.05173614248633385,
-0.03243272379040718,
-0.01581653207540512,
0.01924763061106205,
-0.004774714354425669,
0.014988976530730724,
-0.03313940018415451,
0.010925587266683578,
0.021349063143134117,
-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": "input_tensors", "annotation": null, "type_comment": null}}], "kwa... | def _apply_transform(self, input_tensors, **kwargs):
input_tensor = input_tensors[0]
if isinstance(input_tensor, ops.SparseTensor):
result = ops.SparseTensor(input_tensor.indices,
operation(input_tensor.values),
input_tensor.shape)
else:
... | |
18,544 | [
0.04207203537225723,
0.027821453288197517,
-0.0011741203488782048,
-0.0074241324327886105,
0.03154816851019859,
0.02632139064371586,
0.026063568890094757,
0.014086514711380005,
-0.043267399072647095,
0.02164541929960251,
-0.010125415399670601,
-0.018281999975442886,
-0.005551985464990139,
... | 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 on_enter(self):
super(Layer, self).on_enter()
scn = self.get_ancestor(scene.Scene)
if not scn: return
if scn._handlers_enabled:
if self.is_event_handler:
director.window.push_handlers( self ) | |
18,545 | [
0.06902481615543365,
0.020349722355604172,
0.024185683578252792,
0.0030457088723778725,
-0.01205909438431263,
0.011260404251515865,
0.04130689799785614,
-0.02229582518339157,
-0.01898857392370701,
0.029990248382091522,
0.018594853579998016,
-0.0047387066297233105,
-0.028392868116497993,
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": "stream_factory", "annotation": null, "type_comment": null}}, {"_t... | def __init__(self, stream_factory=None, charset='utf-8', errors='replace',
max_form_memory_size=None, cls=None, buffer_size=10 * 1024):
self.stream_factory = stream_factory
self.charset = charset
self.errors = errors
self.max_form_memory_size = max_form_memory_size
... | |
18,546 | [
0.05785062164068222,
0.04555221274495125,
0.0071511706337332726,
-0.030436847358942032,
0.002642326056957245,
0.03492565453052521,
0.02381815016269684,
0.02215775102376938,
-0.01899726502597332,
0.028146641328930855,
0.014451204799115658,
-0.04965168237686157,
-0.022661596536636353,
-0.000... | 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 on_exit(self):
super(Layer, self).on_exit()
scn = self.get_ancestor(scene.Scene)
if not scn: return
if scn._handlers_enabled:
if self.is_event_handler:
director.window.remove_handlers( self ) | |
18,547 | [
0.030704861506819725,
0.03598225861787796,
0.09000362455844879,
0.026171095669269562,
-0.04245906323194504,
0.0391966737806797,
0.021589355543255806,
-0.001893566339276731,
-0.004758653696626425,
0.06591949611902237,
0.011370393447577953,
-0.017403418198227882,
-0.002304363762959838,
0.038... | 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": "boundary", "annotation": null, "type_comment": null}}], "kwarg": ... | def validate_boundary(self, boundary):
if not boundary:
self.fail('Missing boundary')
if not is_valid_multipart_boundary(boundary):
self.fail('Invalid boundary: %s' % boundary)
if len(boundary) > self.buffer_size: # pragma: no cover
# this should never h... | |
18,548 | [
0.06787897646427155,
0.032348886132240295,
0.005731141194701195,
-0.03346230834722519,
0.011193867772817612,
-0.035470444709062576,
0.043105337768793106,
-0.008549490943551064,
0.017089039087295532,
0.007197477854788303,
0.012625410221517086,
-0.01841122843325138,
-0.003524179570376873,
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": "filename", "annotation": null, "type_comment": null}}, {"_type": ... | def start_file_streaming(self, filename, headers, total_content_length):
filename = _decode_unicode(filename, self.charset, self.errors)
filename = self._fix_ie_filename(filename)
content_type = headers.get('content_type')
try:
content_length = int(headers['content-lengt... | |
18,549 | [
0.0636882409453392,
0.05719621106982231,
0.029924944043159485,
-0.024759750813245773,
0.014310899190604687,
0.017746463418006897,
0.03854939341545105,
-0.0000340826045430731,
0.0029424417298287153,
0.039165426045656204,
0.02196391299366951,
-0.004602470435202122,
0.007658937480300665,
0.00... | 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": "file", "annotation": null, "type_comment": null}}, {"_type": "arg... | def parse(self, file, boundary, content_length):
next_part = '--' + boundary
last_part = next_part + '--'
form = []
files = []
in_memory = 0
iterator = chain(make_line_iter(file, limit=content_length,
buffer_size=self.buf... | |
18,550 | [
0.02151775173842907,
0.02983418107032776,
-0.0752919465303421,
-0.046668894588947296,
-0.027270620688796043,
-0.027896372601389885,
0.03514296934008598,
-0.010920359753072262,
0.02519151382148266,
0.03671743720769882,
0.04033064469695091,
-0.01990291103720665,
0.011192863807082176,
-0.0220... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "video", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "Video", "value": {"_type": "Name", "_fields": ... | def convert_video_to_track(
video: youtube.Video, album_name: str, **kwargs
) -> Track:
try:
adjustedLength = video.length.get() * 1000
except Exception:
adjustedLength = 0
return Track(
name=video.title.get(),
comment=video.id,
length=adjustedLength,
ar... | |
18,551 | [
0.011934967711567879,
-0.009360398165881634,
-0.07554522156715393,
-0.03847142308950424,
-0.013792335987091064,
-0.013259031809866428,
0.030048901215195656,
-0.01958511583507061,
0.05557391792535782,
0.032954487949609756,
0.03422338142991066,
0.007383496966212988,
0.021240197122097015,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "playlist", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "Playlist", "value": {"_type": "Name", "_fie... | def convert_playlist_to_track(playlist: youtube.Playlist) -> Track:
album_name = f"YouTube Playlist ({playlist.video_count.get()} videos)"
return Track(
name=playlist.title.get(),
comment=playlist.id,
length=0,
artists=[Artist(name=playlist.channel.get())],
album=Album(na... | |
18,552 | [
0.013239712454378605,
-0.01496825646609068,
-0.020705154165625572,
-0.05778008699417114,
-0.031225914135575294,
-0.0437648668885231,
0.004365741740912199,
-0.008605346083641052,
0.03242187947034836,
0.03414107859134674,
0.0551639124751091,
-0.00735331978648901,
-0.030571870505809784,
-0.04... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "videos", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "album_name", "annotation": {"_type": "Name", "_fields": {"id": ... | def convert_videos_to_tracks(videos, album_name: str):
# load audio_url in the background to be ready for playback
for video in videos:
video.audio_url # start loading
return [
convert_video_to_track(
video,
album_name,
track_no=count,
)
... | |
18,553 | [
0.01946169137954712,
-0.02898099645972252,
-0.017698856070637703,
-0.03558574989438057,
0.024562157690525055,
0.01120575051754713,
0.01702897995710373,
0.004336572252213955,
-0.0068339211866259575,
-0.005638131871819496,
0.03499813750386238,
-0.07056038081645966,
-0.009002206847071648,
-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}}, {"_type": "arg", "_fields": {"arg": "config", "annotation":... | class YouTubeBackend(pykka.ThreadingActor, backend.Backend):
def __init__(self, config, audio):
super().__init__()
self.config = config
self.library = YouTubeLibraryProvider(backend=self)
self.playback = YouTubePlaybackProvider(audio=audio, backend=self)
youtube_api.youtube_a... | |
18,554 | [
0.018833348527550697,
-0.04873419553041458,
-0.07544499635696411,
-0.006459140684455633,
-0.006584696471691132,
-0.03283047676086426,
0.033760521560907364,
-0.029631134122610092,
0.04683690890669823,
0.010993095114827156,
0.04613007605075836,
-0.02044232003390789,
0.025948168709874153,
-0.... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "playlist", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "Playlist", "value": {"_type": "Name", "_fie... | def convert_playlist_to_album(playlist: youtube.Playlist) -> Album:
return Album(
name=playlist.title.get(),
artists=[
Artist(
name=f"YouTube Playlist ({playlist.video_count.get()} videos)"
)
],
uri=format_playlist_uri(playlist),
) | |
18,555 | [
0.01745176874101162,
-0.03354533761739731,
-0.021138306707143784,
-0.03309260681271553,
0.00019217560475226492,
-0.00570766581222415,
0.03943086415529251,
-0.022043772041797638,
-0.019499845802783966,
0.03404118865728378,
0.03473106771707535,
-0.058165375143289566,
0.0040153078734874725,
-... | 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": "config", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, config, audio):
super().__init__()
self.config = config
self.library = YouTubeLibraryProvider(backend=self)
self.playback = YouTubePlaybackProvider(audio=audio, backend=self)
youtube_api.youtube_api_key = (
config["youtube"]["youtube_api_key"] or No... | |
18,556 | [
0.055699776858091354,
-0.021830638870596886,
-0.0155259408056736,
0.015563173219561577,
0.0070307315327227116,
0.0014094042126089334,
0.025963444262742996,
0.032441891729831696,
-0.0016630503814667463,
0.012106758542358875,
0.026484698057174683,
-0.05465726926922798,
-0.0188148096203804,
-... | 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 on_start(self):
proxy = httpclient.format_proxy(self.config["proxy"])
youtube.Video.proxy = proxy
headers = {
"user-agent": httpclient.format_user_agent(self.user_agent),
"Cookie": "PREF=hl=en;",
"Accept-Language": "en;q=0.8",
}
if youtube... | |
18,557 | [
0.04255308583378792,
-0.01566835306584835,
-0.04581642895936966,
-0.039808422327041626,
-0.01799159310758114,
-0.0028770340140908957,
0.019806960597634315,
0.031833771616220474,
-0.0300616268068552,
0.049792949110269547,
0.04177507385611534,
-0.0904226079583168,
0.010508602485060692,
-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": "query", "annotation": null, "type_comment": null}}, {"_type": "ar... | def search(self, query=None, uris=None, exact=False):
# TODO Support exact search
logger.info('youtube LibraryProvider.search "%s"', query)
# handle only searching (queries with 'any') not browsing!
if not (query and "any" in query):
return None
search_query = " ".j... | |
18,558 | [
0.01946430467069149,
-0.044112712144851685,
-0.06205621734261513,
-0.04755603149533272,
-0.018020024523139,
-0.04870380088686943,
0.005700602196156979,
-0.007207053247839212,
0.013323722407221794,
0.027776088565587997,
0.03955988213419914,
-0.03892860934138298,
0.015064510516822338,
-0.031... | 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": "playlist_id", "annotation": {"_type": "Name", "_fields": {"id": "... | def lookup_playlist_tracks(self, playlist_id: str):
playlist = youtube.Playlist.get(playlist_id)
if not playlist.videos.get():
return None
# ignore videos for which no info was found (removed, etc)
videos = [
video
for video in playlist.videos.get()
... | |
18,559 | [
0.021209819242358208,
-0.004708919208496809,
0.030476246029138565,
-0.03207515925168991,
-0.022057726979255676,
0.01641308143734932,
-0.012143257074058056,
-0.0026951369363814592,
0.02065262198448181,
0.03386787697672844,
0.05097139999270439,
-0.0017548672622069716,
0.0186782069504261,
-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_cluster_policy_list(self):
name = self.name_generate()
po = self.policy_create(name)
self.addCleanup(self.policy_delete, po['id'])
pf = self.profile_create(name)
self.addCleanup(self.profile_delete, pf['id'])
cluster = self.cluster_create(pf['id'], name)
... | |
18,560 | [
0.03303801268339157,
0.026931678876280785,
0.03618232160806656,
-0.012987357564270496,
-0.02374180033802986,
0.04235701262950897,
-0.01030444260686636,
-0.012520268559455872,
0.015436727553606033,
0.015083562582731247,
0.05017221346497536,
-0.009131023660302162,
0.011523431167006493,
-0.03... | 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_cluster_policy_attach_and_detach(self):
name = self.name_generate()
po = self.policy_create(name)
self.addCleanup(self.policy_delete, po['id'])
pf = self.profile_create(name)
self.addCleanup(self.profile_delete, pf['id'])
cluster = self.cluster_create(pf['id'], n... | |
18,561 | [
0.04481520131230354,
-0.004504712298512459,
0.02894909679889679,
-0.01298784464597702,
-0.02049272507429123,
0.04210345074534416,
0.029377266764640808,
0.0020858454518020153,
0.0030313890893012285,
0.02659415826201439,
0.05185622721910477,
0.013023525476455688,
-0.020909002050757408,
-0.02... | 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_cluster_policy_update(self):
name = self.name_generate()
po = self.policy_create(name)
self.addCleanup(self.policy_delete, po['id'])
pf = self.profile_create(name)
self.addCleanup(self.profile_delete, pf['id'])
cluster = self.cluster_create(pf['id'], name)
... | |
18,562 | [
0.046832989901304245,
0.08139646798372269,
-0.02900303713977337,
-0.015010572969913483,
-0.0586848147213459,
0.036573588848114014,
0.03709569573402405,
-0.0428127646446228,
0.03618200868368149,
0.01176698412746191,
0.03759169578552246,
-0.005658333655446768,
0.019017742946743965,
0.0367563... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def validates_snapshot(obj):
checker = Checker()
check = True
_ = obj._
checker.errors = []
if is_param(obj.input, 'title'):
check = checker.check_string(
_('Title'),
obj.input.title,
CHECK_LENGTH | CHECK_ONLYSPACE,
... | |
18,563 | [
0.02569652535021305,
0.042286861687898636,
0.008821619674563408,
-0.04814897105097771,
-0.018539629876613617,
-0.016462281346321106,
-0.024316368624567986,
-0.0016087007243186235,
0.014826012775301933,
0.002851019613444805,
0.017557868734002113,
-0.010664200410246849,
-0.0030128678772598505,... | 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": {"_type": "arg", "_fields": {"arg": "params", "an... | class GuestBy1SnapshotBy1(Rest):
@auth
def _GET(self, *param, **params):
(host_id, guest_id) = self.chk_guestby1(param)
if guest_id is None: return web.notfound()
snapshot_id = param[2]
if not validates_param_id(self, snapshot_id):
return web.notfound(self.v... | |
18,564 | [
0.04400550574064255,
0.04581395164132118,
-0.03100881166756153,
-0.0038550030440092087,
-0.03677172586321831,
0.0381220318377018,
0.03727808967232704,
-0.037784453481435776,
0.020616278052330017,
0.017915666103363037,
0.03626536205410957,
-0.014805140905082226,
0.0518421046435833,
0.027970... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "snapshot_id", "annotation": null, "type_comment": null}}], "kwarg"... | def validates_param_id(obj, snapshot_id):
checker = Checker()
check = True
_ = obj._
checker.errors = []
check = checker.check_number(
_('Snapshot ID'),
snapshot_id,
CHECK_EMPTY | CHECK_VALID | CHECK_MIN | CHECK_MAX,
min = ID_MIN_LENGTH,
... | |
18,565 | [
-0.008037814870476723,
0.021755684167146683,
-0.019826609641313553,
-0.03381240740418434,
-0.005425524897873402,
-0.028882546350359917,
-0.05803302302956581,
-0.0124385179951787,
0.0018687918782234192,
0.030704451724886894,
0.002471627900376916,
0.00615227734670043,
0.0216619111597538,
-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": {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}, "v... | def _GET(self, *param, **params):
(host_id, guest_id) = self.chk_guestby1(param)
if guest_id is None: return web.notfound()
snapshot_id = param[2]
if not validates_param_id(self, snapshot_id):
return web.notfound(self.view.alert)
guest = m_findbyguest1(self.... | |
18,566 | [
0.002001752844080329,
0.00952020101249218,
-0.01545760314911604,
-0.018796119838953018,
-0.02772597223520279,
-0.04283072426915169,
-0.023722467944025993,
0.014629759825766087,
0.010056262835860252,
-0.00014207356434781104,
0.025907430797815323,
0.0011281064944341779,
-0.004817777778953314,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}, "v... | def _PUT(self, *param, **params):
(host_id, guest_id) = self.chk_guestby1(param)
if guest_id is None: return web.notfound()
snapshot_id = param[2]
if not validates_param_id(self, snapshot_id):
return web.notfound(self.view.alert)
if not validates_snapshot(self):
... | |
18,567 | [
0.030881645157933235,
0.02260255441069603,
-0.003830941393971443,
-0.02037847973406315,
0.00658177025616169,
-0.01966550014913082,
0.01790965162217617,
0.006310411728918552,
-0.022857951000332832,
0.006826524622738361,
-0.015643009915947914,
-0.026454778388142586,
0.0022905836813151836,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Migrate the specified user's Gravatar over to an avatar that we serve. If two\nemail addresses are specified, use the Gravatar for the f... | class Command(BaseCommand):
help = """Migrate the specified user's Gravatar over to an avatar that we serve. If two
email addresses are specified, use the Gravatar for the first and upload the image
for both email addresses."""
def add_arguments(self, parser):
parser.add_argument('old_email', metavar=... | |
18,568 | [
0.017283156514167786,
0.05656783655285835,
-0.008681007660925388,
-0.032568562775850296,
-0.01640256866812706,
0.0023328973911702633,
-0.03687949478626251,
0.011736774817109108,
0.0076295603066682816,
0.020082633942365646,
0.04886598885059357,
-0.007340412586927414,
0.01431281864643097,
-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": {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}, "v... | def _DELETE(self, *param, **params):
(host_id, guest_id) = self.chk_guestby1(param)
if guest_id is None: return web.notfound()
snapshot_id = param[2]
if not validates_param_id(self, snapshot_id):
return web.notfound(self.view.alert)
guest = m_findbyguest1(self.orm, ... | |
18,569 | [
-0.009242389351129532,
0.022232158109545708,
0.02078821323812008,
0.009265309199690819,
0.02063923515379429,
0.04735220596194267,
-0.014783238992094994,
-0.041599348187446594,
-0.0359610877931118,
0.008657936006784439,
0.005079589784145355,
-0.0708678662776947,
0.03431086614727974,
-0.0073... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 1}}, "targets": [{"_type": "Name", "_fields": {"id": "PROVIDE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_ty... | class DepRelation(object):
# direction
PROVIDE = 1
USE = 2
# rel_type
ENTITY = 1
PACKAGE = 2
INCLUDE = 3
def __init__(self, obj_name, direction, rel_type):
assert direction in [DepRelation.PROVIDE, DepRelation.USE]
assert rel_type in [DepRelation.ENTITY, DepRelation.PAC... | |
18,570 | [
0.03211837634444237,
-0.02088162489235401,
-0.0005450116004794836,
0.003233491675928235,
0.013168065808713436,
-0.02357376366853714,
0.05276590213179588,
-0.00920594111084938,
-0.0027301788795739412,
0.02495494671165943,
-0.001453608158044517,
-0.020249558612704277,
0.02413560077548027,
-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": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "... | def handle(self, *args, **options):
old_email = options['old_email']
if options['new_email']:
new_email = options['new_email']
else:
new_email = old_email
gravatar_url = "https://secure.gravatar.com/avatar/%s?d=identicon" % (gravatar_hash(old_email),)
gr... | |
18,571 | [
0.018002983182668686,
0.046736497431993484,
-0.007644456345587969,
-0.011568854562938213,
0.050508949905633926,
0.012208076193928719,
-0.01913471892476082,
-0.012375740334391594,
0.008372749201953411,
0.04116164892911911,
0.0008081955602392554,
-0.018788909539580345,
0.020633220672607422,
... | 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}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": n... | class File(object):
def __init__(self, path, module=None):
self.path = path
if module is None:
self.module = global_mod.top_module
else:
assert not isinstance(module, basestring)
self.module = module
@property
def name(self):
return os.pat... | |
18,572 | [
-0.0018272313755005598,
-0.009812752716243267,
-0.044382449239492416,
-0.020390721037983894,
0.03720293566584587,
0.037157922983169556,
0.015056723728775978,
-0.027502715587615967,
0.003446279326453805,
0.019839314743876457,
-0.01658715307712555,
-0.0610821358859539,
0.034164585173130035,
... | 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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __eq__(self, other):
_NOTFOUND = object()
v1, v2 = [getattr(obj, "path", _NOTFOUND) for obj in [self, other]]
if v1 is _NOTFOUND or v2 is _NOTFOUND:
return False
elif v1 != v2:
return False
return True | |
18,573 | [
0.002815272891893983,
0.011315545067191124,
0.04774528369307518,
-0.038836605846881866,
-0.02611614763736725,
-0.04110189527273178,
-0.026508217677474022,
0.03121304325759411,
0.021857842803001404,
-0.0007092636078596115,
0.031234825029969215,
-0.013962010852992535,
0.007879496552050114,
-... | 7 | {"_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 get_parser():
parser = argparse.ArgumentParser(description='p4toEbpf arguments')
parser.add_argument('source', metavar='source', type=str,
help='a P4 source file to compile')
parser.add_argument('-g', dest='generated', default="router",
help="kind of outpu... | |
18,574 | [
0.025244437158107758,
0.0431605689227581,
0.029223302379250526,
-0.035202838480472565,
-0.020096641033887863,
-0.008160045370459557,
-0.012240068055689335,
0.00817690510302782,
0.03799029439687729,
0.005546807777136564,
0.03794533386826515,
-0.029020987451076508,
0.019928045570850372,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "input_args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def process(input_args):
parser = get_parser()
args, unparsed_args = parser.parse_known_args(input_args)
has_remaining_args = False
preprocessor_args = []
for a in unparsed_args:
if a[:2] == "-D" or a[:2] == "-I" or a[:2] == "-U":
input_args.remove(a)
preprocessor_ar... | |
18,575 | [
0.019295547157526016,
0.007856455631554127,
0.04870541766285896,
-0.024790458381175995,
0.013604800216853619,
-0.06801248341798782,
0.004293979145586491,
0.008685875684022903,
-0.007683659438043833,
-0.03617195039987564,
0.012809939682483673,
-0.016484733670949936,
0.03919012099504471,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inputFile", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "gen_file", "annotation": null, "type_comment": null}}, {"_ty... | def compileP4(inputFile, gen_file, isRouter, preprocessor_args):
h = HLIR(inputFile)
for parg in preprocessor_args:
h.add_preprocessor_args(parg)
if not h.build():
return CompileResult("HLIR", "Error while building HLIR")
try:
basename = os.path.basename(inputFile)
base... | |
18,576 | [
-0.027216335758566856,
-0.00486511318013072,
0.006357124075293541,
-0.023524895310401917,
-0.009241463616490364,
0.008257508277893066,
0.03598833084106445,
-0.039100974798202515,
0.0056625669822096825,
0.0076722800731658936,
0.0012950589880347252,
-0.04151906073093414,
0.03755751624703407,
... | 17 | {"_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": "l", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def __getAngularMatrix_M(self, l, j, ll, jj, l1, j1, l2, j2):
# did we already calculated this matrix?
c = self.conn.cursor()
c.execute('''SELECT ind FROM pair_angularMatrix WHERE
l1 = ? AND j1_x2 = ? AND
l2 = ? AND j2_x2 = ? AND
l3 = ? AND j3_x2 = ? AND
... | |
18,577 | [
0.011617979034781456,
0.03595881909132004,
0.0034095030277967453,
-0.030691107735037804,
0.0027970760129392147,
0.016216065734624863,
0.024307357147336006,
-0.009737451560795307,
-0.005808989517390728,
0.01640579290688038,
-0.007968527264893055,
-0.026070700958371162,
0.022834183648228645,
... | 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 __updateAngularMatrixElementsFile(self):
if not (self.savedAngularMatrixChanged):
return
try:
c = self.conn.cursor()
c.execute('''SELECT * FROM pair_angularMatrix ''')
data = []
for v in c.fetchall():
data.append(v)
... | |
18,578 | [
0.009611932560801506,
0.03743775933980942,
0.008550316095352173,
-0.04042176157236099,
-0.002279606182128191,
-0.0333060622215271,
-0.004783012438565493,
-0.02456063963472843,
-0.01625133864581585,
0.015643062070012093,
0.02303420752286911,
-0.022127529606223106,
0.03371923416852951,
-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 __loadAngularMatrixElementsFile(self):
try:
fileHandle = gzip.GzipFile(
os.path.join(self.dataFolder, self.angularMatrixFile_meta),
'rb'
)
data = np.load(fileHandle, encoding='latin1', allow_pickle=True)
fileHandle.close()
... | |
18,579 | [
-0.016077864915132523,
-0.0023867578711360693,
0.03724236786365509,
-0.0017780866473913193,
0.0035625635646283627,
0.019490258768200874,
-0.018531721085309982,
-0.024985872209072113,
-0.01832723245024681,
0.019260209053754807,
0.01559220626950264,
0.010524739511311054,
0.010582251474261284,
... | 20 | {"_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 __makeRawMatrix2(self,
n, l, j,
nn, ll, jj,
k, lrange, limit, limitBasisToMj,
progressOutput=False, debugOutput=False):
# limit = limit in Hz on energy defect
# k defines range of n' = [n-k, n+k]
... | |
18,580 | [
-0.030930161476135254,
-0.022999349981546402,
0.013345640152692795,
0.0073565104976296425,
0.0049670119769871235,
0.06913478672504425,
-0.007158240303397179,
-0.047584861516952515,
-0.003890199353918433,
0.02044234797358513,
0.009154616855084896,
-0.012949098832905293,
-0.01309951115399599,
... | 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": "n", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def __isCoupled(self, n, l, j, nn, ll, jj, n1, l1, j1, n2, l2, j2, limit):
if ((abs(self.__getEnergyDefect(n, l, j,
nn, ll, jj,
n1, l1, j1,
n2, l2, j2)
) / C_h < limit)
... | |
18,581 | [
0.03915516287088394,
-0.02865011990070343,
-0.0015938242431730032,
0.026585247367620468,
-0.025759296491742134,
-0.03938746079802513,
-0.019435621798038483,
0.017667574808001518,
0.009169328957796097,
0.07769086956977844,
0.0364450179040432,
0.04498843103647232,
0.03724515438079834,
-0.013... | 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": "stateVector", "annotation": null, "type_comment": null}}], "kwarg... | def _stateComposition(self, stateVector):
contribution = np.absolute(stateVector)
order = np.argsort(contribution, kind='heapsort')
index = -1
totalContribution = 0
value = "$"
while (index > -5) and (totalContribution < 0.95):
i = order[index]
if ... | |
18,582 | [
-0.007430921774357557,
-0.005398506764322519,
-0.011191952042281628,
-0.011100812815129757,
-0.014157029800117016,
0.018641101196408272,
0.048875171691179276,
-0.002876975806429982,
0.003411661833524704,
-0.019406674429774284,
-0.0006319017265923321,
-0.033782441169023514,
0.0447435043752193... | 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 __initializeDatabaseForMemoization(self):
# memoization of angular parts
self.conn = sqlite3.connect(os.path.join(self.dataFolder,
"precalculated_pair.db"))
c = self.conn.cursor()
# ANGULAR PARTS
c.execute('''DROP TABLE IF EXI... | |
18,583 | [
-0.017094293609261513,
-0.030470680445432663,
0.010830427519977093,
-0.0038795561995357275,
-0.027749603614211082,
0.010372424498200417,
-0.011530903168022633,
-0.06907765567302704,
0.008473058231174946,
0.046797145158052444,
0.0060954829677939415,
0.00085117865819484,
-0.010480189695954323,... | 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": "n1", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _addState(self, n1, l1, j1, mj1, n2, l2, j2, mj2):
stateString = ""
if (abs(self.s1 - 0.5) < 0.1):
# Alkali atom
stateString += "|%s %d/2" %\
(printStateStringLatex(n1, l1, j1, s=self.s1), int(2 * mj1))
else:
# divalent atoms
st... | |
18,584 | [
0.0038467850536108017,
-0.02682698518037796,
0.015533335506916046,
0.00893623661249876,
-0.032187510281801224,
-0.004398066084831953,
-0.0355987511575222,
0.0050924974493682384,
-0.021746670827269554,
0.01621558517217636,
0.03606170415878296,
-0.00017408377607353032,
-0.004163543228060007,
... | 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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _onPick(self, event):
if isinstance(event.artist, matplotlib.collections.PathCollection):
x = event.mouseevent.xdata
y = event.mouseevent.ydata / self.scaleFactor
i = np.searchsorted(self.r, x)
if i == len(self.r):
i -= 1
if ((i > ... | |
18,585 | [
0.01182597503066063,
-0.0219165850430727,
0.021722417324781418,
0.006128391716629267,
-0.02587273344397545,
0.016176527366042137,
-0.0511629693210125,
0.000708405626937747,
-0.036284931004047394,
0.014392618089914322,
0.03851785138249397,
-0.03388211876153946,
-0.0017808742122724652,
-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}}, {"_type": "arg", "_fields": {"arg": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _onPick(self, event):
if isinstance(event.artist, matplotlib.collections.PathCollection):
x = event.mouseevent.xdata * 100.
y = event.mouseevent.ydata
i = np.searchsorted(self.eFieldList, x)
if i == len(self.eFieldList):
i -= 1
if... | |
18,586 | [
-0.0012116371653974056,
-0.0026930002495646477,
0.0014820728683844209,
-0.0015757670626044273,
-0.021839279681444168,
0.024508146569132805,
-0.007052622735500336,
-0.047153767198324203,
0.043678559362888336,
0.04533666372299194,
0.027120228856801987,
-0.019465692341327667,
-0.011288738809525... | 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": "atom1", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self, atom1, state1, atom2, state2):
self.atom1 = atom1
if (issubclass(type(self.atom1), DivalentAtom)
and (len(state1) != 5 or (state1[4] != 0 and state1[4] != 1))
):
raise ValueError("For divalent atoms state specification has to "
... | |
18,587 | [
0.020639125257730484,
-0.026204871013760567,
0.04611264169216156,
-0.018556619063019753,
-0.015321296639740467,
0.0005802817177027464,
-0.02415955252945423,
0.011732691898941994,
-0.02244892157614231,
0.021333293989300728,
0.015197337605059147,
-0.004815795924514532,
-0.024915700778365135,
... | 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": "xdata", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _onPick2(self, xdata, ydata):
x = xdata * 100.
y = ydata
i = np.searchsorted(self.eFieldList, x)
if i == len(self.eFieldList):
i -= 1
if ((i > 0) and (abs(self.eFieldList[i - 1] - x)
< abs(self.eFieldList[i] - x))):
i -= 1
... | |
18,588 | [
0.0006432274240069091,
0.005408026743680239,
0.008090189658105373,
-0.02401382476091385,
0.03500468283891678,
-0.024713044986128807,
-0.03351884335279465,
-0.0023803513031452894,
-0.010056745260953903,
-0.009570568799972534,
0.018278038129210472,
-0.004798940848559141,
-0.011018171906471252,... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def massage_install_data(data):
# Transport cli returns a list containing one result item.
# Transport nxapi returns a list containing two items. The second item
# contains the data we are interested in.
default_error_msg = 'No install all data found'
if len(data) == 1:
result_data = data[0... | |
18,589 | [
-0.024024026468396187,
-0.0018697662744671106,
-0.005236543249338865,
-0.03360489383339882,
-0.00992218591272831,
-0.01906592771410942,
-0.01002398319542408,
0.0044281575828790665,
-0.0060000186786055565,
0.0033024053554981947,
0.00029453684692271054,
-0.0068143922835588455,
-0.0061317556537... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "issu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "image", "annotation": null, "type_comment": null}}, {"_type": "ar... | def build_install_cmd_set(issu, image, kick, type, force=True):
commands = ['terminal dont-ask']
# Different NX-OS plaforms behave differently for
# disruptive and non-disruptive upgrade paths.
#
# 1) Combined kickstart/system image:
# * Use option 'non-disruptive' for issu.
# * Omit ... | |
18,590 | [
0.03146883472800255,
0.015445916913449764,
-0.014502739533782005,
-0.03743859380483627,
0.018586141988635063,
0.005470428615808487,
-0.007096022833138704,
-0.04345273599028587,
0.00901566632091999,
0.021515540778636932,
0.031069371849298477,
-0.0175652913749218,
-0.036284588277339935,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def parse_show_version(data):
version_data = {'raw': data[0].split('\n')}
version_data['version'] = ''
version_data['error'] = False
for x in version_data['raw']:
mo = re.search(r'(kickstart|system|NXOS):\s+version\s+(\S+)', x)
if mo:
version_data['version'] = mo.group(2)
... | |
18,591 | [
0.01504224818199873,
0.025848856195807457,
-0.017652319744229317,
-0.04308905825018883,
-0.03704468533396721,
0.014607236720621586,
-0.014023405499756336,
0.0051686265505850315,
-0.006198917515575886,
0.054170411080121994,
-0.005031254608184099,
-0.0456075482070446,
-0.021510185673832893,
... | 9 | {"_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 = dict(
system_image_file=dict(required=True),
kickstart_image_file=dict(required=False),
issu=dict(choices=['required', 'desired', 'no', 'yes'], default='no'),
)
argument_spec.update(nxos_argument_spec)
module = AnsibleModule(argument_spec=argument_sp... | |
18,592 | [
0.006874720100313425,
0.037077415734529495,
-0.01942381262779236,
-0.050875354558229446,
-0.022127626463770866,
0.028250612318515778,
0.031160548329353333,
0.017956720665097237,
0.01217928808182478,
0.03557394817471504,
0.05024486780166626,
-0.03627718240022659,
-0.03319749981164932,
-0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}, {"_type"... | def check_install_in_progress(module, commands, opts):
for attempt in range(20):
data = parse_show_install(load_config(module, commands, True, opts))
if data['install_in_progress']:
sleep(1)
continue
break
return data | |
18,593 | [
0.028163550421595573,
-0.024307234212756157,
0.0721006765961647,
0.002105424413457513,
0.0024506268091499805,
-0.01009484101086855,
-0.016694119200110435,
0.006142117083072662,
-0.02945728227496147,
0.023498650640249252,
0.039608102291822433,
-0.039956413209438324,
-0.01318611390888691,
-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": "election", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self,
election,
selected_positions=[],
selected_proposals=[],
questions_adapter_class=Adapter,
commitments_adapter_class=CommitmentsAdapter):
self.set_questions_adapter(questions_adapter_class(election, selected_positio... | |
18,594 | [
0.0463465191423893,
0.005889780819416046,
0.02613154798746109,
0.022272910922765732,
0.000556688813958317,
-0.010718436911702156,
-0.01039152406156063,
0.02261590212583542,
-0.013548104092478752,
0.04797572270035744,
-0.03078334964811802,
-0.04210202023386955,
0.017117343842983246,
-0.0021... | 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 get_questions_result(self):
candidates_vector = matrix(self.questions_adapter.candidates).transpose().tolist()
_result = self._get_questions_vector_result().tolist()
concatenated = []
for index in range(len(_result)):
concatenated.append({'candidate': candidates_vector[in... | |
18,595 | [
0.06948347389698029,
-0.0003433958627283573,
-0.06309083104133606,
-0.0040450203232467175,
0.001338329864665866,
0.04155220463871956,
0.00994411762803793,
-0.0008943960419856012,
0.011197577230632305,
0.03426124528050423,
-0.006470988038927317,
0.04470674693584442,
0.007233509793877602,
0.... | 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}}, {"_type": "arg", "_fields": {"arg": "thread", "annotation":... | class StartedSignalWrapper: # Wrapper for the QThread.started signal
def __init__(self, thread, original_started):
self.thread = thread
self.original_started = original_started
def connect(self, func, *args, **kwargs):
return self.original_started.connect(FuncWrapp... | |
18,596 | [
0.05220140516757965,
0.007773854304105043,
0.01414432656019926,
0.021150188520550728,
-0.012564140371978283,
0.005696406587958336,
-0.008591573685407639,
0.028332853689789772,
-0.018708081915974617,
0.03401268646121025,
-0.03297396004199982,
-0.046366870403289795,
0.015868166461586952,
-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 get_result(self):
candidates_vector = matrix(self.questions_adapter.candidates).transpose().tolist()
_result = self._get_result().tolist()
concatenated = []
for index in range(len(_result)):
concatenated.append({'candidate': candidates_vector[index][0],
... | |
18,597 | [
0.033872976899147034,
0.011669112369418144,
-0.08893382549285889,
0.010623527690768242,
0.005987448152154684,
0.004569497890770435,
0.0013994550099596381,
-0.002094866940751672,
-0.015111648477613926,
0.013888511806726456,
-0.023851152509450912,
0.051884640008211136,
0.001538784010335803,
... | 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class ThreadWrapper(QtCore.QThread): # Wrapper for QThread
def __init__(self, *args, **kwargs):
_original_thread_init(self, *args, **kwargs)
# In PyQt5 the program hangs when we try to call original run method of QThread class.
# So we need to distinguish instances of QThr... | |
18,598 | [
0.006623390596359968,
0.0005155374528840184,
-0.04727491736412048,
-0.0016078907065093517,
-0.005872064735740423,
-0.002316588070243597,
-0.025896763429045677,
-0.017211223021149635,
0.00037399775465019047,
-0.022848831489682198,
-0.015676600858569145,
0.03429456427693367,
0.0256409943103790... | 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class RunnableWrapper(QtCore.QRunnable): # Wrapper for QRunnable
def __init__(self, *args, **kwargs):
_original_runnable_init(self, *args, **kwargs)
self._original_run = self.run
self.run = self._new_run
def _new_run(self):
set_trace_in_qt()
... | |
18,599 | [
0.04632587730884552,
0.024090299382805824,
-0.021814050152897835,
0.01223483681678772,
0.015859974548220634,
-0.007640186697244644,
0.03920206055045128,
0.00042350345756858587,
-0.023436931893229485,
0.020749693736433983,
-0.004966121166944504,
0.04775907099246979,
-0.00036784863914363086,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
_original_thread_init(self, *args, **kwargs)
# In PyQt5 the program hangs when we try to call original run method of QThread class.
# So we need to distinguish instances of QThread class and instances of QThread inheritors.
if self.__... | |
18,600 | [
-0.019967930391430855,
0.02458830177783966,
0.013142663985490799,
-0.05911102145910263,
0.0007660618866793811,
0.010522802360355854,
0.03299911320209503,
-0.044097911566495895,
0.004793789703398943,
-0.008732873015105724,
0.01626420207321644,
-0.03676477447152138,
-0.01511220633983612,
-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 TestVariableManager(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_basic_manager(self):
fake_loader = DictDataLoader({})
v = VariableManager()
vars = v.get_vars(loader=fake_loader, use_cache=False)
if 'omit' in vars:
... |