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
401
[ 0.021414389833807945, 0.04178808256983757, -0.02523028664290905, -0.043922848999500275, 0.029353057965636253, 0.009066091850399971, -0.03506356105208397, 0.018585823476314545, 0.009879972785711288, 0.03850587457418442, 0.0063876258209347725, -0.04101422801613808, 0.016597820445895195, -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 Log: @decorators.require_login def GET(self): i = web.input(_unicode=False,) # Get queries. self.event = web.safestr(i.get('event', 'all')) self.domain = web.safestr(i.get('domain', 'all')) self.admin = web.safestr(i.get('admin', 'all')) self.cur_page = web...
402
[ 0.008934469893574715, 0.03550480306148529, 0.01445053331553936, -0.019202634692192078, 0.027217760682106018, -0.02755442075431347, -0.04873817786574364, 0.03037719614803791, 0.0063350568525493145, 0.04570822790265083, 0.017143823206424713, -0.044335685670375824, -0.0035155194345861673, -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 GET(self): i = web.input(_unicode=False,) # Get queries. self.event = web.safestr(i.get('event', 'all')) self.domain = web.safestr(i.get('domain', 'all')) self.admin = web.safestr(i.get('admin', 'all')) self.cur_page = web.safestr(i.get('page', '1')) if not ...
403
[ 0.025328345596790314, 0.03802786022424698, -0.015008517540991306, -0.0016301440773531795, 0.0035135718062520027, -0.01767093874514103, 0.0002727951214183122, 0.037862930446863174, 0.040572475641965866, 0.02850911393761635, 0.05178763344883919, -0.05909162014722824, -0.02742529660463333, -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 POST(self): i = web.input(_unicode=False, id=[],) action = web.safestr(i.get('action', 'delete')) deleteAll = False if action == 'deleteAll': deleteAll = True logLib = loglib.Log() result = logLib.delete(data=i, deleteAll=deleteAll,) if result[0...
404
[ 0.022498758509755135, 0.006689995527267456, 0.06852741539478302, -0.020523440092802048, 0.011802220717072487, 0.0017439333023503423, 0.016224946826696396, 0.0164982620626688, 0.026387279853224754, 0.012858208268880844, 0.018274806439876556, -0.03322014585137367, 0.01473414059728384, 0.0077...
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 validate_pl_balances(self): income_bal = webnotes.conn.sql(""" select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) from `tabGL Entry` t1, tabAccount t2 where t1.account = t2.name and t1.posting_date between %s and %s and t2.debit_or_credit = 'Credit' and t2.is_pl_account = 'Yes' and t2.docs...
405
[ -0.007503320928663015, 0.04247734323143959, 0.020037706941366196, -0.03098703734576702, -0.006021049804985523, 0.0023248393554240465, 0.034644026309251785, -0.027957579120993614, -0.0077738082036376, 0.016099410131573677, 0.028974611312150955, -0.0195616502314806, 0.01750594563782215, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "raw", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def parse_manifest(raw): manifest = {} for line in raw.splitlines(): fixture, filename = line.split('/', 1) if fixture not in manifest: manifest[fixture] = [] manifest[fixture].append(filename) return manifest
406
[ -0.010502264834940434, 0.00777009641751647, 0.03305976092815399, 0.005801250692456961, 0.017382696270942688, 0.01774066686630249, -0.01268694642931223, 0.008270204067230225, 0.0010271951323375106, 0.0084491902962327, -0.00910196267068386, 0.013308132998645306, 0.020004313439130783, -0.0073...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "target", "annotation": null, "type_comment": null}}], "kwarg": nu...
def ascend_find_exe(path, target): if not os.path.isdir(path): path = os.path.dirname(path) while True: test = os.path.join(path, target) if os.access(test, os.X_OK): return test parent = os.path.dirname(path) if os.path.samefile(parent, path): ret...
407
[ -0.005084737669676542, -0.008120770566165447, 0.06684208661317825, -0.038555145263671875, -0.010268207639455795, 0.050896741449832916, 0.004850247409194708, -0.034556470811367035, -0.027669858187437057, -0.0032026441767811775, 0.02784264087677002, -0.0021320106461644173, 0.040579166263341904...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "One or more fixtur...
class CompilerTest(unittest.TestCase): MSG = " ".join([ "One or more fixtures are out of sync with the thrift compiler.", "To sync them, build thrift and then run:", "`thrift/compiler/test/build_fixtures <build-dir>`, where", "<build-dir> is a path where the program `thrift/compiler...
408
[ 0.007794774137437344, 0.0407118946313858, 0.04102789983153343, -0.04576796293258667, -0.010296475142240524, 0.009197043254971504, -0.0020359240006655455, -0.023594992235302925, -0.013719855807721615, 0.019052429124712944, 0.0436876006424427, 0.009776384569704533, 0.05898747965693474, -0.01...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def runTest(self, name): fixtureChildDir = os.path.join(fixtureDir, name) cmdc = read_resource(os.path.join(fixtureChildDir, 'cmd')) write_file(os.path.join(self.tmp, "cmd"), cmdc) for fn in manifest[name]: if fn.startswith('src/'): out = os.path.join(self.tmp...
409
[ 0.03746167570352554, 0.0276559516787529, 0.06764046102762222, -0.02003985457122326, -0.007265042047947645, -0.00003286487117293291, 0.006384430918842554, -0.036842867732048035, -0.022360384464263916, -0.003418318461626768, -0.03353462740778923, -0.01529169362038374, -0.04562518000602722, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 0.5}}, "right": {"_type": "Name", "_fields": {"id": "cm", "...
class band_page_footer(ReportBand): height = 0.5*cm elements = [ Label(text="%s" % request.utcnow.date(), top=0.1*cm, left=0), SystemField(expression="Page # %(page_number)d of %(page_count)d", top=0.1*cm, width=BAND_WIDTH, style={"alignment": ...
410
[ 0.03820158541202545, 0.0318467803299427, 0.060879986733198166, -0.02956681326031685, -0.015595948323607445, 0.007246173452585936, -0.004414405208081007, -0.04142749682068825, -0.0220235176384449, -0.01646912842988968, -0.02539495751261711, -0.01766974851489067, -0.04411979764699936, -0.015...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 1.3}}, "right": {"_type": "Name", "_fields": {"id": "cm", "...
class band_page_header(ReportBand): height = 1.3*cm elements = [ SystemField(expression="%(report_title)s", top=0.1*cm, left=0, width=BAND_WIDTH, style={"fontName": "Helvetica-Bold", "fontSize": 14, "alignment": TA_CENTER} ...
411
[ 0.03053252212703228, 0.031937986612319946, 0.05825411155819893, -0.02895743027329445, -0.012649187818169594, 0.008081424981355667, -0.005064521450549364, -0.041994333267211914, -0.01835586130619049, -0.0165869127959013, -0.02265707030892372, -0.017253298312425613, -0.04369058459997177, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 1.3}}, "right": {"_type": "Name", "_fields": {"id": "cm", "...
class band_page_header(ReportBand): height = 1.3*cm elements = [ SystemField(expression="%(report_title)s", top=0.1*cm, left=0, width=BAND_WIDTH, style={"fontName": "Helvetica-Bold", "fontSize": 14, "alignment": TA_CENTER} ...
412
[ 0.029087452217936516, 0.019170157611370087, 0.08189766854047775, -0.03341858088970184, -0.00736414548009634, 0.0068842764012515545, -0.015712637454271317, -0.030736234039068222, -0.011252316646277905, -0.01048329472541809, -0.02043750323355198, -0.026109803467988968, -0.027807801961898804, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 0.5}}, "right": {"_type": "Name", "_fields": {"id": "cm", "...
class band_detail(ReportBand): height = 0.5*cm auto_expand_height = True elements = ( ObjectValue(attribute_name="code", left=0.2*cm, width=1.8*cm), ObjectValue(attribute_name="description", left=2*cm, width=8*cm), ObjectVal...
413
[ 0.028140679001808167, 0.018760452046990395, 0.07968306541442871, -0.036494940519332886, -0.008909993804991245, 0.0068275341764092445, -0.013349723070859909, -0.02794525772333145, -0.010332905687391758, -0.013972628861665726, -0.020641382783651352, -0.0234383512288332, -0.02833610028028488, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 0.5}}, "right": {"_type": "Name", "_fields": {"id": "cm", "...
class band_detail(ReportBand): height = 0.5*cm auto_expand_height = True elements = ( ObjectValue(attribute_name="code", left=0.2*cm, width=2.8*cm), ObjectValue(attribute_name="description", left=3*cm, width=10*cm), ObjectVa...
414
[ 0.03746167570352554, 0.0276559516787529, 0.06764046102762222, -0.02003985457122326, -0.007265042047947645, -0.00003286487117293291, 0.006384430918842554, -0.036842867732048035, -0.022360384464263916, -0.003418318461626768, -0.03353462740778923, -0.01529169362038374, -0.04562518000602722, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 0.5}}, "right": {"_type": "Name", "_fields": {"id": "cm", "...
class band_page_footer(ReportBand): height = 0.5*cm elements = [ Label(text="%s" % request.utcnow.date(), top=0.1*cm, left=0), SystemField(expression="Page # %(page_number)d of %(page_count)d", top=0.1*cm, width=BAND_WIDTH, style={"alignment": ...
415
[ 0.000015202199392660987, -0.039111681282520294, -0.010532555170357227, -0.023587750270962715, 0.005212374962866306, -0.062009476125240326, 0.035122890025377274, -0.019351009279489517, -0.006603060755878687, 0.014144024811685085, -0.007729623466730118, -0.022768430411815643, -0.00352253066375...
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": "api_key", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, api_key='', version=1.0): if not api_key: self.api_key = API_KEY else: self.api_key = api_key if isinstance(version, float): version = str(version) # Eliminate any weird float behavior. self.version = version BASE_URL = 'htt...
416
[ -0.002130167791619897, 0.020410608500242233, -0.09966964274644852, -0.017886366695165634, 0.03941284120082855, 0.004376797471195459, -0.009566118940711021, 0.014105420559644699, 0.017853865399956703, 0.008141493424773216, -0.00887818168848753, -0.01961975172162056, 0.01797303557395935, -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": "num", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def wrong_type(self, num, value, expected): if type(value) == types.InstanceType: got = "%s.%s instance" % ( value.__class__.__module__, value.__class__.__name__) else: got = type(value).__name__ raise Errors.PlexTypeError("Invalid type for argumen...
417
[ 0.03843420743942261, 0.0353342667222023, 0.045642197132110596, -0.0047097657807171345, -0.005459547508507967, 0.024610495194792747, 0.0026919697411358356, -0.01941872574388981, -0.014352971687912941, 0.10635564476251602, 0.008102687075734138, -0.01829720288515091, 0.012487967498600483, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "re_list", "annotation": null, "type_com...
def __init__(self, *re_list): nullable = 1 for i in xrange(len(re_list)): re = re_list[i] self.check_re(i, re) nullable = nullable and re.nullable self.re_list = re_list self.nullable = nullable i = len(re_list) match_nl = 0 whi...
418
[ 0.0437343493103981, 0.036632832139730453, 0.017891325056552887, 0.003875828580930829, -0.03543257340788841, 0.010508496314287186, 0.030756574124097824, -0.026155591011047363, -0.0025521081406623125, 0.056862156838178635, 0.03895832970738411, -0.007657886948436499, -0.02840607240796089, 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": "m", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def build_machine(self, m, initial_state, final_state, match_bol, nocase): if match_bol: initial_state = self.build_opt(m, initial_state, BOL) initial_state.add_transition(self.range, final_state) if nocase: if self.uppercase_range: initial_state.add_trans...
419
[ 0.04076595976948738, 0.04297984018921852, 0.021757112815976143, -0.008664675056934357, -0.061886899173259735, 0.02220243401825428, 0.021222729235887527, -0.020217575132846832, -0.0033844399731606245, 0.07883454859256744, 0.03613462299108505, -0.020955536514520645, -0.009192698635160923, 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": "m", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def build_machine(self, m, initial_state, final_state, match_bol, nocase): re_list = self.re_list if len(re_list) == 0: initial_state.link_to(final_state) else: s1 = initial_state n = len(re_list) for i in xrange(n): if i < n - 1: ...
420
[ 0.03285418078303337, 0.010741242207586765, 0.04183369129896164, 0.001760255778208375, -0.023179400712251663, 0.001879570190794766, -0.0020253988914191723, -0.017570151016116142, -0.011795923113822937, 0.0971955806016922, 0.0097572673112154, -0.012667949311435223, 0.01364603266119957, 0.005...
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": "re_list", "annotation": null, "type_com...
def __init__(self, *re_list): self.re_list = re_list nullable = 0 match_nl = 0 nullable_res = [] non_nullable_res = [] i = 1 for re in re_list: self.check_re(i, re) if re.nullable: nullable_res.append(re) nul...
421
[ -0.013946376740932465, 0.014758323319256306, 0.012871741317212582, -0.002913455478847027, 0.01979716867208481, 0.012991145253181458, 0.015355342999100685, 0.021027028560638428, 0.029683811590075493, 0.0508183054625988, 0.03742118552327156, -0.0453496053814888, -0.029612168669700623, 0.0208...
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 moduleClass(Module): def __init__(self): Module.__init__(self) self.priority = 107.5 self.sidebarTitle = _("Provide Certificate") self.title = _("Provide Certificate") def needsNetwork(self): return True def apply(self, interface, testing=False): if te...
422
[ 0.05092991888523102, 0.06816694140434265, 0.02986534684896469, 0.002008164767175913, -0.01527116447687149, -0.0030366573482751846, 0.019137777388095856, -0.005175011232495308, -0.013917199335992336, 0.06113673374056816, 0.047284629195928574, -0.0327034667134285, -0.02088230848312378, -0.00...
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": "m", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def build_machine(self, m, initial_state, final_state, match_bol, nocase): for re in self.nullable_res: re.build_machine(m, initial_state, final_state, match_bol, nocase) if self.non_nullable_res: if match_bol: initial_state = self.build_opt(m, initial_state, BOL)...
423
[ 0.009641092270612717, 0.015090906992554665, 0.01081880647689104, 0.024016134440898895, -0.008578839711844921, 0.011263336054980755, 0.0040613822638988495, 0.01658036932349205, 0.010137579403817654, 0.081654854118824, 0.03221394866704941, -0.036439865827560425, -0.030666755512356758, -0.010...
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": "interface", "annotation": null, "type_comment": null}}, {"_type":...
def apply(self, interface, testing=False): if testing: return RESULT_SUCCESS status = self.provideCertificatePage.provideCertificatePageApply() if status == 0: # cert was installed return RESULT_SUCCESS elif status == 1: # the user doesn't want to provide a cert ...
424
[ 0.02548707276582718, -0.01926487684249878, 0.042717769742012024, 0.016524717211723328, 0.015950359404087067, 0.06030743941664696, 0.004941859282553196, 0.007083730772137642, -0.013868317939341068, 0.013736694119870663, 0.029699020087718964, 0.012151231057941914, -0.02613322250545025, 0.060...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Return", "_fields": {"val...
def _should_support_sha2(): if _backend == 'mac': return False if _backend == 'winlegacy': return False if _backend == 'win' and _win_version_pair() < (6, 2): return False if openssl_098: return False return True
425
[ -0.03583263233304024, -0.046879690140485764, 0.024564635008573532, -0.002688953885808587, 0.005573742091655731, -0.05471305549144745, -0.008526318706572056, 0.03818264231085777, 0.009284548461437225, 0.01109727006405592, -0.011539151892066002, -0.026994988322257996, -0.009118842892348766, ...
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": "environ", "annotation"...
class WSGIContainerTest(AsyncHTTPTestCase, LogTrapTestCase): def wsgi_app(self, environ, start_response): status = "200 OK" response_headers = [("Content-Type", "text/plain")] start_response(status, response_headers) return [b("Hello world!")] def get_app(self): return W...
426
[ -0.023104721680283546, -0.025654666125774384, 0.04807201027870178, -0.03514489904046059, 0.0029074919875711203, -0.016674423590302467, -0.024257740005850792, 0.032750166952610016, -0.0016976537881419063, 0.041641715914011, 0.010249671526253223, -0.031708013266325, -0.024102525785565376, -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 WSGIApplicationTest(AsyncHTTPTestCase, LogTrapTestCase): def get_app(self): class HelloHandler(RequestHandler): def get(self): self.write("Hello world!") class PathQuotingHandler(RequestHandler): def get(self, path): self.write(path) ...
427
[ -0.023623939603567123, -0.02078213542699814, -0.00730089470744133, -0.06085618957877159, 0.05535741522908211, 0.007710992358624935, -0.027493875473737717, -0.012996054254472256, 0.0481027290225029, 0.0027219513431191444, 0.020978519693017006, -0.03955421224236488, -0.001914752065204084, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_types(self): headers = {"Cookie": "foo=bar"} response = self.fetch("/typecheck?foo=bar", headers=headers) data = json_decode(response.body) self.assertEqual(data, {}) response = self.fetch("/typecheck", method="POST", body="foo=bar", headers=headers) data = json...
428
[ 0.007481359876692295, -0.003948649391531944, 0.04849296435713768, 0.019188661128282547, -0.0014308309182524681, -0.038443874567747116, -0.06091568246483803, 0.03804457187652588, -0.002925439039245248, 0.03145609423518181, 0.01724761165678501, -0.0009497278369963169, -0.012589093297719955, ...
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 get_app(self): class HelloHandler(RequestHandler): def get(self): self.write("Hello world!") class PathQuotingHandler(RequestHandler): def get(self, path): self.write(path) # It would be better to run the wsgiref server implementation...
429
[ 0.05349612236022949, -0.0075846887193620205, -0.01490918267518282, -0.03382537141442299, 0.02607155404984951, -0.023846885189414024, -0.03772829845547676, 0.017797349020838737, 0.030052540823817253, 0.03827470541000366, 0.041969478130340576, -0.021583188325166702, 0.04587240517139435, 0.04...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "req", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "service", "annotation": null, "type_comment": null}}], "kwarg": nu...
def config_flow_save(req, service): if not req.user: return HttpResponse(status=403) conns = User.GetConnectionRecordsByUser(req.user) if service not in [x.Service.ID for x in conns]: return HttpResponse(status=404) sourceSvc = [x for x in conns if x.Service.ID == service][0] # the ...
430
[ 0.054436199367046356, -0.020775793120265007, -0.007483683992177248, -0.021487293764948845, 0.05314256623387337, 0.007748879492282867, -0.007373725064098835, 0.02869284525513649, 0.029908863827586174, -0.018292011693120003, 0.028873953968286514, -0.020335957407951355, 0.05779965594410896, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "req", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "service", "annotation": null, "type_comment": null}}], "kwarg": nu...
def config_save(req, service): if not req.user: return HttpResponse(status=403) conn = User.GetConnectionRecord(req.user, service) if not conn: return HttpResponse(status=404) conn.SetConfiguration(json.loads(req.POST["config"])) Sync.SetNextSyncIsExhaustive(req.user, True) # e.g. i...
431
[ 0.031161654740571976, -0.012752308510243893, -0.02202889323234558, -0.002134873066097498, 0.03677075356245041, 0.002702674362808466, 0.005033805966377258, 0.06702152639627457, 0.006543947849422693, 0.0007438347092829645, -0.006771667394787073, -0.006172404624521732, 0.020830368623137474, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "req", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def dropbox(req): if not req.user: return HttpResponse(status=403) conn = User.GetConnectionRecord(req.user, "dropbox") if req.method == "POST": form = DropboxConfigForm(req.POST) if form.is_valid(): conn.SetConfiguration({"SyncRoot": form.cleaned_data['path'], "UploadUnt...
432
[ -0.03291591629385948, -0.012101083062589169, 0.04874367266893387, -0.03507314622402191, 0.022784212604165077, -0.019657444208860397, -0.013888674788177013, -0.019633205607533455, -0.018772738054394722, 0.03277048468589783, -0.005477906670421362, -0.016954848542809486, 0.031267695128917694, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "urls", "value": {"_type": "Name", "_fields": {"id": "TestSelect", "ctx": {"_type": "Load", "_fields": {}}}}}},...
class Test(VisualTest): urls = TestSelect.urls def test_test_default_usecase(self): self.driver.get('%s%s' % (self.live_server_url, TestSelect.test_default_usecase.url)) self.assertScreenshot('form', 'select_default_usecase', threshold=1) def test_missing_value_error(self): self.dr...
433
[ 0.0264960378408432, -0.012186438776552677, 0.044027622789144516, -0.02771282009780407, -0.02218763902783394, 0.005459996405988932, -0.013111441396176815, 0.008182235062122345, -0.0073503535240888596, 0.020648036152124405, -0.006586761213839054, -0.037993382662534714, 0.003094722284004092, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class XPlodeAIMLTests(unittest.TestCase): @classmethod def setUpClass(cls): XPlodeAIMLTests.test_client = BasicTestClient() def test_explode(self): response = XPlodeAIMLTests.test_client.bot.ask_question("test", "MAKE EXPLODE") self.assertIsNotNone(response) self.assertEqu...
434
[ 0.026154696941375732, -0.006666050758212805, 0.042458921670913696, -0.012355546467006207, -0.02014675922691822, -0.03742754086852074, -0.012068948708474636, -0.014966770075261593, -0.02889329567551613, 0.0044502257369458675, -0.009542643092572689, -0.05778659135103226, 0.0429471991956234, ...
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 BasicTestClient(TestClient): def __init__(self): TestClient.__init__(self) def load_configuration(self, arguments): super(BasicTestClient, self).load_configuration(arguments) self.configuration.brain_configuration._aiml_files = BrainFileConfiguration(os.path.dirname(__file__), "....
435
[ -0.010041383095085621, -0.011330700479447842, 0.017045220360159874, -0.0066760447807610035, 0.024737421423196793, -0.012794842012226582, -0.03079066053032875, 0.023666633293032646, 0.027971643954515457, -0.011276069097220898, 0.04143299534916878, -0.020421484485268593, -0.0343308225274086, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "req", "annotation": {"_type": "Name", "_fields": {"id": "HTTPRequest", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": null,...
def _dump_http_request(req: HTTPRequest) -> http_pb2.HTTPRequest: preq = http_pb2.HTTPRequest() _move_attrs(req, preq, ['first_line_format', 'method', 'scheme', 'host', 'port', 'path', 'http_version', 'content', 'timestamp_start', 'timestamp_end', 'is_replay']) if req.headers: ...
436
[ -0.029769495129585266, -0.013071718625724316, 0.01585841178894043, 0.0023837978951632977, 0.01985379122197628, -0.003707197494804859, -0.0011044651037082076, 0.018286975100636482, 0.04581816494464874, -0.01799599640071392, 0.036238204687833786, -0.03538764640688896, -0.011986139230430126, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "res", "annotation": {"_type": "Name", "_fields": {"id": "HTTPResponse", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": null...
def _dump_http_response(res: HTTPResponse) -> http_pb2.HTTPResponse: pres = http_pb2.HTTPResponse() _move_attrs(res, pres, ['http_version', 'status_code', 'reason', 'content', 'timestamp_start', 'timestamp_end', 'is_replay']) if res.headers: for h in res.headers.fields: ...
437
[ 0.017929602414369583, -0.04988335072994232, 0.0576498843729496, 0.013924289494752884, -0.004959487821906805, 0.03630300611257553, -0.0016892215935513377, 0.008876040577888489, 0.029379695653915405, -0.04213900491595268, 0.04466867446899414, -0.006623745430260897, 0.024631014093756676, 0.02...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cc", "annotation": {"_type": "Name", "_fields": {"id": "ClientConnection", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": n...
def _dump_http_client_conn(cc: ClientConnection) -> http_pb2.ClientConnection: pcc = http_pb2.ClientConnection() _move_attrs(cc, pcc, ['id', 'tls_established', 'timestamp_start', 'timestamp_tls_setup', 'timestamp_end', 'sni', 'cipher_name', 'alpn_proto_negotiated', 'tls_version']) ...
438
[ 0.02397223189473152, -0.03442889824509621, 0.052413493394851685, -0.016856491565704346, 0.015565679408609867, 0.020186571404337883, -0.005027660168707371, -0.013125067576766014, 0.006052717100828886, -0.04950645565986633, 0.03484109044075012, -0.016541924327611923, 0.010255993343889713, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sc", "annotation": {"_type": "Name", "_fields": {"id": "ServerConnection", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": n...
def _dump_http_server_conn(sc: ServerConnection) -> http_pb2.ServerConnection: psc = http_pb2.ServerConnection() _move_attrs(sc, psc, ['id', 'tls_established', 'sni', 'alpn_proto_negotiated', 'tls_version', 'timestamp_start', 'timestamp_tcp_setup', 'timestamp_tls_setup', 'timestamp_end...
439
[ 0.032611504197120667, -0.0424148254096508, 0.01669214479625225, -0.0007148256408981979, -0.010647865943610668, 0.038197632879018784, -0.0030745782423764467, -0.026252591982483864, -0.009764683432877064, -0.003447170602157712, 0.03958864510059357, -0.008749024011194706, 0.044203270226716995, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "o", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "ClientConnection", "value": {"_type": "Name", "_fi...
def _load_http_client_conn(o: http_pb2.ClientConnection) -> ClientConnection: d: dict = {} _move_attrs(o, d, ['id', 'tls_established', 'sni', 'cipher_name', 'alpn_proto_negotiated', 'tls_version', 'timestamp_start', 'timestamp_tcp_setup', 'timestamp_tls_setup', 'timestamp_end']) for c...
440
[ 0.03653556853532791, -0.02918521873652935, 0.0033968351781368256, -0.02559651806950569, 0.0011586261680349708, 0.026288315653800964, 0.005772187374532223, -0.04617749899625778, -0.028752844780683517, -0.00634508254006505, 0.03685985133051872, -0.0038724460173398256, 0.039475709199905396, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "o", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "ServerConnection", "value": {"_type": "Name", "_fi...
def _load_http_server_conn(o: http_pb2.ServerConnection) -> ServerConnection: d: dict = {} _move_attrs(o, d, ['id', 'tls_established', 'sni', 'alpn_proto_negotiated', 'tls_version', 'timestamp_start', 'timestamp_tcp_setup', 'timestamp_tls_setup', 'timestamp_end']) for addr in ['addres...
441
[ -0.00847725197672844, -0.014046336524188519, -0.018461572006344795, -0.03991372883319855, 0.021640541031956673, -0.03506285697221756, -0.03843021020293236, 0.0010684870649129152, 0.02578497678041458, 0.013540055602788925, 0.03833601996302605, -0.004730189219117165, 0.01487051323056221, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "hf", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "HTTPFlow", "value": {"_type": "Name", "_fields": ...
def load_http(hf: http_pb2.HTTPFlow) -> HTTPFlow: parts = {} for p in ['request', 'response', 'client_conn', 'server_conn', 'error']: if hf.HasField(p): parts[p] = eval(f"_load_http_{p}")(getattr(hf, p)) else: parts[p] = None _move_attrs(hf, parts, ['intercepted', 'ma...
442
[ 0.01065195444971323, 0.015555583871901035, -0.013240895234048367, -0.016904905438423157, -0.017639899626374245, -0.011112698353827, -0.01524842157959938, -0.043002743273973465, -0.009055807255208492, 0.04480183869600296, -0.022280247882008553, -0.028675807639956474, 0.013504177331924438, -...
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": "option_strings", "annotation": null, "type_comment": null}}, {"_t...
def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None): if nargs == 0: raise ValueError('nargs for append actions must be > 0; if arg ' 'strings are not supplying t...
443
[ -0.001644681440666318, 0.05720801278948784, 0.008271096274256706, -0.025532303377985954, -0.024280143901705742, -0.029973553493618965, 0.011435733176767826, -0.009753144346177578, -0.02351710945367813, 0.051025476306676865, -0.014840039424598217, -0.006006449926644564, -0.008095012046396732,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def _gitinfo(): basedir = os.path.join(os.path.dirname(__file__), '..', '..', '..') repo_path = os.path.join(basedir, '.git') result = _git_repo_info(repo_path) submodules = os.path.join(basedir, '.gitmodules') if not os.path.exists(submodules): return result with open(submodules) as f...
444
[ 0.017205722630023956, 0.028683122247457504, -0.027666136622428894, -0.01192362792789936, 0.003665815107524395, 0.007497668731957674, 0.015472697094082832, 0.02077554725110531, 0.053547363728284836, 0.03870768845081329, 0.050766222178936005, -0.011674569919705391, 0.004265109542757273, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def inner(value): if pathsep: return [unfrackpath(x) for x in value.split(os.pathsep) if x] if value == '-': return value return unfrackpath(value)
445
[ 0.03784019127488136, -0.02845235913991928, 0.04826309531927109, 0.012625433504581451, -0.0023800565395504236, -0.013094824738800526, -0.003968766890466213, -0.007131143007427454, -0.012950397096574306, 0.012493040412664413, 0.0012667558621615171, -0.021844767034053802, 0.021435555070638657, ...
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 TestPluralize(TestCase): def test_basics(self): eq_(pluralize(0), 's') eq_(pluralize(1), '') eq_(pluralize(59), 's') def test_overide_s(self): eq_(pluralize(59, 'ies'), 'ies')
446
[ 0.03142378851771355, -0.01676112599670887, 0.034212883561849594, -0.01103020180016756, -0.017079878598451614, -0.0005121639696881175, 0.004698294680565596, 0.01142200268805027, 0.03989732265472412, 0.013228273019194603, 0.06954140216112137, 0.015406422317028046, -0.010027456097304821, -0.0...
16
{"_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_test(self): self.M = 2 self.N = self.num_nodes self.name = f"{self.M}_of_{self.N}_multisig" self.log.info(f"Testing {self.name}...") participants = { # Every participant generates an xpub. The most straightforward way is to create a new descriptor wallet. ...
447
[ -0.006997129414230585, -0.014387080445885658, 0.03611500933766365, -0.033193401992321014, -0.013834675773978233, 0.007297883275896311, -0.022943219169974327, -0.010293145664036274, -0.013945156708359718, 0.08337632566690445, 0.02629447542130947, -0.04399598762392998, -0.026269923895597458, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lines", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def get_history(f, lines=0): buffer_size = 1024 f.seek(0, os.SEEK_END) bytes = f.tell() size = lines block = -1 data = [] while size > 0 and bytes > 0: if bytes - buffer_size > 0: # Seek back one whole buffer_size f.seek(f.tell()+block*buffer_size, 0) ...
448
[ 0.004668822046369314, 0.02346569485962391, 0.021009698510169983, -0.040609024465084076, -0.01642598584294319, 0.022468706592917442, 0.020195087417960167, 0.03698582574725151, -0.0033678743056952953, 0.0658012107014656, 0.03683992475271225, 0.027405012398958206, 0.012924369424581528, -0.026...
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 periodical_task(self): if not self.info["sleep"]: deloffline = self.config.get("deloffline") mode = "0,1,4" if deloffline else "0,4" mode_desc = self._("including") if deloffline else self._("excluding") self.log_info( self._( ...
449
[ -0.00561953242868185, 0.014544671401381493, 0.038239262998104095, 0.005718700587749481, -0.03123137727379799, 0.0038113652262836695, -0.02280868962407112, -0.017480051144957542, -0.03659968450665474, -0.012905090115964413, 0.01010193582624197, -0.0058509246446192265, 0.010696944780647755, ...
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": "debug", "annotation": null, "type_comment": null}}], "kwarg": nul...
def RunPostSubstitutionGatherer(self, debug=False): if not self.should_load_: return root = self.GetRoot() defs = getattr(root, 'defines', {}) target_platform = getattr(root, 'target_platform', '') xtb_file = open(self.ToRealPath(self.GetInputPath()), 'rb') try: lang = xtb_reader.P...
450
[ 0.013950326479971409, -0.005711759440600872, -0.004836191423237324, -0.07239596545696259, 0.04284994676709175, -0.028206219896674156, -0.02754807472229004, -0.006299389060586691, -0.01362125389277935, 0.055707283318042755, 0.012293210253119469, -0.03297777101397514, 0.03944169729948044, -0...
11
{"_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": "file_id", "annotation": null, "type_comment": null}}], "kwarg"...
def get_log_lines(request, file_id): history = int(request.GET.get('history', 0)) try: file_record = LogFile.objects.get(id=file_id) except LogFile.DoesNotExist: return HttpResponse(json.dumps([_('error_logfile_notexist')]), content_type='text/html') content =...
451
[ 0.0041479021310806274, 0.026455264538526535, 0.05925402417778969, -0.06540529429912567, -0.0007475083693861961, 0.0005883202538825572, -0.024869389832019806, -0.02070046402513981, -0.002559024142101407, 0.015810685232281685, -0.009587329812347889, -0.03664330393075943, 0.0005954537191428244,...
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": "seq_path", "annotation": null, "type_comment": null}}, {"_type": ...
def __call__(self, seq_path, result_path=None, log_path=None, failure_path=None): # load candidate sequences seq_file = open(seq_path, 'U') candidate_sequences = parse_fasta(seq_file) # load template sequences template_alignment = [] template_alignment_f...
452
[ 0.008668890222907066, 0.04878658428788185, 0.08346214890480042, -0.039563849568367004, 0.009252835996448994, -0.005845480598509312, -0.005430096294730902, -0.025717707350850105, -0.038094956427812576, 0.021720385178923607, 0.014303668402135372, -0.026151150465011597, 0.03233977407217026, -...
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": "seq_path", "annotation": null, "type_comment": null}}, {"_type": ...
def __call__(self, seq_path, result_path=None, log_path=None, failure_path=None, cmbuild_params=None, cmalign_params=None): log_params = [] # load candidate sequences candidate_sequences = dict(parse_fasta(open(seq_path, 'U'))) # load template sequences try: ...
453
[ 0.02262856252491474, -0.0006294626509770751, 0.050695449113845825, -0.031929731369018555, 0.0026622696314007044, 0.0030721863731741905, 0.01333906501531601, -0.005695068743079901, 0.05685732886195183, 0.0224651787430048, 0.010602397844195366, 0.013432427309453487, 0.005578366573899984, -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": "op", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _run(self, op, name, num_iters, benchmark_id): wall_time = self.run_op_benchmark(op=op, iters=num_iters, warmup=True) zero_division_delta = 1e-100 wall_time = wall_time + zero_division_delta self.report_benchmark( name=name, iters=num_iters, wall_time=wall_time, extr...
454
[ 0.024791067466139793, 0.0007692984654568136, -0.02437896654009819, 0.03773968294262886, -0.03498511761426926, 0.0018544498598203063, -0.020930340513586998, -0.026200883090496063, -0.022253399714827538, 0.02557188831269741, -0.0452442392706871, -0.02429221011698246, 0.018501119688153267, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __str__(self): exception_msg = "Message: %s " % repr(self.msg) if self.screen is not None: exception_msg = "%s; Screenshot: available via screen " \ % exception_msg if self.stacktrace is not None: exception_msg = "%s; Stacktrace: %s " \ ...
455
[ 0.04705037176609039, 0.04389280453324318, 0.06163781136274338, -0.027478668838739395, -0.013093468733131886, -0.008924695663154125, 0.02904440462589264, 0.0028770400676876307, -0.0004839918692596257, 0.050286225974559784, 0.03350675478577614, -0.008376688696444035, -0.023694807663559914, 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": "With", "_fields": {"body": [{"_type": "Expr", "_fields": {"val...
def full_validate(): with cd(PROJECT_ROOT): local( 'pep8 --exclude=migrations --ignore=E501,E225 django_facebook open_facebook') local( 'CUSTOM_USER_MODEL=0 python %s test open_facebook django_facebook' % manage_py) local( 'CUSTOM_USER_MODEL=1 ...
456
[ -0.024765262380242348, -0.03474904224276543, -0.03719358518719673, -0.028900422155857086, -0.006745335645973682, -0.03710220009088516, 0.029106037691235542, 0.040848974138498306, -0.048251137137413025, -0.016163675114512444, 0.010869071818888187, 0.006499738898128271, 0.021292641758918762, ...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def download_image(self, context, session, instance, image_id): params = {} params['image_id'] = image_id params['uuid_stack'] = vm_utils._make_uuid_stack() params['sr_path'] = vm_utils.get_sr_path(session) params['torrent_seed_duration'] = CONF.xenserver.torrent_seed_duration ...
457
[ -0.009344884194433689, 0.021851111203432083, 0.019224079325795174, -0.023309335112571716, -0.015528425574302673, 0.03815874084830284, -0.019413314759731293, -0.0034312810748815536, 0.01609613187611103, -0.04768729582428932, 0.043724484741687775, -0.054321661591529846, 0.03809195011854172, ...
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": "opendj_bindir", "annotation": null, "type_comment": null}}, {"_ty...
def get_property(self, opendj_bindir, hostname, port, username, password_method, backend_name): my_command = [ opendj_bindir + '/dsconfig', 'get-backend-prop', '-h', hostname, '--port', str(port), '--bindDN', username, '--backend-name', bac...
458
[ 0.024516474455595016, 0.02743232622742653, 0.00809440203011036, -0.02400328405201435, 0.005910429637879133, 0.05033925175666809, -0.018148256465792656, -0.028132129460573196, 0.03953893855214119, -0.0123398806899786, 0.042828019708395004, -0.04625706002116203, 0.00864841416478157, 0.014695...
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": "module", "annotation":...
class BackendProp(object): def __init__(self, module): self._module = module def get_property(self, opendj_bindir, hostname, port, username, password_method, backend_name): my_command = [ opendj_bindir + '/dsconfig', 'get-backend-prop', '-h', hostname, ...
459
[ 0.03167920559644699, 0.02059055119752884, 0.021561274304986, -0.03354598209261894, 0.024548117071390152, 0.03063381090760231, 0.005992354359477758, -0.03388200327754021, 0.008227819576859474, 0.03778356686234474, 0.02370806783437729, 0.008134480565786362, 0.018910450860857964, 0.0119007034...
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": "data", "annotation": null, "type_comment": null}}, {"_type": "arg...
def validate_data(self, data=None, name=None, value=None): for config_line in data.split('\n'): if config_line: split_line = config_line.split() if split_line[0] == name: if split_line[1] == value: return True return...
460
[ -0.010081084445118904, 0.006065828260034323, 0.008497527800500393, -0.020462775602936745, -0.0047372509725391865, 0.045091111212968826, 0.010349484160542488, -0.014482835307717323, 0.025379855185747147, -0.03270179033279419, 0.05045910179615021, -0.03626613691449165, 0.026002541184425354, ...
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": "opendj_bindir", "annotation": null, "type_comment": null}}, {"_ty...
def set_property(self, opendj_bindir, hostname, port, username, password_method, backend_name,name, value): my_command = [ opendj_bindir + '/dsconfig', 'set-backend-prop', '-h', hostname, '--port', str(port), '--bindDN', username, '--backen...
461
[ 0.029678823426365852, -0.011311797425150871, -0.014331747777760029, -0.0031566291581839323, -0.011292271316051483, 0.015620432794094086, -0.011305288411676884, 0.03506787121295929, -0.04261774942278862, -0.005323964171111584, 0.023847194388508797, -0.026763008907437325, 0.0010771590750664473...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def indicate_rereceive(): count = 0 for row in botslib.query(u'''SELECT idta FROM filereport ORDER BY idta DESC '''): count += 1 botslib.changeq(u'''UPDATE filereport SET retransmit...
462
[ -0.007800744380801916, 0.009476503357291222, 0.002074262360110879, -0.05161570385098457, -0.018462540581822395, 0.06936590373516083, 0.001826109946705401, -0.005109020508825779, 0.03984452039003372, 0.03290793299674988, 0.04918672889471054, -0.04745842143893242, 0.02110171504318714, 0.0266...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): module = AnsibleModule( argument_spec=dict( opendj_bindir=dict(default="/opt/opendj/bin", type="path"), hostname=dict(required=True), port=dict(required=True), username=dict(default="cn=Directory Manager", required=False), password=dict...
463
[ 0.015333365648984909, -0.012667683884501457, 0.04091935232281685, -0.032147664576768875, 0.047435466200113297, -0.017987655475735664, 0.007262274157255888, -0.0017016504425555468, 0.020664729177951813, -0.0033235582523047924, 0.005750012118369341, -0.005382626783102751, -0.004827276337891817...
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 StudentTest(TestCase): def test_user_creation_creates_student(self): u = User.objects.create(username = "test1", email="foo@foo.pl") u.groups.add(Group.objects.get(name = "students")) u.save() qs = Student.objects.filter(user=u) self.assertEqual(len(qs), 1) def te...
464
[ 0.012275262735784054, -0.022924400866031647, -0.005602199584245682, 0.013630366884171963, -0.01928875409066677, 0.010404557920992374, -0.013894777745008469, 0.007575363852083683, -0.0252644345164299, -0.014013762585818768, 0.0236250888556242, 0.006554077845066786, 0.015203610062599182, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def indicate_send(): count = 0 for row in botslib.query(u'''SELECT idta FROM ta WHERE status=%(status)s ORDER BY idta DESC ''', {'status': EXTERNOUT}): count += 1 botslib.changeq(u'...
465
[ 0.0044901869259774685, -0.016579151153564453, 0.04981081560254097, 0.011969756335020065, 0.027289576828479767, -0.01862097904086113, 0.014366152696311474, 0.048783786594867706, 0.007225869223475456, -0.015038611367344856, 0.034723296761512756, -0.0256267711520195, -0.020833978429436684, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setUp(self): self.u = User.objects.create(username = "test1", email="foo@foo.pl") self.u.groups.add(Group.objects.get(name = "students")) self.u.save() self.student = Student.objects.filter(user=self.u).get() self.other_user = User.objects.create(username = "other", email="...
466
[ -0.011669399216771126, -0.03434543311595917, 0.045328397303819656, -0.006882105488330126, 0.007385096978396177, -0.02598986029624939, -0.01271088793873787, -0.013953572139143944, 0.004361230880022049, -0.008716544136404991, 0.016143064945936203, -0.03761192038655281, 0.013089610263705254, ...
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 TestFixture(TestCase): def setUp(self): self.u = User.objects.create(username = "test1", email="foo@foo.pl") self.u.groups.add(Group.objects.get(name = "students")) self.u.save() self.student = Student.objects.filter(user=self.u).get() self.other_user = User.objects....
467
[ -0.014921452850103378, -0.010743916966021061, 0.02774825319647789, -0.007090043742209673, 0.05366074666380882, 0.024217940866947174, 0.029748763889074326, -0.03285543993115425, 0.007690196856856346, -0.022170361131429672, 0.015062665566802025, -0.002869849558919668, -0.03584443777799606, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestGrades(TestFixture): def test_sync_grades_when_activity_is_added_to_group(self): # After setup it shpould be so: self.assertEqual(len(self.student.grades.all()), 1) #Other student shouldn't change self.assertEqual(len(self.other_student.grades.all()), 1) activity...
468
[ 0.0056477622129023075, -0.0165037140250206, 0.02295483462512493, -0.0026571464259177446, 0.04809238016605377, 0.03475359454751015, 0.03970107063651085, -0.0320858396589756, 0.024361468851566315, -0.023439880460500717, 0.02510116621851921, -0.005729613825678825, -0.042878128588199615, -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_sync_grades_when_activity_is_added_to_group(self): # After setup it shpould be so: self.assertEqual(len(self.student.grades.all()), 1) #Other student shouldn't change self.assertEqual(len(self.other_student.grades.all()), 1) activity = GradeableActivity(name = "activit...
469
[ -0.0141016636043787, -0.01431040558964014, 0.02300797775387764, -0.013858131133019924, 0.038199737668037415, 0.020549463108181953, 0.02423723414540291, -0.004815555643290281, 0.01295358408242464, -0.024863459169864655, 0.009810861200094223, 0.01032691728323698, -0.034419190138578415, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_sync_grades_when_student_is_added_to_group(self): u = User.objects.create(username = "test2", email="foo@foo.pl") u.groups.add(Group.objects.get(name = "students")) u.save() student = Student.objects.filter(user=u).get() # Before addition there should be no grades ...
470
[ -0.014421535655856133, 0.015154833905398846, 0.035247210413217545, -0.01995793916285038, 0.026227639988064766, 0.011341681703925133, 0.025298794731497765, -0.03182515129446983, 0.008487929590046406, 0.017354728654026985, 0.026863165199756622, -0.0056005665101110935, -0.047786612063646317, ...
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 TestGrading(TestFixture): def setUp(self): super(TestGrading, self).setUp() self.grade_part_1 = GradePart.objects.create( weight = 1, required = True, activity = self.activity, name = "Zadanie 1" ) self.grade_part_2 = GradePar...
471
[ -0.012175625190138817, -0.00818068441003561, 0.037397414445877075, -0.01413135789334774, 0.02964603714644909, 0.0005071935011073947, 0.03875688835978508, -0.013511247001588345, -0.019891226664185524, 0.007703676819801331, 0.02809576317667961, 0.011400487273931503, -0.030767006799578667, -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): super(TestGrading, self).setUp() self.grade_part_1 = GradePart.objects.create( weight = 1, required = True, activity = self.activity, name = "Zadanie 1" ) self.grade_part_2 = GradePart.objects.create( weight ...
472
[ -0.013359380885958672, 0.0370987132191658, 0.005994901992380619, -0.01764831878244877, 0.010127659887075424, 0.013311325572431087, 0.0247725211083889, -0.009232630021870136, 0.019318241626024246, 0.017372000962495804, 0.00303199072368443, -0.005586431827396154, -0.04807935282588005, -0.005...
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_default_grade_retuended_when_required_activities_unfinished(self): GradePart.objects.grade(self.grade_part_2, self.student, 5) sg = StudentGrade() grade_student(self.activity, self.student, sg) self.assertEqual(sg.grade, 812.0) self.assertIn('Zadanie 1', sg.short_desc...
473
[ 0.013129773549735546, 0.019870253279805183, 0.01469311211258173, -0.016029879450798035, 0.02616891823709011, -0.006655515171587467, 0.009266742505133152, -0.024356354027986526, 0.02469620853662491, 0.0028505430091172457, 0.04250466823577881, 0.008439759723842144, -0.06892281770706177, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_grade_calculated_when_all_required_activitees_finished(self): GradePart.objects.grade(self.grade_part_1, self.student, 5) sg = StudentGrade() grade_student(self.activity, self.student, sg) self.assertEqual(sg.grade, 3)
474
[ 0.02085087075829506, 0.004484777804464102, 0.017492864280939102, -0.025614552199840546, 0.025636864826083183, 0.002855977974832058, 0.031081072986125946, -0.01751517690718174, 0.02418656274676323, 0.00591834494844079, 0.03351311758160591, 0.0037540490739047527, -0.057967428117990494, -0.03...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_grade_calculated_when_all_activities_finished(self): GradePart.objects.grade(self.grade_part_2, self.student, 3) GradePart.objects.grade(self.grade_part_1, self.student, 3) sg = StudentGrade() grade_student(self.activity, self.student, sg) self.assertEqual(sg.grade, ...
475
[ -0.0287869181483984, 0.025491753593087196, 0.015285898931324482, -0.0007243925938382745, 0.030686212703585625, 0.02727663516998291, 0.008861473761498928, -0.021235501393675804, 0.017986102029681206, 0.03173883631825447, -0.006824879441410303, -0.014439225196838379, -0.054919399321079254, 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_default_grade_returned_when_regired_activity_has_grade_below_passing(self): GradePart.objects.grade(self.grade_part_1, self.student, 2) GradePart.objects.grade(self.grade_part_2, self.student, 3) sg = StudentGrade() grade_student(self.activity, self.student, sg) self....
476
[ -0.014078895561397076, 0.007657777518033981, 0.017337018623948097, 0.009536548517644405, 0.006067361682653427, 0.02220042049884796, 0.0529385469853878, -0.005041766446083784, 0.002082404214888811, 0.0018163439817726612, 0.01133802905678749, 0.0037842977326363325, -0.07419957965612411, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_grade_gets_updated_if_we_add_new_grade_part(self): #Updates the database so grade is calculated self.test_grade_calculated_when_all_activities_finished() #Sanity check sg = StudentGrade() grade_student(self.activity, self.student, sg) self.assertNotEqual(sg.gra...
477
[ 0.000705225917045027, -0.03376614674925804, -0.01564083993434906, 0.010587211698293686, 0.008328606374561787, -0.007425164338201284, -0.00330085726454854, 0.027385586872696877, -0.02998298406600952, 0.027969060465693474, -0.049538739025592804, 0.05623926967382431, 0.04137011617422104, 0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "shape", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _batch_shape_tensor(self, shape=None): # `shape` may be passed in if this can be pre-computed in a # more efficient manner, e.g. without excessive Tensor conversions. if self.batch_shape.is_fully_defined(): return linear_operator_util.shape_tensor( self.batch_shape.as_list(), name="batch...
478
[ -0.007875346578657627, 0.006380027625709772, 0.0192619226872921, 0.012449914589524269, 0.002640345599502325, -0.017035558819770813, -0.005275153089314699, -0.03706175833940506, 0.005372071638703346, -0.00525576900690794, 0.009149136953055859, -0.03136846795678139, 0.01282651349902153, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestAutogradeableGradePart(TestFixture): def test_name_is_set(self): model = AutogradeableGradePart.objects.create( activity = self.activity, autograding_controller = get_autograders()['test'] ) self.assertEqual(model.name, model.autograding_controller)
479
[ 0.024970928207039833, -0.03433270752429962, 0.002650959650054574, -0.002396059688180685, 0.05413148179650307, 0.04197043925523758, -0.018779175356030464, 0.04686451703310013, -0.033109188079833984, 0.011039485223591328, -0.007809207774698734, 0.04908909648656845, 0.06436455994844437, 0.022...
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": "shape", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _domain_dimension_tensor(self, shape=None): # `shape` may be passed in if this can be pre-computed in a # more efficient manner, e.g. without excessive Tensor conversions. dim_value = tensor_shape.dimension_value(self.domain_dimension) if dim_value is not None: return ops.convert_to_tensor_v2_...
480
[ 0.023912936449050903, -0.009603282436728477, 0.00022195086057763547, -0.009179328568279743, 0.04336720332503319, 0.024827534332871437, -0.014100058004260063, 0.05171291530132294, -0.03425933048129082, 0.0016898633912205696, -0.034811899065971375, 0.06798513978719711, 0.06154484674334526, 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": "shape", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _tensor_rank_tensor(self, shape=None): # `shape` may be passed in if this can be pre-computed in a # more efficient manner, e.g. without excessive Tensor conversions. if self.tensor_rank is not None: return ops.convert_to_tensor_v2_with_dispatch(self.tensor_rank) else: shape = self.shape...
481
[ -0.020738236606121063, -0.014848487451672554, -0.02531915344297886, 0.03351064398884773, 0.04269504174590111, 0.04596712812781334, -0.010967119596898556, -0.02978724054992199, 0.0014794892631471157, 0.04294326901435852, -0.011768216267228127, -0.02744036540389061, 0.03931013122200966, 0.05...
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 _assert_self_adjoint(self): dense = self.to_dense() logging.warn( "Using (possibly slow) default implementation of assert_self_adjoint." " Requires conversion to a dense matrix.") return check_ops.assert_equal( dense, linalg.adjoint(dense), message="Matrix was no...
482
[ 0.020365042611956596, -0.029855921864509583, 0.017617683857679367, -0.020211344584822655, 0.02607109770178795, 0.03492796793580055, -0.012853031978011131, 0.025744488462805748, -0.020806925371289253, 0.017905868589878082, -0.029279552400112152, 0.04172912612557411, 0.06559080630540848, 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": "shape", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _range_dimension_tensor(self, shape=None): # `shape` may be passed in if this can be pre-computed in a # more efficient manner, e.g. without excessive Tensor conversions. dim_value = tensor_shape.dimension_value(self.range_dimension) if dim_value is not None: return ops.convert_to_tensor_v2_wi...
483
[ -0.024456340819597244, -0.002380484016612172, 0.008303338661789894, 0.0476888082921505, 0.05760639160871506, 0.04507225379347801, -0.020879680290818214, -0.03108213096857071, -0.02240951918065548, 0.03078671358525753, -0.041527245193719864, 0.006689094007015228, 0.03794003278017044, 0.0276...
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 _log_abs_determinant(self): logging.warn( "Using (possibly slow) default implementation of determinant." " Requires conversion to a dense matrix and O(N^3) operations.") if self._can_use_cholesky(): diag = array_ops.matrix_diag_part(linalg_ops.cholesky(self.to_dense())) return 2...
484
[ -0.00866448599845171, -0.015974976122379303, 0.01635715179145336, 0.03828316181898117, 0.07521232217550278, 0.006939232349395752, -0.02323632873594761, -0.02323632873594761, 0.0009117638110183179, 0.046647366136312485, -0.04878755286335945, 0.012983079999685287, -0.00810760073363781, 0.033...
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 _cond(self): if not self.is_self_adjoint: # In general the condition number is the ratio of the # absolute value of the largest and smallest singular values. vals = linalg_ops.svd(self.to_dense(), compute_uv=False) else: # For self-adjoint matrices, and in general normal matrices, ...
485
[ -0.012079834006726742, 0.015478136949241161, -0.01343915518373251, 0.013121980242431164, 0.02693268470466137, -0.0007697156397625804, -0.012469506822526455, -0.024957137182354927, 0.014100692234933376, 0.06985098868608475, -0.010729575529694557, -0.042773306369781494, 0.009433689527213573, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "matrix", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "rhs", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _solve( matrix, rhs, adjoint=False, name=None): if not isinstance(matrix, LinearOperator): raise ValueError("Passing in `matrix` as a Tensor and `rhs` as a " "LinearOperator is not supported.") return matrix.solve(rhs, adjoint=adjoint, name=name)
486
[ -0.031807441264390945, -0.01744639314711094, 0.0056378538720309734, 0.0004161152464803308, 0.02793046645820141, -0.01000198908150196, -0.02036934904754162, -0.01378254871815443, 0.016624310985207558, 0.008662301115691662, -0.04380374029278755, -0.02210485376417637, 0.05809374526143074, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def _matmul( # pylint:disable=missing-docstring a, b, transpose_a=False, transpose_b=False, adjoint_a=False, adjoint_b=False, a_is_sparse=False, b_is_sparse=False, name=None): if transpose_a or transpose_b: raise ValueError("Transposing not supported at this time.") if a_is_...
487
[ -0.011175984516739845, -0.004766684491187334, 0.01133714709430933, 0.0169096440076828, -0.02445947751402855, -0.02886044792830944, 0.011895016767084599, -0.024434681981801987, -0.01105201430618763, 0.032306838780641556, 0.026058701798319817, -0.010345378890633583, 0.007401068229228258, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}, {"_type": "arg", "_...
def _geneig(a1, b, left, right, overwrite_a, overwrite_b): b1 = asarray(b) overwrite_b = overwrite_b or _datacopied(b1, b) if len(b1.shape) != 2 or b1.shape[0] != b1.shape[1]: raise ValueError('expected square matrix') ggev, = get_lapack_funcs(('ggev',), (a1, b1)) cvl, cvr = left, right ...
488
[ -0.02125980146229267, -0.0072207096964120865, 0.03577180579304695, -0.03148031607270241, 0.023899631574749947, 0.004552646540105343, 0.010771067813038826, -0.047714561223983765, 0.03176265209913254, 0.037098776549100876, 0.05878208205103874, -0.027569981291890144, 0.007933604530990124, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class CompiledFileSystemTest(unittest.TestCase): def testPopulateNamespace(self): def CheckNamespace(expected_file, expected_list, fs): self.assertEqual(expected_file, fs._file_object_store.namespace) self.assertEqual(expected_list, fs._list_object_store.namespace) compiled_fs_creator = _GetTestCo...
489
[ 0.03893336281180382, 0.018737779930233955, -0.0208490788936615, -0.037726905196905136, -0.01423870213329792, -0.057005077600479126, 0.01969289220869541, -0.019441546872258186, 0.0437089204788208, -0.005916036199778318, 0.03136787191033363, 0.00909869372844696, 0.02017044648528099, 0.031719...
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 testPopulateFromFile(self): def Sleepy(key, val): return '%s%s' % ('Z' * len(key), 'z' * len(val)) compiled_fs = _GetTestCompiledFsCreator()(Sleepy, CompiledFileSystemTest) self.assertEqual('ZZZZZZZZzzzzzzzzzzzzzzzzz', compiled_fs.GetFromFile('404.html').Get()) self.assert...
490
[ 0.0017256139544770122, 0.024361608549952507, 0.01671670377254486, -0.02561449259519577, -0.009158805012702942, -0.03143807500600815, -0.01959369331598282, -0.06566033512353897, 0.005649573169648647, 0.06450025737285614, 0.01238961797207594, 0.011043929494917393, 0.042458802461624146, 0.018...
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 testPopulateNamespace(self): def CheckNamespace(expected_file, expected_list, fs): self.assertEqual(expected_file, fs._file_object_store.namespace) self.assertEqual(expected_list, fs._list_object_store.namespace) compiled_fs_creator = _GetTestCompiledFsCreator() f = lambda x: x CheckName...
491
[ 0.04530826583504677, -0.041739463806152344, 0.05513539910316467, -0.03855857625603676, -0.023417029529809952, 0.0005846983985975385, 0.013964876532554626, -0.06227300316095352, 0.028317665681242943, -0.021309366449713707, 0.04052400216460228, -0.033722590655088425, 0.046239256858825684, -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 testCaching(self): compiled_fs = _GetTestCompiledFsCreator()(identity, CompiledFileSystemTest) self.assertEqual('404.html contents', compiled_fs.GetFromFile('404.html').Get()) self.assertEqual(set(('file.html',)), set(compiled_fs.GetFromFileListing('apps/fakedir...
492
[ -0.010720387101173401, 0.017594723030924797, 0.03771940618753433, -0.04249821975827217, -0.02247575670480728, -0.03930382430553436, -0.040096037089824677, -0.05525024235248566, 0.035393886268138885, 0.06537008285522461, 0.0362372063100338, -0.01355700846761465, 0.03912493959069252, -0.0175...
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 testPopulateFromFileListing(self): def strip_ext(path, files): return [os.path.splitext(f)[0] for f in files] compiled_fs = _GetTestCompiledFsCreator()(strip_ext, CompiledFileSystemTest) expected_top_listing = [ '404', 'apps/a11y', 'apps/about_apps', 'apps/deepdir/deeper/de...
493
[ -0.024394981563091278, -0.023892125114798546, 0.011204671114683151, -0.007085117511451244, 0.0491509884595871, 0.007555739488452673, 0.009728336706757545, -0.0044451211579144, 0.03370426967740059, 0.06864634156227112, 0.062457337975502014, -0.020397916436195374, -0.027025306597352028, 0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testCorrectFutureBehaviour(self): # Tests that the underlying FileSystem's Read Future has had Get() called # on it before the Future is resolved, but the underlying Future isn't # resolved until Get is. mock_fs = MockFileSystem(TestFileSystem(_TEST_DATA)) compiled_fs = CompiledFileSystem.Factor...
494
[ 0.010746607556939125, -0.007154590915888548, 0.0760800912976265, -0.02649848535656929, -0.017453668639063835, -0.04529474303126335, -0.004116097930818796, -0.05478708818554878, 0.01379098929464817, 0.022447161376476288, 0.029701856896281242, -0.044093478471040726, 0.02408417873084545, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testFailures(self): compiled_fs = _GetTestCompiledFsCreator()(identity, CompiledFileSystemTest) self.assertRaises(FileNotFoundError, compiled_fs.GetFromFile('405.html').Get) # TODO(kalman): would be nice to test this fails since apps/ is a dir. compiled_fs.GetFromFile('apps/') ...
495
[ 0.008314955048263073, 0.05750509724020958, 0.041633520275354385, -0.01683284342288971, -0.04039455205202103, -0.024202553555369377, 0.020859481766819954, -0.03793798387050629, -0.03699807822704315, 0.05425815284252167, -0.007540601305663586, -0.0019305434543639421, -0.006648759823292494, -...
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": "installed_apps", "annotation": null, "type_comment": null}}], "kw...
def __init__(self, installed_apps=()): # installed_apps is set to None when creating the master registry # because it cannot be populated at that point. Other registries must # provide a list of installed apps and are populated immediately. if installed_apps is None and hasattr(sys.modul...
496
[ 0.019342027604579926, 0.009339375421404839, 0.03983944281935692, -0.06470165401697159, -0.05190681293606758, 0.01566190831363201, -0.006857433822005987, -0.030275408178567886, -0.045787543058395386, 0.013543698936700821, -0.027386942878365517, -0.05147889256477356, 0.010521506890654564, 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": "app_label", "annotation": null, "type_comment": null}}, {"_type":...
def register_model(self, app_label, model): # Since this method is called when models are imported, it cannot # perform imports because of the risk of import loops. It mustn't # call get_app_config(). model_name = model._meta.model_name app_models = self.all_models[app_label] ...
497
[ -0.0023966655135154724, 0.0039124698378145695, 0.040169503539800644, -0.009142063558101654, 0.04417089372873306, -0.06917957961559296, -0.013460229150950909, -0.028609933331608772, -0.003679055254906416, -0.002762070158496499, 0.017772838473320007, 0.012115317396819592, 0.016505731269717216,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request_def", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar...
def _create_request(request_def): data = '' if len(request_def) > 4: data = request_def[4] conn = mock.MockConn(data) conn.local_addr = ('0.0.0.0', request_def[0]) return mock.MockRequest( method=request_def[1], uri=request_def[2], headers_in=request_def[3], c...
498
[ -0.003896441776305437, -0.026391450315713882, 0.04221285507082939, -0.03186722472310066, 0.021936770528554916, -0.05834844335913658, 0.028321435675024986, 0.006059261504560709, 0.027378885075449944, 0.024955179542303085, 0.024685880169272423, -0.046364571899175644, -0.004306002985686064, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request_lines_set", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "pos...
def _create_requests_with_lines(request_lines_set): requests = [] for lines in request_lines_set: request = _create_request(_GOOD_REQUEST) request.connection.get_memorized_lines = _create_get_memorized_lines( lines) requests.append(request) return requests
499
[ 0.009285018779337406, -0.02441098913550377, 0.03874575346708298, 0.007307007443159819, 0.049008145928382874, -0.02825065888464451, -0.02815757505595684, 0.0008224746561609209, 0.04817039892077446, -0.008854510262608528, 0.0068183219991624355, -0.009895875118672848, -0.03434759005904198, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_good_request_default_port(self): request = _create_request(_GOOD_REQUEST) handshaker = Handshaker(request, mock.MockDispatcher()) handshaker.do_handshake() self.assertEqual(_GOOD_RESPONSE_DEFAULT_PORT, request.connection.written_data()) self.asse...
500
[ -0.004313219338655472, -0.02374432235956192, 0.04198155924677849, -0.00582966348156333, 0.03554332256317139, -0.02455575205385685, -0.04530709236860275, -0.011759093031287193, 0.06395669281482697, 0.005726571660488844, 0.006242029834538698, -0.04357781633734703, -0.03298931196331978, 0.034...
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 HyBi00HandshakerTest(unittest.TestCase): def test_good_request_default_port(self): request = _create_request(_GOOD_REQUEST) handshaker = Handshaker(request, mock.MockDispatcher()) handshaker.do_handshake() self.assertEqual(_GOOD_RESPONSE_DEFAULT_PORT, ...