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
16,401
[ -0.0025236252695322037, 0.026333481073379517, -0.036303360015153885, -0.012288957834243774, 0.03238042816519737, -0.029281098395586014, -0.009428036399185658, -0.026441849768161774, -0.009596007876098156, 0.017100507393479347, -0.02000477723777294, -0.06619132310152054, 0.0012469120556488633...
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": "request", "annotation"...
class ClustHttpLoadBalan(object): def __init__(self, request, module): self.module = module if request: self.request = request else: self.request = {} def to_request(self): return remove_nones_from_dict({ u'disabled': self.request.get('disable...
16,402
[ 0.012148985639214516, -0.00024686293909326196, -0.015388715080916882, -0.028536247089505196, 0.020226119086146355, 0.0251189973205328, -0.0063851517625153065, -0.031931307166814804, 0.0014589877100661397, 0.01704186387360096, -0.023898551240563393, -0.07540137320756912, -0.011915991082787514...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"...
class ClusterAddonsConfig(object): def __init__(self, request, module): self.module = module if request: self.request = request else: self.request = {} def to_request(self): return remove_nones_from_dict({ u'httpLoadBalancing': ClustHttpLoadBa...
16,403
[ -0.016009001061320305, 0.00927259773015976, -0.038559313863515854, 0.001327628269791603, 0.013576092198491096, -0.043769411742687225, -0.032867226749658585, -0.001099542947486043, -0.010483314283192158, 0.0015478236600756645, -0.02375529333949089, -0.059629227966070175, 0.00205276720225811, ...
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": "request", "annotation"...
class ClustHorizPodAutos(object): def __init__(self, request, module): self.module = module if request: self.request = request else: self.request = {} def to_request(self): return remove_nones_from_dict({ u'disabled': self.request.get('disable...
16,404
[ 0.024276724085211754, 0.017918534576892853, 0.0488324910402298, -0.03392362967133522, -0.034661103039979935, -0.018685901537537575, -0.02332000434398651, 0.011241438798606396, -0.003894141875207424, -0.015985166653990746, 0.053616080433130264, -0.019174225628376007, 0.009846224449574947, -...
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 build_parser(parser): parser.add_argument('sseqids', nargs='?', type=Opener('r'), default = sys.stdin, help = 'csv input file, each line containing gb,seq_start,seq_stop') parser.add_argument('-o', '--outfasta', type = Opener('w'), default = sys.stdout, ...
16,405
[ 0.044198159128427505, 0.0060942089185118675, 0.03847953677177429, -0.02774500660598278, -0.007669252809137106, 0.020863275974988937, 0.010789051651954651, 0.019130727276206017, -0.030265076085925102, -0.0352809876203537, 0.04022420197725296, -0.0589793398976326, 0.030919326469302177, -0.02...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "seq_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "seq_start", "annotation": null, "type_comment": null}}, {"_type...
def retrieve_record(seq_id, seq_start, seq_stop): seq_handle = Entrez.efetch(db="nuccore", id=seq_id, seq_start=seq_start, seq_stop=seq_stop, retmode="xml") try: seq_records = Entrez.read(seq_handle) except...
16,406
[ 0.03732387349009514, 0.0029899112414568663, -0.008886371739208698, -0.02585328370332718, -0.0016700155101716518, -0.0072302501648664474, -0.024363886564970016, -0.015271888114511967, -0.009442117065191269, -0.02989911288022995, 0.04846101626753807, -0.046060193330049515, 0.015838749706745148...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "seq_record", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def parse_taxid(seq_record): taxid = '' features = seq_record['GBSeq_feature-table'] for feature in features: for qual in feature['GBFeature_quals']: if 'taxon' in qual['GBQualifier_value']: taxid = qual['GBQualifier_value'].split(':')[-1] return taxid ...
16,407
[ 0.058035437017679214, 0.03399282693862915, 0.03698689863085747, -0.021206121891736984, -0.010169708169996738, -0.02557341195642948, -0.030120795592665672, 0.02994070202112198, 0.005763022229075432, -0.025415828451514244, 0.04103902354836464, -0.04437077045440674, 0.022624364122748375, -0.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 action(args): Entrez.email = args.email sseqids = csv.DictReader(args.sseqids, fieldnames=fieldnames) if args.seqinfo: info = csv.writer(args.seqinfo, delimiter=',', quotechar='"', quoting=csv.QUOTE_ALL) if not args.no_header: info.writerow(FETCH_HEADERS) # For each s...
16,408
[ -0.008878882974386215, 0.0495448000729084, 0.005194620694965124, -0.048432569950819016, 0.010313407517969608, 0.022383632138371468, 0.03063688613474369, -0.048280902206897736, 0.008177420124411583, 0.05904931202530861, -0.047977566719055176, -0.00626577390357852, -0.010313407517969608, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def check_update(arn): res = devicefarm.list_runs(arn=arn) if res['ResponseMetadata']['HTTPStatusCode'] != 200: return res['runs'] = [ensure_utc(run) for run in res['runs']] collection = db[arn] cursor = collection.find(limit=1, sort=[('_id', DESCENDING)]) if cursor.count() == 0: ...
16,409
[ 0.027821244671940804, 0.03670588508248329, -0.013208065181970596, -0.025162337347865105, 0.007409270852804184, 0.039559345692396164, 0.0384136363863945, 0.031042195856571198, 0.024124715477228165, 0.0007059343624860048, 0.039883602410554886, -0.03210143744945526, -0.011694866232573986, 0.0...
13
{"_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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def key_check(module, s3, bucket, obj, version=None, validate=True): exists = True try: if version: s3.head_object(Bucket=bucket, Key=obj, VersionId=version) else: s3.head_object(Bucket=bucket, Key=obj) except botocore.exceptions.ClientError as e: # if a clien...
16,410
[ -0.002949067624285817, 0.023425133898854256, 0.01901274174451828, -0.05251821503043175, -0.030444303527474403, -0.018952954560518265, 0.03960390016436577, -0.004065617918968201, 0.02843540906906128, 0.017984380945563316, -0.008340495638549328, 0.04013004153966904, 0.045726243406534195, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "run", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def ensure_utc(run): created = run['created'] if created.tzinfo != tz: created = created.astimezone(tz) microsecond = floor(created.microsecond / 1000) * 1000 created = created.replace(microsecond=microsecond) run['created'] = created return run
16,411
[ 0.03903219476342201, 0.0042031304910779, -0.033843956887722015, -0.037674933671951294, -0.007672902196645737, 0.030822956934571266, 0.044702041894197464, 0.05074404180049896, 0.022569933906197548, 0.00211798376403749, 0.022394804283976555, -0.03986406698822975, -0.009599337354302406, -0.00...
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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def keysum(module, s3, bucket, obj, version=None): if version: key_check = s3.head_object(Bucket=bucket, Key=obj, VersionId=version) else: key_check = s3.head_object(Bucket=bucket, Key=obj) if not key_check: return None md5_remote = key_check['ETag'][1:-1] if '-' in md5_remot...
16,412
[ 0.0012591449776664376, 0.000030626524676335976, 0.018787242472171783, 0.006452761124819517, 0.0004347048234194517, 0.026816077530384064, 0.03805416077375412, 0.024189289659261703, 0.029168765991926193, 0.023024365305900574, 0.04942929372191429, -0.012608581222593784, 0.0243034977465868, 0....
13
{"_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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def bucket_check(module, s3, bucket, validate=True): exists = True try: s3.head_bucket(Bucket=bucket) except botocore.exceptions.ClientError as e: # If a client error is thrown, then check that it was a 404 error. # If it was a 404 error, then the bucket does not exist. error...
16,413
[ 0.027500377967953682, 0.01802641525864601, 0.03352643921971321, -0.0417889766395092, -0.010359235107898712, 0.008635284379124641, -0.010685387998819351, 0.09152986854314804, 0.004027728457003832, 0.0031838726717978716, 0.019755542278289795, -0.03342289850115776, -0.0311864223331213, -0.009...
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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def list_keys(module, s3, bucket, prefix, marker, max_keys): pagination_params = {'Bucket': bucket} for param_name, param_value in (('Prefix', prefix), ('StartAfter', marker), ('MaxKeys', max_keys)): pagination_params[param_name] = param_value try: keys = sum(paginated_list(s3, **pagination_...
16,414
[ 0.0063356938771903515, 0.015086039900779724, 0.05077416077256203, 0.0015977689763531089, -0.0250104833394289, 0.012427707202732563, 0.04669805243611336, 0.04953360557556152, 0.01937260292470455, 0.011729894205927849, 0.02793464995920658, -0.011596977710723877, 0.02445666491985321, -0.03909...
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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def create_bucket(module, s3, bucket, location=None): if module.check_mode: module.exit_json(msg="PUT operation skipped - running in check mode", changed=True) configuration = {} if location not in ('us-east-1', None): configuration['LocationConstraint'] = location try: if len(co...
16,415
[ 0.0628092810511589, 0.06256424635648727, -0.0004252924118191004, -0.05370233952999115, -0.01349705271422863, 0.04688234627246857, 0.0339774526655674, 0.0865771621465683, 0.03563139960169792, -0.010995707474648952, 0.03657068312168121, -0.0505986325442791, -0.02807631902396679, -0.021174648...
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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def delete_key(module, s3, bucket, obj): if module.check_mode: module.exit_json(msg="DELETE operation skipped - running in check mode", changed=True) try: s3.delete_object(Bucket=bucket, Key=obj) module.exit_json(msg="Object deleted from bucket %s." % (bucket), changed=True) except b...
16,416
[ 0.03780311346054077, 0.03542010858654976, -0.002542773960158229, -0.03996948152780533, -0.024003352969884872, 0.04339234158396721, 0.03312376141548157, 0.07352651655673981, 0.025953082367777824, 0.012099162675440311, 0.046100299805402756, -0.032062239944934845, -0.003179144347086549, -0.01...
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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def delete_bucket(module, s3, bucket): if module.check_mode: module.exit_json(msg="DELETE operation skipped - running in check mode", changed=True) try: exists = bucket_check(module, s3, bucket) if exists is False: return False # if there are contents then we need to ...
16,417
[ 0.043582733720541, -0.000889170914888382, 0.005367682781070471, 0.008781861513853073, -0.02657715603709221, 0.002535398816689849, -0.009381569921970367, -0.05633692070841789, 0.023263918235898018, 0.0690198540687561, 0.0049520437605679035, -0.06388967484235764, -0.012920440174639225, 0.032...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "option", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def option_in_extra_args(option): temp_option = option.replace('-', '').lower() allowed_extra_args = {'acl': 'ACL', 'cachecontrol': 'CacheControl', 'contentdisposition': 'ContentDisposition', 'contentencoding': 'ContentEncoding', 'contentlanguage': 'ContentLanguage', ...
16,418
[ 0.022580599412322044, 0.02601402997970581, 0.006013769656419754, -0.019052380695939064, -0.012174987234175205, -0.00193393777590245, 0.04869994893670082, 0.0671941339969635, 0.02255953475832939, -0.008783684112131596, 0.04625652730464935, -0.004083781503140926, -0.0002730090927798301, -0.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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def create_dirkey(module, s3, bucket, obj): if module.check_mode: module.exit_json(msg="PUT operation skipped - running in check mode", changed=True) try: bucket = s3.Bucket(bucket) key = bucket.new_key(obj) key.set_contents_from_string('') for acl in module.params.get('p...
16,419
[ 0.034873656928539276, 0.04016753286123276, 0.012956604361534119, -0.06323811411857605, -0.005577107425779104, 0.028529247269034386, 0.04169183969497681, 0.05623454600572586, 0.014182228595018387, 0.008074703626334667, 0.028961820527911186, -0.011370501480996609, -0.009315777570009232, -0.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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def upload_s3file(module, s3, bucket, obj, src, expiry, metadata, encrypt, headers): if module.check_mode: module.exit_json(msg="PUT operation skipped - running in check mode", changed=True) try: extra = {} if encrypt: extra['ServerSideEncryption'] = 'AES256' if metad...
16,420
[ 0.029731569811701775, 0.017141586169600487, 0.0018438687548041344, -0.062260910868644714, -0.0031996930483728647, 0.032153524458408356, 0.04735336825251579, 0.038166649639606476, 0.0023123393766582012, 0.0019104203674942255, 0.004311494994908571, -0.037227097898721695, -0.026307428255677223,...
13
{"_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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def download_s3file(module, s3, bucket, obj, dest, retries, version=None): if module.check_mode: module.exit_json(msg="GET operation skipped - running in check mode", changed=True) # retries is the number of loops; range/xrange needs to be one # more to get that count of loops. try: if v...
16,421
[ 0.053954146802425385, 0.045741815119981766, 0.012826251797378063, -0.06335859000682831, 0.006468316540122032, 0.0010727636981755495, 0.04349004477262497, 0.034240130335092545, 0.02260599285364151, -0.0032700318843126297, 0.020795747637748718, -0.036933425813913345, -0.025299284607172012, -...
13
{"_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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def download_s3str(module, s3, bucket, obj, version=None, validate=True): if module.check_mode: module.exit_json(msg="GET operation skipped - running in check mode", changed=True) try: if version: contents = to_native(s3.get_object(Bucket=bucket, Key=obj, VersionId=version)["Body"].r...
16,422
[ -0.007020368706434965, 0.003175997408106923, -0.0020295160356909037, -0.027417980134487152, -0.01430418435484171, 0.001322112511843443, 0.019738994538784027, 0.0252323467284441, 0.027574095875024796, -0.002119770972058177, 0.03391633555293083, -0.055577512830495834, -0.0204317606985569, -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": "s3", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_download_url(module, s3, bucket, obj, expiry, changed=True): try: url = s3.generate_presigned_url(ClientMethod='get_object', Params={'Bucket': bucket, 'Key': obj}, ExpiresIn=expiry) module.exit_json(msg="Download...
16,423
[ -0.01171347126364708, -0.025486210361123085, 0.043554626405239105, -0.03755396604537964, 0.0320625826716423, -0.010960620827972889, -0.00024028254847507924, 0.019828759133815765, 0.0193637628108263, 0.0008974700467661023, -0.015809865668416023, -0.03660183027386665, -0.00842528510838747, 0...
13
{"_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": "aws_connect_kwargs", "annotation": null, "type_comment": null}}...
def get_s3_connection(module, aws_connect_kwargs, location, rgw, s3_url): if s3_url and rgw: # TODO - test this rgw = urlparse(s3_url) params = dict(module=module, conn_type='client', resource='s3', use_ssl=rgw.scheme == 'https', region=location, endpoint=s3_url, **aws_connect_kwargs) elif is_f...
16,424
[ -0.00863895658403635, 0.01868470199406147, 0.024618787690997124, -0.04854697361588478, -0.008933103643357754, 0.055811114609241486, 0.038648299872875214, 0.007807672955095768, 0.010109689086675644, 0.0717717632651329, 0.04054107144474983, -0.061080172657966614, -0.0019950810819864273, 0.00...
13
{"_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( bucket=dict(required=True), dest=dict(default=None, type='path'), encrypt=dict(default=True, type='bool'), expiry=dict(default=600, type='int', aliases=['expiration']), ...
16,425
[ 0.020764505490660667, -0.0454755574464798, 0.0313144214451313, -0.010008233599364758, 0.0008169575594365597, 0.014999453909695148, 0.011059356853365898, 0.006022996734827757, 0.016108613461256027, 0.039026953279972076, 0.01377421896904707, -0.06665277481079102, 0.009589075110852718, -0.015...
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_algorithm(self): test_logger.debug("DiceDissimilarityTest - test_algorithm Starts") data = [[1, 0, 1, 1, 0], [1, 1, 0, 1, 1]] dice_dissimilarity = DiceDissimilarity(data) dice_dissimilarity.process() result = dice_dissimilarity.get_result() self.assertEquals(3.0 ...
16,426
[ 0.017496759071946144, -0.05123070999979973, 0.03594131022691727, -0.01071255560964346, 0.007201979868113995, 0.01878126710653305, -0.005437339190393686, 0.004502017050981522, 0.0049790311604738235, 0.03721334785223007, -0.004692199174314737, -0.06280376017093658, 0.009203569032251835, 0.00...
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 DiceDissimilarityTest(TestCase): def test_algorithm(self): test_logger.debug("DiceDissimilarityTest - test_algorithm Starts") data = [[1, 0, 1, 1, 0], [1, 1, 0, 1, 1]] dice_dissimilarity = DiceDissimilarity(data) dice_dissimilarity.process() result = dice_dissimilarity....
16,427
[ -0.03235599026083946, -0.022461917251348495, 0.023556245490908623, -0.007372608408331871, 0.0026074890047311783, -0.007823877036571503, -0.028655584901571274, 0.0038132236804813147, -0.002676589647307992, 0.016629265621304512, -0.01745283044874668, -0.05798807367682457, 0.0043237218633294106...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "learning_unit/search/base.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": ...
class LearningUnitSearch(BaseLearningUnitSearch): template_name = "learning_unit/search/base.html" search_type = SearchTypes.SIMPLE_SEARCH filterset_class = LearningUnitFilter serializer_class = LearningUnitSerializer def get_context_data(self, **kwargs): context = super().get_context_data(...
16,428
[ 0.002753480104729533, -0.035359032452106476, 0.009324128739535809, 0.03593147173523903, 0.009384674951434135, 0.013111024163663387, 0.016094304621219635, 0.018560189753770828, -0.03218860924243927, 0.002608994720503688, -0.0228975061327219, -0.026023896411061287, -0.002781001152470708, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) form = context["form"] select_comparison_form_academic_year = context["proposal_academic_year"].year if form.is_valid(): select_comparison_form_academic_year = form.cleaned_data["academic_year...
16,429
[ 0.04823160916566849, 0.015497369691729546, -0.004284508526325226, 0.010021896101534367, -0.01719733700156212, -0.017711279913783073, -0.016633974388241768, -0.07096371799707413, -0.02241583727300167, 0.0163177028298378, 0.01644618809223175, 0.02822735160589218, -0.007200148887932301, -0.01...
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": "plotly_name", "annotat...
class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="choroplethmapbox.colorbar.title.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=p...
16,430
[ 0.04012104868888855, 0.016002638265490532, 0.0017154974630102515, 0.003761348547413945, -0.024118412286043167, -0.0061804731376469135, -0.012256897985935211, -0.055853161960840225, -0.006216890178620815, 0.01862465776503086, 0.04665528982877731, 0.04064129292964935, -0.0016998902428895235, ...
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": "plotly_name", "annotation": null, "type_comment": null}}, {"_type...
def __init__( self, plotly_name="color", parent_name="choroplethmapbox.colorbar.title.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "colorbars"),...
16,431
[ 0.016742780804634094, 0.029837625101208687, -0.017547843977808952, 0.01811390370130539, 0.02686895616352558, 0.015308764763176441, -0.007755015045404434, 0.02686895616352558, 0.01083060447126627, -0.0012987920781597495, 0.02221469022333622, -0.0009292809991165996, -0.01602577231824398, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "patch_get_key", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly...
def test_read_actions(patch_get_key): patch_get_key([ # Enter: '\n', # Enter: '\r', # Ignored: 'x', 'y', # Up: const.KEY_UP, # Down: const.KEY_DOWN, # Ctrl+C: const.KEY_CTRL_C]) assert list(islice(ui.read_actions(), ...
16,432
[ 0.022438446059823036, -0.0420922227203846, 0.01682308129966259, -0.038778237998485565, 0.02793874219059944, 0.007686606142669916, -0.00786496326327324, 0.024670783430337906, 0.0114436075091362, 0.02080446667969227, 0.005577967502176762, -0.03647685796022415, 0.024417631328105927, -0.011725...
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 test_command_selector(): selector = ui.CommandSelector(iter([1, 2, 3])) assert selector.value == 1 selector.next() assert selector.value == 2 selector.next() assert selector.value == 3 selector.next() assert selector.value == 1 selector.previous() assert selector.value == 3
16,433
[ 0.01756078191101551, -0.03067612648010254, 0.030312173068523407, -0.021187324076890945, 0.011958490125834942, 0.030104199424386024, -0.023163074627518654, -0.011048604734241962, 0.012179462239146233, 0.01938055269420147, 0.04549425467848778, -0.023527029901742935, 0.02862238697707653, 0.03...
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 TestSelectCommand(object): @pytest.fixture def commands_with_side_effect(self): return [CorrectedCommand('ls', lambda *_: None, 100), CorrectedCommand('cd', lambda *_: None, 100)] @pytest.fixture def commands(self): return [CorrectedCommand('ls', None, 100), ...
16,434
[ 0.000009716610293253325, -0.02038443833589554, 0.0005509307375177741, -0.0741773173213005, 0.0035121834371238947, 0.00395568273961544, -0.01659403368830681, 0.0033799600787460804, 0.0009007717599160969, 0.029992669820785522, 0.03444419056177139, -0.02026323229074478, 0.01859942264854908, 0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test_class", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null...
def test_both(test_class, **kwargs): frozen_tests = types.new_class('Frozen_'+test_class.__name__, (test_class, unittest.TestCase)) source_tests = types.new_class('Source_'+test_class.__name__, (test_class, unittest.TestCase)) frozen_test...
16,435
[ 0.04164261743426323, 0.02541138418018818, 0.054119378328323364, -0.029257429763674736, -0.016139661893248558, 0.019321808591485023, 0.024541445076465607, -0.032050393521785736, 0.006146807689219713, 0.004529979545623064, 0.05054805055260658, -0.010502227582037449, 0.0047674961388111115, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "content", "annotation": null, "type_comment": null}}], "kwarg": n...
def temp_module(name, content='', *, pkg=False): conflicts = [n for n in sys.modules if n.partition('.')[0] == name] with support.temp_cwd(None) as cwd: with uncache(name, *conflicts): with support.DirsOnSysPath(cwd): invalidate_caches() location = os.path.jo...
16,436
[ 0.026422079652547836, 0.035492345690727234, 0.012038339860737324, -0.042798373848199844, 0.013397841714322567, -0.019250964745879173, 0.0035103175323456526, -0.04412674158811569, -0.01210060715675354, 0.04267383739352226, 0.02270679920911789, -0.035554613918066025, 0.007435750216245651, -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": {"_type": "arg", "_fields": {"arg": "names", "annotation": null, "type_comme...
def __init__(self, *names, module_code={}): self.modules = {} self.module_code = {} for name in names: if not name.endswith('.__init__'): import_name = name else: import_name = name[:-len('.__init__')] if '.' not in name: ...
16,437
[ 0.03483476862311363, 0.01945735141634941, -0.012643654830753803, -0.04224906861782074, 0.030899807810783386, 0.030671995133161545, -0.004574393387883902, -0.019219184294342995, -0.0368850938975811, 0.04481714591383934, 0.019219184294342995, -0.01527386624366045, 0.013264964334666729, 0.001...
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": "fullname", "annotation": null, "type_comment": null}}], "kwarg": ...
def load_module(self, fullname): if fullname not in self.modules: raise ImportError else: sys.modules[fullname] = self.modules[fullname] if fullname in self.module_code: try: self.module_code[fullname]() except Excep...
16,438
[ 0.028892749920487404, 0.04625337943434715, 0.033763717859983444, -0.01936938241124153, 0.021794458851218224, 0.007972567342221737, -0.008102667517960072, -0.018620003014802933, -0.004160618409514427, 0.05982547625899315, 0.02260628715157509, -0.009414082393050194, 0.026936035603284836, -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": "fullname", "annotation": null, "type_comment": null}}, {"_type": ...
def find_spec(self, fullname, path=None, parent=None): try: module = self.modules[fullname] except KeyError: return None is_package = hasattr(module, '__path__') spec = util.spec_from_file_location( fullname, module.__file__, loader=self, ...
16,439
[ -0.004476599860936403, 0.036128051578998566, 0.024295536801218987, 0.0327233150601387, -0.015930810943245888, 0.002612663432955742, -0.004571176134049892, -0.011464719660580158, -0.016214538365602493, 0.024589775130152702, -0.04791853576898575, -0.06443782150745392, 0.02416943572461605, -0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "res.partner"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ...
class res_partner_country_code(models.Model): _inherit = 'res.partner' def get_country_name(self): email = self.env.context.get('default_email', False) if email: top_level_domain = email.split(".")[-1] if len(top_level_domain) == 2: country_name = self.en...
16,440
[ 0.036062367260456085, 0.017983857542276382, 0.012328407727181911, -0.036133356392383575, -0.01529811043292284, 0.0022465032525360584, -0.025319378823041916, -0.001376889063976705, 0.0007276363321579993, 0.012363902293145657, 0.04349254071712494, -0.01846894808113575, 0.022255023941397667, ...
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def reformate(self, data): _list = data.split(':') filename = os.path.basename(_list[0]) _data = ''.join(_list[1:])[:-5] if self.filter: _data = self.filter(data) if not _data: return None return {'collectors': self.collector_set, 'filename...
16,441
[ 0.04210810363292694, 0.022181734442710876, 0.012260536663234234, 0.013340231031179428, -0.06171056628227234, 0.01733510196208954, -0.03047139197587967, 0.015187709592282772, 0.030039513483643532, 0.06886054575443268, -0.008241672068834305, -0.049857914447784424, 0.0461149737238884, 0.05552...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "state", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def scan_command_double_ampersand(state): params = { 'flags': [], 'count': '', } m = state.match(r'\s*([cgr])*\s*(\d*)\s*$') params['flags'] = list(m.group(1)) if m.group(1) else [] params['count'] = m.group(2) or '' state.expect(EOF) return None, [TokenDoubleAmpersand(params), TokenEof()]
16,442
[ 0.002711667213588953, 0.023126140236854553, 0.02103022299706936, -0.014517485164105892, -0.008176445960998535, 0.043955061584711075, 0.0150385033339262, 0.02211962640285492, 0.0023371847346425056, -0.014529325999319553, 0.017501503229141235, -0.0073949177749454975, -0.014410912990570068, 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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def run(self, *args, **kwargs): self.log.info('Socket Agent[{}] starts'.format(os.getpid())) signal.signal(signal.SIGTERM, lambda *args, **kwargs: self.log.info(self.name+': got terminate sig.')) chn = kwargs.get('channel', None) event = kwargs.get('event') if not chn: ...
16,443
[ 0.007694342639297247, 0.03618553653359413, 0.029056591913104057, -0.04338822513818741, 0.007423934526741505, 0.04117579385638237, 0.03493182361125946, -0.008351926691830158, 0.01286897249519825, 0.03210482746362686, 0.017601115629076958, -0.03365353122353554, 0.012918137945234776, -0.02036...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen...
def test_create(self, *args): set_module_args(dict( name='foo', parent='/Common/ldap', interval=20, timeout=30, time_until_up=60, provider=dict( server='localhost', password='password', user='...
16,444
[ 0.01308599766343832, 0.03560991585254669, 0.01885230839252472, -0.04149390757083893, 0.010638256557285786, 0.028996311128139496, 0.015451362356543541, -0.017804957926273346, -0.0038922603707760572, 0.016663463786244392, -0.007249077782034874, -0.03819887340068817, 0.011420827358961105, -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 TestManager(unittest.TestCase): def setUp(self): self.spec = ArgumentSpec() def test_create(self, *args): set_module_args(dict( name='foo', parent='/Common/ldap', interval=20, timeout=30, time_until_up=60, provider=d...
16,445
[ 0.03298259153962135, 0.05251622572541237, 0.04664046689867973, -0.0259186252951622, -0.06429386138916016, 0.00565378600731492, 0.006339291110634804, -0.04645766690373421, -0.022915460169315338, 0.02721129171550274, 0.028281986713409424, 0.00774294463917613, -0.03389659896492958, 0.01176457...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, ...
def _g(*args): global G_SCALE evt = args[0] ca.delete("my_text") if evt.delta > 0: G_SCALE += 1.0 if evt.delta < 0: G_SCALE -= 1.0 draw_string(ca, BASE_COORD, TEXT, G_SCALE, tag="my_text")
16,446
[ 0.04238924756646156, -0.014763331972062588, 0.019749537110328674, -0.03715568780899048, 0.017145773395895958, -0.006118841003626585, 0.02687082625925541, -0.008572886697947979, 0.036739084869623184, 0.04077491536736488, 0.0711868554353714, -0.01458106841892004, -0.0788419172167778, 0.01295...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "output_f", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def cm(output_f): pp.pprint(input_fs) pp.pprint(output_f) for f in input_fs: while True: chunk = f.read(1024) if not chunk: break output_f.write(chunk) output_f.flush()
16,447
[ 0.0747973695397377, 0.04881931096315384, 0.04192717373371124, -0.019638175144791603, 0.022587215527892113, -0.006997066084295511, -0.003470920491963625, 0.025028180330991745, -0.028452157974243164, 0.010012376122176647, -0.02228899672627449, -0.010619856417179108, 0.03647089749574661, 0.03...
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": "c", "annotation": null, "type_comment": null}}], "kwarg": {"_type...
def run(self, c=None, **global_optargs): if c is None: c = Repl.get() if c is None: if Repl.replActive: raise RqlDriverError("RqlQuery.run must be given" + " a connection to run on. A default connection" + ...
16,448
[ -0.018778663128614426, 0.03469301015138626, 0.055198293179273605, -0.010205795057117939, 0.03742348030209541, -0.019019586965441704, -0.024815140292048454, -0.01893927901983261, -0.03910994529724121, 0.017547275871038437, 0.004339972510933876, -0.06692324578762054, 0.03568347543478012, 0.0...
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": {"_type": "arg", "_fields": {"arg": "optargs", "a...
class RqlQuery(object): # Instantiate this AST node with the given pos and opt args def __init__(self, *args, **optargs): self.args = [expr(e) for e in args] self.optargs = {} for k, v in dict_items(optargs): self.optargs[k] = expr(v) # Send this query to the server to ...
16,449
[ 0.0304324422031641, -0.012179282493889332, -0.04955780506134033, -0.02986498735845089, -0.002524652751162648, 0.027174826711416245, -0.0227192472666502, 0.02385415881872177, -0.009457596577703953, -0.006625571753829718, 0.03434158116579056, -0.04104596748948097, 0.04375714436173439, -0.027...
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": "index", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __getitem__(self, index): if isinstance(index, slice): if index.stop: return Slice(self, index.start or 0, index.stop, bracket_operator=True) else: return Slice(self, index.start or 0, -1, right...
16,450
[ 0.02612188644707203, 0.03465629369020462, 0.01690378412604332, -0.0092947231605649, 0.01440475881099701, -0.006854637525975704, 0.015265271998941898, -0.020970594137907028, -0.029304606840014458, -0.023646436631679535, -0.024424435570836067, -0.0488017201423645, 0.04505318030714989, 0.0299...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "optargs", "a...
class RqlBoolOperQuery(RqlQuery): def __init__(self, *args, **optargs): self.infix = False RqlQuery.__init__(self, *args, **optargs) def set_infix(self): self.infix = True def compose(self, args, optargs): t_args = [T('r.expr(', args[i], ')') if needs_wrap...
16,451
[ 0.04626302421092987, 0.012840445153415203, -0.008940364234149456, -0.0005105333984829485, -0.0010115650948137045, 0.0003533899725880474, 0.020453495904803276, -0.03157486394047737, -0.0260551106184721, -0.02119024284183979, -0.02345895580947399, -0.0388253889977932, 0.03398390859365463, 0....
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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "optargs", "a...
class RqlBiCompareOperQuery(RqlBiOperQuery): def __init__(self, *args, **optargs): RqlBiOperQuery.__init__(self, *args, **optargs) for arg in args: try: if arg.infix: err = ( "Calling '%s' on result of infix bitwise operator:\n...
16,452
[ 0.03966940939426422, -0.013031892478466034, 0.03601626306772232, -0.04842758923768997, -0.0016889942344278097, -0.030021360144019127, 0.012867969460785389, -0.021813491359353065, -0.007540466263890266, 0.04177699238061905, -0.04393141344189644, -0.004595703445374966, 0.07877679914236069, -...
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": "args", "annotation": null, "type_comment": null}}, {"_type": "arg...
def compose(self, args, optargs): t_args = [T('r.expr(', args[i], ')') if needs_wrap(self.args[i]) else args[i] for i in xrange(len(args))] if self.infix: return T('(', T(*t_args, intsp=[' ', self.st_infix, ' ']), ')') else: return T('...
16,453
[ 0.04874170944094658, 0.010668018832802773, -0.017181914299726486, 0.018808946013450623, 0.014747136272490025, -0.028940390795469284, 0.020966781303286552, -0.01922435872256756, -0.04957253485918045, -0.008308245800435543, -0.01242775097489357, -0.026494072750210762, 0.019916711375117302, 0...
14
{"_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": "optargs", "annotation": null, "type_comment": null}}, "...
def __init__(self, *args, **optargs): RqlBiOperQuery.__init__(self, *args, **optargs) for arg in args: try: if arg.infix: err = ( "Calling '%s' on result of infix bitwise operator:\n" "%s.\n" ...
16,454
[ 0.05414283275604248, 0.008881757035851479, 0.0319608673453331, -0.0383978970348835, 0.0014410426374524832, -0.0215427465736866, 0.018705518916249275, -0.011819913983345032, -0.019602665677666664, 0.0042754667811095715, -0.013804852031171322, -0.06966347992420197, 0.06553660333156586, 0.028...
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": "args", "annotation": n...
class RqlMethodQuery(RqlQuery): def compose(self, args, optargs): if len(args) == 0: return T('r.', self.st, '()') if needs_wrap(self.args[0]): args[0] = T('r.expr(', args[0], ')') restargs = args[1:] restargs.extend([T(k, '=', v) for k, v in dict_items(opta...
16,455
[ 0.0484897755086422, -0.010906758718192577, 0.01731777749955654, -0.045874904841184616, 0.013739533722400665, -0.03669992461800575, 0.0023381866049021482, -0.014014783315360546, 0.00219339388422668, 0.049223773181438446, -0.03750273585319519, -0.013934502378106117, 0.08280420303344727, -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": "args", "annotation": null, "type_comment": null}}, {"_type": "arg...
def compose(self, args, optargs): if len(args) == 0: return T('r.', self.st, '()') if needs_wrap(self.args[0]): args[0] = T('r.expr(', args[0], ')') restargs = args[1:] restargs.extend([T(k, '=', v) for k, v in dict_items(optargs)]) restargs = T(*restarg...
16,456
[ 0.026405256241559982, 0.010713881812989712, 0.01350395567715168, -0.003998175263404846, -0.010775263421237469, 0.008626907132565975, 0.019630957394838333, -0.0034708513412624598, -0.05200697109103203, -0.005887054838240147, -0.04660538583993912, -0.044484931975603104, 0.06843492388725281, ...
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": "optargs", "a...
class RqlBracketQuery(RqlMethodQuery): def __init__(self, *args, **optargs): if 'bracket_operator' in optargs: self.bracket_operator = optargs['bracket_operator'] del optargs['bracket_operator'] else: self.bracket_operator = False RqlMethodQuery.__init__(...
16,457
[ 0.015255472622811794, 0.03332560881972313, -0.0058591896668076515, -0.022329658269882202, 0.03925516456365585, 0.007951422594487667, -0.008401768282055855, -0.005526121240109205, 0.001447205781005323, -0.015227326191961765, -0.02743357978761196, -0.03283773362636566, 0.06218528375029564, 0...
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 reql_type_time_to_datetime(obj): if 'epoch_time' not in obj: raise RqlDriverError(('pseudo-type TIME object %s does not ' + 'have expected field "epoch_time".') % py_json.dumps(obj)) if 'timezone' in obj: return datetime.datetime.fr...
16,458
[ 0.034378230571746826, 0.03100079670548439, 0.04251985251903534, -0.01764764077961445, -0.0034557166509330273, -0.01917978562414646, 0.018464040011167526, -0.001832704059779644, -0.057930782437324524, -0.005309389904141426, -0.013207770884037018, -0.004747416358441114, 0.04182647168636322, ...
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": "offsetstr", "annotatio...
class RqlTzinfo(datetime.tzinfo): def __init__(self, offsetstr): hours, minutes = map(int, offsetstr.split(':')) self.offsetstr = offsetstr self.delta = datetime.timedelta(hours=hours, minutes=minutes) def __getinitargs__(self): return (self.offsetstr,) def __copy__(self):...
16,459
[ 0.005834805779159069, 0.0202765092253685, -0.0037641203962266445, -0.026066603139042854, 0.003730586962774396, -0.0019491269486024976, -0.01234027836471796, 0.01593952625989914, -0.0017088045133277774, 0.013625724241137505, 0.0382503941655159, -0.038921061903238297, 0.022836223244667053, 0...
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": "format_opts", "annotation": null, "type_comment": null}}], "kwarg"...
def recursively_convert_pseudotypes(obj, format_opts): if isinstance(obj, dict): for key, value in dict_items(obj): obj[key] = recursively_convert_pseudotypes(value, format_opts) obj = convert_pseudotype(obj, format_opts) elif isinstance(obj, list): for i in xrange(len(obj)):...
16,460
[ -0.0023695724084973335, 0.05696750432252884, 0.023095522075891495, -0.034284792840480804, 0.014144105836749077, -0.02055349387228489, -0.02385595813393593, -0.021748464554548264, -0.0012458926066756248, 0.0074902926571667194, -0.003003721358254552, -0.0361967459321022, 0.032351113855838776, ...
14
{"_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": "format_opts", "annotation": null, "type_comment": null}}], "kwarg"...
def convert_pseudotype(obj, format_opts): reql_type = obj.get('$reql_type$') if reql_type is not None: if reql_type == 'TIME': time_format = format_opts.get('time_format') if time_format is None or time_format == 'native': # Convert to native python datetime objec...
16,461
[ 0.03448475897312164, -0.02591962367296219, 0.021334361284971237, 0.0016984528629109263, 0.02260119467973709, -0.018879171460866928, 0.0033128238283097744, -0.03482108563184738, -0.037668656557798386, -0.024843376129865646, -0.03648030012845993, -0.04901409521698952, 0.0875796228647232, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "MAKE_ARRAY", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}...
class MakeArray(RqlQuery): tt = pTerm.MAKE_ARRAY def compose(self, args, optargs): return T('[', T(*args, intsp=', '), ']') def do(self, *args): return FunCall(self, *args)
16,462
[ 0.03619099780917168, 0.03676343709230423, 0.008660821244120598, -0.0258022528141737, 0.04816985875368118, -0.0048524984158575535, 0.017014220356941223, 0.004126346204429865, -0.0079187685623765, -0.04155498370528221, -0.010855179280042648, -0.04144897311925888, 0.0521557442843914, -0.00168...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "MAKE_OBJ", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, ...
class MakeObj(RqlQuery): tt = pTerm.MAKE_OBJ # We cannot inherit from RqlQuery because of potential conflicts with # the `self` parameter. This is not a problem for other RqlQuery sub- # classes unless we add a 'self' optional argument to one of them. def __init__(self, obj_dict): self.args...
16,463
[ 0.05561680346727371, 0.0307671669870615, -0.0048554749228060246, -0.06013491749763489, 0.014613904058933258, -0.0060224877670407295, 0.02842814289033413, 0.019012069329619408, -0.010665551759302616, 0.033426057547330856, -0.003508536610752344, -0.03618490695953369, 0.02632901817560196, 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": "obj_dict", "annotation": null, "type_comment": null}}], "kwarg": ...
def __init__(self, obj_dict): self.args = [] self.optargs = {} for k, v in dict_items(obj_dict): if not isinstance(k, (str, unicode)): raise RqlDriverError("Object keys must be strings.") self.optargs[k] = expr(v)
16,464
[ 0.023075006902217865, -0.0004706376639660448, -0.021500710397958755, -0.03313729539513588, 0.0175484549254179, 0.014796187169849873, 0.01766955479979515, 0.03351160138845444, -0.024484166875481606, -0.012385201640427113, -0.012715473771095276, -0.036990467458963394, 0.04777935519814491, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "SLICE", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, "ta...
class Slice(RqlBracketQuery): tt = pTerm.SLICE st = 'slice' # Slice has a special bracket syntax, implemented here def compose(self, args, optargs): if self.bracket_operator: if needs_wrap(self.args[0]): args[0] = T('r.expr(', args[0], ')') return T(args[...
16,465
[ 0.04351707547903061, -0.010879268869757652, 0.051501430571079254, -0.03074677474796772, 0.018151570111513138, -0.045127954334020615, -0.017591264098882675, 0.0021901531144976616, 0.02210872806608677, 0.0012730903690680861, -0.03301134333014488, -0.06410830467939377, 0.08077739924192429, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "FUNCALL", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, "...
class FunCall(RqlQuery): tt = pTerm.FUNCALL # This object should be constructed with arguments first, and the # function itself as the last parameter. This makes it easier for # the places where this object is constructed. The actual wire # format is function first, arguments last, so we flip the...
16,466
[ -0.006198568735271692, 0.04471568390727043, 0.10424105077981949, -0.01584874838590622, 0.03707198053598404, 0.03394283726811409, 0.011692482978105545, 0.07280630618333817, -0.02694406732916832, -0.012050781399011612, -0.015359073877334595, -0.028042849153280258, 0.05192943289875984, -0.026...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "DB", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, "targe...
class DB(RqlTopLevelQuery): tt = pTerm.DB st = 'db' def table_list(self, *args): return TableList(self, *args) def config(self, *args): return Config(self, *args) def wait(self, *args, **kwargs): return Wait(self, *args, **kwargs) def reconfigure(self, *args, **kwargs...
16,467
[ 0.042599473148584366, -0.010998453013598919, 0.02625204622745514, -0.041878264397382736, -0.009345680475234985, 0.006803414784371853, -0.029425369575619698, -0.02016984112560749, -0.004231099039316177, 0.039137665182352066, -0.039810795336961746, -0.02670881152153015, 0.06923616677522659, ...
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": "args", "annotation": null, "type_comment": null}}, {"_type": "arg...
def compose(self, args, optargs): if len(args) != 2: return T('r.do(', T(T(*(args[1:]), intsp=', '), args[0], intsp=', '), ')') if isinstance(self.args[1], Datum): args[1] = T('r.expr(', args[1], ')') return T(args[1], '.do(', args[0], ')...
16,468
[ -0.010260088369250298, 0.04361867904663086, 0.06523878872394562, -0.014228111132979393, 0.032595738768577576, 0.021785685792565346, 0.005233531817793846, 0.028905654326081276, -0.028574492782354355, -0.030395880341529846, -0.008468268439173698, -0.030656078830361366, 0.06703651696443558, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "TABLE", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, "ta...
class Table(RqlQuery): tt = pTerm.TABLE st = 'table' def insert(self, *args, **kwargs): return Insert(self, *[expr(arg) for arg in args], **kwargs) def get(self, *args): return Get(self, *args) def get_all(self, *args, **kwargs): return GetAll(self, *args, **kwargs) d...
16,469
[ 0.05454081669449806, 0.029834292829036713, 0.018471622839570045, -0.01277280692011118, 0.0032398176845163107, -0.00028971166466362774, 0.011578269302845001, 0.004352776799350977, -0.02200279012322426, 0.027783185243606567, 0.002406555227935314, -0.08353602141141891, 0.044564973562955856, 0...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "ann...
class RqlBinary(bytes): def __new__(cls, *args, **kwargs): return bytes.__new__(cls, *args, **kwargs) def __repr__(self): excerpt = binascii.hexlify(self[0:6]).decode('utf-8') excerpt = ' '.join([excerpt[i:i+2] for i in xrange(0, len(excerpt), 2)]) ex...
16,470
[ 0.051757361739873886, -0.021174531430006027, 0.005542917642742395, -0.012200284749269485, -0.014921885915100574, -0.009742630645632744, 0.00009659780334914103, 0.012716450728476048, -0.002095457399263978, 0.027661798521876335, 0.00029914159676991403, -0.057294413447380066, 0.0107339043170213...
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 __repr__(self): excerpt = binascii.hexlify(self[0:6]).decode('utf-8') excerpt = ' '.join([excerpt[i:i+2] for i in xrange(0, len(excerpt), 2)]) excerpt = ', \'%s%s\'' % (excerpt, '...' if len(self) > 6 else '') \ if len(self) > 0 else '' r...
16,471
[ 0.08145830035209656, 0.024498408660292625, 0.046168405562639236, 0.00033519414137117565, 0.042665526270866394, -0.04218687117099762, -0.013010700233280659, -0.0027060299180448055, -0.02166999690234661, -0.0020356415770947933, 0.003516478929668665, -0.009845053777098656, -0.002980712335556745...
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def __init__(self, data): # We only allow 'bytes' objects to be serialized as binary # Python 2 - `bytes` is equivalent to `str`, either will be accepted # Python 3 - `unicode` is equivalent to `str`, neither will be accepted if isinstance(data, RqlQuery): RqlTopLevelQuery.__...
16,472
[ 0.05469091981649399, 0.054286468774080276, 0.045950260013341904, -0.0052185566164553165, 0.022705495357513428, -0.012178503908216953, 0.03523227944970131, 0.002013834659010172, -0.0042523653246462345, -0.01709933951497078, -0.028154365718364716, -0.02034619078040123, 0.018267756327986717, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "BINARY", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, "t...
class Binary(RqlTopLevelQuery): # Note: this term isn't actually serialized, it should exist only # in the client tt = pTerm.BINARY st = 'binary' def __init__(self, data): # We only allow 'bytes' objects to be serialized as binary # Python 2 - `bytes` is equivalent to `str`, either ...
16,473
[ -0.007770056836307049, 0.0615316666662693, -0.029800189658999443, -0.041724756360054016, 0.006119481287896633, -0.009897840209305286, 0.0046654026955366135, -0.017740881070494652, -0.016831381246447563, -0.0009719589143060148, 0.008224807679653168, -0.04260057210922241, 0.04246583208441734, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def _ivar_scan(query): if not isinstance(query, RqlQuery): return False if isinstance(query, ImplicitVar): return True if any([_ivar_scan(arg) for arg in query.args]): return True if any([_ivar_scan(arg) for k, arg in dict_items(query.optargs)]): return True return Fa...
16,474
[ 0.000422246812377125, 0.02024300955235958, 0.030153390020132065, -0.025533514097332954, 0.012245157733559608, -0.008047527633607388, 0.025632865726947784, -0.004750276915729046, 0.0015415113884955645, -0.01567280851304531, -0.007650118786841631, -0.0203920379281044, 0.04925385117530823, -0...
16
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "FUNC", "value": {"_type": "Name", "_fields": {"id": "pTerm", "ctx": {"_type": "Load", "_fields": {}}}}}}, "tar...
class Func(RqlQuery): tt = pTerm.FUNC lock = threading.Lock() nextVarId = 1 def __init__(self, lmbd): vrs = [] vrids = [] try: code = lmbd.func_code except AttributeError: code = lmbd.__code__ for i in xrange(code.co_argcount): ...
16,475
[ -0.007377341855317354, 0.005328783765435219, 0.01836419850587845, -0.02112516202032566, -0.010689230635762215, -0.0012372087221592665, -0.0039293053559958935, -0.014754683710634708, -0.01056258101016283, 0.05111579969525337, 0.02358216419816017, 0.0042617605067789555, 0.06874542683362961, ...
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": "lmbd", "annotation": null, "type_comment": null}}], "kwarg": null...
def __init__(self, lmbd): vrs = [] vrids = [] try: code = lmbd.func_code except AttributeError: code = lmbd.__code__ for i in xrange(code.co_argcount): Func.lock.acquire() var_id = Func.nextVarId Func.nextVarId += 1 ...
16,476
[ 0.027502698823809624, 0.04818194359540939, 0.056815702468156815, -0.020656036213040352, 0.012382017448544502, -0.018625246360898018, 0.021735256537795067, 0.036971982568502426, -0.03836452588438988, -0.005193020217120647, -0.03128577023744583, 0.012614107690751553, 0.0065739573910832405, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ("auth", "0006_require_contenttypes_0002"), ] operations = [ migrations.AlterField( model_name="user", name="username", field=models.CharField( error_messages={"unique": "A user with...
16,477
[ 0.04983889311552048, -0.0002253157872473821, 0.02280542626976967, -0.033658966422080994, -0.035595834255218506, 0.029690751805901527, 0.05631086230278015, 0.007794708479195833, -0.011686157435178757, -0.025084787979722023, 0.03422585502266884, -0.010753154754638672, 0.0010319130960851908, ...
10
{"_type": "Module", "_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": [], "kw_defaults": [], "posonlyargs": []}...
def setUpClass(cls): os.system('rm %s; touch %s' % (CONFIG, CONFIG)) start_single_mongod_instance("30000", "/MC", "MC_log") cls.mongo_doc = DocManager("%s:30000" % (HOSTNAME)) cls.mongo_doc._remove() cls.flag = start_cluster() if cls.flag: cls.conn = Connectio...
16,478
[ 0.022846857085824013, -0.04599539935588837, 0.005920573603361845, 0.0002908071910496801, -0.022313106805086136, 0.01222985703498125, 0.0018463718006387353, 0.012276269495487213, 0.007368082646280527, -0.02018970623612404, 0.0281495563685894, 0.012670781463384628, -0.00010288845805916935, -...
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): if not self.flag: self.fail("Shards cannot be added to mongos") self.connector = Connector("%s:%s" % (HOSTNAME, PORTS_ONE["MONGOS"]), CONFIG, '%s:30000' % (HOSTNAME), ['test.test'], '_id', None, 'mongo_connector/doc_managers/mongo_...
16,479
[ 0.01773352548480034, 0.02098446898162365, 0.034415993839502335, 0.02254883199930191, 0.005136122927069664, -0.016926901414990425, -0.014299258589744568, 0.02999177947640419, -0.02000674046576023, -0.012013821862637997, 0.039720162749290466, -0.004240891430526972, 0.03712918609380722, -0.02...
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 OwnershipControl(UsesQApplication): def setUp(self): super(OwnershipControl, self).setUp() self.toolbox = QToolBox() def tearDown(self): del self.toolbox super(OwnershipControl, self).tearDown() def testAddItem(self): # Was losing ownership of the widget. ...
16,480
[ 0.009271053597331047, 0.06123998388648033, 0.01135491393506527, -0.016904788091778755, 0.017617126926779747, -0.040635280311107635, 0.010291719809174538, -0.0016160551458597183, -0.023943133652210236, 0.009680382907390594, 0.009786702692508698, -0.020232586190104485, -0.003224136307835579, ...
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": "filename", "annotation": null, "type_comment": null}}, {"_type": ...
def OpenDocumentFile(self, filename, bMakeVisible = 1): if filename is not None: try: path = os.path.split(filename)[0] # print "The editor is translating", `filename`,"to", filename = win32api.FindFiles(filename)[0][8] filename = os.path.join(path, filename) # print `filename` except (win32ap...
16,481
[ 0.0084422891959548, 0.0425834059715271, 0.059603240340948105, -0.0364968404173851, -0.002647373592481017, -0.002947474829852581, 0.02095356024801731, 0.00041845126543194056, -0.011457392945885658, -0.01649007946252823, -0.0208295751363039, 0.014630296267569065, 0.013627140782773495, 0.0310...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='InternalComment', fields=[ ('...
16,482
[ 0.02130977250635624, 0.028175264596939087, 0.016777358949184418, -0.02303357608616352, -0.014971824362874031, 0.025693582370877266, -0.04368948936462402, 0.008893932215869427, 0.03334667161107063, 0.01116756908595562, 0.04226289689540863, -0.013099417090415955, -0.011420194990932941, 0.009...
23
{"_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": "id", "annotation": nul...
class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent (self,event,st) : htmltext = event player = st.getPlayer() if event == "30527_1" : if player.getClassId().getId() != 0x35 : if player.getClassId().getId() == 0x38 : ...
16,483
[ 0.018184134736657143, 0.011238710023462772, 0.006651128176599741, -0.030579261481761932, -0.029166633263230324, 0.009168239310383797, -0.03841796889901161, -0.013516920618712902, 0.03933202102780342, -0.0008339877240359783, 0.04700453579425812, -0.026272129267454147, 0.009140539914369583, ...
22
{"_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}}, {"_type": "ar...
def onEvent (self,event,st) : htmltext = event player = st.getPlayer() if event == "30527_1" : if player.getClassId().getId() != 0x35 : if player.getClassId().getId() == 0x38 : htmltext = "30527-02a.htm" else: htmltext = "30527-02.htm" ...
16,484
[ 0.021958306431770325, 0.0015585576184093952, 0.019915003329515457, -0.016418365761637688, -0.014569321647286415, 0.006727069616317749, -0.01476357877254486, -0.013303049840033054, 0.05600375309586525, 0.03292306885123253, 0.045758459717035294, -0.005511160474270582, 0.0008791056461632252, ...
18
{"_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": "npc", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def onTalk (self,npc,player): htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30527 and id != STARTED : return htmltext if ...
16,485
[ -0.0013920492492616177, 0.0174799095839262, 0.012435742653906345, -0.02581535093486309, 0.03334176540374756, -0.005850131157785654, 0.011105749756097794, 0.04415332153439522, -0.011657359078526497, 0.011093491688370705, 0.02946823462843895, 0.00027791186585091054, -0.00022447465744335204, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lineitem", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def test_where(lineitem): table = lineitem q = table.l_quantity expr = api.where(table.l_discount > 0, q * table.l_discount, api.null()) assert isinstance(expr, ir.DecimalColumn) expr = api.where( table.l_discount > 0, (q * table.l_discount).sum(), api.null() ) assert isinstance(e...
16,486
[ 0.02396656759083271, 0.009651060216128826, -0.008271337486803532, -0.006432873196899891, -0.025591420009732246, 0.009097770787775517, -0.030816158279776573, 0.047148723155260086, 0.0042197126895189285, -0.011493026278913021, 0.0546286441385746, -0.006191246211528778, -0.02930336631834507, ...
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": "npc", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def onKill(self,npc,player,isPet): st = player.getQuestState(qn) if not st : return if st.getState() != STARTED : return npcId = npc.getNpcId() if npcId == 20389 : st.set("id","0") if st.getInt("cond") and st.getQuestItemsCount(SILVERYS_RING) == 1 and st.getQuestItemsCount(RATMAN_TOOTH)<...
16,487
[ 0.01848074421286583, -0.0008135162643156946, 0.059194665402173996, -0.04054975509643555, -0.005995101761072874, 0.012840364128351212, 0.03609373793005943, -0.005036471877247095, 0.02539929561316967, 0.018680091947317123, 0.053190771490335464, -0.010231249034404755, -0.014423423446714878, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lineitem", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def test_precision_scale(lineitem): col = lineitem.l_extendedprice p = col.precision() s = col.scale() assert isinstance(p, ir.IntegerValue) assert isinstance(p.op(), ops.DecimalPrecision) assert isinstance(s, ir.IntegerValue) assert isinstance(s.op(), ops.DecimalScale)
16,488
[ 0.006428602617233992, 0.02254699543118477, -0.0688079297542572, 0.002779302652925253, 0.032674387097358704, 0.015013964846730232, 0.018087608739733696, -0.005610701162368059, 0.04288513585925102, 0.03207007795572281, -0.008069615811109543, 0.016430966556072235, -0.012023675255477428, 0.051...
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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _convert_to_boolean(self, value): value_lower = value.lower() if value_lower in ('y', 'yes'): return True elif value_lower in ('n', 'no'): return False else: return None
16,489
[ 0.011220939457416534, 0.007977893576025963, -0.052450865507125854, 0.012053321115672588, -0.004545669537037611, 0.015242316760122776, 0.015447709709405899, 0.044191908091306686, 0.009599416516721249, 0.08492456376552582, 0.04587829113006592, -0.021890560165047646, 0.021685168147087097, 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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def __init__(self, *args, **kwargs): self.initialized = False super(InteractiveArgumentParser, self).__init__(*args, **kwargs) self.interactive_args = [] self.add_argument( '-i', '--interactive', action=_InteractiveModeAction, help='provide arguments interactively (pass this as t...
16,490
[ 0.0315871424973011, 0.01061287708580494, -0.031637437641620636, 0.005557928700000048, -0.021691011264920235, 0.027311811223626137, -0.04179763421416283, 0.004885192960500717, 0.007884210906922817, 0.08555689454078674, 0.003759775310754776, -0.013366692699491978, -0.022810140624642372, -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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def add_argument(self, *args, **kwargs): if self.initialized: # Picks the name with the most "-" characters in front of it. longest_name = max(args, key=lambda x: x.count('-', 0, 2)) kwargs_and_extra = {'name': longest_name, 'was_required': kwargs.get('required', False)} kwargs_and_extra.upd...
16,491
[ 0.018167313188314438, -0.03190241754055023, -0.0009073286782950163, 0.01162565778940916, 0.001761328661814332, -0.006334265228360891, 0.034485895186662674, 0.02758871763944626, 0.02600070647895336, -0.021461842581629753, 0.023227615281939507, 0.016283031553030014, -0.020158251747488976, -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}}, {"_type": "arg", "_fields": {"arg": "make_processor", "anno...
class ConsumerWorker(Thread): def __init__(self, make_processor, consumer_option): super(ConsumerWorker, self).__init__() self.make_processor = make_processor self.option = consumer_option self.consumer_client = \ ConsumerClient(consumer_option.endpoint, consumer_option....
16,492
[ 0.0009489767835475504, 0.03562789037823677, -0.02729339711368084, -0.015070163644850254, 0.004211084451526403, 0.028531193733215332, -0.031151194125413895, -0.007509294431656599, 0.002759253140538931, 0.10331469029188156, 0.015905676409602165, -0.02886127308011055, 0.0407441109418869, 0.03...
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": "args", "annotation": null, "type_comment": null}}, {"_type": "arg...
def parse_known_args(self, args=None, namespace=None): if len(args or []) == 0: self.print_help() sys.exit(2) namespace, args = super(InteractiveArgumentParser, self).parse_known_args(args, namespace) # Have to do our own checking of required args (note parse_args calls parse_known_args) for...
16,493
[ 0.020123617723584175, -0.016904307529330254, 0.01976071298122406, -0.018777361139655113, 0.00017459272930864245, 0.005247476045042276, 0.0310926865786314, 0.032193105667829514, 0.028236281126737595, -0.044812802225351334, 0.028166040778160095, 0.025567179545760155, -0.05595747008919716, -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 run(self): self.logger.debug('worker start') self.heart_beat.start() while not self.shut_down_flag: held_shards = self.heart_beat.get_held_shards() for shard in held_shards: shard_consumer = self._get_shard_consumer(shard) shard_consume...
16,494
[ 0.023801175877451897, -0.025616327300667763, 0.026523903012275696, 0.008644660003483295, -0.006188532337546349, -0.009614631533622742, 0.04158966243267059, -0.004756264388561249, 0.024844888597726822, -0.014067425392568111, 0.034510571509599686, 0.007124470081180334, -0.016211573034524918, ...
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": "make_processor", "annotation": null, "type_comment": null}}, {"_t...
def __init__(self, make_processor, consumer_option): super(ConsumerWorker, self).__init__() self.make_processor = make_processor self.option = consumer_option self.consumer_client = \ ConsumerClient(consumer_option.endpoint, consumer_option.accessKeyId, consumer_option.access...
16,495
[ 0.015815576538443565, -0.03895514830946922, 0.008820634335279465, 0.0374266617000103, 0.03313840925693512, -0.025304924696683884, 0.01087984349578619, 0.026706036180257797, 0.03369036316871643, -0.041736140847206116, 0.030060211196541786, 0.004943694919347763, 0.01729099079966545, 0.004649...
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": "shard_id", "annotation": null, "type_comment": null}}], "kwarg": ...
def _get_shard_consumer(self, shard_id): consumer = self.shard_consumers.get(shard_id, None) if consumer is not None: return consumer consumer = ShardConsumerWorker(self.consumer_client, shard_id, self.option.consumer_name, self.make_processor(...
16,496
[ 0.017970338463783264, -0.020672645419836044, 0.031774621456861496, -0.007594607770442963, 0.006665689870715141, -0.0032962511759251356, -0.031391795724630356, 0.012813436798751354, 0.05035297945141792, -0.015864791348576546, 0.049497250467538834, -0.011349687352776527, -0.019816914573311806,...
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": "owned_shards", "annotation": null, "type_comment": null}}], "kwar...
def clean_shard_consumer(self, owned_shards): remove_shards = [] # remove the shards that's not assigned by server for shard, consumer in self.shard_consumers.items(): if shard not in owned_shards: consumer.shut_down() self.logger.info('Try to shut dow...
16,497
[ 0.039940085262060165, -0.01363686379045248, 0.011465666815638542, 0.015664974227547646, 0.02318018116056919, 0.0019161287928000093, -0.007502763997763395, -0.024511516094207764, -0.008367510512471199, 0.01013433001935482, -0.008386174216866493, -0.020803682506084442, -0.00004911343421554193,...
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 __init__(self): super(SkiaGmailthreadDesktopPageSet, self).__init__( archive_data_file='data/skia_gmailthread_desktop.json') urls_list = [ # Why: productivity, top google properties, long email thread. 'https://mail.google.com/mail/?shva=1#inbox/13ba91194d0b8a2e', ] for url in ur...
16,498
[ 0.0502622127532959, 0.04961066693067551, -0.007050671614706516, 0.006015176884829998, 0.010366581380367279, 0.016591183841228485, -0.005299638491123915, -0.009121661074459553, -0.01554405502974987, 0.021070571616292, -0.0023284086491912603, -0.035974714905023575, -0.01186165027320385, -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}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": nu...
class SkiaBuildbotDesktopPage(page_module.Page): def __init__(self, url, page_set): super(SkiaBuildbotDesktopPage, self).__init__( url=url, page_set=page_set, credentials_path='data/credentials.json', shared_page_state_class=shared_page_state.SharedDesktopPageState) self.archi...
16,499
[ 0.031570859253406525, 0.005060200113803148, 0.0701361745595932, -0.008126262575387955, -0.0154021717607975, 0.029630616307258606, -0.04613465443253517, 0.0044793253764510155, 0.02262418530881405, 0.030948065221309662, 0.0019522192887961864, -0.013270300813019276, -0.009222140535712242, 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 MandatoryValidatorTest(unittest.TestCase): def test_constructor_does_not_raise_error(self): testhelpers.assertRaisesNothing(self, StringMandatoryValidator) def test_validator_restricts_property_values_to_non_empty(self): class TestAlgorithm(PythonAlgorithm): def PyInit(self)...
16,500
[ 0.02749635837972164, 0.004768566228449345, 0.053426921367645264, -0.01702211983501911, -0.0028142842929810286, 0.01441245712339878, -0.03798246011137962, -0.017876192927360535, 0.016215497627854347, 0.034494999796152115, 0.011779069900512695, -0.039951570332050323, -0.0075383675284683704, ...
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_validator_restricts_property_values_to_non_empty(self): class TestAlgorithm(PythonAlgorithm): def PyInit(self): self.declareProperty("StringInput", "", StringMandatoryValidator()) self.declareProperty(FloatArrayProperty("ArrayInput", FloatArrayMandatoryValid...