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
601
[ -0.023689189925789833, 0.005593553185462952, 0.05503271520137787, -0.08470799028873444, 0.02317889966070652, -0.04459141567349434, 0.016780659556388855, -0.00026342447381466627, 0.013748365454375744, 0.03697632998228073, -0.0654347613453865, 0.055228978395462036, 0.03768288716673851, 0.006...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "settings", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "test_runner_class", "annotation": null, "type_comment": null}...
def get_runner(settings, test_runner_class=None): if not test_runner_class: test_runner_class = settings.TEST_RUNNER test_path = test_runner_class.split('.') # Allow for Python 2.5 relative paths if len(test_path) > 1: test_module_name = '.'.join(test_path[:-1]) else: test_m...
602
[ 0.03655889257788658, -0.001106379902921617, 0.0021304849069565535, 0.0013106236001476645, 0.000025327475668746047, -0.013210161589086056, 0.057228635996580124, -0.005635104142129421, 0.008031178265810013, -0.005903579760342836, 0.014434180222451687, 0.010386835783720016, -0.00890877563506364...
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 enable(self): override = UserSettingsHolder(settings._wrapped) for key, new_value in self.options.items(): setattr(override, key, new_value) settings._wrapped = override for key, new_value in self.options.items(): setting_changed.send(sender=settings._wrapped....
603
[ 0.0274759903550148, 0.012835271656513214, -0.05528401583433151, 0.03345264121890068, 0.017079107463359833, 0.020596615970134735, 0.022391686215996742, -0.052337195724248886, -0.01356160081923008, 0.03154343366622925, -0.0023514903150498867, -0.019424114376306534, 0.012866400182247162, 0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "want_element", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "got_element", "annotation": null, "type_comment": null}}]...
def check_element(want_element, got_element): if want_element.tagName != got_element.tagName: return False if norm_child_text(want_element) != norm_child_text(got_element): return False if attrs_dict(want_element) != attrs_dict(got_element): return False ...
604
[ 0.011047808453440666, 0.014537760056555271, 0.04588063806295395, 0.010075290687382221, 0.014715592376887798, -0.006846529431641102, -0.016038216650485992, 0.010825518518686295, -0.05984044447541237, -0.007580086123198271, -0.015682553872466087, -0.048014622181653976, 0.04765895754098892, 0...
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}}, {"_type": "arg", "_fields": {"arg": "conn", "annotation": n...
class QtSqlDBCursor(object): def __init__(self, conn): self.qry = QSqlQuery(conn) self.description = None self.rowcount = -1 self.arraysize = 1 def close(self): self.qry.finish() def execute(self, operation, parameters=[]): if len(parameters) == 0: ...
605
[ -0.0009788795141503215, 0.046349190175533295, 0.04428434371948242, -0.025481071323156357, 0.01877032406628132, -0.002196644200012088, -0.05768387392163277, 0.020033394917845726, -0.04118707776069641, 0.021713826805353165, 0.016288116574287415, -0.013081016018986702, 0.04819437116384506, 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": "operation", "annotation": null, "type_comment": null}}, {"_type":...
def execute(self, operation, parameters=[]): if len(parameters) == 0: if not self.qry.exec_(operation): raise ExecError(self.qry.lastError().databaseText()) else: if not self.qry.prepare(operation): raise ExecError(self.qry.lastError().databaseText...
606
[ 0.022025441750884056, 0.028455503284931183, 0.034962769597768784, 0.012231454253196716, 0.004775671754032373, -0.007339975796639919, -0.04299207404255867, 0.06379326432943344, -0.042528845369815826, -0.00801827572286129, 0.03659509867429733, -0.06621970236301422, 0.03741126507520676, 0.017...
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": "operation", "annotation": null, "type_comment": null}}, {"_type":...
def executemany(self, operation, seq_of_parameters): if len(seq_of_parameters) == 0: return if not self.qry.prepare(operation): raise ExecError(self.qry.lastError().databaseText()) for r in seq_of_parameters: for i in range(len(r)): self.qry....
607
[ 0.0339413583278656, 0.016083966940641403, 0.006142326630651951, -0.01795591413974762, 0.04771002009510994, -0.016724370419979095, -0.04007444530725479, -0.014446012675762177, -0.01687215454876423, 0.023374708369374275, -0.014101180247962475, -0.06541962921619415, -0.023448601365089417, -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 fetchone(self): if not self.qry.next(): return None row = [] for i in range(len(self.description)): value = self.qry.value(i) if (isinstance(value, QDate) or isinstance(value, QTime) or isinstance(value, QDateTime))...
608
[ 0.015399002470076084, -0.021725136786699295, 0.022017112001776695, -0.027791738510131836, 0.0154422577470541, -0.04416399076581001, -0.011268090456724167, 0.007175026927143335, -0.03479915112257004, 0.003292834386229515, -0.03157660737633705, -0.060384850949048996, -0.030624981969594955, -...
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": "size", "annotation": null, "type_comment": null}}], "kwarg": null...
def fetchmany(self, size=10): rows = [] while len(rows) < size: row = self.fetchone() if row is None: break rows.append(row) return rows
609
[ 0.01933770440518856, -0.008511895313858986, 0.010974559932947159, -0.02767881006002426, 0.019910672679543495, -0.019282611086964607, -0.01599905826151371, 0.011800957843661308, -0.014269132167100906, 0.03080810233950615, -0.006693820934742689, -0.060073599219322205, 0.003214686643332243, -...
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 fetchall(self): rows = [] while True: row = self.fetchone() if row is None: break rows.append(row) return rows
610
[ 0.009332493878901005, -0.008307220414280891, 0.07197923958301544, -0.013083497062325478, 0.03442919999361038, -0.018955066800117493, 0.02656709961593151, 0.01712457649409771, -0.0406508632004261, -0.026186998933553696, -0.022285956889390945, 0.009162448346614838, 0.05093361437320709, 0.034...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "connections", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class QtSqlDBConnection(object): connections = 0 def __init__(self, driver, dbname, user, passwd): self.conn = QSqlDatabase.addDatabase( driver, "qtsql_%d" % QtSqlDBConnection.connections) QtSqlDBConnection.connections += 1 self.conn.setDatabaseName(dbname) self.conn...
611
[ 0.010076092556118965, -0.01530434563755989, 0.050058573484420776, -0.01807454042136669, 0.05072186142206192, -0.04303554818034172, 0.010973479598760605, 0.017879456281661987, -0.06188067048788071, 0.01946939155459404, -0.02438551001250744, 0.02370271645486355, 0.05942261219024658, 0.024736...
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": "driver", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, driver, dbname, user, passwd): self.conn = QSqlDatabase.addDatabase( driver, "qtsql_%d" % QtSqlDBConnection.connections) QtSqlDBConnection.connections += 1 self.conn.setDatabaseName(dbname) self.conn.setUserName(user) self.conn.setPassword(passwd) ...
612
[ 0.025881286710500717, 0.022232823073863983, 0.02715824916958809, -0.012438979931175709, -0.02243804931640625, 0.003417584113776684, -0.012051330879330635, -0.06357447803020477, -0.008539685048162937, -0.0002462000120431185, 0.02217581681907177, -0.03206087276339531, 0.05153454467654228, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "build", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "property", "annotation": null, "type_comment": null}}], "kwarg":...
def config_property_exists(build, property): properties = property.split('.') at = build.config for x in properties: if x in at: at = at[x] else: return False return True
613
[ 0.03489142283797264, 0.01447332464158535, -0.003466035472229123, -0.029261741787195206, -0.026404889300465584, 0.002066492335870862, 0.015723196789622307, -0.0626407116651535, -0.005403864663094282, 0.010130276903510094, 0.027497215196490288, -0.027812309563159943, 0.021310867741703987, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "build", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "property", "annotation": null, "type_comment": null}}, {"_type":...
def config_property_equals(build, property, value): properties = property.split('.') at = build.config for x in properties: if x in at: at = at[x] else: return False return at == value
614
[ 0.019903825595974922, 0.018790092319250107, 0.020830096676945686, -0.0008856099448166788, -0.01560327596962452, 0.0017353820148855448, -0.012846513651311398, -0.0494011826813221, -0.0045376308262348175, 0.012945756316184998, 0.02073085308074951, -0.036433372646570206, 0.03603639826178551, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "build", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "property", "annotation": null, "type_comment": null}}], "kwarg":...
def config_property_true(build, property): properties = property.split('.') at = build.config for x in properties: if x in at: at = at[x] else: return False return at == True
615
[ 0.02504607103765011, 0.03257596120238304, 0.0010122595122084022, -0.0397614985704422, -0.017906447872519493, 0.026744887232780457, 0.013647927902638912, -0.03296623006463051, 0.0042786081321537495, 0.05459171161055565, 0.008195643313229084, -0.02318655513226986, -0.009825590066611767, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __command_display(argv): parser = optparse.OptionParser(display_usage()) register_display_options(parser) (options, args) = parser.parse_args(argv) if len(args) != 1 or not valid_display(args[0]): parser.print_help() sys.exit(0) # open output if options.output == 'stdout': ...
616
[ 0.016965802758932114, 0.05301688611507416, 0.018398690968751907, -0.06408197432756424, -0.028896592557430267, 0.006263913586735725, 0.05377313494682312, -0.02609051764011383, -0.006587308365851641, 0.024657629430294037, -0.012318863533437252, 0.011522814631462097, -0.011532764881849289, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "parser", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def register_display_options(parser): parser.add_option( '-i', '--input', action='store', type='string', dest='input', default='stdin', metavar='PATH', help='the input file name') parser.add_option( '-o', '--output',...
617
[ 0.04238445311784744, 0.025297321379184723, 0.02850034087896347, -0.045731279999017715, -0.04026653617620468, 0.017936911433935165, 0.04805837199091911, -0.011517798528075218, -0.00926914718002081, -0.0016897565219551325, 0.010498061776161194, 0.02159750647842884, 0.06840081512928009, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __command_record(argv): pin = pintool.Pin(config.pin_home()) recorder = tracer_pintool.Profiler() usage = 'usage: <script> record [options] --- program' parser = optparse.OptionParser(usage) recorder.register_cmdline_options(parser) (opt_argv, prog_argv) = separate_opt_prog(argv) if len(...
618
[ 0.022470742464065552, 0.03556139022111893, 0.023473283275961876, -0.03514654561877251, 0.006706652697175741, 0.0011408223072066903, -0.030905913561582565, 0.026573093608021736, 0.04941258579492569, 0.06181182712316513, 0.014312135055661201, 0.009080484509468079, 0.04070085287094116, -0.001...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def main(argv): if len(argv) < 1: logging.err(command_usage()) command = argv[0] logging.msg('performing command: %s ...\n' % command, 2) if valid_command(command): eval('__command_%s(argv[1:])' % command) else: logging.err(command_usage())
619
[ 0.014809672720730305, 0.04840735346078873, 0.002776813693344593, -0.06231869012117386, -0.014026839286088943, 0.02661634422838688, 0.013783005066215992, 0.0038018764462321997, -0.02163700945675373, 0.016773173585534096, 0.011235588230192661, -0.009483837522566319, -0.006647669244557619, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [], "values": []}}, "targets": [{"_type": "Name", "_fields": {"id": "CACHE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_type": "...
class WorkflowService(object): CACHE = {} @classmethod def clear_cache(cls, dbname): cls.CACHE[dbname] = {} @classmethod def new(cls, cr, uid, model_name, record_id): return cls(Session(cr, uid), Record(model_name, record_id)) def __init__(self, session, record): asser...
620
[ 0.026573432609438896, 0.060396306216716766, 0.029280204325914383, -0.05719525367021561, -0.016829056665301323, 0.032857850193977356, 0.043684933334589005, 0.038318466395139694, -0.04745087772607803, -0.0026111516635864973, -0.003948355559259653, -0.0076260338537395, -0.014593027532100677, ...
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 trigger(self): self.cr.execute('select instance_id from wkf_triggers where res_id=%s and model=%s', (self.record.id, self.record.model)) res = self.cr.fetchall() for (instance_id,) in res: self.cr.execute('select %s,res_type,res_id from wkf_instance where id=%s', (self.session.ui...
621
[ 0.041330888867378235, 0.023036103695631027, 0.04350997880101204, -0.042288731783628464, -0.018881462514400482, -0.001366421696729958, 0.03393155708909035, -0.0049538398161530495, -0.03522464260458946, -0.03711638227105141, 0.010775724425911903, -0.01534941978752613, 0.01634318195283413, -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 create(self): WorkflowService.CACHE.setdefault(self.cr.dbname, {}) wkf_ids = WorkflowService.CACHE[self.cr.dbname].get(self.record.model, None) if not wkf_ids: self.cr.execute('select id from wkf where osv=%s and on_create=True', (self.record.model,)) wkf_ids = self...
622
[ 0.04253169894218445, 0.05577694624662399, -0.004336100537329912, -0.021822670474648476, 0.004916617181152105, 0.024334292858839035, -0.01555546559393406, -0.01498679630458355, 0.0033231591805815697, 0.03757954016327858, 0.004969929810613394, 0.01626630127429962, -0.0028137266635894775, 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": "signal", "annotation": null, "type_comment": null}}], "kwarg": nu...
def validate(self, signal): result = False # ids of all active workflow instances for a corresponding resource (id, model_nam) self.cr.execute('select id from wkf_instance where res_id=%s and res_type=%s and state=%s', (self.record.id, self.record.model, 'active')) # TODO: Refactor the w...
623
[ 0.02468791976571083, 0.005217427853494883, 0.026822322979569435, -0.015711572021245956, -0.02358514629304409, 0.011840003542602062, -0.022695811465382576, -0.040363918989896774, -0.025660259649157524, -0.007760923821479082, 0.004073150921612978, -0.05312290042638779, 0.05639565363526344, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "reward.emp"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null...
class reward_emp(osv.osv): # name to erp _name = 'reward.emp' _order = 'reward_name asc' _description = 'reward types model' # to show in inheritance #_rec_name = 'field name' _rec_name = 'reward_name' _columns = { 'reward_name' : fields.char( 'Rewar...
624
[ 0.002667540917173028, 0.03834318742156029, 0.018948525190353394, -0.02837941236793995, -0.014499525539577007, -0.0074790287762880325, -0.010391326621174812, 0.012318399734795094, -0.01469780970364809, 0.0019627027213573456, 0.014276456087827682, -0.006977121811360121, 0.015577695332467556, ...
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": "new_rid", "annotation": null, "type_comment": null}}], "kwarg": n...
def redirect(self, new_rid): # get ids of wkf instances for the old resource (res_id) # CHECKME: shouldn't we get only active instances? self.cr.execute('select id, wkf_id from wkf_instance where res_id=%s and res_type=%s', (self.record.id, self.record.model)) for old_inst_id, workflow_...
625
[ 0.0002948594046756625, 0.014576788991689682, 0.02461230382323265, -0.022153425961732864, -0.025718210265040398, 0.00511481799185276, -0.020612215623259544, -0.012812045402824879, -0.006253078114241362, 0.012764984741806984, -0.007164862472563982, -0.047789279371500015, 0.04463627189397812, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "reward.reg"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null...
class reward_reg(osv.osv): # name to erp _name = 'reward.reg' _description = "Give Employees Reward" _columns = { 'employee': fields.many2one('hr.employee', 'Employee', required=True, select=True), 'reward_name': fields.many2one('reward.emp', ...
626
[ 0.0013615729985758662, -0.0012291489401832223, -0.010977109894156456, 0.03218750283122063, 0.044584646821022034, -0.02855851873755455, -0.012791601940989494, 0.04810092970728874, 0.02441110834479332, 0.03394564241170883, 0.0262594111263752, -0.03834099322557449, 0.0379578098654747, 0.01379...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def login(request): if 'openid' in request.GET or request.method == 'POST': form = LoginForm( dict(list(request.GET.items()) + list(request.POST.items())) ) if form.is_valid(): client = _openid_consumer(request) try: auth_request = client.b...
627
[ 0.024381034076213837, -0.034786783158779144, -0.015024514868855476, 0.054689668118953705, 0.021806640550494194, -0.014602660201489925, 0.0017590797506272793, 0.03811835125088692, 0.0707850456237793, 0.031303778290748596, 0.05378105863928795, -0.021828273311257362, 0.038788992911577225, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def callback(request): client = _openid_consumer(request) response = client.complete( dict(list(request.GET.items()) + list(request.POST.items())), request.build_absolute_uri(request.path)) if response.status == consumer.SUCCESS: login = providers.registry \ .by_id(OpenID...
628
[ -0.026322955265641212, -0.005538214463740587, -0.09091562777757645, -0.04267774894833565, 0.007488642819225788, -0.009348280727863312, -0.02206519804894924, 0.015603425912559032, 0.01336184237152338, 0.021526716649532318, 0.03736807778477669, -0.05324700474739075, 0.0036597922444343567, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https?://(?:www\\.)?tube8\\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\\d+)"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID...
class Tube8IE(KeezMoviesIE): _VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.tube8.com/teen/kasia-music-video/229795/', 'md5': '65e20c48e6abff62ed0c3965fff13a39', 'info_dict': { 'id': '229795', ...
629
[ -0.017578352242708206, 0.009553964249789715, -0.06636004894971848, -0.032544661313295364, 0.02077869512140751, -0.026967594400048256, -0.008030272088944912, 0.021437589079141617, -0.011824795976281166, 0.04922880232334137, 0.02710878476500511, -0.03828645125031471, 0.02274361252784729, -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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): webpage, info = self._extract_info(url) if not info['title']: info['title'] = self._html_search_regex( r'videoTitle\s*=\s*"([^"]+)', webpage, 'title') description = self._html_search_regex( r'>Description:</strong>\s*(.+?)\s...
630
[ 0.009574396535754204, 0.011719007976353168, -0.008711240254342556, 0.0006162438658066094, 0.002869995078071952, 0.02523072622716427, 0.047008827328681946, 0.01305358111858368, 0.015855519101023674, 0.06368766725063324, 0.001754531404003501, 0.004378858953714371, -0.0328265018761158, 0.0296...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def sh_ver(instance): more_str = " --More-- " for idx, line in enumerate(VERSION.splitlines()): if idx==0: crlf = "" elif idx==23: crlf = CRLF # FIXME: Implement paging here in the future if not getattr(instance, 'term_nopage', None): ...
631
[ 0.033485326915979385, -0.006375517230480909, 0.006929910276085138, -0.0012931212550029159, 0.035880304872989655, 0.020379479974508286, 0.006880015134811401, 0.013427394442260265, -0.02178763784468174, -0.012540365569293499, -0.004706794861704111, -0.04745602607727051, 0.027342654764652252, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "username"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},...
class command_username(MockSSH.SSHCommand): name = 'username' def start(self): if 'config' not in self.protocol.prompt: invalid_input(self) elif (not len(self.args)>3 or not self.args[1]=='password'): # Throw incomplete command if not enough args incomplete_...
632
[ 0.07034346461296082, 0.01912848651409149, 0.025620345026254654, -0.011010449379682541, -0.006083706859499216, 0.017315907403826714, 0.02094106376171112, 0.05728261545300484, 0.0015048577915877104, 0.06957215815782547, 0.00816945731639862, -0.03334629908204079, 0.019732678309082985, -0.0209...
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 start(self): if 'config' not in self.protocol.prompt: invalid_input(self) elif (not len(self.args)>3 or not self.args[1]=='password'): # Throw incomplete command if not enough args incomplete_command(self) elif (not len(self.args)==3 or not self.args[1]=...
633
[ 0.02923792041838169, -0.002879397477954626, 0.03136385977268219, -0.03941741958260536, -0.028037389740347862, -0.01077976357191801, 0.06092692166566849, 0.010479630902409554, -0.03148891404271126, -0.0011466004652902484, 0.023272784426808357, 0.012180382385849953, -0.016907472163438797, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def wr_build_config(instance): instance.terminal.session.conn.transport.transport.setTcpNoDelay(True) instance.write("Building configuration...") ## In a perfect world, we would sleep here to pretend ## that the router is building the configuration; however, ## there isn't a good way to make T...
634
[ 0.01006766501814127, 0.004200279712677002, 0.0556647889316082, -0.017534172162413597, 0.033744119107723236, 0.018290873616933823, -0.006798482034355402, -0.015855243429541588, -0.05363115668296814, -0.014353664591908455, -0.020821090787649155, -0.06427226215600967, 0.013029438443481922, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "SCRUB_SQL_COLUMNS", "ctx": {"_type": "Store", "_fields": {}}}...
class BaseCloudSqlQuery(DatabaseQuery): SCRUB_SQL_COLUMNS = [] FETCH_CHUCK_SIZE = 50 # Based on the GAE/CloudSQL documentation: # https://cloud.google.com/appengine/docs/standard/python/cloud-sql/using-cloud-sql-mysql def _connect_to_cloudsql(self): secrets_sitevar = Sitevar.get_by_id('goo...
635
[ 0.031222982332110405, -0.03199214115738869, 0.038289617747068405, 0.01910875365138054, 0.02121191844344139, 0.0029459327924996614, -0.0023660603910684586, 0.018159326165914536, -0.013652543537318707, -0.011603460647165775, 0.02545430324971676, -0.0380973257124424, 0.008208351209759712, 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": "connection", "annotation": null, "type_comment": null}}, {"_type"...
def _query_cloud_sql(self, connection, query): cursor = connection.cursor() cursor.execute(query) while True: result = cursor.fetchmany(self.FETCH_CHUCK_SIZE) if not result: break # Filter out wall_time because it won't be consistent if we ba...
636
[ 0.017301222309470177, -0.021371515467762947, 0.06940295547246933, -0.009893486276268959, 0.04139617085456848, -0.03309712931513786, 0.007075972389429808, -0.013686485588550568, -0.037355586886405945, -0.02412465773522854, -0.019658230245113373, -0.023134319111704826, 0.008982375264167786, ...
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 _connect_to_cloudsql(self): secrets_sitevar = Sitevar.get_by_id('google.secrets') cloudsql_connection = secrets_sitevar.contents.get('sql_connection', '') cloudsql_db = secrets_sitevar.contents.get('sql_db', '') cloudsql_user = secrets_sitevar.contents.get('sql_user', '') clo...
637
[ 0.041774485260248184, 0.0033687343820929527, 0.05803583934903145, -0.0003506830835249275, 0.026057351380586624, 0.003006826853379607, 0.037573087960481644, 0.024642374366521835, -0.026079120114445686, -0.01865593157708645, -0.004985074046999216, -0.031238345429301262, 0.01167900487780571, ...
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 _query_async(self): db = None rows = [] query_result = [] try: query = self._build_query() db = self._connect_to_cloudsql() rows = self._query_cloud_sql(db, query) result_to_cache = None for row_dict in rows: ...
638
[ 0.00817202404141426, 0.0013404112542048097, 0.08109381049871445, -0.03132134675979614, -0.008792756125330925, 0.040364671498537064, 0.013098017312586308, -0.01996593363583088, -0.028428392484784126, -0.02430536411702633, -0.0098178181797266, -0.041412513703107834, 0.044601596891880035, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 3}}, "targets": [{"_type": "Name", "_fields": {"id": "CACHE_VERSION", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},...
class MatchGdcvDataQuery(BaseCloudSqlQuery): CACHE_VERSION = 3 CACHE_KEY_FORMAT = 'match_timeseries_{}' def _build_query(self): match_key = self._query_args[0] event_key = match_key.split('_')[0] match_id = match_key.split('_')[1] year = int(event_key[:4]) query = ""...
639
[ -0.001355938264168799, 0.04523980990052223, 0.012685872614383698, -0.04119768738746643, -0.0370185412466526, 0.01444431021809578, -0.04028421267867088, 0.016659485176205635, 0.03370719775557518, 0.057183485478162766, 0.01724182441830635, -0.017481612041592598, 0.020347638055682182, 0.01250...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "warnings", "annotation": null, "type_comment": null}}], "kwarg"...
def parse_commands(module, warnings): command = ComplexList(dict( command=dict(key=True), prompt=dict(), answer=dict() ), module) commands = command(module.params['commands']) for item in list(commands): command_split = re.match(r'^(\w*)(.*)$', item['command']) if...
640
[ 0.003232648130506277, 0.013819640502333641, 0.03216329962015152, -0.04274185374379158, -0.02615378238260746, 0.015237617306411266, -0.01592409797012806, -0.021944869309663773, -0.03918565809726715, -0.005564993713051081, -0.012052797712385654, -0.049966778606176376, 0.04069366678595543, -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 _build_query(self): match_key = self._query_args[0] event_key = match_key.split('_')[0] match_id = match_key.split('_')[1] year = int(event_key[:4]) query = """SELECT * FROM {}_matches WHERE event_key = '{}' AND match_id = '{}' AND (mode = 'auto' OR mode = 'teleop...
641
[ 0.011463772505521774, 0.01687818206846714, 0.01459235418587923, 0.010505571961402893, -0.00842177402228117, 0.012987657450139523, -0.030177542939782143, -0.028699835762381554, 0.01436146255582571, 0.009524282068014145, 0.023989645764231682, -0.016554933041334152, -0.01657802239060402, 0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "atoms", "annotation": null, "type_comment": null}}, {"_type": "ar...
def calculation_required(self, atoms, quantities): if self.calc is None: return True if atoms != self.get_atoms(): return True return False
642
[ 0.005613255314528942, -0.014481593854725361, -0.02120339125394821, -0.01661805808544159, -0.005260537378489971, -0.008636552840471268, -0.015680834650993347, -0.008500504307448864, 0.043616101145744324, 0.03456636518239975, 0.004620606079697609, -0.007618709467351437, 0.001284271478652954, ...
8
{"_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": "typecode", "annotation": null, "type_comment": null}}], "kwarg": nul...
def np2num(a, typecode=None): if num.__version__ > '23.8': return num.array(a, typecode) if typecode is None: typecode = num.Float b = num.fromstring(a.tostring(), typecode) b.shape = a.shape return b
643
[ 0.027448613196611404, 0.007493794895708561, 0.007423051167279482, -0.008090064860880375, -0.029389016330242157, 0.014128557406365871, 0.00002534461600589566, -0.03713041543960571, 0.07575655728578568, 0.06140566244721413, 0.010854127816855907, -0.06322479248046875, -0.03401768580079079, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "bo...
def verify_result_length(*a): result = f(*a) if not hasattr(result, "__len__"): raise TypeError("Return type of the user-defined function should be " "Pandas.Series, but is {}".format(type(result))) if len(result) != len(a[0]): raise RuntimeErr...
644
[ -0.007800525054335594, 0.018991705030202866, 0.008784420788288116, -0.00786107312887907, -0.03221122547984123, 0.030596626922488213, -0.006125380285084248, -0.037539396435022354, 0.07455404847860336, 0.051424939185380936, -0.013431434519588947, -0.05211114138364792, -0.02367403917014599, -...
12
{"_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": "return_type", "annotation": null, "type_comment": null}}], "kwarg": ...
def wrap_scalar_pandas_udf(f, return_type): arrow_return_type = to_arrow_type(return_type) def verify_result_length(*a): result = f(*a) if not hasattr(result, "__len__"): raise TypeError("Return type of the user-defined function should be " "Pandas.Series...
645
[ -0.024111812934279442, 0.013143905438482761, 0.009434818290174007, -0.049454495310783386, 0.013528551906347275, 0.03591495379805565, -0.023386480286717415, 0.010297524742782116, 0.037321656942367554, 0.00708847725763917, 0.022815005853772163, -0.021946804597973824, 0.05050952360033989, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pickleSer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "infile", "annotation": null, "type_comment": null}}, {"_type...
def read_single_udf(pickleSer, infile, eval_type, runner_conf): num_arg = read_int(infile) arg_offsets = [read_int(infile) for i in range(num_arg)] row_func = None for i in range(read_int(infile)): f, return_type = read_command(pickleSer, infile) if row_func is None: row_func...
646
[ 0.012761694379150867, -0.0004431541310623288, 0.042256660759449005, -0.06317897140979767, 0.03204730525612831, 0.019514519721269608, -0.006157660391181707, 0.000975010625552386, 0.05058895796537399, -0.0002582383167464286, 0.03577852621674538, -0.026713717728853226, 0.013746004551649094, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pickleSer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "infile", "annotation": null, "type_comment": null}}, {"_type...
def read_udfs(pickleSer, infile, eval_type): runner_conf = {} if eval_type in (PythonEvalType.SQL_SCALAR_PANDAS_UDF, PythonEvalType.SQL_GROUPED_MAP_PANDAS_UDF, PythonEvalType.SQL_GROUPED_AGG_PANDAS_UDF, PythonEvalType.SQL_WINDOW_AGG_PANDAS_UDF): ...
647
[ 0.01849333383142948, 0.02812153659760952, -0.01924518495798111, 0.011771544814109802, -0.01567669026553631, -0.004028583876788616, -0.009263498708605766, -0.0325428806245327, 0.01592356711626053, 0.0025908059906214476, -0.006761063821613789, -0.032767314463853836, 0.012310185469686985, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "error", "annotation": ...
class GPGMEError(Exception): def __init__(self, error = None, message = None): self.error = error self.message = message def getstring(self): message = "%s: %s" % (pygpgme.gpgme_strsource(self.error), pygpgme.gpgme_strerror(self.error)) if self....
648
[ -0.028743648901581764, -0.0013539729407057166, 0.011472060345113277, -0.015789957717061043, -0.010191507637500763, -0.006386889610439539, -0.00764098484069109, -0.036956120282411575, -0.015260803513228893, -0.022055141627788544, 0.0059582749381661415, -0.016287362203001976, 0.042903810739517...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/bookmarklets.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}...
class BookmarkletsView(BaseAdminDocsView): template_name = 'admin_doc/bookmarklets.html' def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context.update({ 'admin_url': "%s://%s%s" % ( self.request.scheme, self.request.get_host(), con...
649
[ 0.001407132251188159, -0.011351282708346844, -0.030972151085734367, -0.030861299484968185, -0.009788264520466328, -0.0012907373020425439, -0.0229242704808712, -0.009965628385543823, -0.0431215725839138, -0.008857103995978832, -0.018301725387573242, -0.019654124975204468, 0.02158295549452305,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): tags = [] try: engine = Engine.get_default() except ImproperlyConfigured: # Non-trivial TEMPLATES settings aren't supported (#24125). pass else: app_libs = sorted(engine.template_libraries.items()) ...
650
[ 0.015923846513032913, -0.002689557382836938, 0.004785485565662384, -0.04828185215592384, -0.008034825325012207, 0.00122631317935884, -0.022099673748016357, -0.0417623445391655, -0.0015127132646739483, -0.01702778786420822, 0.014559539966285229, -0.005717587657272816, 0.04815687611699104, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/template_tag_index.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields...
class TemplateTagIndexView(BaseAdminDocsView): template_name = 'admin_doc/template_tag_index.html' def get_context_data(self, **kwargs): tags = [] try: engine = Engine.get_default() except ImproperlyConfigured: # Non-trivial TEMPLATES settings aren't supported (#...
651
[ -0.006304609123617411, 0.02132333256304264, 0.002078788820654154, -0.06038986146450043, 0.010304702445864677, -0.010299453511834145, -0.044179510325193405, -0.012409739196300507, -0.028410112485289574, 0.024777481332421303, 0.029271025210618973, -0.016136860474944115, 0.041953735053539276, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/template_filter_index.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fie...
class TemplateFilterIndexView(BaseAdminDocsView): template_name = 'admin_doc/template_filter_index.html' def get_context_data(self, **kwargs): filters = [] try: engine = Engine.get_default() except ImproperlyConfigured: # Non-trivial TEMPLATES settings aren't sup...
652
[ -0.015062476508319378, 0.018161892890930176, -0.027242839336395264, -0.04638830944895744, 0.00868065282702446, -0.010613499209284782, -0.04023522511124611, 0.01785309426486492, -0.05841999128460884, 0.02481820434331894, -0.010693557560443878, -0.046434059739112854, 0.0031766158062964678, 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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): filters = [] try: engine = Engine.get_default() except ImproperlyConfigured: # Non-trivial TEMPLATES settings aren't supported (#24125). pass else: app_libs = sorted(engine.template_libraries.items()) ...
653
[ -0.022349705919623375, -0.005712667014449835, 0.008670045994222164, -0.043515320867300034, 0.002548925345763564, -0.014163542538881302, -0.01772719994187355, 0.0032477094791829586, -0.03290405124425888, 0.05223660171031952, 0.010372176766395569, -0.03049032762646675, 0.019947368651628494, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): views = [] urlconf = import_module(settings.ROOT_URLCONF) view_functions = extract_views_from_urlpatterns(urlconf.urlpatterns) for (func, regex, namespace, name) in view_functions: views.append({ 'full_name': self._get_ful...
654
[ 0.002264993730932474, 0.03184393420815468, 0.0260755717754364, -0.034116968512535095, -0.010593201033771038, -0.007344476412981749, -0.03673310577869415, -0.03469594940543175, 0.0018495215335860848, 0.018334386870265007, 0.023738205432891846, 0.0015734335174784064, 0.04162227362394333, -0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/view_index.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}}...
class ViewIndexView(BaseAdminDocsView): template_name = 'admin_doc/view_index.html' @staticmethod def _get_full_name(func): mod_name = func.__module__ return '%s.%s' % (mod_name, func.__qualname__) def get_context_data(self, **kwargs): views = [] urlconf = import_module...
655
[ -0.010607600212097168, 0.04480632394552231, -0.011913237161934376, -0.05374965816736221, -0.02772657386958599, -0.005474709440022707, 0.01641852594912052, -0.012361524626612663, 0.007688128389418125, 0.02936282381415367, 0.05357034131884575, -0.037028536200523376, 0.047742605209350586, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "view", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_view_func(view): urlconf = get_urlconf() if get_resolver(urlconf)._is_callback(view): mod, func = get_mod_func(view) try: # Separate the module and function, e.g. # 'mymodule.views.myview' -> 'mymodule.views', 'myview'). re...
656
[ 0.019733870401978493, 0.024992765858769417, -0.009413941763341427, -0.014193807728588581, -0.0008389498689211905, -0.0031397161073982716, 0.006253398023545742, -0.009622214362025261, 0.010252241045236588, 0.014256290160119534, 0.016328606754541397, 0.0022636677604168653, 0.04265432059764862,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/view_detail.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}...
class ViewDetailView(BaseAdminDocsView): template_name = 'admin_doc/view_detail.html' @staticmethod def _get_view_func(view): urlconf = get_urlconf() if get_resolver(urlconf)._is_callback(view): mod, func = get_mod_func(view) try: # Separate the modul...
657
[ -0.02490340732038021, -0.01670916937291622, -0.017416903749108315, -0.015061475336551666, 0.008138947188854218, -0.02087816782295704, 0.006800886243581772, 0.013734472915530205, -0.028751714155077934, 0.020789701491594315, 0.0017873060423880816, -0.009593119844794273, 0.034612640738487244, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): view = self.kwargs['view'] view_func = self._get_view_func(view) if view_func is None: raise Http404 title, body, metadata = utils.parse_docstring(view_func.__doc__) title = title and utils.parse_rst(title, 'view', _('view:') + vi...
658
[ -0.015023513697087765, 0.026828473433852196, -0.005535263102501631, -0.026072438806295395, -0.014418684877455235, -0.0016038761241361499, -0.02721729315817356, -0.020510174334049225, -0.008305594325065613, 0.014364682137966156, -0.013651848770678043, -0.028210939839482307, 0.0148831065744161...
16
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/model_detail.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}...
class ModelDetailView(BaseAdminDocsView): template_name = 'admin_doc/model_detail.html' def get_context_data(self, **kwargs): model_name = self.kwargs['model_name'] # Get the model class. try: app_config = apps.get_app_config(self.kwargs['app_label']) except LookupEr...
659
[ -0.017417175695300102, 0.0035502100363373756, 0.021000772714614868, -0.03935280069708824, -0.02555260993540287, -0.03229689598083496, -0.020522218197584152, -0.009270611219108105, -0.035279516130685806, 0.019309137016534805, -0.030182350426912308, -0.04427190124988556, -0.0015163514763116837...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): model_name = self.kwargs['model_name'] # Get the model class. try: app_config = apps.get_app_config(self.kwargs['app_label']) except LookupError: raise Http404(_("App %(app_label)r not found") % self.kwargs) try: ...
660
[ 0.019242534413933754, 0.013587545603513718, 0.009543401189148426, -0.024430328980088234, -0.0022812183015048504, -0.0185125432908535, -0.0039808782748878, -0.004540537018328905, -0.006448244210332632, 0.003438252490013838, 0.008594414219260216, -0.013490213081240654, 0.046096429228782654, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "admin_doc/template_detail.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": ...
class TemplateDetailView(BaseAdminDocsView): template_name = 'admin_doc/template_detail.html' def get_context_data(self, **kwargs): template = self.kwargs['template'] templates = [] try: default_engine = Engine.get_default() except ImproperlyConfigured: #...
661
[ 0.0007165170391090214, 0.005250092130154371, 0.044725336134433746, -0.027308862656354904, 0.004689453635364771, -0.010594497434794903, -0.0237878430634737, 0.05189312621951103, 0.024521388113498688, 0.001147475210018456, 0.0005652232212014496, -0.05319254845380783, -0.0050038304179906845, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}, {"_type": "ar...
def make_rest_call(method, url, headers, data=None): response = None try: if method == 'GET': response = requests.get(url, headers=headers) elif method == 'DELETE': response = requests.delete(url, headers=headers) elif method == 'POST': response = requ...
662
[ 0.02163705788552761, -0.00809341762214899, 0.004194159992039204, -0.048320215195417404, 0.0061110216192901134, -0.00224316562525928, -0.009158341214060783, 0.003503324929624796, -0.029621252790093422, 0.00795688945800066, -0.028135821223258972, -0.01990041509270668, 0.03835908696055412, -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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): template = self.kwargs['template'] templates = [] try: default_engine = Engine.get_default() except ImproperlyConfigured: # Non-trivial TEMPLATES settings aren't supported (#24125). pass else: #...
663
[ 0.01535688154399395, 0.003116634441539645, -0.039909377694129944, 0.007837872952222824, 0.0433243028819561, 0.005790974013507366, -0.021621007472276688, 0.02896515652537346, 0.01362884696573019, -0.017383208498358727, 0.012579682283103466, -0.02483021654188633, -0.012188817374408245, -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": "request", "annotation": null, "type_comment": null}}], "kwarg": n...
def authenticate(self, request): auth_header = get_authorization_header(request)\ .decode(HTTP_HEADER_ENCODING) auth = auth_header.split() if not auth or auth[0].lower() != 'bearer': return None if len(auth) == 1: raise AuthenticationFailed('Credential...
664
[ 0.024982117116451263, 0.01980459690093994, -0.02283449098467827, -0.012340144254267216, 0.03696238994598389, -0.004599983338266611, -0.004919224884361029, 0.03094903565943241, -0.026142995804548264, 0.005818906240165234, 0.0321795679628849, -0.007000100798904896, 0.014998557977378368, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "oauth_token", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar...
def do_auth(oauth_token): strategy = load_strategy() path = NAMESPACE + ":complete" backend = 'github' backend = load_backend(strategy, backend, reverse(path, args=(backend,))) try: user = backend.do_auth(access_token=oauth_token) except requests.HTTPError as e...
665
[ 0.033588044345378876, -0.012292752973735332, -0.03446686640381813, -0.023063648492097855, 0.03551715984940529, -0.0442410483956337, -0.03133741021156311, -0.031980447471141815, 0.027221964672207832, 0.019559089094400406, 0.007936166599392891, 0.01870170421898365, 0.018755290657281876, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def decorator(func): @wraps(func, assigned=available_attrs(func)) def _wrapped_view(self, request, *args, **kwargs): for key in payload_value_list: if key not in request.data: raise BadRequest("request missing key '{}'".format(key)) return func...
666
[ 0.023607784882187843, -0.020355479791760445, -0.02921879105269909, -0.019991803914308548, 0.019493049010634422, -0.01771623082458973, -0.03302180394530296, -0.007231962401419878, 0.04154222086071968, 0.04704931750893593, 0.02801346406340599, 0.02689126320183277, -0.0008039843523874879, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload_value_list", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "po...
def validate_request_payload(payload_value_list): def decorator(func): @wraps(func, assigned=available_attrs(func)) def _wrapped_view(self, request, *args, **kwargs): for key in payload_value_list: if key not in request.data: raise BadRequest("request ...
667
[ -0.008665336295962334, -0.00870689656585455, 0.021320467814803123, -0.0339132584631443, 0.009261035360395908, -0.009635078720748425, -0.007931102998554707, -0.022705813869833946, -0.01985200121998787, -0.002680643694475293, 0.038346365094184875, -0.06405837833881378, -0.027568375691771507, ...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'OrderItem.created' db.add_column('shoppingcart_orderitem', 'created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now), keep_default=False) # ...
668
[ 0.055400300770998, 0.006952871102839708, 0.023758890107274055, -0.00716440798714757, 0.022801410406827927, -0.04495707526803017, 0.0021223234944045544, -0.012925994582474232, -0.007242342457175255, -0.016299445182085037, 0.005722619593143463, 0.00019553210586309433, 0.010743828490376472, -...
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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding field 'OrderItem.created' db.add_column('shoppingcart_orderitem', 'created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now), keep_default=False) # Adding field 'OrderItem.modified' ...
669
[ -0.004265121649950743, -0.023377077654004097, 0.02098701521754265, 0.022238953039050102, 0.034758321940898895, 0.017549879848957062, 0.0013351623201742768, -0.0031611407175660133, 0.01175682619214058, 0.053491849452257156, 0.02412823960185051, -0.01811894215643406, 0.006339353509247303, -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": "Attribute", "_fields"...
def test_incremental_pca(): # Incremental PCA on dense arrays. X = iris.data batch_size = X.shape[0] // 3 ipca = IncrementalPCA(n_components=2, batch_size=batch_size) pca = PCA(n_components=2) pca.fit_transform(X) X_transformed = ipca.fit_transform(X) np.testing.assert_equal(X_transfor...
670
[ -0.00955725833773613, -0.013242421671748161, 0.05282469466328621, 0.031003698706626892, 0.013037018477916718, 0.014583579264581203, -0.0008238755399361253, 0.009327691048383713, 0.012136872857809067, 0.04898246005177498, 0.052099745720624924, -0.00048103457083925605, -0.015332694165408611, ...
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 test_incremental_pca_check_projection(): # Test that the projection of data is correct. rng = np.random.RandomState(1999) n, p = 100, 3 X = rng.randn(n, p) * .1 X[:10] += np.array([3, 4, 5]) Xt = 0.1 * rng.randn(1, p) + np.array([3, 4, 5]) # Get the reconstruction of the generated data ...
671
[ -0.01425483450293541, -0.011229614727199078, 0.031970519572496414, 0.018877370283007622, 0.023378895595669746, 0.0014468112494796515, -0.006958004552870989, 0.012742224149405956, 0.01507769338786602, 0.012609114870429039, 0.06185968592762947, -0.004023541696369648, -0.018889470025897026, -...
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 test_incremental_pca_inverse(): # Test that the projection of data can be inverted. rng = np.random.RandomState(1999) n, p = 50, 3 X = rng.randn(n, p) # spherical data X[:, 1] *= .00001 # make middle component relatively small X += [5, 4, 3] # make a large mean # same check that we c...
672
[ -0.015608629211783409, -0.01808987557888031, 0.03762205317616463, 0.0011054074857383966, 0.009931097738444805, -0.0007261160062626004, -0.007394847925752401, 0.0050022173672914505, 0.022147875279188156, 0.0350552462041378, 0.04903823137283325, -0.026988139376044273, -0.029408270493149757, ...
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 test_incremental_pca_set_params(): # Test that components_ sign is stable over batch sizes. rng = np.random.RandomState(1999) n_samples = 100 n_features = 20 X = rng.randn(n_samples, n_features) X2 = rng.randn(n_samples, n_features) X3 = rng.randn(n_samples, n_features) ipca = Increm...
673
[ 0.0018121656030416489, -0.013993695378303528, 0.026332609355449677, 0.014077633619308472, -0.012081104330718517, 0.0037082694470882416, -0.02082866244018078, -0.01443736907094717, 0.004745505750179291, 0.01355002261698246, 0.03707670047879219, -0.02341875620186329, -0.04940362274646759, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_incremental_pca_batch_signs(): # Test that components_ sign is stable over batch sizes. rng = np.random.RandomState(1999) n_samples = 100 n_features = 3 X = rng.randn(n_samples, n_features) all_components = [] batch_sizes = np.arange(10, 20) for batch_size in batch_sizes: ...
674
[ -0.023099146783351898, -0.017655912786722183, 0.044722165912389755, -0.006146702915430069, 0.024702133610844612, -0.012155018746852875, -0.003768170950934291, 0.018935997039079666, 0.021623017266392708, 0.03427392244338989, 0.06116718798875809, -0.011405420489609241, -0.011820582672953606, ...
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 test_incremental_pca_num_features_change(): # Test that changing n_components will raise an error. rng = np.random.RandomState(1999) n_samples = 100 X = rng.randn(n_samples, 20) X2 = rng.randn(n_samples, 50) ipca = IncrementalPCA(n_components=None) ipca.fit(X) assert_raises(ValueErro...
675
[ -0.026349367573857307, -0.03225525841116905, 0.019821802154183388, 0.005373883992433548, 0.020909728482365608, 0.011512904427945614, -0.011142291128635406, 0.03868718445301056, -0.014967970550060272, 0.040456559509038925, 0.0476297102868557, -0.009785370901226997, -0.024747364223003387, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_incremental_pca_partial_fit(): # Test that fit and partial_fit get equivalent results. rng = np.random.RandomState(1999) n, p = 50, 3 X = rng.randn(n, p) # spherical data X[:, 1] *= .00001 # make middle component relatively small X += [5, 4, 3] # make a large mean # same check t...
676
[ -0.005369076505303383, -0.03552643954753876, 0.039972975850105286, 0.007351681124418974, 0.008875880390405655, -0.011288239620625973, -0.014038673602044582, 0.006807324476540089, 0.0179007425904274, 0.023997537791728973, 0.0479033924639225, -0.025303993374109268, -0.0586300864815712, -0.03...
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 test_incremental_pca_batch_values(): # Test that components_ values are stable over batch sizes. rng = np.random.RandomState(1999) n_samples = 100 n_features = 3 X = rng.randn(n_samples, n_features) all_components = [] batch_sizes = np.arange(20, 40, 3) for batch_size in batch_sizes:...
677
[ -0.01571749523282051, -0.007246818859130144, 0.03168429434299469, 0.020986877381801605, 0.03524254262447357, 0.024545127525925636, 0.017099998891353607, -0.004827435128390789, 0.0065668984316289425, 0.026063617318868637, 0.054801587015390396, -0.005683001596480608, -0.034743934869766235, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_incremental_pca_against_pca_random_data(): # Test that IncrementalPCA and PCA are approximate (to a sign flip). rng = np.random.RandomState(1999) n_samples = 100 n_features = 3 X = rng.randn(n_samples, n_features) + 5 * rng.rand(1, n_features) Y_pca = PCA(n_components=3).fit_transform(...
678
[ -0.02921465039253235, -0.009040997363626957, 0.009178155101835728, 0.000015939258446451277, 0.023728331550955772, 0.024779874831438065, 0.020813724026083946, -0.011172660626471043, 0.003954721614718437, 0.04882824048399925, 0.0337865836918354, -0.01945357397198677, -0.006480714771896601, -...
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": "Attribute", "_fields"...
def test_incremental_pca_against_pca_iris(): # Test that IncrementalPCA and PCA are approximate (to a sign flip). X = iris.data Y_pca = PCA(n_components=2).fit_transform(X) Y_ipca = IncrementalPCA(n_components=2, batch_size=25).fit_transform(X) assert_almost_equal(np.abs(Y_pca), np.abs(Y_ipca), 1)
679
[ 0.011648669838905334, 0.0009124208008870482, 0.033441826701164246, 0.017968568950891495, 0.01648770645260811, 0.03206590563058853, 0.027774905785918236, -0.02803143300116062, -0.003879974829033017, 0.046361472457647324, 0.061100129038095474, -0.005506590940058231, -0.03787275031208992, 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": "Call", "_fields": {"a...
def test_whitening(): # Test that PCA and IncrementalPCA transforms match to sign flip. X = datasets.make_low_rank_matrix(1000, 10, tail_strength=0., effective_rank=2, random_state=1999) prec = 3 n_samples, n_features = X.shape for nc in [None, 9]: pca =...
680
[ -0.0046962108463048935, -0.009858502075076103, 0.028696442022919655, -0.0188792385160923, -0.007492697797715664, 0.02617134526371956, -0.009899800643324852, -0.0346670038998127, 0.03837205097079277, 0.046702515333890915, 0.06121593341231346, -0.00968150980770588, -0.028743641451001167, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_explained_variances(): # Test that PCA and IncrementalPCA calculations match X = datasets.make_low_rank_matrix(1000, 100, tail_strength=0., effective_rank=10, random_state=1999) prec = 3 n_samples, n_features = X.shape for nc in [None, 99]: pca ...
681
[ -0.0116764260455966, 0.005401016212999821, 0.009243588894605637, 0.008642815053462982, 0.00729850959032774, -0.025173017755150795, -0.008256178349256516, 0.014656501822173595, 0.024720950052142143, -0.010332119651138783, 0.013371678069233894, -0.03276299312710762, -0.0010892743011936545, -...
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 get_imap_messages(): # type: () -> Generator[Message, None, None] mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT) mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD) try: mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER) try:...
682
[ 0.03873105347156525, 0.015795152634382248, 0.028863416984677315, 0.008411756716668606, 0.022404389455914497, 0.00933034811168909, -0.03882349282503128, 0.003316173329949379, -0.04145794361829758, 0.009728982113301754, -0.012640743516385555, -0.03313862159848213, 0.013507340103387833, 0.044...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "__doc__", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "help", "ctx": {"_type": "Store", "_fields": {}}}}], "typ...
class Command(BaseCommand): help = __doc__ def add_arguments(self, parser): # type: (ArgumentParser) -> None parser.add_argument('recipient', metavar='<recipient>', type=str, nargs='?', default=None, help="original recipient") def handle(self, *args, **options):...
683
[ 0.049176059663295746, 0.05484355613589287, 0.027743514627218246, 0.005751024931669235, 0.01677975244820118, -0.016037285327911377, -0.0060882288962602615, 0.0005444757407531142, -0.02964917942881584, 0.013735638000071049, 0.020987065508961678, -0.0027084574103355408, -0.030861875042319298, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "...
def handle(self, *args, **options): # type: (*Any, **str) -> None rcpt_to = force_text(os.environ.get("ORIGINAL_RECIPIENT", options['recipient'])) if rcpt_to is not None: if is_missed_message_address(rcpt_to): try: mark_missed_message_address_as_us...
684
[ 0.024627434089779854, -0.02573610469698906, 0.0701078400015831, -0.03482969477772713, -0.033633824437856674, 0.011821666732430458, -0.027006715536117554, -0.0001540577068226412, 0.022198325023055077, 0.027006715536117554, 0.02476446144282818, -0.033783309161663055, -0.016779541969299316, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class ModelRelease_SinceLastAccepted(TestCase): def test_OnlyOneRelease_ReturnsThatRelease(self): r = test_release() self.assertEqual([r], r.since_last_accepted) def test_TwoRelease_ReturnsThatBothRelease(self): p = test_project() r1 = test_release(project=p) r2 = test_...
685
[ 0.004472755827009678, -0.03165435791015625, 0.07729552686214447, -0.04227592051029205, -0.0009070393280126154, 0.0130994888022542, -0.015971779823303223, 0.03005060739815235, 0.03799048811197281, 0.045404549688100815, 0.012047848664224148, -0.01138400100171566, -0.03622899204492569, -0.013...
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_ThreeReleaseFirstIsAccepted_ReturnsTwoRecentReleases(self): p = test_project() r1 = test_release(project=p) for res in r1.responses: res.response = ResponseCodes.Accept res.save() r2 = test_release(project=p, number="2") r3 = test_release(project...
686
[ 0.03728282451629639, -0.012229586020112038, 0.08554565161466599, -0.045504167675971985, -0.042226556688547134, 0.016538279131054878, -0.024664023891091347, 0.004066286142915487, 0.031219245865941048, 0.02712223120033741, 0.018054174259305, -0.03340432047843933, -0.04381073638796806, -0.000...
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_ManyReleasesSomeAreAcceptedCheckAnAcceptedInTheMiddle_ReturnsUntilThePreviousSaved(self): p = test_project() r1 = test_release(project=p) for res in r1.responses: res.response = ResponseCodes.Accept res.save() r2 = test_release(project=p, number="2") ...
687
[ 0.012517939321696758, 0.02480943873524666, 0.05372311919927597, -0.04777904227375984, -0.0034797608386725187, -0.0014488683082163334, 0.0007744103786535561, -0.0019017502199858427, -0.009376071393489838, 0.029692070558667183, 0.031899869441986084, -0.026819100603461266, 0.006453567650169134,...
17
{"_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 Path: def __init__(self): self.db = DB() self.sstate = 0 self.dstate = 0 self.anytype = 0 self.ffov = 0 self.s = set() self.sd = [] self.pairs = [] self.r = {} self.currentpath = '' pass def start_element(self, name, attrs): #print 'Start element:', nam...
688
[ 0.010415185242891312, -0.007116864435374737, 0.030612707138061523, -0.00803932175040245, 0.05208665132522583, -0.0008232394466176629, -0.015477973967790604, 0.027888240292668343, -0.051271457225084305, -0.02389807626605034, 0.045994143933057785, -0.042433030903339386, 0.04526476189494133, ...
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 DB: def __init__(self): engine = create_engine('oracle://flxuser:flxuser@messpdb') self.connection = engine.connect() pass def execute(self, sql): return self.connection.execute(sql) def getName(self,id): sql = """select sequenceno, stepname from operation_step where id = %s""...
689
[ 0.027922332286834717, -0.0008470853790640831, -0.02379635162651539, -0.019310547038912773, -0.01961040124297142, -0.0012121566105633974, -0.008251960389316082, -0.030153239145874977, 0.012557853013277054, -0.013517383486032486, 0.027634473517537117, -0.015148584730923176, 0.02340054512023925...
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def start_element(self, name, attrs): #print 'Start element:', name, attrs #print name, attrs if name == 'SourceStepID': self.sstate = 1 if name == 'DestinationStepID': self.dstate = 1 if name == 'anyType': self.anytype = 1 if name == 'FlowFunctionOutputValue': self.ff...
690
[ 0.07783043384552002, -0.006943979300558567, -0.005889121443033218, -0.02075960487127304, -0.035925447940826416, -0.007944587618112564, -0.02288137748837471, -0.02259204350411892, 0.007818005047738552, -0.03349023312330246, 0.0483185239136219, -0.02458120509982109, 0.004746860824525356, -0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def end_element(self, name): #print 'End element:', name if name == 'SourceStepID': self.sstate = 0 if name == 'DestinationStepID': self.dstate = 0 if name == 'anyType': self.anytype = 0 if name == 'FlowFunctionOutputValue': self.ffov = 0 pass
691
[ 0.03227069601416588, 0.0189776960760355, 0.04840604588389397, -0.05239681899547577, -0.00901512335985899, -0.01055831741541624, 0.013673416338860989, 0.006538835819810629, -0.006219430360943079, 0.03838605061173439, 0.03456754609942436, -0.02130325511097908, -0.019422711804509163, -0.03973...
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 __del__(self): g = """ graph G { rankdir = TB; fontsize=10; fontname="simsun.ttc"; label="Workstation Operation 2.7" node[style=filled,color=lightskyblue, fontsize=10, fontname="simsun.ttc" ,shape=box]; Start[label="Start" color=green shape=diamond]; /* Logout[label="Logout" color=red, s...
692
[ 0.08191078901290894, 0.0012185138184577227, 0.04546291008591652, -0.008397066965699196, 0.0035775385331362486, -0.0047650025226175785, -0.01925388164818287, -0.0049134353175759315, 0.015630904585123062, 0.013910293579101562, -0.0169758889824152, -0.015449149534106255, 0.013546784408390522, ...
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}}], "kwarg": null...
def char_data(self, data): #print 'Character data:', repr(data) if self.sstate == 1: #print data, self.sd.append(data) self.s.add(data) if self.dstate == 1: self.sd.append(data) self.pairs.append(self.sd) self.currentpath = "%s-%s"%(self.sd[0],self.sd[1]) self.sd = ...
693
[ 0.051620785146951675, 0.04957595095038414, 0.053801946341991425, -0.018835226073861122, -0.02515150047838688, 0.020834622904658318, 0.01054795365780592, -0.008912083692848682, 0.06170865148305893, -0.010479792021214962, 0.040442340075969696, -0.04119211435317993, 0.026401124894618988, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): p = xml.parsers.expat.ParserCreate() path = Path() p.StartElementHandler = path.start_element p.EndElementHandler = path.end_element p.CharacterDataHandler = path.char_data #input = file('wp27.xml','r') input = file('COB_SO_SubAssmMgmt27.xml','r') inputxml = '' for line in input: ...
694
[ 0.03445642441511154, 0.011531084775924683, 0.03716815635561943, -0.0033678975887596607, 0.016519179567694664, 0.0331876315176487, -0.05299074202775955, -0.002406973857432604, 0.041745759546756744, 0.013720373623073101, -0.006561647169291973, -0.08344176411628723, 0.03281445428729057, -0.06...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "service"}}, {"_type": "Constant", "_fields": {"kind": nul...
class CommandDelRequiredServicePersonality(BrokerCommand): required_parameters = ["service", "archetype", "personality"] def render(self, session, service, archetype, personality, **arguments): dbpersonality = Personality.get_unique(session, name=personality, ...
695
[ -0.004822975490242243, 0.009947788901627064, -0.02877087891101837, -0.042282916605472565, -0.05379126965999603, -0.002573645208030939, -0.03986822068691254, -0.0031098881736397743, -0.041897594928741455, 0.03342045843601227, 0.06766294687986374, -0.028925009071826935, -0.01540012750774622, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "engine", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def do_filtertest(engine): app = pg.mkQApp() dev = NumpyDeviceBuffer() dev.configure(nb_channel=nb_channel, sample_interval=1./sample_rate, chunksize=chunksize, buffer=buffer) dev.output.configure(**stream_spec) dev.initialize() f1, f2 = 40., 60. coeff...
696
[ 0.05107058584690094, -0.0030225038062781096, 0.043931975960731506, -0.007266086060553789, 0.018289335072040558, 0.007614965550601482, -0.025105902925133705, 0.034217026084661484, 0.039960116147994995, -0.0013602945255115628, 0.0189602579921484, -0.06333503872156143, 0.021066952496767044, -...
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": "session", "annotation": null, "type_comment": null}}, {"_type": "...
def render(self, session, service, archetype, personality, **arguments): dbpersonality = Personality.get_unique(session, name=personality, archetype=archetype, compel=True) dbservice = Service.get_unique(session, service, compel=True) try: ...
697
[ 0.03168100491166115, 0.041845791041851044, 0.04648039862513542, -0.025859760120511055, 0.012873906642198563, 0.0010068233823403716, -0.025300024077296257, 0.011575320735573769, -0.012191029265522957, 0.02219909243285656, 0.013982181437313557, -0.010170386172831059, 0.010702134110033512, -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": "req", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def create(self, req, body): context = req.environ['nova.context'] authorize(context) sg_rule = self._from_body(body, 'security_group_default_rule') try: values = self._rule_args_to_dict(to_port=sg_rule.get('to_port'), from_port=sg_rule.get('from_port'), ...
698
[ 0.008128693327307701, 0.023955771699547768, 0.05503225326538086, -0.024144399911165237, 0.009531614370644093, 0.0020012264139950275, -0.030652068555355072, -0.010144655592739582, -0.018261559307575226, 0.010309705510735512, -0.0062306225299835205, -0.0618700236082077, 0.014689414761960506, ...
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 SecurityGroupDefaultRulesController(sg.SecurityGroupControllerBase): def __init__(self): self.security_group_api = ( openstack_driver.get_openstack_security_group_driver( skip_policy_check=True)) @extensions.expected_errors((400, 409, 501)) def create(self, req, b...
699
[ 0.006544915493577719, 0.01809893548488617, 0.00653900858014822, -0.010520301759243011, 0.04293181002140045, 0.010354907251894474, -0.04255376383662224, 0.02729017101228237, 0.0011237998260185122, 0.0023066692519932985, 0.033811457455158234, -0.0120502058416605, 0.01125276554375887, -0.0073...
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": "req", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def show(self, req, id): context = req.environ['nova.context'] authorize(context) try: id = self.security_group_api.validate_id(id) except exception.Invalid as ex: raise exc.HTTPBadRequest(explanation=ex.format_message()) try: rule = self.sec...
700
[ 0.024492226541042328, 0.03229328989982605, 0.008640066720545292, -0.028737248852849007, 0.01750238612294197, 0.01664671301841736, -0.03247109055519104, 0.05662994086742401, 0.0021350132301449776, 0.013346263207495213, 0.05685219168663025, -0.029448457062244415, -0.0023280950263142586, 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": "req", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def delete(self, req, id): context = req.environ['nova.context'] authorize(context) try: id = self.security_group_api.validate_id(id) except exception.Invalid as ex: raise exc.HTTPBadRequest(explanation=ex.format_message()) try: rule = self.s...