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
17,901
[ 0.03041480854153633, 0.029927106574177742, 0.0419866219162941, -0.00025649330927990377, -0.050233203917741776, 0.010302683338522911, -0.03553566709160805, 0.01861022785305977, 0.030303966253995895, -0.023210134357213974, 0.04593256860971451, -0.025692975148558617, -0.017169293016195297, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def cancel_all_calls_after_grace(): shutdown_event.wait(timeout=grace) with state.lock: state.server.cancel_all_calls() # TODO(https://github.com/grpc/grpc/issues/6597): delete this loop. for rpc_state in sta...
17,902
[ 0.06762370467185974, 0.02781330980360508, -0.005349911283701658, -0.007492988836020231, -0.026713231578469276, -0.0008471125038340688, 0.008603445254266262, 0.036883771419525146, 0.009885141626000404, 0.011976328678429127, 0.0287888515740633, -0.016563449054956436, 0.011146080680191517, -0...
11
{"_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 _start(state): with state.lock: if state.stage is not _ServerStage.STOPPED: raise ValueError('Cannot start already-started server!') state.server.start() state.stage = _ServerStage.STARTED _request_call(state) def cleanup_server(timeout): if timeo...
17,903
[ 0.06612207740545273, 0.014764065854251385, 0.05020218342542648, 0.020717669278383255, 0.006586038041859865, 0.0016642286209389567, -0.014513272792100906, 0.014535080641508102, 0.014262479729950428, 0.013106651604175568, 0.02542821317911148, -0.04780329763889313, 0.020401451736688614, -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}}, {"_type": "arg", "_fields": {"arg": "thread_pool", "annotat...
class Server(grpc.Server): def __init__(self, thread_pool, generic_handlers, options, maximum_concurrent_rpcs): completion_queue = cygrpc.CompletionQueue() server = cygrpc.Server(_common.channel_args(options)) server.register_completion_queue(completion_queue) self....
17,904
[ -0.0058524650521576405, -0.04076271131634712, 0.08255120366811752, -0.02071107178926468, -0.002283591078594327, -0.036146681755781174, 0.01729178987443447, 0.01773141138255596, -0.029772164300084114, -0.00827343761920929, 0.050409965217113495, 0.017279578372836113, -0.033362410962581635, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "buckets", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "project_name", "annotation": null, "type_comment": null}}, {"_...
def stage_in_s3(buckets, project_name, project_root): distinct_buckets = {} for test in buckets.values(): for bucket in test.values(): distinct_buckets[f"{bucket.name}-{bucket.partition}"] = bucket pool = ThreadPool(32) func = partial(_sync_wrap, project_name=project_name, project_r...
17,905
[ 0.043547678738832474, -0.019187411293387413, 0.08477099239826202, -0.048264771699905396, 0.010322919115424156, 0.016657955944538116, 0.01938110962510109, -0.02203589864075184, -0.011633222922682762, -0.0326094850897789, 0.0057824295945465565, 0.019050683826208115, -0.042567797005176544, -0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setUp(self): self.maxDiff = None filename = 'chart_date03.xlsx' test_dir = 'xlsxwriter/test/comparison/' self.got_filename = test_dir + '_test_' + filename self.exp_filename = test_dir + 'xlsx_files/' + filename self.ignore_files = [] self.ignore_elements =...
17,906
[ 0.03385360166430473, -0.01430222112685442, 0.07089831680059433, -0.03803905099630356, -0.02384088933467865, -0.027055131271481514, 0.062111180275678635, 0.011134226806461811, -0.024326493963599205, -0.03198055177927017, 0.021910032257437706, 0.005457274150103331, -0.007954671047627926, -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.staging_dir = os.path.abspath("tmp-submit-staging-dir") os.mkdir(self.staging_dir) settings.IDSUBMIT_STAGING_PATH = self.staging_dir self.repository_dir = os.path.abspath("tmp-submit-repository-dir") os.mkdir(self.repository_dir) settings.INTERNET_D...
17,907
[ 0.020113471895456314, 0.031315214931964874, 0.037661027163267136, -0.04411720484495163, -0.0252453051507473, -0.0015743827680125833, -0.00039402677793987095, -0.01747857965528965, 0.015905922278761864, 0.009084171615540981, 0.07328035682439804, -0.007856394164264202, 0.0008660829626023769, ...
16
{"_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 SubmitTests(TestCase): def setUp(self): self.staging_dir = os.path.abspath("tmp-submit-staging-dir") os.mkdir(self.staging_dir) settings.IDSUBMIT_STAGING_PATH = self.staging_dir self.repository_dir = os.path.abspath("tmp-submit-repository-dir") os.mkdir(self.repository...
17,908
[ 0.03759964555501938, 0.02072998881340027, 0.03852612525224686, -0.051779936999082565, -0.027151009067893028, -0.0010398771846666932, 0.027151009067893028, 0.001520810415968299, -0.005793716758489609, 0.024770470336079597, 0.018684012815356255, -0.020253881812095642, 0.018323713913559914, 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 do_submission(self, name, rev, group=None, formats=["txt",]): # break early in case of missing configuration self.assertTrue(os.path.exists(settings.IDSUBMIT_IDNITS_BINARY)) # get url = urlreverse('submit_upload_submission') r = self.client.get(url) self.assertEqual(...
17,909
[ 0.025060148909687996, 0.041685957461595535, 0.05696491897106171, -0.05343221127986908, -0.04844226315617561, -0.020224755629897118, 0.016405014321208, 0.0017332349671050906, 0.020158516243100166, 0.012585273012518883, 0.010277973487973213, 0.0020934056956321, 0.007087496109306812, -0.00339...
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def submission_file(self, name, rev, group, format, templatename): # construct appropriate text draft f = open(os.path.join(settings.BASE_DIR, "submit", templatename)) template = f.read() f.close() submission_text = template % dict( date=datetime.date.today().strftim...
17,910
[ 0.02366582863032818, -0.00561115937307477, -0.05086889863014221, 0.029329625889658928, -0.004724217113107443, 0.022002482786774635, -0.005345339886844158, 0.015822837129235268, 0.030213935300707817, 0.0450156070291996, 0.033940672874450684, -0.00947475340217352, 0.0033345867414027452, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "confirm_email", "annotation": null, "type_comment": null}}], "kwa...
def extract_confirm_url(self, confirm_email): # dig out confirm_email link msg = confirm_email.get_payload(decode=True) line_start = "http" confirm_url = None for line in msg.split("\n"): if line.strip().startswith(line_start): confirm_url = line.strip...
17,911
[ 0.029102159664034843, 0.00859836582094431, 0.007789972238242626, 0.004045307170599699, -0.00285610044375062, 0.006634170189499855, 0.042170073837041855, 0.008939092978835106, 0.010261918418109417, -0.01954842172563076, 0.020350134000182152, -0.022969059646129608, -0.014230395667254925, 0.0...
15
{"_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 supply_extra_metadata(self, name, status_url, submitter_name, submitter_email, replaces): # check the page r = self.client.get(status_url) q = PyQuery(r.content) post_button = q('[type=submit]:contains("Post")') self.assertEqual(len(post_button), 1) action = post_butt...
17,912
[ 0.006495033390820026, 0.01867971569299698, 0.031695764511823654, -0.039255980402231216, -0.03037077561020851, -0.009904925711452961, 0.010320608504116535, 0.008657879196107388, 0.002524944255128503, 0.015536120161414146, 0.054973963648080826, -0.005806559696793556, -0.04097067192196846, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "formats", "annotation": null, "type_comment": null}}], "kwarg": n...
def submit_new_wg(self, formats): # submit new -> supply submitter info -> approve draft = make_test_data() # prepare draft to suggest replace sug_replaced_draft = Document.objects.create( name="draft-ietf-ames-sug-replaced", time=datetime.datetime.now(),...
17,913
[ 0.041700396686792374, 0.03165115416049957, 0.03763849660754204, -0.051248494535684586, -0.033576600253582, -0.009488752111792564, 0.031361017376184464, 0.013781440444290638, -0.005238925572484732, 0.021061206236481667, 0.040698111057281494, -0.00018720750813372433, -0.026850730180740356, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "formats", "annotation": null, "type_comment": null}}], "kwarg": n...
def submit_existing(self, formats): # submit new revision of existing -> supply submitter info -> prev authors confirm draft = make_test_data() prev_author = draft.documentauthor_set.all()[0] # Make it such that one of the previous authors has an invalid email address bogus_emai...
17,914
[ 0.040973640978336334, 0.011559883132576942, 0.06123477965593338, -0.04197666794061661, -0.03355124220252037, -0.0023978606332093477, 0.04817035794258118, 0.04862172156572342, 0.03277389705181122, 0.033501092344522476, 0.03956940397620201, 0.010657158680260181, -0.007748381234705448, 0.0342...
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": "formats", "annotation": null, "type_comment": null}}], "kwarg": n...
def submit_new_individual(self, formats): # submit new -> supply submitter info -> confirm draft = make_test_data() name = "draft-authorname-testing-tests" rev = "00" group = None status_url = self.do_submission(name, rev, group, formats) # supply submitter inf...
17,915
[ 0.03100285679101944, -0.008113483898341656, 0.0317004919052124, -0.03211907297372818, -0.03669555112719536, 0.01718970388174057, 0.03926284611225128, 0.017901290208101273, 0.0014441024977713823, 0.008825071156024933, 0.02871461771428585, -0.012969017028808594, -0.027179822325706482, 0.0414...
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_submit_update_individual(self): draft = make_test_data() replaces_count = draft.relateddocument_set.filter(relationship_id='replaces').count() name = draft.name rev = '%02d'%(int(draft.rev)+1) status_url = self.do_submission(name,rev) mailbox_before = len(outbox)...
17,916
[ 0.017152968794107437, -0.010189520195126534, 0.07012142986059189, -0.03678940236568451, -0.007998225279152393, 0.014961672946810722, 0.00509780365973711, 0.014085154980421066, 0.010512127541005611, -0.012685161083936691, -0.009672131389379501, 0.006981708575040102, 0.00948343612253666, -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 test_submit_new_wg_with_dash(self): make_test_data() group = Group.objects.create(acronym="mars-special", name="Mars Special", type_id="wg", state_id="active") name = "draft-ietf-%s-testing-tests" % group.acronym self.do_submission(name, "00") self.assertEqual(Submission....
17,917
[ 0.005430541466921568, -0.0031819811556488276, 0.04773866385221481, -0.04394533485174179, 0.003113391110673547, -0.02200845442712307, 0.01579360105097294, 0.018060054630041122, 0.0042406534776091576, -0.010616544634103775, 0.024453837424516678, 0.0009080723975785077, 0.012489350512623787, 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 test_submit_new_irtf(self): make_test_data() group = Group.objects.create(acronym="saturnrg", name="Saturn", type_id="rg", state_id="active") name = "draft-irtf-%s-testing-tests" % group.acronym self.do_submission(name, "00") self.assertEqual(Submission.objects.get(name=n...
17,918
[ 0.023677831515669823, 0.0011020731180906296, 0.05823371931910515, -0.033938612788915634, -0.02039344795048237, -0.01366163045167923, 0.015164060518145561, 0.018879372626543045, 0.01672472432255745, -0.014663251116871834, 0.022443275898694992, -0.006824992131441832, 0.005383707582950592, -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 test_submit_new_iab(self): make_test_data() name = "draft-iab-testing-tests" self.do_submission(name, "00") self.assertEqual(Submission.objects.get(name=name).group.acronym, "iab")
17,919
[ 0.027086783200502396, 0.010759537108242512, 0.020779062062501907, -0.030140800401568413, -0.018288863822817802, -0.003344736061990261, -0.01071255188435316, 0.055630095303058624, 0.01861775852739811, -0.008005049079656601, 0.010266195982694626, -0.020755570381879807, 0.02870776131749153, 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 test_cancel_submission(self): # submit -> cancel make_test_data() name = "draft-ietf-mars-testing-tests" rev = "00" status_url = self.do_submission(name, rev) # check we got cancel button r = self.client.get(status_url) self.assertEqual(r.status_cod...
17,920
[ 0.0125472042709589, 0.01854472979903221, 0.032469142228364944, -0.04011043533682823, -0.006210136227309704, 0.018443183973431587, 0.018176626414060593, 0.05234665423631668, -0.012934345752000809, 0.022048044949769974, 0.050315748900175095, 0.0006410053465515375, 0.020804114639759064, 0.062...
14
{"_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_edit_submission_and_force_post(self): # submit -> edit draft = make_test_data() name = "draft-ietf-mars-testing-tests" rev = "00" status_url = self.do_submission(name, rev) # check we have edit button r = self.client.get(status_url) self.assert...
17,921
[ 0.03870290517807007, 0.008370221592485905, 0.035604674369096756, -0.04814751446247101, -0.015128863044083118, 0.02512315660715103, 0.0060871499590575695, 0.08670050650835037, 0.01116862427443266, 0.0007097510388121009, 0.03620433062314987, -0.025160636752843857, 0.042775578796863556, 0.056...
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_search_for_submission_and_edit_as_secretariat(self): # submit -> edit make_test_data() name = "draft-ietf-mars-testing-tests" rev = "00" self.do_submission(name, rev) # search status page r = self.client.get(urlreverse("submit_search_submission")) ...
17,922
[ 0.006166690960526466, -0.011116824112832546, 0.01880571059882641, -0.01686401292681694, 0.024906480684876442, -0.013939478434622288, -0.01124267466366291, 0.024510949850082397, 0.007215448189526796, 0.03638887032866478, 0.011266646906733513, 0.010727285407483578, 0.005576390773057938, -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": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_request_full_url(self): # submit -> request full URL to be sent make_test_data() name = "draft-ietf-mars-testing-tests" rev = "00" self.do_submission(name, rev) submission = Submission.objects.get(name=name) url = urlreverse('submit_submission_status',...
17,923
[ 0.0099156079813838, 0.023007644340395927, 0.05396249145269394, -0.07628334313631058, -0.01833498291671276, -0.022001979872584343, -0.007879749871790409, -0.019070835784077644, 0.007186822593212128, 0.01287741307169199, 0.0294340867549181, -0.010473629459738731, 0.042507726699113846, 0.0094...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_submit_all_file_types(self): make_test_data() name = "draft-ietf-mars-testing-tests" rev = "00" group = "mars" self.do_submission(name, rev, group, ["txt", "xml", "ps", "pdf"]) self.assertEqual(Submission.objects.filter(name=name).count(), 1) self.ass...
17,924
[ 0.03141435235738754, 0.025295179337263107, 0.04586131498217583, -0.06116574630141258, -0.01853940449655056, 0.03640323132276535, 0.00037250141031108797, 0.012478695251047611, 0.025295179337263107, 0.02107281982898712, 0.054254066199064255, -0.05518948286771774, -0.004537411965429783, -0.00...
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_expire_submissions(self): s = Submission.objects.create(name="draft-ietf-mars-foo", group=None, submission_date=datetime.date.today() - datetime.timedelta(days=10), rev="00", ...
17,925
[ 0.002388909924775362, -0.004284735303372145, 0.054191697388887405, -0.03392421826720238, 0.009167972952127457, -0.004825427662581205, 0.011419159360229969, 0.04015408828854561, 0.009780078195035458, -0.05038304254412651, 0.04812505468726158, 0.004220123868435621, -0.0024127138312906027, 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_blackout_access(self): make_test_data() # get url = urlreverse('submit_upload_submission') # set meeting to today so we're in blackout period meeting = Meeting.get_current_meeting() meeting.date = datetime.datetime.utcnow() meeting.save() ...
17,926
[ 0.010226154699921608, 0.022105270996689796, 0.0625164657831192, -0.03634047135710716, -0.017837176099419594, -0.028865139931440353, 0.036414485424757004, 0.004092311952263117, 0.015937505289912224, 0.026546061038970947, 0.013063326478004456, -0.012754938565194607, 0.02431333065032959, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def submit_bad_file(self, name, formats): make_test_data() rev = "" group = None # break early in case of missing configuration self.assertTrue(os.path.exists(settings.IDSUBMIT_IDNITS_BINARY)) # get url = urlreverse('submit_upload_submission') r = self...
17,927
[ -0.003194507211446762, -0.0030408950988203287, 0.028314808383584023, -0.019273631274700165, -0.001711679040454328, -0.0022273771464824677, -0.031249115243554115, 0.01598821021616459, 0.02696051262319088, 0.020314432680606842, 0.04875463992357254, -0.07704436779022217, -0.03197642043232918, ...
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 ApprovalsTestCase(TestCase): def test_approvals(self): make_test_data() url = urlreverse('submit_approvals') self.client.login(username="marschairman", password="marschairman+password") Preapproval.objects.create(name="draft-ietf-mars-foo", by=Person.objects.get(user__usernam...
17,928
[ 0.015234733000397682, -0.005716319661587477, 0.01329085510224104, -0.015709171071648598, -0.006576238665729761, -0.023735081776976585, -0.015761885792016983, 0.03083847276866436, 0.016354933381080627, 0.009574423544108868, 0.04196140915155411, -0.028518998995423317, -0.01760692335665226, 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_preapproval(self): make_test_data() url = urlreverse('submit_add_preapproval') login_testing_unauthorized(self, "marschairman", url) # get r = self.client.get(url) self.assertEqual(r.status_code, 200) q = PyQuery(r.content) self.assertEqual(...
17,929
[ 0.009747215546667576, -0.00009772599150892347, 0.047517675906419754, -0.03909716382622719, 0.003303223056718707, -0.016475502401590347, -0.028781361877918243, 0.020726369693875313, 0.017815744504332542, 0.020563917234539986, 0.05718366429209709, -0.05929556116461754, -0.0121501749381423, 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_approvals(self): make_test_data() url = urlreverse('submit_approvals') self.client.login(username="marschairman", password="marschairman+password") Preapproval.objects.create(name="draft-ietf-mars-foo", by=Person.objects.get(user__username="marschairman")) Preapproval....
17,930
[ 0.01026417501270771, 0.030573604628443718, -0.03787924721837044, -0.006395563017576933, -0.012609736062586308, 0.05899554863572121, -0.01312263123691082, 0.0063079954124987125, 0.06329887360334396, 0.04743662476539612, 0.014748887158930302, -0.04746164381504059, 0.0056700026616454124, 0.03...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): argument_spec = spectrum_accelerate_spec() argument_spec.update( dict( state=dict(default='present', choices=['present', 'absent']), vol=dict(required=True), pool=dict(), size=dict() ) ) module = AnsibleModule(argument_spec) ...
17,931
[ 0.024823348969221115, 0.0027909192722290754, -0.001927876379340887, -0.006308284588158131, -0.023184187710285187, -0.018241871148347855, -0.03812289983034134, 0.03986140340566635, 0.014454415999352932, -0.005581838544458151, 0.0567745603621006, -0.05394328385591507, -0.002904232358559966, ...
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_cancel_preapproval(self): make_test_data() preapproval = Preapproval.objects.create(name="draft-ietf-mars-foo", by=Person.objects.get(user__username="marschairman")) url = urlreverse('submit_cancel_preapproval', kwargs=dict(preapproval_id=preapproval.pk)) login_testing_unautho...
17,932
[ 0.013027860783040524, 0.009977179579436779, 0.056713614612817764, -0.0459752157330513, 0.003559127915650606, 0.03209897503256798, 0.029193565249443054, -0.024521665647625923, -0.011307857930660248, -0.0049856845289468765, 0.026125451549887657, -0.04969414323568344, 0.018338952213525772, 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": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_mappings(self): # This is more of a linter than a test. If it passes, then # everything is fine. If it fails, then it means things are # not fine. Not fine? Yeah, it means that there are two fields # with the same name, but different types in the # mappings that share an...
17,933
[ 0.014981451444327831, 0.013622641563415527, 0.07922551035881042, -0.04246855527162552, -0.005066747777163982, 0.028419848531484604, 0.017491795122623444, -0.03341750428080559, -0.014198408462107182, -0.01155563909560442, 0.010306225158274174, -0.04923957586288452, 0.005343115422874689, 0.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": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestMappings(unittest.TestCase): def test_mappings(self): # This is more of a linter than a test. If it passes, then # everything is fine. If it fails, then it means things are # not fine. Not fine? Yeah, it means that there are two fields # with the same name, but different ty...
17,934
[ -0.014815501868724823, 0.01131095178425312, 0.031439803540706635, -0.052550408989191055, -0.0028084004297852516, 0.015113001689314842, -0.018825802952051163, -0.03558100387454033, 0.01090635173022747, 0.023086003959178925, -0.011911901645362377, -0.026870204135775566, 0.0018787127919495106, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestGetAnalyzerForLocale(ElasticTestCase): def test_default(self): actual = es_utils.es_analyzer_for_locale('en-US') eq_('snowball-english', actual) def test_without_synonyms(self): actual = es_utils.es_analyzer_for_locale('en-US', synonyms=False) eq_('snowball-english', ...
17,935
[ 0.012854539789259434, 0.017006779089570045, 0.04597300663590431, -0.030109956860542297, -0.0406770333647728, -0.002393132308498025, 0.019207218661904335, 0.005612983368337154, -0.03692261502146721, 0.025510169565677643, 0.004229939077049494, 0.0037699604872614145, -0.023645391687750816, -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 setUp(self): super(TestAnalyzers, self).setUp() self.locale_data = { 'en-US': { 'analyzer': 'snowball-english', 'content': 'I have a cat.', }, 'es': { 'analyzer': 'snowball-spanish', 'content': 'Tien...
17,936
[ 0.04087383300065994, -0.0015958755975589156, 0.03611654415726662, -0.003258498851209879, -0.01894419640302658, -0.028082557022571564, 0.030703919008374214, -0.003203887026757002, -0.023034006357192993, 0.0001255310926353559, 0.01493933703750372, 0.013895646668970585, 0.00967234093695879, -...
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": "work_dir", "annotation": null, "type_comment": null}}, {"_type": ...
def __init__(self, work_dir, is_on=True): self._work_dir = work_dir self._is_on = is_on if not self._is_on: return self._out_dir = utils.safe_makedir(os.path.join(work_dir, "world2cwl")) self._lworld = {} self._lfiles = set([])
17,937
[ 0.015271792188286781, 0.0010945700341835618, -0.05678030475974083, -0.007201913744211197, 0.040299952030181885, 0.0023772907443344593, 0.040563639253377914, -0.007591948378831148, -0.044123392552137375, 0.011613153852522373, 0.019369905814528465, -0.020688334479928017, -0.021578272804617882,...
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": "orig", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _compare_dicts(self, orig, new, ns): out = {} for key, val in new.items(): nskey = ns + [key] orig_val = tz.get_in([key], orig) if isinstance(val, dict) and isinstance(orig_val, dict): for nkey, nval in self._compare_dicts(orig_val or {}, val or {}...
17,938
[ 0.007682631723582745, -0.04014863073825836, 0.024910351261496544, -0.04122800752520561, -0.020730407908558846, 0.011947233229875565, -0.029016220942139626, -0.012941953726112843, -0.013619210571050644, 0.029122041538357735, 0.03233901038765907, -0.0017751535633578897, -0.013365239836275578, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"k...
def main(): pip_packages = {} for package in pip.get_installed_distributions(): name = package.project_name version = package.version full_name = "{0}-{1}-pip".format(name.lower(), version) pip_packages[full_name] = {'version': version} data = json.dumps(pip_packages) pri...
17,939
[ 0.05660880357027054, 0.03613928705453873, 0.024234026670455933, -0.023010561242699623, -0.052185505628585815, -0.02373993583023548, 0.011205296032130718, -0.009017175063490868, -0.005290899891406298, 0.01634032279253006, 0.0016675598453730345, -0.020116595551371574, -0.0442800372838974, -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": "step", "annotation": null, "type_comment": null}}, {"_type": "arg...
def report(self, step, world): if not self._is_on: return new_files = self._find_files() file_changes = new_files - self._lfiles self._lfiles = new_files world_changes = self._compare_dicts(self._lworld, self._items_to_world(world), []) self._lworld = self._it...
17,940
[ 0.011220481246709824, 0.03198627382516861, 0.02878343127667904, -0.027582364156842232, -0.03236555680632591, -0.0013077391777187586, 0.08748814463615417, -0.019174905493855476, -0.02581237442791462, 0.041995152831077576, -0.025559518486261368, 0.0019148567225784063, 0.03754910081624985, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_typ...
def avatar_file_path(instance=None, filename=None, size=None, ext=None): tmppath = [AVATAR_STORAGE_DIR] if AVATAR_HASH_USERDIRNAMES: tmp = md5_constructor(instance.user.username).hexdigest() tmppath.extend([tmp[0], tmp[1], instance.user.username]) else: tmppath.append(instance.user.u...
17,941
[ 0.029340676963329315, 0.029783818870782852, -0.020501157268881798, -0.031999532133340836, 0.0029737174045294523, 0.0031194877810776234, 0.04300811514258385, -0.05378346890211105, -0.030017051845788956, 0.019253361970186234, -0.017620733007788658, -0.05364352837204933, -0.008775381371378899, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "User", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", ...
class Avatar(models.Model): user = models.ForeignKey(User) primary = models.BooleanField(default=False) avatar = models.ImageField(max_length=1024, upload_to=avatar_file_path, blank=True) date_uploaded = models.DateTimeField(default=datetime.datetime.now) def __unicode__(self): return _...
17,942
[ 0.032250430434942245, 0.0002294509467901662, -0.0467665009200573, -0.017689349129796028, -0.007539353799074888, 0.000042747327825054526, 0.0738181546330452, -0.02729921229183674, -0.006571616046130657, -0.01729550212621689, 0.007004847284406424, 0.007319924887269735, -0.012861913070082664, ...
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": "size", "annotation": null, "type_comment": null}}, {"_type": "arg...
def create_thumbnail(self, size, quality=None): # invalidate the cache of the thumbnail with the given size first invalidate_cache(self.user, size) try: orig = self.avatar.storage.open(self.avatar.name, 'rb').read() image = Image.open(StringIO(orig)) except IOErro...
17,943
[ 0.04735846072435379, 0.018245648592710495, 0.009019501507282257, -0.0019464254146441817, 0.0014647573698312044, 0.006406033877283335, 0.024566594511270523, 0.004351727198809385, -0.012149584479629993, 0.03629680722951889, 0.007560822181403637, -0.057763706892728806, -0.018950678408145905, ...
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 save(self, *args, **kwargs): avatars = Avatar.objects.filter(user=self.user) if self.pk: avatars = avatars.exclude(pk=self.pk) if AVATAR_MAX_AVATARS_PER_USER > 1: if self.primary: avatars = avatars.filter(primary=True) avatars.update(pr...
17,944
[ 0.019720008596777916, -0.046693623065948486, -0.016909528523683548, -0.008763800375163555, -0.009644262492656708, 0.0006155213923193514, 0.041282571852207184, 0.018378907814621925, -0.0011486817384138703, -0.005702592898160219, 0.017037807032465935, -0.04879273474216461, 0.04429130256175995,...
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": "submission", "annotati...
class ProxyTimelineUser(object): def __init__(self, submission): self.submission = submission @property def username(self): return self.submission["submitter__username"] @property def email_hash(self): return md5(self.submission['submitter__email']).hexdigest() @prope...
17,945
[ -0.00019394847913645208, -0.02540186606347561, 0.003471295814961195, -0.04621711000800133, -0.013521762564778328, -0.009354954585433006, 0.029900765046477318, 0.0028415753040462732, -0.016140898689627647, 0.03599119931459427, 0.0371190570294857, -0.00411041546612978, 0.013534294441342354, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "unit", "annotation": null, "type_comment": null}}], "kwarg": n...
def _calculate_timeline(request, unit): submission_filter = ( Q(field__in=[SubmissionFields.TARGET, SubmissionFields.STATE, SubmissionFields.COMMENT, SubmissionFields.NONE])) timeline = ( Submission.objects.filter(unit=unit) .filter(submission_filte...
17,946
[ -0.049025848507881165, 0.00003577210372895934, 0.00794192310422659, -0.007261375430971384, -0.022266456857323647, -0.007869243621826172, -0.015011687763035297, -0.02994408831000328, 0.027050111442804337, 0.017733877524733543, 0.05883101746439934, -0.014350962825119495, 0.007175481412559748, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_users", "annotation": null, "type_comment": null}}, {"_...
def test_timeline_view_units(client, request_users, system, admin): _timeline_test( client, request_users, Unit.objects.filter(state=TRANSLATED).first()) _timeline_test( client, request_users, Unit.objects.filter(state=UNTRANSLATED).first())
17,947
[ -0.05412446707487106, -0.03414463624358177, 0.0029059594962745905, -0.022800365462899208, 0.01128214318305254, -0.0034138422925025225, -0.009076657705008984, 0.0008379289647564292, 0.019818302243947983, -0.011344268918037415, 0.04791183024644852, -0.026316717267036438, 0.018153315410017967, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_user", "annotation": null, "type_comment": null}}, {"_t...
def _timeline_test(client, request_user, unit): url = reverse("pootle-xhr-units-timeline", kwargs=dict(uid=unit.id)) user = request_user["user"] if user.username != "nobody": client.login( username=user.username, password=request_user["password"]) response = client.get( ...
17,948
[ -0.008228749968111515, 0.0024420912377536297, -0.018357450142502785, 0.01637888140976429, -0.03726522997021675, -0.0012554412242025137, 0.013849982060492039, 0.002597690559923649, 0.04520571231842041, 0.03278397023677826, 0.055766813457012177, -0.010737994685769081, -0.0015510800294578075, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_users", "annotation": null, "type_comment": null}}, {"_...
def test_timeline_view_unit_with_suggestion(client, request_users, system, admin, store0): # test with "state change" subission - apparently this is what is required # to get one suggestion = Suggestion.objects.filter( unit__store=store0, state__na...
17,949
[ -0.0347510501742363, 0.005840207450091839, 0.011505087837576866, 0.009219789877533913, -0.002386565087363124, 0.009745771065354347, 0.009002141654491425, -0.01380852423608303, 0.008246421813964844, -0.007750669028609991, 0.03941837698221207, 0.0006159121403470635, 0.01701277866959572, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_users", "annotation": null, "type_comment": null}}, {"_...
def test_timeline_view_unit_disabled_project(client, request_users, system, admin): unit = Unit.objects.filter( store__translation_project__project__disabled=True, state=TRANSLATED).first() _timeline_test( client, request_users, ...
17,950
[ -0.002328982576727867, 0.004722839221358299, -0.019955294206738472, 0.015972020104527473, -0.0344352088868618, 0.014466939494013786, 0.02662435732781887, 0.011878459714353085, 0.045853059738874435, 0.026520559564232826, 0.06025512516498566, -0.007447554264217615, 0.011125919409096241, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_users", "annotation": null, "type_comment": null}}, {"_...
def test_timeline_view_unit_with_suggestion_and_comment(client, request_users, system, admin, store0): # test with "state change" subission - apparently this is what is required # to get one suggestion = Suggestion.objects.filter( unit__store=s...
17,951
[ -0.018073704093694687, 0.027399171143770218, -0.011826795525848866, 0.009319053031504154, -0.022550441324710846, 0.00296471593901515, 0.00470121530815959, 0.0019529606215655804, -0.00854941364377737, -0.001086314325220883, 0.08568654954433441, -0.011942241340875626, -0.039610788226127625, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_users", "annotation": null, "type_comment": null}}, {"_...
def test_timeline_view_unit_with_qc(client, request_users, system, admin, store0): # check a Unit with a quality check qc_filter = dict( unit__store=store0, unit__state=TRANSLATED, unit__store__translation_project__project__disabled=False) qc = QualityCheck.objects.filter(**qc_filter...
17,952
[ -0.00767533527687192, -0.002289346419274807, 0.03021937422454357, -0.022652480751276016, -0.02411043271422386, -0.0180014930665493, 0.04814857244491577, -0.0032773802522569895, 0.007127096876502037, -0.001462470623664558, 0.058366287499666214, 0.0007116554188542068, 0.02436346560716629, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request_users", "annotation": null, "type_comment": null}}, {"_...
def test_timeline_view_unit_with_creation(client, request_users, system, admin, store0): # add a creation submission for a unit and test with that unit = Unit.objects.create( state=TRANSLATED, source_f="Foo", target_f="Bar", store=store0) # save and ...
17,953
[ 0.02465161122381687, 0.031159453094005585, 0.013625075109302998, 0.035988595336675644, -0.046934645622968674, -0.030377592891454697, 0.014981833286583424, -0.02485857531428337, -0.004185255151242018, 0.01209584716707468, 0.0214436836540699, 0.005208572838455439, 0.036609482020139694, 0.022...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mappable", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cax", "annotation": null, "type_comment": null}}, {"_type": "...
def colorbar(mappable=None, cax=None, ax=None, **kw): if mappable is None: mappable = gci() if mappable is None: raise RuntimeError('No mappable was found to use for colorbar ' 'creation. First define a mappable such as ' 'an ...
17,954
[ 0.02080458216369152, 0.006711522117257118, -0.03291030600667, -0.008500125259160995, 0.04601537436246872, 0.0180677343159914, 0.04974021390080452, 0.006030149292200804, -0.007898245938122272, -0.009272348135709763, -0.008920305408537388, -0.07486015558242798, -0.004673081915825605, -0.0076...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "_inst", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_t...
class Singleton(object): _inst = None def __new__(cls): if cls._inst is None: cls._inst = super(Singleton, cls).__new__(cls) return cls._inst def __reduce__(self): return repr(self) def __float__(self): return 0.0
17,955
[ 0.004451696760952473, -0.006653351243585348, 0.002133911242708564, -0.015968043357133865, 0.012338942848145962, 0.005051708314567804, -0.0031282848212867975, 0.0032105445861816406, -0.022897206246852875, -0.0026952121406793594, -0.022897206246852875, -0.04560086131095886, 0.00914533436298370...
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo...
class User(models.Model): username = models.CharField(max_length=50) password = models.CharField(max_length=200) create_time = models.DateTimeField() last_login_time = models.DateTimeField() # groups = models.ManyToManyField(Group) def __unicode__(self): return self.username
17,956
[ -0.028820831328630447, -0.0006223767413757741, 0.04447599872946739, -0.011603735387325287, -0.01338110025972128, -0.03439828380942345, -0.010083700530230999, -0.005691156722605228, -0.03672022745013237, 0.030520398169755936, -0.014254821464419365, -0.03980817273259163, 0.06032266840338707, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "MeshDirCorners"}}, "targets": [{"_type": "Name", "_fields": {"id": "description", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comm...
class MeshDirCorners(SimpleTopology): description='MeshDirCorners' def __init__(self, controllers): self.nodes = controllers # This file contains a special network creation function. This # networks is not general and will only work with specific system # configurations. The network spec...
17,957
[ -0.013796571642160416, -0.016196509823203087, 0.04625112935900688, -0.03844825178384781, -0.00020076411601621658, -0.054300155490636826, -0.00690443953499198, 0.011673548258841038, -0.04024512693285942, 0.024983977898955345, -0.00047998776426538825, -0.005366017110645771, 0.00710135744884610...
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": "options", "annotation": null, "type_comment": null}}, {"_type": "...
def makeTopology(self, options, IntLink, ExtLink, Router): nodes = self.nodes num_routers = options.num_cpus num_rows = options.mesh_rows # First determine which nodes are cache cntrls vs. dirs vs. dma cache_nodes = [] dir_nodes = [] dma_nodes = [] for n...
17,958
[ 0.013593762181699276, 0.03978441283106804, 0.0456070713698864, -0.05587036535143852, -0.03289690613746643, 0.0011271494440734386, -0.018328923732042313, -0.010178329423069954, 0.035864878445863724, 0.01343516819179058, 0.011747276410460472, -0.007963678799569607, -0.01962033100426197, -0.0...
8
{"_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(): parser = argparse.ArgumentParser() parser.add_argument("--output", required=True, type=pathlib.Path) parser.add_argument("--input", required=True, type=pathlib.Path) parser.add_argument("--lzss_tool", required=True, type=pathlib.Path) option = parser.parse_args() cgs = parse_cgs(op...
17,959
[ 0.019115982577204704, 0.05941963195800781, 0.010164194740355015, -0.03199337422847748, -0.023129869252443314, -0.014772512018680573, -0.006897762417793274, -0.0449884794652462, 0.008663401007652283, 0.017762327566742897, 0.051650822162628174, -0.04100990667939186, 0.021376000717282295, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs...
def parse_cgs(file_name): cgs = [] with open(file_name, mode="r") as file: for line in file: if len(line) == 0: break striped_line = line.strip() item_type = None nested_data = None if striped_line.startswith('ENTRY'): ...
17,960
[ 0.035809364169836044, 0.019255777820944786, -0.05306509509682655, 0.0005857852520421147, -0.0010558762587606907, 0.024809101596474648, -0.006808673031628132, -0.007218257058411837, 0.049830976873636246, -0.002808577613905072, 0.05404384061694145, 0.005542685277760029, 0.03461784869432449, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "TextIOBase", "value": {"_type": "Name", "_field...
def parse_commented_bytes(file: io.TextIOBase, line): items = [] data = bytearray() while len(line) != 0: striped_line = line.strip() name = None if striped_line.startswith('COMMENTED_BYTES'): name = "commented_bytes" elif striped_line.startswith('<hex>'): ...
17,961
[ 0.030726836994290352, 0.06115327402949333, -0.002234240062534809, -0.02656412310898304, 0.010567714460194111, 0.043193522840738297, -0.02467588149011135, -0.019933821633458138, -0.006453279405832291, -0.0002846443385351449, 0.03336608409881592, -0.03536161035299301, 0.04737769439816475, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "TextIOBase", "value": {"_type": "Name", "_field...
def parse_entry(file: io.TextIOBase, line): # compile the regex for extracting name and remark of the entry. data_re = re.compile(r""" ^\s* # Allow leading spaces ENTRY\s+"([^"]+)" # Parse the entry name (?: # Optional non-capturing part begin \s*=\s* ...
17,962
[ 0.04234131798148155, 0.0595293790102005, 0.02932080812752247, -0.007021951489150524, -0.03385825827717781, 0.01400691270828247, 0.005070724058896303, -0.029394788667559624, 0.005422130227088928, -0.0007991399616003036, 0.030134590342640877, -0.02724936418235302, 0.0006400055717676878, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "option", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgs", "annotation": null, "type_comment": null}}], "kwarg": nul...
def compress_cgs(option, cgs): for item in cgs: if item.nested_data is None: continue entry = compress_entry(option, item.nested_data) if entry is None: continue cgs.insert(cgs.index(item), Item(item.line, item.type, entry)) cgs.remove(item)
17,963
[ 0.03552991524338722, 0.046131934970617294, -0.020656418055295944, -0.03706326335668564, 0.007453177124261856, 0.05165199562907219, 0.001987878931686282, 0.005514584481716156, 0.025059323757886887, 0.017151616513729095, 0.024051692336797714, -0.007825561799108982, 0.008499140851199627, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "option", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "entry", "annotation": null, "type_comment": null}}], "kwarg": n...
def compress_entry(option, entry): if entry.name != 'Data': return None for item in entry.items: if item.nested_data is None: continue commented_bytes = compress_commented_bytes(option, item.nested_data) if commented_bytes is None: return None en...
17,964
[ 0.03260453790426254, 0.05588733032345772, 0.018125619739294052, -0.037481192499399185, 0.0393369123339653, 0.0009143727947957814, 0.022031258791685104, -0.007660232484340668, 0.014662331901490688, 0.008863212540745735, 0.01929083839058876, 0.009402665309607983, 0.0008604275062680244, -0.03...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "option", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": nu...
def compress_data(option, data): raw_file = str(option.input.with_suffix('.tmp')) compressed_file = str(option.input.with_suffix('.tmp.lz')) with open(raw_file, mode="wb") as binary: binary.write(data) subprocess.run([option.lzss_tool, "e", raw_file, compressed_file, ], chec...
17,965
[ 0.04473211616277695, 0.034670788794755936, 0.025062674656510353, -0.036392997950315475, -0.0019289875635877252, 0.024904049932956696, -0.0003229142166674137, 0.010996079072356224, 0.009585453197360039, 0.010389906354248524, 0.030773159116506577, 0.032019492238759995, 0.035418592393398285, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "TextIOBase", "value": {"_type": "Name", "_field...
def export_entry(file: io.TextIOBase, entry): for item in entry.items: if item.type == 'entry': file.write('ENTRY "{}"'.format(entry.name)) if entry.remark: file.write(' = "{}"'.format(entry.remark)) file.write('\n') elif item.nested_data is None: ...
17,966
[ 0.062119245529174805, -0.026192547753453255, 0.03191349282860756, 0.04066568985581398, -0.004624254535883665, 0.003487536683678627, -0.013299068436026573, -0.015978094190359116, -0.021229412406682968, 0.02296917699277401, 0.021346818655729294, -0.03626824542880058, -0.014921426773071289, -...
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": "message", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, message, cycles, edges, msg=None): if msg is None: message += " Cycles: %r all edges: %r" % (cycles, edges) else: message = msg SQLAlchemyError.__init__(self, message) self.cycles = cycles self.edges = edges
17,967
[ 0.02798406034708023, 0.03463729843497276, -0.019937237724661827, 0.006692573428153992, 0.006467801984399557, 0.037446942180395126, 0.0009805659065023065, 0.003245139494538307, 0.056462615728378296, -0.0040655555203557014, 0.03344601020216942, 0.035176750272512436, 0.02730974555015564, -0.0...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "TextIOBase", "value": {"_type": "Name", "_field...
def export_commented_bytes(file: io.TextIOBase, commented_bytes, is_compressed_data): for item in commented_bytes.items: if is_compressed_data and item.type == 'data': continue file.write(item.line) if is_compressed_data and item.type == 'hex': indent = item.line.rs...
17,968
[ 0.031487837433815, 0.014001944102346897, -0.017585119232535362, 0.03609635308384895, -0.024233287200331688, -0.004294297192245722, -0.007750682532787323, -0.05442015454173088, -0.020517809316515923, 0.010843237861990929, 0.021168293431401253, -0.010628247633576393, 0.015898270532488823, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "statement", "annotation": null, "type_comment": null}}, {"_type":...
def __init__(self, statement, params, orig, connection_invalidated=False): try: text = str(orig) except (KeyboardInterrupt, SystemExit): raise except Exception as e: text = 'Error in str() of DB-API-generated exception: ' + str(e) StatementError.__init...
17,969
[ 0.03681786358356476, 0.009354628622531891, -0.023158546537160873, 0.011646012775599957, 0.000031457861041417345, 0.006534892600029707, 0.0007661118288524449, -0.042001284658908844, -0.0029087222646921873, 0.007013191003352404, -0.009710571728646755, -0.04613912105560303, 0.04636158421635628,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "statement", "annotation": null, "type_comment": null}}, {"_type": ...
def instance(cls, statement, params, orig, dbapi_base_err, connection_invalidated=False): # Don't ever wrap these, just return them directly as if # DBAPIError didn't exist. if isinstance(orig, (KeyboardInterrupt, SystemExit...
17,970
[ -0.020581645891070366, 0.009588463231921196, 0.038579609245061874, 0.0030822299886494875, -0.040511101484298706, -0.03504272922873497, 0.011965197511017323, -0.07219253480434418, -0.05152309685945511, 0.04575371369719505, -0.050569891929626465, 0.023842601105570793, -0.004756605252623558, ...
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": "LocalOptions", "annotation": null, "type_comment": null}}], "kwar...
def setupUi(self, LocalOptions): LocalOptions.setObjectName(_fromUtf8("LocalOptions")) LocalOptions.resize(472, 215) self.verticalLayout = QtGui.QVBoxLayout(LocalOptions) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.local_cover_regex_label = QtGui.QLabel(Lo...
17,971
[ -0.017270106822252274, 0.020966600626707077, 0.02075265534222126, 0.0036192345432937145, -0.04690147563815117, -0.032757341861724854, 0.02083585597574711, -0.0632801502943039, -0.05462726578116417, 0.03152121603488922, -0.04939749836921692, 0.00647183321416378, -0.006454004440456629, 0.013...
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": "LocalOptions", "annota...
class Ui_LocalOptions(object): def setupUi(self, LocalOptions): LocalOptions.setObjectName(_fromUtf8("LocalOptions")) LocalOptions.resize(472, 215) self.verticalLayout = QtGui.QVBoxLayout(LocalOptions) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.local_...
17,972
[ -0.02440902777016163, 0.05852619186043739, -0.04739155247807503, -0.05396931245923042, 0.0389910452067852, 0.017791645601391792, 0.024547714740037918, -0.02419109083712101, -0.002171947853639722, 0.009718041867017746, 0.008306399919092655, -0.0637170746922493, 0.021873025223612785, -0.0026...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}], "kwarg"...
def Parse(source, filename): lexer = Lexer(filename) parser = Parser(lexer, source, filename) lex.lex(object=lexer) yacc.yacc(module=parser, debug=0, write_tables=0) tree = yacc.parse(source) return tree
17,973
[ 0.0459379218518734, 0.0632249042391777, -0.006227216683328152, -0.02032884955406189, 0.014623915776610374, 0.03983122855424881, -0.011622224934399128, 0.028214745223522186, -0.0002851749595720321, 0.015140458941459656, 0.016093194484710693, -0.009464222006499767, 0.024702249094843864, 0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "e", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def p_error(self, e): if e is None: # Unexpected EOF. # TODO(vtl): Can we figure out what's missing? raise ParseError(self.filename, "Unexpected end of file") raise ParseError(self.filename, "Unexpected %r:" % e.value, lineno=e.lineno, snippet=self._GetSnippet(e.lineno))
17,974
[ 0.021344806998968124, -0.008856591768562794, 0.046441491693258286, -0.010437911376357079, -0.02558971755206585, 0.012626505456864834, 0.009073046036064625, 0.0007177567458711565, 0.022138472646474838, -0.02813906967639923, 0.0323479063808918, -0.0026786229573190212, 0.004121652338653803, 0...
15
{"_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": "exc_type", "annotation": null, "type_comment": null}}, {"_type": ...
def __exit__(self, exc_type, exc_value, traceback): connection = get_connection(self.using) if connection.savepoint_ids: sid = connection.savepoint_ids.pop() else: # Prematurely unset this flag to allow using commit or rollback. connection.in_atomic_block = F...
17,975
[ 0.0015775355277583003, -0.011442466638982296, -0.001567578176036477, 0.018321603536605835, 0.017650190740823746, 0.010896232910454273, 0.019903406500816345, -0.011857832781970501, 0.01417932752519846, 0.010782434605062008, 0.028040017932653427, 0.00984928384423256, 0.019812367856502533, 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 __enter__(self): connection = get_connection(self.using) if not connection.in_atomic_block: # Reset state when entering an outermost atomic block. connection.commit_on_exit = True connection.needs_rollback = False if not connection.get_autocommit(): ...
17,976
[ 0.020683806389570236, 0.021060682833194733, -0.007105209399014711, 0.009327664971351624, 0.018644247204065323, 0.01763555034995079, 0.0020298617891967297, -0.0032727192156016827, 0.010352987796068192, 0.019098713994026184, 0.020783567801117897, 0.005836025811731815, 0.038662977516651154, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "using", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "savepoint", "annotation": null, "type_comment": null}}], "kwarg"...
def atomic(using=None, savepoint=True): # Bare decorator: @atomic -- although the first argument is called # `using`, it's actually the function being decorated. if callable(using): return Atomic(DEFAULT_DB_ALIAS, savepoint)(using) # Decorator: @atomic(...) or context manager: with atomic(...): ...
17,977
[ 0.0020998732652515173, 0.05634474381804466, 0.04508598521351814, -0.029929962009191513, -0.008227555081248283, 0.034005530178546906, -0.00017989816842600703, 0.03380175307393074, 0.04615582153201103, 0.009921464137732983, 0.07116962969303131, -0.017614100128412247, -0.02269582636654377, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "exc_type", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "using", "annotation": null, "type_comment": null}}], "kwarg":...
def exiting(exc_type, using): try: if exc_type is not None: if is_dirty(using=using): rollback(using=using) else: if is_dirty(using=using): try: commit(using=using) except:...
17,978
[ 0.006534467451274395, 0.041034188121557236, 0.037908732891082764, 0.05409052222967148, 0.03317014127969742, 0.02141188085079193, 0.001582418684847653, -0.014631662517786026, 0.0027568270452320576, 0.04577277973294258, -0.0062698121182620525, -0.0475875586271286, 0.04098377749323845, -0.037...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "aff", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def geometryFromAffordance(aff): if isinstance(aff, affordanceitems.SphereAffordanceItem): radius = aff.getProperty('Radius') return urdf.Sphere(radius=radius) if isinstance(aff, affordanceitems.BoxAffordanceItem): dimensions = aff.getProperty('Dimensions') return urdf.Box(size...
17,979
[ 0.04246753081679344, 0.013093558140099049, -0.004067119210958481, -0.03685770928859711, 0.002900396240875125, 0.01577910967171192, 0.007107761222869158, 0.0016844379715621471, -0.04132169485092163, 0.013857448473572731, 0.08245241641998291, 0.019025644287467003, -0.020648911595344543, -0.0...
6
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def main(): # write the Douglas Adams quote to a simple text file write_quote_2_file(FILENAME, DOUGLAS_ADAMS_QUOTE) # read the file in again, as a series of strings, one for each line lines = read_quote_file(FILENAME) # remove all characters from each string that aren't letters lines =...
17,980
[ -0.009059221483767033, 0.02204226143658161, 0.00634699035435915, 0.04597877711057663, 0.032153163105249405, -0.0049478234723210335, 0.015769073739647865, -0.024834444746375084, -0.023075491189956665, 0.01992659829556942, 0.02512965351343155, -0.02498205006122589, 0.06622518599033356, -0.05...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "aff", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def linkFromAffordance(aff): geometry = geometryFromAffordance(aff) material = materialFromAffordance(aff) pose = poseFromAffordance(aff) visual = urdf.Visual(geometry=geometry, material=material, origin=pose) collision = urdf.Collision(geometry=geometry, origin=pose) return urdf.Link(name=st...
17,981
[ 0.06660835444927216, -0.014780638739466667, 0.005757574457675219, -0.029102962464094162, -0.008854378946125507, 0.028211796656250954, -0.02844095416367054, -0.004614971112459898, -0.007905922830104828, 0.0005768713890574872, 0.039822425693273544, -0.03834563493728638, 0.02364138327538967, ...
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 archive_errors(self): items = [] if self.folder_path in ('article', 'fileset'): article = FigshareClient(self.external_account.oauth_key).article(self.folder_id) items = [article] else: project = FigshareClient(self.external_account.oauth_key).project(self...
17,982
[ 0.04808807000517845, -0.007559533696621656, -0.0181602593511343, -0.009055303409695625, -0.010364877991378307, -0.007081632036715746, 0.0020574594382196665, 0.008974619209766388, 0.030014701187610626, -0.06032731384038925, 0.018706433475017548, -0.004003201611340046, 0.005862052086740732, ...
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 serialize_waterbutler_credentials(self): if not self.has_auth: raise exceptions.AddonError('Addon is not authorized') try: # FigshareProvider(self.external_account).refresh_oauth_key() # TODO: Maybe return {'token': self.external_account.oauth_key} except...
17,983
[ 0.02871907874941826, 0.0402672253549099, -0.0019304691813886166, -0.05400901287794113, -0.05476544052362442, -0.0035079384688287973, 0.012752127833664417, -0.025693362578749657, -0.005556599702686071, -0.007627323269844055, 0.02073875442147255, -0.0031659696251153946, 0.006410733796656132, ...
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": "auth", "annotation": null, "type_comment": null}}, {"_type": "arg...
def create_waterbutler_log(self, auth, action, metadata): url = self.owner.web_url_for('addon_view_or_download_file', path=metadata['path'], provider='figshare') self.owner.add_log( 'figshare_{0}'.format(action), auth=auth, params={ 'project': self.own...
17,984
[ 0.017756151035428047, -0.05436167120933533, -0.03940185531973839, -0.023981736972928047, 0.01628318428993225, 0.011041495017707348, 0.024787265807390213, 0.007991994731128216, -0.023889675736427307, -0.01523599773645401, 0.01063873153179884, -0.005299227312207222, 0.023141685873270035, -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": "folder_id", "annotation": null, "type_comment": null}}, {"_type":...
def set_folder(self, folder_id, auth): try: info = FigshareClient(self.external_account.oauth_key).get_linked_folder_info(folder_id) except HTTPError as e: raise exceptions.InvalidFolderError(e.message) self.folder_id = info['id'] self.folder_name = info['name'] ...
17,985
[ 0.035659581422805786, 0.012795788235962391, 0.03702347353100777, -0.030699972063302994, 0.019193682819604874, -0.009051283821463585, 0.018387746065855026, -0.046124354004859924, -0.024760842323303223, 0.005793442018330097, -0.006645874585956335, -0.02167348563671112, 0.009534846059978008, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "season", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "game_id", "annotation": null, "type_comment": null}}, {"_type":...
def calculate_mean_age( season, game_id, plr_types='', toi_type='', query_team=''): # retrieving game game = Game.find_by_id(game_id) # retrieving players participating in game players_in_game = PlayerGame.get_players_in_game(game.game_id) # positions = ["L", "R", "C"]) toi_type = "toi_...
17,986
[ 0.030991384759545326, 0.0332050547003746, 0.058477792888879776, -0.044365644454956055, -0.014688625000417233, 0.005162348505109549, 0.021018339321017265, -0.020672453567385674, -0.022724710404872894, 0.014042971655726433, -0.0002604953770060092, -0.027763115242123604, -0.02580309472978115, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "season", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "team", "annotation": null, "type_comment": null}}], "kwarg": nu...
def process_team(season, team): games = Game.find_by_season_team(season, team) std_ages = list() weighted_ages = list() output = list() output.append("team,game_id,std_mean_age,weighted_mean_age") for g in games: # if not g.game_id == 2019020951: # continue print(g....
17,987
[ 0.008236723020672798, 0.02256123349070549, 0.0009762572008185089, -0.03735923767089844, -0.024184642359614372, -0.04703725501894951, 0.002799341222271323, -0.01559930294752121, -0.023705944418907166, 0.026203498244285583, -0.026598945260047913, -0.044955961406230927, 0.03752573952078819, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "files", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def filter_files(files): for F in files: filename = F['name'] ignore = any(regex.match(filename) for regex in ignores) if not ignore: relpath = '{}{}'.format(config['BUNDLE_DIR_NAME'], filename) F['url'] = staticfiles_storage.url(relpath) yield F
17,988
[ 0.03273067623376846, -0.022690286859869957, 0.014725076965987682, -0.018515076488256454, -0.0012084504123777151, -0.011848405934870243, 0.020565403625369072, 0.011456979438662529, 0.005980120971798897, 0.008748062886297703, -0.009214046411216259, 0.03330228477716446, -0.04120536148548126, ...
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": "H0", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, H0, Om0, Ode0, Tcmb0=2.725, Neff=3.04, m_nu=u.Quantity(0.0, u.eV), Ob0=None, name=None): # all densities are in units of the critical density self._Om0 = float(Om0) if self._Om0 < 0.0: raise ValueError("Matter density can not be negative") ...
17,989
[ -0.009295843541622162, 0.0026184855960309505, 0.03823838755488396, -0.008381498046219349, -0.04506080970168114, -0.0498904287815094, 0.006482473574578762, -0.02733657881617546, 0.029188713058829308, 0.00565897673368454, 0.018427573144435883, -0.013949626125395298, 0.01352762058377266, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bundle_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar...
def get_bundle(bundle_name): assets = get_assets() if settings.DEBUG: # poll when debugging and block request until bundle is compiled # TODO: support timeouts while assets['status'] == 'compiling': time.sleep(config['POLL_INTERVAL']) assets = get_assets() i...
17,990
[ -0.001013672212138772, -0.007382886949926615, -0.003520687110722065, 0.009599615819752216, -0.023508504033088684, -0.03189109265804291, 0.022365987300872803, -0.022837895900011063, -0.00676816375926137, 0.06591819226741791, -0.01994435116648674, 0.024092180654406548, -0.020999936386942863, ...
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": "H0", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, H0, Om0, w0=-1., Tcmb0=2.725, Neff=3.04, m_nu=u.Quantity(0.0, u.eV), Ob0=None, name=None): FLRW.__init__(self, H0, Om0, 0.0, Tcmb0, Neff, m_nu, name=name, Ob0=Ob0) self._w0 = float(w0) # Do some twiddling after the fact to get flatness ...
17,991
[ -0.001597233465872705, -0.0050577749498188496, -0.006982304155826569, 0.007924161851406097, -0.02090923860669136, -0.011044849641621113, 0.02697480097413063, -0.02903432957828045, -0.0008492415654473007, 0.062237948179244995, -0.01319856382906437, 0.017819944769144058, -0.010843920521438122,...
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": "H0", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, H0, Om0, Tcmb0=2.725, Neff=3.04, m_nu=u.Quantity(0.0, u.eV), Ob0=None, name=None): FLRW.__init__(self, H0, Om0, 0.0, Tcmb0, Neff, m_nu, name=name, Ob0=Ob0) # Do some twiddling after the fact to get flatness self._Ode0 = 1.0 - self._Om0 -...
17,992
[ 0.0008259718306362629, -0.002749107079580426, -0.005352545529603958, 0.01077947486191988, -0.020815109834074974, -0.0271749384701252, 0.029803171753883362, -0.03292729705572128, -0.0009855874814093113, 0.06644967198371887, -0.019091881811618805, 0.011052216403186321, -0.013761032372713089, ...
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": "H0", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, H0, Om0, w0=-1., wa=0., Tcmb0=2.725, Neff=3.04, m_nu=u.Quantity(0.0, u.eV), Ob0=None, name=None): FLRW.__init__(self, H0, Om0, 0.0, Tcmb0, Neff, m_nu, name=name, Ob0=Ob0) # Do some twiddling after the fact to get flatness self._Ode0 = 1....
17,993
[ 0.040231190621852875, -0.008189409971237183, 0.01655062474310398, -0.045643072575330734, -0.04255056753754616, -0.005447675473988056, 0.0049394164234399796, -0.04724659398198128, 0.03252856433391571, 0.03221358731389046, -0.010974095202982426, -0.02030171826481819, -0.010866716504096985, -...
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 __repr__(self): retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\ "Ode0={3:.3g}, w0={4:.3g}, wa={5:.3g}, Tcmb0={6:.4g}, "\ "Neff={7:.3g}, m_nu={8}, Ob0={9:s})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, self._w0, self...
17,994
[ 0.021266866475343704, 0.001060985610820353, 0.0063010756857693195, 0.015902994200587273, -0.027986442670226097, -0.02890596352517605, 0.024237625300884247, -0.018791234120726585, -0.006324653048068285, 0.056585896760225296, -0.01719975471496582, 0.020394500344991684, -0.012720038183033466, ...
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": "H0", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, H0, Om0, Ode0, wp=-1., wa=0., zp=0, Tcmb0=2.725, Neff=3.04, m_nu=u.Quantity(0.0, u.eV), Ob0=None, name=None): FLRW.__init__(self, H0, Om0, Ode0, Tcmb0, Neff, m_nu, name=name, Ob0=Ob0) self._wp = float(wp) self._wa = floa...
17,995
[ 0.04667060822248459, -0.0008184014586731791, 0.014803650788962841, -0.03867490217089653, -0.044497862458229065, -0.006054722238332033, -0.00017291447147727013, -0.04635193943977356, 0.030997859314084053, 0.027883589267730713, -0.00700348848477006, -0.014521193690598011, -0.013065453618764877...
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 __repr__(self): retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, wp={4:.3g}, "\ "wa={5:.3g}, zp={6:.3g}, Tcmb0={7:.4g}, Neff={8:.3g}, "\ "m_nu={9}, Ob0={10:s})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, s...
17,996
[ 0.001659394009038806, 0.030430572107434273, 0.005140299443155527, -0.012189099565148354, -0.0009127326193265617, -0.007038256153464317, -0.010069714859127998, -0.03968838229775429, 0.00849335640668869, 0.029713565483689308, -0.017925146967172623, -0.028279554098844528, -0.013032635673880577,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null...
def validate(cls, value): if value is None: value = 'WMAP9' if isinstance(value, six.string_types): return cls.get_cosmology_from_string(value) elif isinstance(value, Cosmology): return value else: raise TypeError("default_cosmology must be...
17,997
[ 0.005148032214492559, -0.0017358949407935143, -0.006114406511187553, 0.007886093109846115, -0.02846628986299038, -0.02930142916738987, 0.02260839007794857, -0.003427050309255719, -0.01148911938071251, 0.06413863599300385, -0.012634451501071453, 0.03013656660914421, -0.026533542200922966, -...
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": "H0", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, H0, Om0, Ode0, w0=-1., wz=0., Tcmb0=2.725, Neff=3.04, m_nu=u.Quantity(0.0, u.eV), Ob0=None, name=None): FLRW.__init__(self, H0, Om0, Ode0, Tcmb0, Neff, m_nu, name=name, Ob0=Ob0) self._w0 = float(w0) self._wz = float(wz)
17,998
[ 0.026343854144215584, 0.020927246659994125, 0.013462751172482967, 0.04645921662449837, 0.04738016054034233, 0.04071543365716934, -0.01655276119709015, 0.03562600165605545, 0.0006729103624820709, -0.02106054127216339, 0.01743735373020172, -0.014674520120024681, 0.035601768642663956, 0.00559...
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": "request", "annotation": null, "type_comment": null}}, {"_type": "...
def _can_access(self, request, member): # TODO(dcramer): ideally org owners/admins could perform these actions if request.user.is_superuser: return True if not request.user.is_authenticated(): return False if request.user.id == member.user_id: return...
17,999
[ 0.012498332187533379, -0.018458280712366104, 0.0019315604586154222, 0.03567705675959587, -0.014140675775706768, 0.029541512951254845, -0.026979871094226837, 0.06974276155233383, -0.03606956824660301, -0.006486738100647926, 0.011888910084962845, -0.04635745286941528, 0.026174193248152733, -...
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": "request", "annotation": null, "type_comment": null}}, {"_type": "...
def _get_member(self, request, organization, member_id): if member_id == 'me': queryset = OrganizationMember.objects.filter( organization=organization, user__id=request.user.id, ) else: queryset = OrganizationMember.objects.filter( ...
18,000
[ 0.02806142531335354, 0.004339664708822966, 0.0029452901799231768, -0.054731376469135284, -0.002452475717291236, 0.04051513224840164, 0.0007971996092237532, 0.019422680139541626, 0.04517657682299614, 0.00776907242834568, 0.033766474574804306, -0.04897994175553322, -0.005734039004892111, 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": "options", "annotation": null, "type_comment": null}}, "...
def execute(self, *args, **options): ccache_name = getattr(context, 'ccache_name', None) if ccache_name is None: logger.debug('session logout command: no ccache_name found') else: delattr(context, 'ccache_name') setattr(context, 'logout_cookie', 'MagBearerToken='...