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 |
|---|---|---|---|---|---|
20,901 | [
0.04637114331126213,
0.04044468700885773,
-0.0100715858861804,
-0.03114783763885498,
-0.038725558668375015,
0.043611496686935425,
-0.007560758385807276,
-0.00468800961971283,
0.03114783763885498,
-0.00753248343244195,
0.011377895250916481,
-0.03492539003491402,
0.004323260858654976,
0.0251... | 9 | {"_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": "result", "annotation": null, "type_comment": null}}], "kwarg": ... | def rollback_config(module, result):
rollback = module.params['rollback']
kwargs = dict(comment=module.param['comment'],
commit=not module.check_mode)
diff = module.connection.rollback_config(rollback, **kwargs)
if diff:
result['changed'] = True
result['diff'] = dict... | |
20,902 | [
0.045221514999866486,
0.038428984582424164,
-0.009176896885037422,
-0.05475897341966629,
-0.0626680850982666,
-0.0054782237857580185,
-0.005646873731166124,
0.007880034856498241,
0.025634830817580223,
0.017551252618432045,
-0.004949010908603668,
-0.030147677287459373,
0.0054200682789087296,
... | 12 | {"_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": "result", "annotation": null, "type_comment": null}}], "kwarg": ... | def run(module, result):
if module.params['rollback']:
return rollback_config(module, result)
elif module.params['zeroize']:
return zeroize_config(module, result)
elif not any((module.params['src'], module.params['lines'])):
return confirm_config(module, result)
else:
ret... | |
20,903 | [
0.026294467970728874,
0.012056414969265461,
0.008026127703487873,
0.023435374721884727,
0.017590884119272232,
-0.002544764894992113,
-0.03228822723031044,
0.008938970975577831,
0.021081503480672836,
-0.006010984070599079,
-0.01584557443857193,
-0.04905238747596741,
-0.019462499767541885,
-... | 15 | {"_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": "status", "annotation":... | class BotoServerError(StandardError):
def __init__(self, status, reason, body=None, *args):
super(BotoServerError, self).__init__(status, reason, body, *args)
self.status = status
self.reason = reason
self.body = body or ''
self.request_id = None
self.error_code = Non... | |
20,904 | [
0.0647788718342781,
-0.03205254673957825,
-0.04071539640426636,
-0.011502339504659176,
0.01304240245372057,
-0.04579278826713562,
-0.029044611379504204,
-0.011400070041418076,
0.04215920343995094,
-0.03354448080062866,
0.02507413923740387,
-0.015785638242959976,
0.013511640019714832,
-0.01... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def endElement(self, name, value, connection):
if name in ('RequestId', 'RequestID'):
self.request_id = value
elif name == 'Code':
self.error_code = value
elif name == 'Message':
self.message = value
elif name == 'BoxUsage':
self.box_usage ... | |
20,905 | [
0.02983105555176735,
-0.009664545767009258,
0.0022647164296358824,
0.028988368809223175,
0.031242553144693375,
-0.026986991986632347,
-0.007836972363293171,
0.01837053708732128,
0.023700520396232605,
0.03311752527952194,
-0.017032774165272713,
-0.03634079918265343,
-0.03221163898706436,
-0... | 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": "status", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, status, reason, body=None, *args):
super(BotoServerError, self).__init__(status, reason, body, *args)
self.status = status
self.reason = reason
self.body = body or ''
self.request_id = None
self.error_code = None
self._error_message = None
... | |
20,906 | [
0.06484398245811462,
0.008157052099704742,
-0.01914386823773384,
-0.018651235848665237,
0.011198761872947216,
0.019854173064231873,
0.007841996848583221,
-0.04852987453341484,
0.008684052154421806,
-0.02513563446700573,
0.019533390179276466,
0.022878697142004967,
0.021263325586915016,
-0.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}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":... | class ConsoleOutput(object):
def __init__(self, parent=None):
self.parent = parent
self.instance_id = None
self.timestamp = None
self.comment = None
self.output = None
def startElement(self, name, attrs, connection):
return None
def endElement(self, name, va... | |
20,907 | [
0.07116104662418365,
-0.00946652889251709,
0.045184407383203506,
0.03637168928980827,
0.0025410735979676247,
0.023800930008292198,
0.005642556585371494,
0.04681069403886795,
0.006906225811690092,
0.04164613410830498,
0.010213742032647133,
-0.022877903655171394,
0.01269163191318512,
0.00238... | 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": "status", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, status, reason, body=None):
self.errors = None
self._errorResultSet = []
super(EC2ResponseError, self).__init__(status, reason, body)
self.errors = [
(e.error_code, e.error_message) for e in self._errorResultSet]
if len(self.errors):
sel... | |
20,908 | [
0.014663474634289742,
0.01695498637855053,
-0.007089365739375353,
0.0036300637293606997,
0.050765808671712875,
-0.041357386857271194,
-0.03922010958194733,
-0.012592299841344357,
0.016018550843000412,
0.01568804495036602,
0.004304847680032253,
-0.010890191420912743,
0.023862572386860847,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}... | def make_fake_mail_handler(**kwargs):
class FakeMailHandler(logbook.MailHandler):
mails = []
def get_connection(self):
return self
def close_connection(self, con):
pass
def sendmail(self, fromaddr, recipients, mail):
self.mails.append((fromaddr,... | |
20,909 | [
0.056621164083480835,
-0.007524545304477215,
-0.004541749134659767,
0.03672892600297928,
0.011972757056355476,
-0.004596312530338764,
0.023820798844099045,
-0.012409264221787453,
0.04223722591996193,
0.037456437945365906,
0.008569044061005116,
0.014976339414715767,
0.014435902237892151,
-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": "status", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, status, reason, body=None, *args):
self.status = status
self.reason = reason
self.body = body
if self.body:
self.error_message = self.body.get('message', None)
self.error_code = self.body.get('__type', None)
if self.error_code:
... | |
20,910 | [
0.02793249674141407,
0.02662881836295128,
-0.018698114901781082,
-0.01863775961101055,
0.01156410202383995,
0.020750198513269424,
-0.016851238906383514,
-0.009783616289496422,
0.016766740009188652,
0.027328941971063614,
0.016380464658141136,
-0.02032771147787571,
0.00332860229536891,
-0.03... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def missing(name):
def decorate(f):
def wrapper(*args, **kwargs):
old = sys.modules.get(name, _missing)
sys.modules[name] = None
try:
f(*args, **kwargs)
finally:
if old is _missing:
del sys.modules[name]
... | |
20,911 | [
0.033160626888275146,
0.012077387422323227,
-0.015327843837440014,
-0.04561375454068184,
0.0031490668188780546,
0.0038468714337795973,
-0.010568459518253803,
-0.00914302933961153,
0.008421367965638638,
0.04838111624121666,
0.015459055081009865,
-0.029200438410043716,
-0.014636003412306309,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def decorate(f):
def wrapper(*args, **kwargs):
old = sys.modules.get(name, _missing)
sys.modules[name] = None
try:
f(*args, **kwargs)
finally:
if old is _missing:
del sys.modules[name]
else:
... | |
20,912 | [
0.012800944969058037,
0.016103286296129227,
-0.005560301244258881,
-0.0368741899728775,
0.004839737433940172,
0.031109681352972984,
-0.021097637712955475,
0.016406681388616562,
-0.01166321337223053,
-0.003439451800659299,
0.02200782299041748,
-0.029802747070789337,
-0.0033052577637135983,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"... | def wrapper(*args, **kwargs):
old = sys.modules.get(name, _missing)
sys.modules[name] = None
try:
f(*args, **kwargs)
finally:
if old is _missing:
del sys.modules[name]
else:
sys.module... | |
20,913 | [
0.017613766714930534,
0.01051966194063425,
0.04767332971096039,
0.021098589524626732,
-0.017554501071572304,
0.0076926881447434425,
0.04504193365573883,
0.004945722874253988,
-0.017483381554484367,
0.03930501267313957,
0.03077075257897377,
-0.024559706449508667,
-0.03961319476366043,
-0.01... | 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 setUp(self):
Surface = pygame.Surface
size = self.default_size
palette = self.default_palette
if not self.is_started:
# Necessary for Surface.set_palette.
pygame.init()
pygame.display.set_mode((1, 1))
# Create test surfaces
... | |
20,914 | [
0.0021681177895516157,
-0.00415103929117322,
0.023620445281267166,
-0.0012474283576011658,
0.01497443113476038,
0.023451123386621475,
0.04973839223384857,
0.005815159063786268,
-0.030647316947579384,
0.018382040783762932,
0.015535310842096806,
-0.004807163029909134,
0.02117585577070713,
-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": "server", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, server, username=None, password=None, compression=None, socket_timeout=None, pickle_protocol=0,
pickler=None, unpickler=None):
super(Protocol, self).__init__()
self.server = server
self._username = username
self._password = password
self.compr... | |
20,915 | [
0.036770567297935486,
0.012235276401042938,
0.03601530194282532,
-0.004469544161111116,
0.02893739938735962,
0.04123741388320923,
-0.010357906110584736,
0.008631587959825993,
-0.005998953711241484,
0.016507912427186966,
-0.005632111337035894,
-0.008976851589977741,
0.022442128509283066,
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 _open_connection(self):
if self.connection:
return
self.authenticated = False
# If we're deferring a reconnection attempt, wait.
if self.reconnects_deferred_until and self.reconnects_deferred_until > datetime.now():
return
try:
if self.h... | |
20,916 | [
0.05728597193956375,
-0.0005511689814738929,
0.028419211506843567,
0.010700433515012264,
0.058384496718645096,
-0.01267370767891407,
-0.006016450934112072,
-0.003201484214514494,
-0.03531549870967865,
-0.022112872451543808,
0.010802148841321468,
-0.0016630426980555058,
0.0231503676623106,
... | 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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def _send(self, data):
try:
self._open_connection()
if self.connection is None:
return
self.connection.sendall(data)
except socket.error as e:
self._connection_error(e) | |
20,917 | [
0.029154319316148758,
0.024734070524573326,
0.054057471454143524,
-0.0035718269646167755,
-0.04260830208659172,
0.00045440401299856603,
0.028284762054681778,
0.03463736176490784,
-0.008858613669872284,
0.005866491701453924,
0.065120168030262,
-0.03794650733470917,
0.00035778654273599386,
-... | 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 __del__(self):
# Cleaning any GeoIP file handles lying around.
if GeoIP_delete is None:
return
if self._country:
GeoIP_delete(self._country)
if self._city:
GeoIP_delete(self._city) | |
20,918 | [
0.0826433077454567,
0.047852933406829834,
0.04673205316066742,
-0.0264484453946352,
-0.008552094921469688,
-0.004184437450021505,
0.03032841347157955,
0.002418243559077382,
0.008207209408283234,
0.013041001744568348,
0.031341515481472015,
-0.0526813380420208,
0.03013441525399685,
0.0227193... | 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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,... | def forwards(self, orm):
# Deleting field 'FileBlob.storage_options'
db.delete_column(u'sentry_fileblob', 'storage_options')
# Deleting field 'FileBlob.storage'
db.delete_column(u'sentry_fileblob', 'storage')
# Deleting field 'File.storage_options'
db.delete_column(u'se... | |
20,919 | [
0.007245531305670738,
0.039081595838069916,
0.02015107311308384,
-0.019875850528478622,
-0.04535188153386116,
0.0398234985768795,
0.02608630619943142,
0.017733901739120483,
-0.01799715869128704,
-0.020916908979415894,
0.016609080135822296,
-0.0492049977183342,
-0.015280831605196,
-0.005914... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Return", "_fields": {"val... | def tearDownModule():
if utils.options.skip_teardown:
return
utils.wait_procs([t.teardown_mysql() for t in tablets], raise_on_error=False)
utils.kill_sub_processes()
for t in tablets:
t.remove_tree() | |
20,920 | [
0.027749881148338318,
0.028487196192145348,
0.00010272496729157865,
0.009344917722046375,
-0.03358137607574463,
0.001559813623316586,
0.02122575417160988,
-0.05500821769237518,
-0.008160743862390518,
0.045490141957998276,
0.021527383476495743,
-0.057108450680971146,
0.030743829905986786,
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class MockChecker(checker.Checker):
def __init__(self, *args, **kwargs):
super(MockChecker, self).__init__(*args, **kwargs)
self.mismatches = []
def handle_mismatch(self, mismatch):
self.mismatches.append(mismatch) | |
20,921 | [
-0.016292225569486618,
-0.012050529941916466,
0.05272964388132095,
-0.0212999414652586,
0.008180412463843822,
0.0169439148157835,
0.020465321838855743,
0.01604069583117962,
-0.05643398314714432,
0.008186128921806812,
0.010552789084613323,
0.0060938638634979725,
0.04536670073866844,
-0.0102... | 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": "destination_table_name", "annotation": null, "type_comment": null... | def make_checker(self, destination_table_name='test', **kwargs):
default = {'keyrange': TestCheckersBase.keyrange,
'batch_count': 20,
'logging_level': logging.WARNING,
'directory': tempfile.mkdtemp()}
default.update(kwargs)
source_addresses = [
'vt_dba@lo... | |
20,922 | [
-0.0012830110499635339,
-0.009279384277760983,
0.08290046453475952,
-0.02253233827650547,
-0.0005774273304268718,
0.019624564796686172,
0.015303454361855984,
0.006742324214428663,
-0.04879496246576309,
0.006273141596466303,
-0.003822967177256942,
0.0038722024764865637,
0.052363067865371704,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "end"}}], "values": [{"_type": "Constant", "_fields": {"kind": null, "value": 900}}]}}, "targets": ... | class TestCheckersBase(unittest.TestCase):
keyrange = {'end': 900}
def make_checker(self, destination_table_name='test', **kwargs):
default = {'keyrange': TestCheckersBase.keyrange,
'batch_count': 20,
'logging_level': logging.WARNING,
'directory': tempfile.mkdtemp()... | |
20,923 | [
-0.02383142150938511,
-0.014910693280398846,
0.020480310544371605,
-0.024426914751529694,
0.04282883554697037,
0.002907410031184554,
-0.025337669998407364,
-0.043109066784381866,
-0.007507889997214079,
0.01860041916370392,
-0.024053271859884262,
-0.010514548979699612,
0.010053333826363087,
... | 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 TestSortedRowListDifference(unittest.TestCase):
def test_sorted_row_list_difference(self):
expected = [(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0)]
actual = [(1, 0), (3, 0), (4, 0), (5, 0), (6, 1), (10, 0)]
missing, unexpected, different = checker.sorted_row_list_difference(
expected, a... | |
20,924 | [
-0.012503436766564846,
-0.0073617794550955296,
-0.0018770403694361448,
-0.027226995676755905,
0.03718095272779465,
0.0202372707426548,
-0.009008573368191719,
-0.043719332665205,
0.011009123176336288,
0.03527798876166344,
-0.003842519596219063,
-0.017773177474737167,
0.005916260182857513,
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_sorted_row_list_difference(self):
expected = [(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0)]
actual = [(1, 0), (3, 0), (4, 0), (5, 0), (6, 1), (10, 0)]
missing, unexpected, different = checker.sorted_row_list_difference(
expected, actual, 1)
self.assertEqual(missing, [(2, 0)])
sel... | |
20,925 | [
0.00890053529292345,
-0.010859185829758644,
0.05137794092297554,
-0.031578246504068375,
-0.0020202749874442816,
0.003171148942783475,
0.003121183253824711,
0.01290444377809763,
-0.042370811104774475,
-0.014536652714014053,
0.05841309577226639,
-0.00459017138928175,
0.01521618478000164,
-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 setUp(self):
create_table = (
'create table test (pk1 bigint, pk2 bigint, pk3 bigint, '
'keyspace_id bigint, msg varchar(64), primary key (pk1, pk2, pk3)) '
'Engine=InnoDB')
destination_tablet.create_db('test_checkers')
destination_tablet.mquery('test_checkers', create_table, Tru... | |
20,926 | [
0.000688189931679517,
0.0016986862756311893,
0.04846435785293579,
-0.025231987237930298,
0.0006076133577153087,
0.035387925803661346,
0.00009239587234333158,
-0.021943146362900734,
-0.017404545098543167,
0.0077485088258981705,
0.034809090197086334,
-0.03767696022987366,
0.021495863795280457,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"... | class TestCheckers(TestCheckersBase):
@classmethod
def setUpClass(cls):
config = dict(db_configuration)
cls.configuration = config
def setUp(self):
create_table = (
'create table test (pk1 bigint, pk2 bigint, pk3 bigint, '
'keyspace_id bigint, msg varchar(64), primary key (pk1, pk2, ... | |
20,927 | [
0.009805350564420223,
0.007900618016719818,
0.057195644825696945,
-0.04230653494596481,
0.002385946223512292,
0.04549897462129593,
0.00967121496796608,
-0.006307751405984163,
-0.00959743931889534,
0.0007465513772331178,
0.029509946703910828,
-0.03270238637924194,
0.022548282518982887,
0.05... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"... | class TestDifferentEncoding(TestCheckersBase):
@classmethod
def setUpClass(cls):
config = dict(db_configuration)
cls.configuration = config
def setUp(self):
create_table = (
'create table test (pk1 bigint, pk2 bigint, pk3 bigint, '
'keyspace_id bigint, msg varchar(64), primary key (p... | |
20,928 | [
0.0062258485704660416,
0.014811979606747627,
0.05308228358626366,
-0.03933002054691315,
0.0015180774498730898,
0.0308041013777256,
0.021567687392234802,
0.0077491942793130875,
-0.001560978009365499,
-0.014330289326608181,
-0.0029669117648154497,
-0.03937818855047226,
0.024542126804590225,
... | 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_more_mismatches(self):
destination_tablet.mquery(
'test_checkers',
'insert into test (pk1, pk2, pk3) values (1, 1, 900)', write=True)
destination_tablet.mquery(
'test_checkers', 'insert into test (pk1, pk2, pk3) '
'values (1000, 1000, 1000)', write=True)
self.c._run(... | |
20,929 | [
-0.008509626612067223,
0.004813092760741711,
0.055867552757263184,
-0.022793643176555634,
0.0042283860966563225,
0.022489728406071663,
-0.0010744394967332482,
-0.001545177772641182,
-0.030021540820598602,
0.01721745915710926,
0.026784183457493782,
-0.016768192872405052,
0.03525416925549507,
... | 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 TestRlookup(TestCheckersBase):
def setUp(self):
source_create_table = (
'create table test (pk1 bigint, k2 bigint, k3 bigint, '
'keyspace_id bigint, msg varchar(64), primary key (pk1)) Engine=InnoDB')
destination_create_table = (
'create table test_lookup (pk1_lookup bigint, msg... | |
20,930 | [
0.002100842772051692,
-0.007592927198857069,
0.07052188366651535,
-0.02877739444375038,
-0.00030889862682670355,
0.006586515810340643,
0.012203156016767025,
0.024220308288931847,
-0.037227265536785126,
-0.014229265041649342,
0.04958321154117584,
0.004324580542743206,
0.010316549800336361,
... | 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 setUp(self):
create_table = (
'create table test (pk1 bigint, pk2 bigint, pk3 bigint, '
'keyspace_id bigint, msg varchar(64), primary key (pk1, pk2, pk3)) '
'Engine=InnoDB')
destination_tablet.create_db('test_checkers')
destination_tablet.mquery(
'test_checkers', create_t... | |
20,931 | [
0.02102641947567463,
-0.022464944049715996,
0.03879218548536301,
-0.016171403229236603,
-0.03251063451170921,
0.005238623358309269,
0.026732563972473145,
-0.0001580877578817308,
-0.024335024878382683,
0.004600278567522764,
0.010609111748635769,
-0.03325387090444565,
-0.022692710161209106,
... | 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 BuildDumbTestCase(support.TempdirManager,
support.LoggingSilencer,
support.EnvironGuard,
unittest.TestCase):
def setUp(self):
super(BuildDumbTestCase, self).setUp()
self.old_location = os.getcwd()
self.old_sys_arg... | |
20,932 | [
0.012126239947974682,
-0.010644495487213135,
0.059219107031822205,
-0.04115955904126167,
-0.010169577784836292,
0.0048536621034145355,
0.00990995578467846,
0.0056325276382267475,
-0.04592140391469002,
-0.020149188116192818,
0.051595091819763184,
0.003827839158475399,
0.03305429220199585,
-... | 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 setUp(self):
source_create_table = (
'create table test (pk1 bigint, k2 bigint, k3 bigint, '
'keyspace_id bigint, msg varchar(64), primary key (pk1)) Engine=InnoDB')
destination_create_table = (
'create table test_lookup (pk1_lookup bigint, msg_lookup varchar(64), '
'primary ... | |
20,933 | [
0.030619481578469276,
-0.0157635398209095,
0.0026436769403517246,
-0.04471113160252571,
-0.0008553511579521,
-0.02069561742246151,
0.006436778698116541,
0.02126883529126644,
-0.00551425339654088,
0.017614560201764107,
0.03245856240391731,
-0.017638444900512695,
-0.002348110545426607,
-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 test_simple_built(self):
# let's create a simple package
tmp_dir = self.mkdtemp()
pkg_dir = os.path.join(tmp_dir, 'foo')
os.mkdir(pkg_dir)
self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
self.write_file((pkg_dir, 'foo.py'), '#')
self.write_file((pkg_dir, 'MA... | |
20,934 | [
0.025590090081095695,
-0.005349405575543642,
0.052692215889692307,
-0.007674735970795155,
-0.03855695575475693,
-0.029003627598285675,
0.013619792647659779,
0.015544204041361809,
0.01232539676129818,
0.04769790917634964,
0.02868289314210415,
0.02058432810008526,
-0.0594276562333107,
-0.003... | 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_finalize_options(self):
pkg_dir, dist = self.create_dist()
os.chdir(pkg_dir)
cmd = bdist_dumb(dist)
self.assertEqual(cmd.bdist_dir, None)
cmd.finalize_options()
# bdist_dir is initialized to bdist_base/dumb if not set
base = cmd.get_finalized_command('bd... | |
20,935 | [
0.01972421631217003,
0.003632474225014448,
-0.023060886189341545,
-0.029178114607930183,
0.052724119275808334,
0.033343035727739334,
-0.003795166499912739,
0.05830889940261841,
0.03142622485756874,
0.012163463979959488,
0.04510420560836792,
-0.0481332391500473,
-0.016943657770752907,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_active_filter_returns_only_active_products(self):
ret1 = len(Product.objects.active())
# Set self.product to be active
self.product.active = True
self.product.save()
ret2 = len(Product.objects.active())
self.assertNotEqual(ret1, ret2)
self.assertEqual(ret... | |
20,936 | [
-0.007488894741982222,
-0.03571373224258423,
-0.003884555073454976,
0.0017362367361783981,
-0.02988964505493641,
-0.008944915607571602,
0.027252323925495148,
0.039625756442546844,
0.052131056785583496,
0.004384547472000122,
0.02214251272380352,
-0.06105399504303932,
-0.04217517003417015,
-... | 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 ProductTestCase(TestCase):
def setUp(self):
self.product = Product()
self.product.name = 'test'
self.product.unit_price = Decimal('1.0')
self.product.save()
def test_unicode_returns_proper_stuff(self):
ret = self.product.__unicode__()
self.assertEqual(ret,... | |
20,937 | [
0.029038503766059875,
-0.03747247904539108,
0.019470209255814552,
-0.031040238216519356,
-0.008300527930259705,
-0.011156336404383183,
0.030853409320116043,
0.043611135333776474,
0.01366517785936594,
-0.02938546985387802,
0.04985654726624489,
-0.051511313766241074,
-0.04305064678192139,
-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 setUp(self):
self.product = Product()
self.product.name = 'test'
self.product.slug = 'test'
self.product.unit_price = Decimal('1.0')
self.product.save()
self.product2 = Product()
self.product2.name = 'test2'
self.product2.slug = 'test2'
self.p... | |
20,938 | [
0.02366848848760128,
-0.045162834227085114,
0.026904992759227753,
-0.033798009157180786,
-0.02415025793015957,
0.007584786973893642,
-0.0030095174442976713,
0.013415437191724777,
0.03871453180909157,
-0.011618065647780895,
0.02001197822391987,
-0.05771355703473091,
-0.042618103325366974,
-... | 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 ProductStatisticsTestCase(TestCase):
def setUp(self):
self.product = Product()
self.product.name = 'test'
self.product.slug = 'test'
self.product.unit_price = Decimal('1.0')
self.product.save()
self.product2 = Product()
self.product2.name = 'test2'
... | |
20,939 | [
-0.038574665784835815,
-0.00004248056575306691,
-0.029078999534249306,
-0.039569225162267685,
0.00470935320481658,
-0.05943671613931656,
0.01992669142782688,
-0.032678354531526566,
0.013817260973155499,
0.006648150738328695,
0.02910267934203148,
-0.013402861542999744,
-0.018707172945141792,
... | 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": "host", "annotation": null, "type_comment": null}}, {"_type": "arg... | def get_media_url(self, host, media_id):
web_url = self.get_url(host, media_id)
# get landing page
html = self.net.http_GET(web_url, headers = {'Referer':web_url}).content
# read POST variables into data
data = {}
r = re.findall(r'type="hidden" name="(.+... | |
20,940 | [
-0.03108062408864498,
0.015057254582643509,
0.010067624039947987,
-0.013843719847500324,
-0.0008630233933217824,
-0.01959328167140484,
-0.0022606500424444675,
-0.007746592164039612,
0.033154238015413284,
0.004774610511958599,
0.004724537488073111,
-0.03522785007953644,
-0.0014101448468863964... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Name", "_fields": {"id": "UrlResolver", "ctx": {"_type": "Load", "_fields": {}}}}, {"_type": "Name", "_f... | class VivosxResolver(Plugin, UrlResolver, PluginSettings):
implements = [UrlResolver, PluginSettings]
name = "vivosx"
domains = [ "vivo.sx" ]
pattern = '(?://|\.)(vivo\.sx)/([0-9a-zA-Z]+)'
def __init__(self):
p = self.get_setting('priority') or 100
self.priority = int(p)
sel... | |
20,941 | [
0.03184790164232254,
-0.00847235880792141,
0.0021786976139992476,
0.024855654686689377,
-0.025685027241706848,
-0.029398063197731972,
0.03450189530849457,
-0.017199909314513206,
0.02097674272954464,
0.027917953208088875,
0.041800372302532196,
0.0063638389110565186,
0.028326259925961494,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "child", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def testfunc(child):
child.expect_exact("Hello blob!")
child.expect_exact("Hello blob_subdir!")
child.expect_exact("0x00")
child.expect_exact("0x01")
child.expect_exact("0x02")
child.expect_exact("0x03")
child.expect_exact("0xFF") | |
20,942 | [
-0.004611296579241753,
-0.03278348222374916,
-0.04560557007789612,
-0.021035868674516678,
0.006446860730648041,
-0.04326559975743294,
-0.020009147003293037,
0.04305070638656616,
0.01728713884949684,
0.020534446462988853,
0.017024489119648933,
-0.06146007403731346,
0.0024996509309858084,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"... | def fake_auth_request_v2(*args, **kwargs):
s_url = 'http://127.0.0.1:8080/v1.0/AUTH_fakeuser'
resp = {'access': {'token': {'id': '12' * 10},
'serviceCatalog':
[
{'type': 'object-store',
'endpoints': [{'region': ... | |
20,943 | [
0.03876252472400665,
0.044112104922533035,
0.005201588850468397,
-0.002447322942316532,
-0.021606599912047386,
-0.006971993017941713,
0.06862369924783707,
-0.015347153879702091,
-0.009602933190762997,
-0.003579175565391779,
0.07068460434675217,
0.05985390022397041,
0.009701593779027462,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "marker", "annotation": null, "type_comment": null}}, {"_type": "a... | def create_commit(data, marker='Default', blob=None):
if not blob:
blob = Blob.from_string('The blob content %s' % marker)
tree = Tree()
tree.add("thefile_%s" % marker, 0o100644, blob.id)
cmt = Commit()
if data:
assert isinstance(data[-1], Commit)
cmt.parents = [data[-1].id]
... | |
20,944 | [
0.03837490826845169,
-0.01109167467802763,
-0.04043315723538399,
-0.012555318884551525,
0.018089720979332924,
-0.023921426385641098,
-0.004779711365699768,
-0.008107214234769344,
0.0003239240904804319,
-0.022537825629115105,
0.03556196764111519,
-0.03880942985415459,
0.02419586107134819,
-... | 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": "root", "annotation": n... | class FakeSwiftConnector(object):
def __init__(self, root, conf, store=None):
if store:
self.store = store
else:
self.store = {}
self.conf = conf
self.root = root
self.concurrency = 1
self.chunk_length = 12228
self.cache_length = 1
... | |
20,945 | [
0.04173668846487999,
0.03925643488764763,
-0.024161094799637794,
-0.041373204439878464,
0.030853504315018654,
-0.009167318232357502,
0.008194460533559322,
0.006708445958793163,
-0.020900417119264603,
-0.010728168301284313,
0.0339965857565403,
-0.00447140634059906,
0.03391106054186821,
-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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def get_object(self, name, range=None):
name = posixpath.join(self.root, name)
if not range:
try:
return BytesIO(self.store[name])
except KeyError:
return None
else:
l, r = range.split('-')
try:
if no... | |
20,946 | [
0.027027098461985588,
0.019867027178406715,
-0.011552905663847923,
-0.027622736990451813,
0.017050152644515038,
0.024992000311613083,
0.02176562510430813,
-0.03616022318601608,
0.014183642342686653,
-0.026505913585424423,
0.05206873267889023,
-0.01942029781639576,
0.00743927713483572,
-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 TestSwiftObjectStore(TestCase):
def setUp(self):
super(TestSwiftObjectStore, self).setUp()
self.conf = swift.load_conf(file=BytesIO(config_file %
def_config_file))
self.fsc = FakeSwiftConnector('fakerepo', conf=self.conf)
def _put... | |
20,947 | [
0.022284191101789474,
0.0037086803931742907,
-0.020280541852116585,
-0.05877375230193138,
0.023311704397201538,
-0.003682992421090603,
-0.00023058841179590672,
-0.016632869839668274,
0.013139324262738228,
-0.021487869322299957,
0.0469573512673378,
-0.035192325711250305,
0.011161361820995808,... | 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_load_packs(self):
store = {'fakerepo/objects/pack/pack-'+'1'*40+'.idx': '',
'fakerepo/objects/pack/pack-'+'1'*40+'.pack': '',
'fakerepo/objects/pack/pack-'+'1'*40+'.info': '',
'fakerepo/objects/pack/pack-'+'2'*40+'.idx': '',
'fakerepo/... | |
20,948 | [
0.019815631210803986,
0.024676311761140823,
0.029086928814649582,
-0.013669055886566639,
0.04220305010676384,
-0.00004470491694519296,
0.01391337625682354,
-0.008763369172811508,
0.013733350671827793,
-0.056630782783031464,
0.06398610025644302,
-0.03057856671512127,
-0.005699726287275553,
... | 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_find_missing_objects(self):
commit_amount = 3
sos = swift.SwiftObjectStore(self.fsc)
odata = self._put_pack(sos, commit_amount, 'Default')
head = odata[-1].id
i = sos.iter_shas(sos.find_missing_objects([],
[head, ],
... | |
20,949 | [
0.04182920977473259,
0.0190050657838583,
0.03421686217188835,
-0.020424317568540573,
0.049518972635269165,
0.007934905588626862,
0.01896636001765728,
-0.01445055939257145,
0.01567627675831318,
-0.0596601665019989,
0.04453868791460991,
-0.03968742862343788,
0.0021401667036116123,
-0.0180631... | 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_find_missing_objects_with_common(self):
commit_amount = 3
sos = swift.SwiftObjectStore(self.fsc)
odata = self._put_pack(sos, commit_amount, 'Default')
head = odata[-1].id
have = odata[7].id
i = sos.iter_shas(sos.find_missing_objects([have, ],
... | |
20,950 | [
0.021341782063245773,
0.013284687884151936,
-0.006635999772697687,
0.0018667714903131127,
0.012117360718548298,
0.006997617427259684,
0.009884214028716087,
-0.017801735550165176,
0.019755739718675613,
-0.05461059883236885,
0.059127647429704666,
-0.023130837827920914,
-0.011666925624012947,
... | 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_find_missing_objects_with_tag(self):
commit_amount = 3
sos = swift.SwiftObjectStore(self.fsc)
odata = self._put_pack(sos, commit_amount, 'Default')
head = odata[-1].id
peeled_sha = dict([(sha.object[1], sha.id)
for sha in odata if isinstance(sh... | |
20,951 | [
0.03156151622533798,
0.030016547068953514,
-0.007516398560255766,
-0.006081784144043922,
-0.01055729016661644,
0.01564588025212288,
0.032885774970054626,
-0.01251915656030178,
-0.005882532335817814,
-0.005738457664847374,
0.05022376403212547,
0.012347493320703506,
0.0011127458419650793,
-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 test_add_thin_pack_ext_ref(self):
sos = swift.SwiftObjectStore(self.fsc)
odata = self._put_pack(sos, 1, 'Default1')
ref_blob_content = odata[0].as_raw_string()
ref_blob_id = odata[0].id
new_blob = Blob.from_string(ref_blob_content.replace('blob',
... | |
20,952 | [
0.030016044154763222,
0.012247052974998951,
0.01797163113951683,
-0.02292364463210106,
0.02682446502149105,
0.007073401007801294,
0.02488671988248825,
-0.025899920612573624,
0.009657060727477074,
-0.04853226989507675,
0.05633390694856644,
-0.0580056868493557,
0.005544102750718594,
-0.03072... | 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_find_missing_objects_multiple_packs(self):
sos = swift.SwiftObjectStore(self.fsc)
commit_amount_a = 3
odataa = self._put_pack(sos, commit_amount_a, 'Default1')
heada = odataa[-1].id
commit_amount_b = 2
odatab = self._put_pack(sos, commit_amount_b, 'Default2')
... | |
20,953 | [
0.011627435684204102,
0.009471477009356022,
-0.04678000509738922,
-0.04216097295284271,
0.010534101165831089,
-0.010362115688621998,
-0.01627718284726143,
-0.013832533732056618,
0.008715970441699028,
-0.054642193019390106,
0.034741032868623734,
0.01423792727291584,
0.02320573292672634,
-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 test_put_named_file(self):
store = {'fakerepo/objects/pack': ''}
with patch('dulwich.contrib.swift.SwiftConnector',
new_callable=create_swift_connector,
store=store):
repo = swift.SwiftRepo('fakerepo', conf=self.conf)
desc = 'Fake repo'
... | |
20,954 | [
0.005976418498903513,
0.006287081632763147,
-0.013583049178123474,
-0.041585784405469894,
0.02586192823946476,
0.025049898773431778,
-0.004952153190970421,
-0.02247847057878971,
0.020596036687493324,
-0.01503486093133688,
0.017827752977609634,
-0.0022423104383051395,
-0.016572795808315277,
... | 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 TestSwiftRepo(TestCase):
def setUp(self):
super(TestSwiftRepo, self).setUp()
self.conf = swift.load_conf(file=BytesIO(config_file %
def_config_file))
def test_init(self):
store = {'fakerepo/objects/pack': ''}
with patch('d... | |
20,955 | [
0.04660303518176079,
0.012964666821062565,
0.00975547544658184,
-0.035626672208309174,
0.017476137727499008,
0.023243378847837448,
-0.0034911578986793756,
-0.020452778786420822,
0.0012986467918381095,
-0.00392137560993433,
0.037556834518909454,
0.01119728572666645,
0.00452600559219718,
-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 TestPackInfoLoadDump(TestCase):
def setUp(self):
conf = swift.load_conf(file=BytesIO(config_file %
def_config_file))
sos = swift.SwiftObjectStore(
FakeSwiftConnector('fakerepo', conf=conf))
commit_amount = 10
self.commits... | |
20,956 | [
0.014810621738433838,
0.005609072279185057,
-0.005816073622554541,
-0.02215583436191082,
0.004233513958752155,
-0.005278537515550852,
-0.000720749085303396,
0.010750721208751202,
0.030502667650580406,
-0.01559856254607439,
0.028499428182840347,
-0.023397844284772873,
-0.018149355426430702,
... | 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_init_bare(self):
fsc = FakeSwiftConnector('fakeroot', conf=self.conf)
with patch('dulwich.contrib.swift.SwiftConnector',
new_callable=create_swift_connector,
store=fsc.store):
swift.SwiftRepo.init_bare(fsc, conf=self.conf)
self.assertIn(... | |
20,957 | [
0.034772902727127075,
-0.009026183746755123,
0.0006871038349345326,
-0.03290833905339241,
-0.0024608608800917864,
-0.024917351081967354,
0.013851044699549675,
-0.009952411986887455,
-0.02770208939909935,
-0.012640289030969143,
0.035354066640138626,
0.008408698253333569,
0.0020900669042021036... | 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 setUp(self):
super(TestSwiftInfoRefsContainer, self).setUp()
content = \
"22effb216e3a82f97da599b8885a6cadb488b4c5\trefs/heads/master\n" + \
"cca703b0e1399008b53a1a236d6b4584737649e4\trefs/heads/dev"
self.store = {'fakerepo/info/refs': content}
self.conf = swi... | |
20,958 | [
0.06667625159025192,
0.014158898964524269,
0.017989514395594597,
-0.027219600975513458,
-0.0008514295914210379,
0.009661519899964333,
0.0259514432400465,
-0.008935925550758839,
-0.015060989186167717,
-0.030148126184940338,
0.06134215369820595,
0.016224555671215057,
-0.0019512609578669071,
... | 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 setUp(self):
conf = swift.load_conf(file=BytesIO(config_file %
def_config_file))
sos = swift.SwiftObjectStore(
FakeSwiftConnector('fakerepo', conf=conf))
commit_amount = 10
self.commits = create_commits(length=commit_amount, ma... | |
20,959 | [
0.016184544190764427,
-0.0021969382651150227,
0.029353173449635506,
-0.023074351251125336,
0.022411368787288666,
0.037516944110393524,
-0.030289147049188614,
-0.00045701838098466396,
0.05662640556693077,
0.006418569479137659,
0.04482273757457733,
-0.005313600413501263,
0.0005638591246679425,... | 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestSwiftConnector(TestCase):
def setUp(self):
super(TestSwiftConnector, self).setUp()
self.conf = swift.load_conf(file=BytesIO(config_file %
def_config_file))
with patch('geventhttpclient.HTTPClient.request',
fake_a... | |
20,960 | [
-0.005415072198957205,
-0.03308522328734398,
0.02188333496451378,
-0.02822776697576046,
0.009752086363732815,
0.04639366269111633,
-0.00010765089245978743,
0.03196999058127403,
0.03794267773628235,
0.01619565114378929,
0.014237798750400543,
0.005514204036444426,
-0.011288628913462162,
0.04... | 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_init_connector(self):
self.assertEqual(self.conn.auth_ver, '1')
self.assertEqual(self.conn.auth_url,
'http://127.0.0.1:8080/auth/v1.0')
self.assertEqual(self.conn.user, 'test:tester')
self.assertEqual(self.conn.password, 'testing')
self.assertEqu... | |
20,961 | [
0.025686511769890785,
0.0021333801560103893,
0.03315180912613869,
0.009343897923827171,
0.019191212952136993,
0.043834056705236435,
-0.03794040158390999,
0.06060641631484032,
0.034256868064403534,
-0.010086744092404842,
0.04037153348326683,
-0.015397172421216965,
0.020161209627985954,
-0.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 test_del_root(self):
with patch('dulwich.contrib.swift.SwiftConnector.del_object',
lambda *args: None):
with patch('dulwich.contrib.swift.SwiftConnector.'
'get_container_objects',
lambda *args: ({'name': 'a'}, {'name': 'b'})):
... | |
20,962 | [
0.0126129649579525,
-0.01943941041827202,
-0.015907779335975647,
-0.04789837822318077,
0.027532299980521202,
0.007691334467381239,
0.03288637474179268,
-0.00041796534787863493,
-0.022301780059933662,
-0.022816596552729607,
-0.003657759865745902,
-0.03387482091784477,
-0.011356816627085209,
... | 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 SwiftObjectStoreTests(ObjectStoreTests, TestCase):
def setUp(self):
TestCase.setUp(self)
conf = swift.load_conf(file=BytesIO(config_file %
def_config_file))
fsc = FakeSwiftConnector('fakerepo', conf=conf)
self.store = swift.SwiftObjectStore(fsc) | |
20,963 | [
0.015375110320746899,
0.04247843846678734,
0.016247456893324852,
0.0003967965894844383,
-0.0005834575858898461,
0.044828929007053375,
-0.024001650512218475,
0.0068939621560275555,
0.018779685720801353,
-0.01635649986565113,
0.052195411175489426,
-0.01308520045131445,
0.028375498950481415,
... | 12 | {"_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": "state", "annotation": null, "type_comment": null}}], "kwarg": n... | def lock(module, state):
consul_api = get_consul_api(module)
session = module.params.get('session')
key = module.params.get('key')
value = module.params.get('value')
if not session:
module.fail(
msg='%s of lock for %s requested but no session supplied' %
(state, ke... | |
20,964 | [
-0.014381780289113522,
0.059946075081825256,
-0.017163576558232307,
-0.0073008425533771515,
-0.00861477479338646,
0.03555862233042717,
-0.018713906407356262,
0.033645451068878174,
0.03905510902404785,
0.026850387454032898,
0.06364047527313232,
-0.02278214693069458,
0.01860395446419716,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def execute(module):
state = module.params.get('state')
if state == 'acquire' or state == 'release':
lock(module, state)
elif state == 'present':
if module.params.get('value') is NOT_SET:
get_value(module)
else:
set_value(module)
elif state == 'absent':
... | |
20,965 | [
-0.008318406529724598,
0.009218641556799412,
0.049056969583034515,
-0.013409995473921299,
-0.028994586318731308,
0.08300869166851044,
-0.011182790622115135,
-0.009370628744363785,
0.01793455332517624,
0.034372612833976746,
0.02361655794084072,
-0.0675760880112648,
0.03037416748702526,
0.00... | 14 | {"_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(
cas=dict(type='str'),
flags=dict(type='str'),
key=dict(type='str', required=True),
host=dict(type='str', default='localhost'),
scheme=dict(type='str', default='http'),
validate_ce... | |
20,966 | [
0.052191898226737976,
-0.001964801922440529,
0.009064849466085434,
-0.008343718014657497,
-0.01843392662703991,
0.038242507725954056,
-0.0017788851400837302,
-0.00087042833911255,
0.05814123526215553,
-0.022512827068567276,
0.0473693311214447,
-0.013194454833865166,
0.007853574119508266,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def set_value(module):
consul_api = get_consul_api(module)
key = module.params.get('key')
value = module.params.get('value')
if value is NOT_SET:
raise AssertionError('Cannot set value of "%s" to `NOT_SET`', (key, ))
index, changed = _has_value_changed(consul_api, key, value)
if chan... | |
20,967 | [
0.025476204231381416,
0.015675976872444153,
0.04954924434423447,
-0.00599085446447134,
-0.034092508256435394,
-0.02701091393828392,
0.0026336738374084234,
-0.003727155504748225,
-0.0073392074555158615,
0.07761253416538239,
0.020236261188983917,
-0.010304488241672516,
0.031154634431004524,
... | 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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __call__(self, text, definitions=None):
if definitions is None:
definitions = []
m = grammar.parse(text)
for definition in m.definition:
definitions.append(self._definition(definition))
self.definitions = model.Definitions(definitions, model=m)
ret... | |
20,968 | [
0.01462507713586092,
0.009281299076974392,
0.03536048159003258,
-0.03825020045042038,
-0.015430228784680367,
0.01359933614730835,
0.016036849468946457,
-0.029558978974819183,
-0.0033915620297193527,
0.03897814825177193,
0.007748202886432409,
-0.0324045829474926,
0.021308936178684235,
-0.00... | 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": "text", "annotation": n... | class Compiler(object):
def __call__(self, text, definitions=None):
if definitions is None:
definitions = []
m = grammar.parse(text)
for definition in m.definition:
definitions.append(self._definition(definition))
self.definitions = model.Definitions(defini... | |
20,969 | [
0.04419497773051262,
-0.00875872652977705,
0.009508294984698296,
0.017092501744627953,
-0.01978386379778385,
0.020503919571638107,
0.01688002608716488,
-0.05462990328669548,
-0.007566501386463642,
0.056188058108091354,
-0.02570957876741886,
-0.05774621665477753,
0.05019151791930199,
0.0014... | 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": "array", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _array(self, array):
constraints = []
elements = array.element
# for some reason nodes come out in reverse order, hence:
elements.reverse()
for index, element in enumerate(elements):
value = element.value
token = element.token
if value:
... | |
20,970 | [
0.03622767701745033,
0.019470680505037308,
0.030438484624028206,
-0.010170659981667995,
0.013568418100476265,
-0.02055615372955799,
0.00313486997038126,
-0.021358951926231384,
0.00818062573671341,
0.06340973824262619,
0.009102147072553635,
0.017243197187781334,
-0.0006155256414785981,
-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}}, {"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def _definition(self, node):
kv = node.pair
val = node.value
if kv:
constraint = self._pair(*kv)
elif val:
constraint = self._value(*val)
else:
raise ValueError("{} is not a valid definition body".format(node))
name = node.descend('na... | |
20,971 | [
0.015283803455531597,
0.032772842794656754,
-0.050174545496702194,
-0.01586240530014038,
0.023253215476870537,
-0.020796889439225197,
-0.032860178500413895,
-0.008580763824284077,
0.046550098806619644,
0.027205171063542366,
0.022259768098592758,
-0.03513091430068016,
0.03641911968588829,
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": "val", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _value(self, val):
obj = val.object
array = val.array
primitive = val.primitive
# The following calls use argument unpacking, so that they throw if you somehow have too many elements here.
if obj:
return self._object(*obj)
if array:
return se... | |
20,972 | [
0.038934383541345596,
0.033310066908597946,
-0.004371297545731068,
-0.02706313133239746,
-0.0112486332654953,
0.016364477574825287,
-0.007222369313240051,
0.00966095644980669,
0.000287960865534842,
-0.02280857414007187,
-0.044703975319862366,
-0.07728765159845352,
0.055745068937540054,
-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": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _object(self, obj):
pairs = []
for pair in obj.pair:
pairs.append(self._pair(pair))
return model.Object(pairs, model=obj) | |
20,973 | [
0.033256080001592636,
0.009521386586129665,
-0.03873762488365173,
-0.010565733537077904,
0.022211475297808647,
-0.002444026293233037,
0.02484017238020897,
0.023372992873191833,
0.028936048969626427,
-0.022700535133481026,
-0.03912479802966118,
-0.06516724079847336,
0.05412263795733452,
-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": "pair", "annotation": null, "type_comment": null}}], "kwarg": null... | def _pair(self, pair):
token = pair.token
key = pair.pair_key
value = pair.pair_value
# using unpacking here, should only get one element, if you have more it will throw.
if token:
return model.ObjectElement(self._token(*token), model=pair)
elif key and value... | |
20,974 | [
0.04873386397957802,
-0.014851225540041924,
-0.033882640302181244,
-0.039491236209869385,
0.03980632498860359,
-0.04894392564892769,
0.0282320324331522,
0.06978185474872589,
0.016888804733753204,
0.027034690603613853,
-0.015407883562147617,
-0.016510697081685066,
-0.02074340172111988,
-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}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _pair_key(self, key):
token = key.one_token
string = key.string
if token:
return self._one_token(*token)
elif string:
return self._string(*string)
else:
raise ValueError('node "{}" must either be a string or a single token'.format(key)) | |
20,975 | [
0.04057798907160759,
-0.012775270268321037,
-0.04166524484753609,
-0.030870335176587105,
0.07032223790884018,
-0.03411269187927246,
0.02753090299665928,
0.03380204737186432,
0.0409274622797966,
0.015105106867849827,
0.01126087736338377,
0.004649965558201075,
0.0031137296464294195,
-0.03960... | 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": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def _pair_value(self, node):
value = node.value
token = node.one_token
if token:
return self._one_token(*token)
elif value:
return self._value(*value)
else:
raise ValueError('"{}" must be a JSON value or a single token'.format(value)) | |
20,976 | [
-0.028301740065217018,
0.04270286485552788,
-0.014025742188096046,
-0.024547891691327095,
0.04333988204598427,
-0.01570928655564785,
0.002784104086458683,
0.016619309782981873,
0.03624169901013374,
0.04704822972416878,
-0.009572313167154789,
-0.03328412026166916,
-0.009418746456503868,
-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": "n", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def _primitive(self, n):
if n.string:
return self._string(n)
elif n.number:
return model.Number(float(n.text), model=n)
elif n.boolean:
tf = {'true': True, 'false': False}[n.text]
return model.Boolean(tf, model=n)
elif n.null:
r... | |
20,977 | [
0.012999639846384525,
0.012678660452365875,
0.06075669452548027,
-0.03633937984704971,
-0.02251436747610569,
-0.027351975440979004,
-0.019682876765727997,
-0.06580064445734024,
0.02627440355718136,
0.02482999861240387,
0.023454375565052032,
-0.05351174250245094,
-0.025265613570809364,
0.01... | 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": "jsl", "annotation": nu... | class ApiSpecification(object):
def __init__(self, jsl, definitions=None):
_definitions = [] # defaults.definitions.copy()
if definitions:
_definitions.extend(definitions)
self.definitions = c(jsl, _definitions)
self._match = Matcher(self.definitions)
def validat... | |
20,978 | [
0.004213211126625538,
-0.011481152847409248,
0.07936201989650726,
-0.020120980218052864,
0.0024297607596963644,
-0.012743286788463593,
0.00361872767098248,
-0.03109605982899666,
-0.00036374005139805377,
0.07999613881111145,
0.03341301903128624,
-0.039193227887153625,
0.01708454079926014,
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": "jsl", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __init__(self, jsl, definitions=None):
_definitions = [] # defaults.definitions.copy()
if definitions:
_definitions.extend(definitions)
self.definitions = c(jsl, _definitions)
self._match = Matcher(self.definitions) | |
20,979 | [
-0.03237979859113693,
0.00889598298817873,
0.08159257471561432,
-0.03826908394694328,
-0.005212357733398676,
0.00285438634455204,
-0.002817719243466854,
-0.002551178215071559,
0.01870582066476345,
0.015772458165884018,
0.027032053098082542,
-0.03206389769911766,
0.003790805581957102,
-0.00... | 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_server_groups_list(self):
subs = self._get_create_subs()
uuid = self._post_server_group()
response = self._do_get('os-server-groups')
subs.update(self._get_regexes())
subs['id'] = uuid
self._verify_response('server-groups-list-resp',
... | |
20,980 | [
-0.016366122290492058,
-0.019920801743865013,
0.06621503829956055,
-0.025289306417107582,
-0.0026555857621133327,
-0.015167329460382462,
-0.030918417498469353,
0.013687081634998322,
0.018628191202878952,
-0.033211760222911835,
0.010450341738760471,
-0.05032842978835106,
-0.014437629841268063... | 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_server_groups_get(self):
# Get api sample of server groups get request.
subs = {'name': 'test'}
uuid = self._post_server_group()
subs['id'] = uuid
response = self._do_get('os-server-groups/%s' % uuid)
self._verify_response('server-groups-get-resp', subs, respons... | |
20,981 | [
-0.014690586365759373,
-0.017897536978125572,
-0.017241328954696655,
-0.048898059874773026,
0.00884822104126215,
-0.028640292584896088,
-0.007556973025202751,
0.013907371088862419,
-0.01954863965511322,
-0.009896036237478256,
0.05520612373948097,
-0.0006075875135138631,
-0.03516003489494324,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "videoName", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fps_sample", "annotation": null, "type_comment": null}}, {"_... | def extract_cnn(videoName, fps_sample = 5.0, batch_size = 1, layer_name = 'inception_5b/output', frame_max = None):
global net
cnn4v = []
# get frame
video = cv2.VideoCapture(videoName)
try:
fps = video.get(cv2.cv.CV_CAP_PROP_FPS)*1.0
except:
fps = 30.0
vData = []
step =... | |
20,982 | [
-0.012366821989417076,
-0.004832463804632425,
0.06465502828359604,
-0.04903879389166832,
-0.0023686212953180075,
-0.03761227801442146,
0.025995321571826935,
0.08089020103216171,
-0.08169957995414734,
-0.010254107415676117,
0.005323446821421385,
0.009480436332523823,
-0.02437656559050083,
-... | 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": "Constant", "_fields":... | def build_net():
net_proto = '/home/gzn/code/repository/temporal-segment-networks/models/bn_inception_kinetics_rgb_pretrained/bn_inception_rgb_deploy.prototxt'
net_weights = '/home/gzn/code/repository/temporal-segment-networks/models/bn_inception_kinetics_rgb_pretrained/bn_inception_kinetics_rgb_pretrained.caff... | |
20,983 | [
0.001317595480941236,
-0.008766465820372105,
0.028322428464889526,
-0.03844863548874855,
-0.02176692523062229,
0.008650390431284904,
-0.00484753493219614,
0.0051404875703155994,
0.02900782786309719,
0.040195297449827194,
-0.011309073306620121,
-0.01670382171869278,
0.0156425591558218,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sahara_node_group_template_list(self):
result = self.sahara('node-group-template-list')
node_group_templates = self.parser.listing(result)
self.assertTableStruct(node_group_templates, [
'name',
'id',
'plugin_name',
'node_processes',
... | |
20,984 | [
0.01722116768360138,
0.003614740213379264,
-0.02407553419470787,
-0.029895493760704994,
-0.03471514582633972,
0.02174527756869793,
-0.0011203705798834562,
0.005780174396932125,
0.020415326580405235,
0.030486583709716797,
-0.0002465241414029151,
-0.04733263701200485,
0.018403347581624985,
-... | 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_sahara_plugins_show(self):
name_param = '--name %s' % \
(CONF.data_processing_feature_enabled.plugins[0])
result = self.sahara('plugin-show', params=name_param)
plugin = self.parser.listing(result)
self.assertTableStruct(plugin, [
'Property',
... | |
20,985 | [
0.012401783838868141,
-0.013235237449407578,
0.030315471813082695,
-0.040027979761362076,
-0.01312411017715931,
0.0011293290881440043,
0.015735596418380737,
-0.006356469821184874,
0.018602674826979637,
0.05836395174264908,
-0.007262155879288912,
-0.035871826112270355,
0.019747285172343254,
... | 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_sahara_cluster_template_list(self):
result = self.sahara('cluster-template-list')
cluster_templates = self.parser.listing(result)
self.assertTableStruct(cluster_templates, [
'name',
'id',
'plugin_name',
'node_groups',
'descript... | |
20,986 | [
-0.008324086666107178,
-0.014727667905390263,
0.02818257361650467,
-0.009420706890523434,
0.00444045988842845,
0.025637051090598106,
-0.004812628962099552,
0.0059831151738762856,
0.02961442992091179,
0.0709109902381897,
-0.008352496661245823,
-0.03813738748431206,
-0.005085363518446684,
-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_sahara_cluster_list(self):
result = self.sahara('cluster-list')
clusters = self.parser.listing(result)
self.assertTableStruct(clusters, [
'name',
'id',
'status',
'node_count'
]) | |
20,987 | [
-0.009283251129090786,
0.016846951097249985,
0.02556089125573635,
-0.01604526862502098,
-0.022342544049024582,
-0.005861577112227678,
0.010723955929279327,
0.01624278537929058,
0.030068904161453247,
0.06260094791650772,
0.005196413025259972,
-0.05381729453802109,
0.010979564860463142,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sahara_job_binary_list(self):
result = self.sahara('job-binary-list')
job_binaries = self.parser.listing(result)
self.assertTableStruct(job_binaries, [
'id',
'name',
'description'
]) | |
20,988 | [
-0.020797379314899445,
-0.026086697354912758,
0.015377192758023739,
-0.04056961461901665,
0.010398689657449722,
-0.0036261819768697023,
-0.017558354884386063,
-0.004757659509778023,
0.01311968918889761,
0.00916088093072176,
0.005676474422216415,
-0.04098403453826904,
0.020437488332390785,
... | 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_sahara_data_source_list(self):
result = self.sahara('data-source-list')
data_sources = self.parser.listing(result)
self.assertTableStruct(data_sources, [
'name',
'id',
'type',
'description'
]) | |
20,989 | [
-0.003817590419203043,
-0.0012945437338203192,
0.014838610775768757,
-0.03242679312825203,
-0.019406083971261978,
-0.005377008114010096,
-0.0004509244754444808,
0.004834478255361319,
0.02251923829317093,
0.04758353903889656,
0.00044595362851396203,
-0.04594742879271507,
0.04031193628907204,
... | 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_sahara_job_template_list(self):
result = self.sahara('job-template-list')
job_templates = self.parser.listing(result)
self.assertTableStruct(job_templates, [
'id',
'name',
'description'
]) | |
20,990 | [
-0.030201315879821777,
-0.0028217954095453024,
0.017493657767772675,
-0.012389376759529114,
-0.007420659065246582,
-0.001374796382151544,
-0.00018234840536024421,
0.016456298530101776,
0.034445058554410934,
0.05545159429311752,
0.013768593780696392,
-0.03941967338323593,
0.011487580835819244... | 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_sahara_job_list(self):
result = self.sahara('job-list')
jobs = self.parser.listing(result)
self.assertTableStruct(jobs, [
'id',
'cluster_id',
'status'
]) | |
20,991 | [
0.008081023581326008,
0.03280261531472206,
0.042827628552913666,
-0.009211529046297073,
-0.01213050726801157,
-0.006080207414925098,
0.004964655265212059,
-0.012967918999493122,
-0.018279502168297768,
0.014941818080842495,
-0.009450789541006088,
0.01286025159060955,
0.0018079121364280581,
... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "initial", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"... | class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL)
]
operations = [
migrations.CreateModel(
name='Bookmark',
fields=[
('id', models.AutoField(auto_created=True, primar... | |
20,992 | [
0.013741632923483849,
-0.006964424159377813,
0.043733589351177216,
-0.011532487347722054,
-0.009997318498790264,
-0.0055384645238518715,
-0.00720780435949564,
0.027483265846967697,
0.02603546343743801,
0.0796290785074234,
-0.0026178995613008738,
-0.029954511672258377,
0.018534354865550995,
... | 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_sahara_help(self):
help_text = self.sahara('help')
lines = help_text.split('\n')
self.assertFirstLineStartsWith(lines, 'usage: sahara')
commands = []
cmds_start = lines.index('Positional arguments:')
cmds_end = lines.index('Optional arguments:')
command_... | |
20,993 | [
-0.019299637526273727,
-0.023876814171671867,
0.07049794495105743,
-0.0015173691790550947,
0.0011074288049712777,
0.029374143108725548,
0.021753381937742233,
0.008275486528873444,
0.00009612584835849702,
0.010068606585264206,
0.007998260669410229,
0.01026915293186903,
0.04194958135485649,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "new_context", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "super_client", "annotation": null, "type_comment": null}}]... | def test_project_from_template(new_context, super_client):
template = test_project_template(new_context)
user_client = new_context.user_client
proj = user_client.create_project(projectTemplateId=template.id)
assert proj.orchestration == 'kubernetes'
proj = user_client.wait_success(proj)
assert ... | |
20,994 | [
-0.010708284564316273,
-0.040249183773994446,
0.05572963505983353,
-0.019705571234226227,
-0.013781096786260605,
-0.005569471977651119,
0.018250640481710434,
-0.005758612882345915,
0.00640169158577919,
0.011010909453034401,
0.01529422402381897,
-0.005656767636537552,
0.03508127108216286,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "new_context", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_project_template(new_context):
user_client = new_context.user_client
entry = {
'name': 'foo-' + random_str(),
'dockerCompose': 'test:\n image: nginx'
}
entry2 = {
'name': 'foo-' + random_str(),
'templateVersionId': 'foo:infra*k8s'
}
template = user_clien... | |
20,995 | [
-0.018375782296061516,
-0.0014324970543384552,
0.035744354128837585,
-0.02913890965282917,
0.023622659966349602,
-0.003569165011867881,
-0.006265802308917046,
-0.029724497348070145,
0.03572092950344086,
-0.005522104445844889,
0.010107265785336494,
-0.07711035758256912,
0.008432481437921524,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "xs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "foo", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def get_new_sources(xs, foo, sources, cfoo, cx=0, cy=0, compute_curve = True):
if compute_curve:
ys = foo(xs)
sources['curve'].data = dict(x=xs, base_x=base_x, y=ys)
r = foo(period)
y = foo(xs[0]) + cy
x = cfoo(xs[0]) + cx
sources['lines'].data = {
'line_x': [x, shift], 'li... | |
20,996 | [
0.010364958085119724,
-0.0001583951379870996,
0.019555620849132538,
-0.027488108724355698,
-0.017482629045844078,
0.02299463003873825,
-0.027032770216464996,
-0.021784387528896332,
-0.0054820445366203785,
-0.002724546240642667,
0.04527030512690544,
-0.05075833946466446,
0.004640266299247742,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "foos", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "title", "annotation": null, "type_comment": null}}, {"_type": "ar... | def create_plot(foos, title='', r = 1, y_range=None, period = pi/2, cfoos=None):
if y_range is None:
y_range=[-2, 2]
# create new figure
p = figure(title=title, width=800, height=300, x_range=[-2, 9], y_range=y_range)
p.xgrid.bounds = (-2, 2)
p.xaxis.bounds = (-2, 2)
_sources = []
... | |
20,997 | [
-0.005013168323785067,
-0.006373140029609203,
0.02381024695932865,
-0.021231520920991898,
-0.0148092620074749,
0.03340065851807594,
-0.027973050251603127,
-0.02361377328634262,
0.018333522602915764,
-0.0022778757847845554,
0.03774765506386757,
-0.03956504166126251,
0.014968897216022015,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "foos", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "title", "annotation": null, "type_comment": null}}, {"_type": "ar... | def create_centric_plot(foos, title='', r = 1, y_range=(-2, 2), period = pi/2, cfoos=None):
p = figure(title=title, width=800, height=300, x_range=[-2, 9], y_range=y_range)
p.xgrid.bounds = (-2, 2)
p.xaxis.bounds = (-2, 2)
_sources = []
for i, foo in enumerate(foos):
sources = new_source()
... | |
20,998 | [
0.000462019961560145,
0.013178406283259392,
0.0323680154979229,
-0.019153103232383728,
0.017327839508652687,
0.010647373273968697,
0.00870650913566351,
-0.04105627164244652,
0.019189609214663506,
-0.0008776477770879865,
0.03784380853176117,
-0.07422740757465363,
-0.029715299606323242,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sources", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "foos", "annotation": null, "type_comment": null}}, {"_type": "... | def update_sources(sources, foos, newx, ind, cfoos):
cx, cy = 0, 0
for i, foo in enumerate(foos):
get_new_sources(newx, foo, sources[i], cfoos[i], cx, cy,
compute_curve = i != 0)
if i == 0:
full_y = sum([foo(newx) for foo in foos])
sources[i]['cu... | |
20,999 | [
-0.006659708917140961,
-0.016629967838525772,
-0.0126148397102952,
-0.06698315590620041,
-0.0366380512714386,
-0.028742916882038116,
0.019506189972162247,
-0.003945153672248125,
0.003662839764729142,
0.0358659103512764,
0.05053657293319702,
-0.0018760593375191092,
0.020152857527136803,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "srcDir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dstDir", "annotation": null, "type_comment": null}}, {"_type": ... | def copyFilesOfType(srcDir, dstDir, extension, interactive=False):
print("Source Dir: %s, Destination Dir: %s, Extension: %s" % (srcDir, dstDir, extension))
src = []
dest = []
for root, dirs, files in os.walk(srcDir):
for file_ in files:
#print(file_)
if file_.lower().en... | |
21,000 | [
-0.03231871500611305,
0.007200476247817278,
0.03239572420716286,
-0.013297135941684246,
-0.04307450354099274,
0.019137093797326088,
-0.03113788738846779,
-0.00011481373803690076,
0.018726371228694916,
0.0035168100148439407,
0.051545653492212296,
-0.014054405502974987,
-0.012918501161038876,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "gind", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def cb(gind):
global newx
oldx = np.delete(newx, 0)
newx = np.hstack([oldx, [oldx[-1] + 2*pi/N]])
for k, p in fourier.items():
update_sources(p['sources'], p['fs'], newx, gind, p['cfs'])
update_centric_sources(p['csources'], p['fs'], newx, gind, p['cfs']) |