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
18,901
[ -0.05495221167802811, -0.020619455724954605, 0.04037254676222801, -0.03933291137218475, -0.00930722150951624, 0.001475138938985765, -0.007227948401123285, 0.04648660123348236, 0.04019927605986595, 0.019827350974082947, 0.05925927683711052, 0.005034191999584436, 0.009802286513149738, -0.032...
11
{"_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": "Expr", "_fields": {"value...
def test_serve(): if is_port_8000_in_use(): pytest.skip("port 8000 already in use") p = subprocess.Popen([os.path.join(wpt.localpaths.repo_root, "wpt"), "serve"], preexec_fn=os.setsid) start = time.time() try: while True: if p.poll() is not None: ...
18,902
[ 0.037251658737659454, 0.000388406275305897, 0.06361763179302216, -0.06484286487102509, -0.014832333661615849, 0.0727597251534462, -0.01804855838418007, 0.016823330894112587, 0.0016125303227454424, 0.031101955100893974, -0.0035343130584806204, -0.025588426738977432, 0.038759633898735046, -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 RangeDatasetSerializationTest( dataset_serialization_test_base.DatasetSerializationTestBase, parameterized.TestCase): def _iterator_checkpoint_prefix_local(self): return os.path.join(self.get_temp_dir(), "iterator") def _save_op(self, iterator_resource): iterator_state_variant = gen_dataset_...
18,903
[ 0.004323224071413279, 0.007260838523507118, 0.05039021745324135, -0.06007133424282074, 0.0022266570013016462, 0.07662604749202728, -0.012325272895395756, 0.038893889635801315, -0.006093053612858057, -0.006710224784910679, 0.032359134405851364, -0.027203941717743874, 0.009917095303535461, -...
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 testSaveRestore(self): def _build_graph(start, stop): iterator = dataset_ops.make_initializable_iterator( dataset_ops.Dataset.range(start, stop)) init_op = iterator.initializer get_next = iterator.get_next() save_op = self._save_op(iterator._iterator_resource) restore_op...
18,904
[ 0.01568237878382206, 0.005251724738627672, 0.009609096683561802, -0.02142287790775299, -0.021714061498641968, 0.017110569402575493, 0.04290121793746948, -0.013366766273975372, 0.01906566694378853, 0.02196364849805832, 0.034332066774368286, -0.0373271107673645, -0.023627562448382378, 0.0011...
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": "awaken", "annotation": null, "type_comment": null}}, {"_type": "a...
def fixed_point(self, awaken, verbosity=0): if verbosity: s = "# constraints to awaken: {}, # variables to determine: {}|{}" print(s.format(len(awaken), len(self.dstore.ess_undet), len(self.dstore.undetermined))) if self.dstore.is_determined(): # All essential variabl...
18,905
[ 0.042870551347732544, 0.024954499676823616, -0.0029207353945821524, -0.06760440766811371, -0.03598655015230179, 0.03322853893041611, -0.0024725585244596004, 0.02632247284054756, 0.0005684953648597002, 0.000878427061252296, 0.030889742076396942, 0.0018202883657068014, 0.022792216390371323, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "start", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "stop", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _build_graph(start, stop): iterator = dataset_ops.make_initializable_iterator( dataset_ops.Dataset.range(start, stop)) init_op = iterator.initializer get_next = iterator.get_next() save_op = self._save_op(iterator._iterator_resource) restore_op = self._restore_op(iterator._it...
18,906
[ 0.015424233861267567, 0.06370208412408829, 0.01625971309840679, -0.055887140333652496, -0.030154377222061157, 0.015090042725205421, 0.06437046825885773, -0.027969278395175934, 0.006327149458229542, 0.057892292737960815, 0.004418400581926107, 0.015694158151745796, 0.024254608899354935, 0.02...
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": "constraints", "annotation": null, "type_comment": null}}, {"_type...
def run_constraints(self, constraints, verbosity=0, tracevar=[]): awaken = set() all_changed = set() for constraint in constraints: state, changed_vars = constraint.run(dstore=self.dstore, verbosity=verbosity, tracevar=tracevar) all_changed.update(changed_vars) ...
18,907
[ -0.01307921577244997, 0.002094805706292391, 0.008053924888372421, 0.03459373861551285, -0.04074074700474739, -0.032283004373311996, 0.03490782156586647, -0.002654261887073517, -0.04127917066216469, 0.014638401567935944, 0.05110540613532066, -0.025889219716191292, 0.021828604862093925, -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": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def on_expose(): gl.glClearColor(1.0, 1.0, 1.0, 1.0) gl.glClear(gl.GL_COLOR_BUFFER_BIT) img.blit( (win.width - img.width) / 2, (win.height - img.height) / 2 )
18,908
[ -0.004092058166861534, 0.008705247193574905, -0.005477791652083397, -0.004512515850365162, -0.015290440991520882, -0.011186538264155388, 0.022882364690303802, -0.019175231456756592, -0.004743471276015043, 0.017138084396719933, 0.07082636654376984, 0.03183633089065552, 0.02574858069419861, ...
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": "ctx", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def __call__(self, ctx, req): if IValueSet.providedBy(ctx): if ctx.values and ctx.values[0].domainelement: if 'icon' in ctx.values[0].domainelement.jsondatadict: return svg.data_url(svg.icon(ctx.values[0].domainelement.jsondata['icon'])) if IDomainElement....
18,909
[ -0.005250039044767618, 0.015436012297868729, -0.006343797314912081, 0.008985643275082111, -0.020652396604418755, -0.006848608609288931, 0.05294911190867424, -0.02775341086089611, -0.007263675797730684, 0.0063494062051177025, 0.04805804789066315, 0.026182886213064194, 0.05146833136677742, -...
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": "ctx", "annotation": nu...
class GlottologMapMarker(MapMarker): def __call__(self, ctx, req): if IValueSet.providedBy(ctx): if ctx.values and ctx.values[0].domainelement: if 'icon' in ctx.values[0].domainelement.jsondatadict: return svg.data_url(svg.icon(ctx.values[0].domainelement.json...
18,910
[ 0.0037536739837378263, 0.035508688539266586, 0.016046511009335518, -0.0018397746607661247, -0.015963492915034294, -0.00524506252259016, -0.03645748645067215, 0.02905687689781189, -0.053749293088912964, 0.04442737251520157, -0.004462305922061205, -0.06489764153957367, 0.0010229205945506692, ...
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": "query", "annotation": null, "type_comment": null}}, {"_type": "ar...
def refined_query(self, query, model, req): if model == Language: query = query.options( joinedload(models.Languoid.family), joinedload(models.Languoid.children), joinedload(Language.valuesets) .joinedload(ValueSet.references) ...
18,911
[ -0.03320738673210144, 0.045431267470121384, 0.03199489787220955, -0.005471671465784311, -0.0049551259726285934, -0.0038632662035524845, 0.00943391676992178, 0.006396504584699869, -0.042164966464042664, 0.036003537476062775, 0.010021603666245937, -0.04456520453095436, 0.010584545321762562, ...
18
{"_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": "query", "annotation": ...
class GLCtxFactoryQuery(CtxFactoryQuery): def refined_query(self, query, model, req): if model == Language: query = query.options( joinedload(models.Languoid.family), joinedload(models.Languoid.children), joinedload(Language.valuesets) ...
18,912
[ 0.02951100468635559, 0.04279189556837082, -0.036292336881160736, 0.002989139873534441, -0.023574991151690483, -0.013891398906707764, -0.030375108122825623, -0.0019054885488003492, -0.02896624431014061, 0.07014264166355133, -0.012257116846740246, 0.035972993820905685, -0.007762840483337641, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":...
class SearchWidget(QLineEdit): def __init__(self, parent): super(SearchWidget, self).__init__() def keyPressEvent(self, event): if event.key() in [Qt.Key.Key_Return, Qt.Key.Key_Enter]: self.parent().load() elif event.key() == Qt.Key.Key_Escape: self.line_edit.set...
18,913
[ -0.022298747673630714, 0.03581949323415756, 0.016966437920928, -0.004274363163858652, -0.016507886350154877, -0.009347918443381786, -0.028325436636805534, 0.010612212121486664, -0.02050384320318699, 0.029661789536476135, 0.0050932071171700954, -0.06666041910648346, 0.010644965805113316, 0....
17
{"_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": "model", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __call__(self, model, req): if model == Language: # responses for no longer supported legacy codes if not models.Languoid.get(req.matchdict['id'], default=None): legacy = models.LegacyCode.get(req.matchdict['id'], default=None) if legacy: ...
18,914
[ 0.03050863929092884, 0.009586147964000702, -0.016408832743763924, -0.010734520852565765, 0.002246081829071045, 0.0019835527054965496, -0.012214508838951588, -0.025964276865124702, -0.0343652069568634, 0.02800309844315052, -0.00365698360837996, -0.03957279771566391, 0.027536379173398018, -0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":...
class FireflyBrowserView(FireflyView): def __init__(self, parent): super(FireflyBrowserView, self).__init__(parent) self.current_page = 1 self.page_count = 1 self.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers) self.activated.connect(self.on_activate) se...
18,915
[ 0.03280677646398544, 0.03923656418919563, -0.022366328164935112, 0.01469514425843954, -0.0243398267775774, 0.01238211803138256, 0.00008338964107679203, 0.03505614027380943, -0.04401116073131561, 0.034568071365356445, 0.008822391740977764, 0.027522891759872437, 0.03630814701318741, 0.054409...
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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul...
def keyPressEvent(self, event): if event.key() in [Qt.Key.Key_Return, Qt.Key.Key_Enter]: self.parent().load() elif event.key() == Qt.Key.Key_Escape: self.line_edit.setText("") elif event.key() in [Qt.Key.Key_Down, Qt.Key.Key_Up]: self.parent().view.setFocus() ...
18,916
[ 0.01190814096480608, 0.022243747487664223, 0.0036777006462216377, -0.031044866889715195, -0.027975888922810555, -0.004467138089239597, -0.0023112446069717407, -0.007165175396949053, -0.012256888672709465, 0.02283978834748268, -0.005586300510913134, -0.05864030122756958, 0.029523059725761414,...
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": "selected", "annotation": null, "type_comment": null}}, {"_type": ...
def selectionChanged(self, selected, deselected): rows = [] self.selected_objects = [] tot_dur = 0 for idx in self.selectionModel().selectedIndexes(): row = idx.row() if row in rows: continue rows.append(row) obj = self.mod...
18,917
[ 0.030549772083759308, 0.01367113459855318, 0.010317837819457054, 0.0018056216649711132, 0.006403788458555937, -0.0005309620755724609, 0.0017313219141215086, -0.015689842402935028, -0.040239568799734116, 0.05176863074302673, 0.008489785715937614, 0.010396342724561691, 0.01903192512691021, -...
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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, parent): super(FireflyBrowserView, self).__init__(parent) self.current_page = 1 self.page_count = 1 self.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers) self.activated.connect(self.on_activate) self.setModel(BrowserModel(self)) sel...
18,918
[ 0.0661056712269783, -0.005510758142918348, 0.0002205254859291017, 0.008345196954905987, 0.0027041365392506123, 0.016608405858278275, 0.02541624940931797, -0.019091468304395676, 0.0070860967971384525, 0.047014202922582626, 0.008128514513373375, -0.032982561737298965, -0.027196558192372322, ...
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": "current_page", "annotation": null, "type_comment": null}}, {"_typ...
def set_page(self, current_page, page_count): self.current_page = current_page self.page_count = page_count if self.page_count > 1: self.parent().pager.show() else: self.parent().pager.hide() if self.current_page == 1: self.parent().pager.btn_...
18,919
[ 0.024588586762547493, -0.0025928791146725416, -0.020295342430472374, -0.05285054072737694, 0.011462046764791012, 0.01751735992729664, -0.02571355551481247, 0.008345426060259342, -0.015347777865827084, -0.00901696365326643, 0.03266999125480652, -0.016989313066005707, 0.0021078800782561302, ...
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": "index", "annotation": null, "type_comment": null}}], "kwarg": nul...
def on_header_clicked(self, index): old_order, old_trend = self.current_order value = self.model().header_data[index] if value == old_order: if old_trend == "asc": trend = "desc" else: trend = "asc" else: trend = "asc" ...
18,920
[ 0.04349260404706001, -0.002658344805240631, 0.0008496278314851224, 0.00786036066710949, 0.014240387827157974, -0.03442296013236046, 0.008595314808189869, -0.023247485980391502, -0.032046087086200714, 0.031545691192150116, -0.009106134064495564, -0.01890031062066555, -0.013635745272040367, ...
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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, parent): layout = QHBoxLayout() super(Pager, self).__init__(parent) self._parent = parent self.btn_prev = PagerButton() self.btn_prev.setIcon(QIcon(pixlib["previous"])) self.btn_prev.clicked.connect(self.on_prev) layout.addWidget(self.btn_prev,...
18,921
[ 0.03906475007534027, -0.010570337064564228, -0.0036742237862199545, -0.004121267702430487, 0.016030089929699898, -0.021034864708781242, 0.0008319246699102223, -0.00848060566931963, -0.03950914740562439, 0.03354151174426079, -0.0041953339241445065, 0.0032880203798413277, -0.012908720411360264...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":...
class Pager(QWidget): def __init__(self, parent): layout = QHBoxLayout() super(Pager, self).__init__(parent) self._parent = parent self.btn_prev = PagerButton() self.btn_prev.setIcon(QIcon(pixlib["previous"])) self.btn_prev.clicked.connect(self.on_prev) layou...
18,922
[ -0.00487926509231329, 0.01615767925977707, -0.020033888518810272, 0.010690181516110897, -0.007732020225375891, -0.011982251890003681, -0.05668788030743599, -0.014443985186517239, -0.021081145852804184, -0.0015181825729086995, 0.013267521746456623, -0.01934025064110756, 0.045725684612989426, ...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":...
class BrowserTab(QWidget): def __init__(self, parent, **kwargs): super(BrowserTab, self).__init__(parent) self._parent = parent self.loading = False self.title = False # Search query self.search_query = { "id_view": kwargs.get("id_view", min(config["view...
18,923
[ 0.027248328551650047, 0.0017688445514068007, -0.0028612425085157156, 0.015248756855726242, -0.0011729274410754442, -0.04387518763542175, -0.015226348303258419, -0.01773606240749359, -0.039169471710920334, 0.03435171768069267, 0.0063078985549509525, 0.001421517925336957, 0.03934873640537262, ...
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": "parent", "annotation": null, "type_comment": null}}], "kwarg": {"...
def __init__(self, parent, **kwargs): super(BrowserTab, self).__init__(parent) self._parent = parent self.loading = False self.title = False # Search query self.search_query = { "id_view": kwargs.get("id_view", min(config["views"])), "fulltext": ...
18,924
[ 0.014629381708800793, 0.02385427989065647, -0.0019640761893242598, -0.05819139629602432, -0.026649702340364456, -0.007040972355753183, -0.02027846686542034, 0.003048758488148451, -0.02024352364242077, 0.027255376800894737, 0.02751162461936474, -0.0165861789137125, 0.03361496701836586, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def load_view_menu(self): i = 1 for id_view in sorted( config["views"].keys(), key=lambda k: config["views"][k]["position"] ): view = config["views"][id_view] if view.get("separator", False): self.action_search.addSeparator() action...
18,925
[ 0.023487985134124756, 0.006216753739863634, 0.05507220700383186, -0.01574762724339962, -0.04221609607338905, -0.007718116510659456, -0.02629052847623825, -0.04034773260354996, -0.057296447455883026, 0.038190219551324844, 0.013256476260721684, 0.0018794836942106485, -0.009058221243321896, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def on_section_resize(self, *args, **kwargs): if self.loading: return if "browser_view_sizes" not in self.app_state: self.app_state["browser_view_sizes"] = {} if "browser_default_sizes" not in self.app_state: self.app_state["browser_default_sizes"] = {} ...
18,926
[ 0.042885251343250275, 0.028025591745972633, -0.022560488432645798, -0.026060864329338074, -0.008321861736476421, -0.0006810207269154489, -0.021679747849702835, 0.015898482874035835, -0.035207007080316544, 0.036652322858572006, 0.038458969444036484, -0.011833528988063335, 0.00790972076356411,...
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 load(self, **kwargs): self.loading = True self.old_view = self.search_query.get("id_view", -1) search_string = self.search_box.text() self.search_query["fulltext"] = search_string self.search_query.update(kwargs) if self.search_query.get("id_view") != self.old_view: ...
18,927
[ 0.03308987244963646, 0.015942389145493507, -0.002923294436186552, 0.004045224282890558, -0.0486556701362133, -0.017360884696245193, -0.01562856324017048, -0.05804536119103432, -0.02608526311814785, 0.036780472844839096, 0.036529410630464554, 0.021202122792601585, 0.0310311708599329, 0.0080...
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 load_callback(self): if self.first_load or self.id_view != self.old_view: view_state = self.app_state.get("browser_view_sizes", {}).get( self.id_view, {} ) default_sizes = self.app_state.get("browser_defaut_sizes", {}) for i, h in enumerate(sel...
18,928
[ 0.04219302162528038, 0.014667907729744911, -0.01071231160312891, -0.002553516300395131, -0.014485621824860573, 0.017134837806224823, -0.015117545612156391, 0.036165446043014526, -0.0011157392291352153, 0.014230422675609589, 0.018933389335870743, -0.028728196397423744, 0.0174994096159935, -...
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 on_reset(self): objects = [ obj.id for obj in self.view.selected_objects if obj["status"] not in [ObjectStatus.ARCHIVED, ObjectStatus.TRASHED, ObjectStatus.RESET] ] if not objects: return response = api.set(objects=objects, ...
18,929
[ -0.00629457226023078, 0.04030526801943779, -0.009688765741884708, -0.007457224186509848, -0.014076839201152325, -0.00016584197874180973, -0.011295225471258163, -0.01433937344700098, -0.013089210726320744, 0.004350568633526564, 0.019102495163679123, -0.031854163855314255, 0.06540855020284653,...
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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul...
def contextMenuEvent(self, event): if not self.view.selected_objects: return menu = QMenu(self) objs = self.view.selected_objects states = set([obj["status"] for obj in objs]) if states == set([ObjectStatus.TRASHED]): action_untrash = QAction("Untrash", ...
18,930
[ 0.030301693826913834, 0.034864772111177444, -0.016909534111618996, -0.004203617572784424, -0.0040342845022678375, 0.017444269731640816, -0.012114736251533031, 0.0322742760181427, -0.016719404608011246, -0.020997291430830956, 0.004904715344309807, -0.007284289691597223, 0.019713925197720528, ...
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 on_untrash(self): objects = [ obj.id for obj in self.view.selected_objects if obj["status"] in [ObjectStatus.TRASHED] ] if not objects: return response = api.set(objects=objects, data={"status": ObjectStatus.CREATING}) if not re...
18,931
[ 0.04870693385601044, 0.04236336797475815, -0.018994245678186417, 0.01695263758301735, -0.013076012954115868, 0.02564162388443947, -0.008786206133663654, 0.018945636227726936, -0.01900639757514, 0.011897227726876736, -0.0048123616725206375, -0.019358819350600243, 0.027027001604437828, -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 on_trash(self): objects = [ obj.id for obj in self.view.selected_objects if obj["status"] not in [ObjectStatus.ARCHIVED, ObjectStatus.TRASHED] ] if not objects: return ret = QMessageBox.question( self, "Trash", ...
18,932
[ 0.04352055490016937, 0.03672490641474724, -0.02017383649945259, -0.010075079277157784, 0.009749503806233406, 0.03371777385473251, -0.04498860239982605, 0.004862912930548191, 0.002212432911619544, -0.011921979486942291, 0.014325318858027458, -0.02431752346456051, 0.01966475509107113, -0.026...
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 on_unarchive(self): objects = [ obj.id for obj in self.view.selected_objects if obj["status"] in [ObjectStatus.ARCHIVED] ] if not objects: return response = api.set(objects=objects, data={"status": ObjectStatus.RETRIEVING}) if n...
18,933
[ 0.04721307381987572, 0.03747567906975746, -0.023401157930493355, -0.004802251234650612, -0.0006316168582998216, 0.04276721924543381, -0.030347811058163643, -0.027786610648036003, -0.0028541681822389364, 0.013373816385865211, 0.005273415241390467, -0.01599542237818241, 0.02991289086639881, ...
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 on_archive(self): objects = [ obj.id for obj in self.view.selected_objects if obj["status"] not in [ObjectStatus.ARCHIVED, ObjectStatus.TRASHED] ] if not objects: return ret = QMessageBox.question( self, "Archive...
18,934
[ 0.024926988407969475, 0.01841197907924652, -0.021610470488667488, -0.008633566088974476, 0.013207054696977139, 0.013561131432652473, -0.016747819259762764, -0.016830438748002052, 0.002146588871255517, -0.018541807308793068, 0.003747310023754835, -0.03975099325180054, 0.01716090925037861, -...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "objects", "annotation": null, "type_com...
def refresh_assets(self, *objects, request_data=False): if request_data: asset_cache.request([[aid, 0] for aid in objects]) for row, obj in enumerate(self.model().object_data): if obj.id in objects: self.model().object_data[row] = asset_cache[obj.id] ...
18,935
[ 0.08904023468494415, -0.037846364080905914, -0.015223833732306957, -0.0026878914795815945, -0.03872056305408478, 0.021631063893437386, 0.0008768629631958902, -0.03594871610403061, -0.03524509444832802, 0.030959391966462135, 0.00477610481902957, -0.012196124531328678, 0.03562888875603676, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def on_copy_result(self): result = "" for obj in self.view.selected_objects: result += "{}\n".format( "\t".join( [obj.format_display(key) or "" for key in self.model().header_data] ) ) clipboard = QApplication.clipboard(...
18,936
[ -0.0013061003992334008, 0.023664331063628197, 0.003999978303909302, 0.020650366321206093, -0.017530441284179688, -0.024417821317911148, -0.006434107664972544, -0.02962161973118782, -0.018566492944955826, 0.010083830915391445, 0.00209417543374002, -0.028043998405337334, 0.020497312769293785, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":...
class BrowserModule(BaseModule): def __init__(self, parent): super(BrowserModule, self).__init__(parent) self.tabs = QTabWidget(self) self.tabs.setTabsClosable(True) self.tabs.tabCloseRequested.connect(self.close_tab) self.tabs.currentChanged.connect(self.on_tab_switch) ...
18,937
[ 0.017426781356334686, 0.020584583282470703, 0.0025356074329465628, 0.020969942212104797, -0.023849427700042725, -0.022500673308968544, 0.002613214310258627, -0.038985464721918106, -0.02855936996638775, 0.026611166074872017, 0.006433351431041956, -0.011357380077242851, 0.025241002440452576, ...
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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, parent): super(BrowserModule, self).__init__(parent) self.tabs = QTabWidget(self) self.tabs.setTabsClosable(True) self.tabs.tabCloseRequested.connect(self.close_tab) self.tabs.currentChanged.connect(self.on_tab_switch) self.layout = QVBoxLayout(self) ...
18,938
[ 0.022852139547467232, 0.005240444093942642, -0.0011311417911201715, -0.0004764357872772962, -0.002899861428886652, 0.0010703201405704021, -0.00010337922140024602, 0.037001896649599075, 0.006767275743186474, -0.011224729008972645, 0.025458378717303276, -0.022471830248832703, 0.028232403099536...
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": "idx", "annotation": null, "type_comment": null}}], "kwarg": null,...
def close_tab(self, idx=False): if self.tabs.count() == 1: return if not idx: idx = self.tabs.currentIndex() w = self.tabs.widget(idx) w.deleteLater() self.tabs.removeTab(idx) self.redraw_tabs()
18,939
[ 0.013197279535233974, -0.004047991707921028, -0.05576315149664879, -0.0052381218411028385, -0.01639849692583084, -0.014488093554973602, 0.00092744966968894, -0.0034722888376563787, 0.0034645439591258764, 0.008302513509988785, 0.01830890215933323, -0.0032528506126254797, 0.0465519055724144, ...
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": "title", "annotation": null, "type_comment": null}}], "kwarg": {"_...
def new_tab(self, title=False, **kwargs): if "id_view" not in kwargs: try: id_view = self.tabs.currentWidget().id_view except AttributeError: pass else: kwargs["id_view"] = id_view tab = BrowserTab(self, **kwargs) ...
18,940
[ -0.010941160842776299, 0.013606386259198189, 0.01909070461988449, 0.03310374543070793, -0.04040151461958885, -0.006984538398683071, -0.01903575100004673, -0.008814476430416107, -0.05169986933469772, 0.014419691637158394, 0.009798136539757252, -0.037609897553920746, 0.04422625154256821, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def redraw_tabs(self, *args, **kwargs): QApplication.processEvents() views = [] for i, b in enumerate(self.browsers): id_view = b.id_view self.tabs.setTabText(i, b.title or config["views"][id_view]["title"]) sq = copy.copy(b.search_query) if self.t...
18,941
[ 0.011075519025325775, 0.0060800048522651196, 0.034928083419799805, 0.01700282283127308, 0.05240459367632866, 0.02909427136182785, -0.011418317444622517, -0.01364962663501501, 0.022649653255939484, 0.04250705614686012, 0.03223555535078049, 0.0027439489495009184, 0.03368154540657997, 0.02759...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class StatelessOpsTest(test.TestCase): def testMatchStateful(self): # Stateless ops should be the same as stateful ops on the first call # after seed scrambling. key = 0x3ec8f720, 0x02461e29 for seed in (7, 17), (11, 5), (2, 3): preseed = invert_philox(key, (seed[0], 0, seed[1], 0)).astype(np.u...
18,942
[ 0.0027441249694675207, 0.004497228655964136, 0.021125057712197304, -0.00005517651152331382, 0.04250100627541542, 0.01505348552018404, 0.01238776370882988, -0.009314344264566898, 0.04365510866045952, 0.03600291907787323, 0.03994191437959671, -0.00383863877505064, 0.02360888384282589, 0.0155...
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 testMatchStateful(self): # Stateless ops should be the same as stateful ops on the first call # after seed scrambling. key = 0x3ec8f720, 0x02461e29 for seed in (7, 17), (11, 5), (2, 3): preseed = invert_philox(key, (seed[0], 0, seed[1], 0)).astype(np.uint64) preseed = preseed[::2] | pres...
18,943
[ 0.016453631222248077, -0.02543642371892929, 0.022742856293916702, 0.02095138095319271, 0.05925848335027695, -0.0063749877735972404, 0.005279138218611479, -0.02403881773352623, 0.032754797488451004, 0.03908213973045349, 0.023632241412997246, -0.0301628727465868, -0.015030614100396633, -0.00...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testDeterminism(self): # Stateless values should be equal iff the seeds are equal (roughly) with self.test_session(use_gpu=True): seed_t = array_ops.placeholder(dtypes.int64, shape=[2]) seeds = [(x, y) for x in range(5) for y in range(5)] * 3 for stateless_op, _ in CASES: for shape...
18,944
[ -0.003680902300402522, -0.018965179100632668, 0.031080465763807297, 0.006941304076462984, 0.030836697667837143, 0.0032086011487990618, 0.0007000722689554095, 0.021707572042942047, 0.004342123866081238, 0.019233323633670807, 0.002460537012666464, 0.0005991369253024459, 0.036467745900154114, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testShapeType(self): with self.test_session(use_gpu=True): for shape_dtype in [dtypes.int32, dtypes.int64]: seed_t = array_ops.placeholder(dtypes.int64, shape=[2]) seeds = [(x, y) for x in range(5) for y in range(5)] * 3 for stateless_op, _ in CASES: for shape in (), (3,)...
18,945
[ 0.011399133130908012, 0.04065980389714241, 0.03778211027383804, 0.0056623551063239574, 0.007833028212189674, -0.03721153363585472, -0.023468073457479477, -0.04125518724322319, 0.009029999375343323, -0.004654542542994022, -0.016782401129603386, -0.01664596050977707, 0.006347667425870895, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "cross"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"...
class Data(QBallData): name = "cross" default_params = { 'model': {}, 'solver': { 'pdhg': { 'n_w_tvw': { 'step_factor': 0.0001, 'step_bound': 1.25, }, 'sh_w_tvw': { 'step_factor': 0.001, 'step_bound': 0.08, }, 'sh_l_tvc': { 'step_factor...
18,946
[ 0.026056960225105286, 0.06894029676914215, 0.026176579296588898, 0.0023425347171723843, -0.03191827982664108, -0.005083798430860043, 0.010287215933203697, 0.0016136076301336288, 0.01267959177494049, -0.006429509725421667, -0.022269031032919884, -0.006808302830904722, -0.001801758073270321, ...
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": "text", "annotation": n...
class SafeMIMEText(MIMEMixin, MIMEText): def __init__(self, text, subtype, charset): self.encoding = charset if charset == 'utf-8': # Unfortunately, Python doesn't support setting a Charset instance # as MIMEText init parameter (http://bugs.python.org/issue16324). ...
18,947
[ 0.00762510672211647, 0.029906950891017914, 0.004965062718838453, 0.041373755782842636, 0.017783084884285927, -0.01562113594263792, -0.022234153002500534, 0.0006130156689323485, 0.017920855432748795, 0.007757578976452351, 0.025159142911434174, 0.003502567997202277, 0.0027713209856301546, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "addr", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "encoding", "annotation": null, "type_comment": null}}], "kwarg": ...
def sanitize_address(addr, encoding): if isinstance(addr, six.string_types): addr = parseaddr(force_text(addr)) nm, addr = addr # This try-except clause is needed on Python 3 < 3.2.4 # http://bugs.python.org/issue14291 try: nm = Header(nm, encoding).encode() except UnicodeEncodeE...
18,948
[ 0.05895407870411873, 0.053254589438438416, 0.027584630995988846, 0.030211739242076874, -0.02018197625875473, -0.005782976280897856, 0.032593946903944016, 0.004199475981295109, -0.0021720947697758675, -0.012033488601446152, -0.01904653012752533, -0.05062748119235039, 0.01757713221013546, 0....
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}}, {"_type": "arg", "_fields": {"arg": "_subtype", "annotation...
class SafeMIMEMultipart(MIMEMixin, MIMEMultipart): def __init__(self, _subtype='mixed', boundary=None, _subparts=None, encoding=None, **_params): self.encoding = encoding MIMEMultipart.__init__(self, _subtype, boundary, _subparts, **_params) def __setitem__(self, name, val): name, val ...
18,949
[ 0.02762734889984131, 0.03960452228784561, 0.03667011484503746, 0.0006450207438319921, -0.0296834297478199, -0.007760210894048214, 0.041201479732990265, 0.005619290750473738, 0.013164910487830639, 0.009591720066964626, -0.006642341148108244, 0.018035627901554108, -0.007840058766305447, 0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, text, subtype, charset): self.encoding = charset if charset == 'utf-8': # Unfortunately, Python doesn't support setting a Charset instance # as MIMEText init parameter (http://bugs.python.org/issue16324). # We do it manually and trigger re-encoding ...
18,950
[ 0.06716989725828171, -0.020943794399499893, 0.040103729814291, 0.013786345720291138, 0.0014892996987327933, -0.0220229160040617, 0.015118732117116451, 0.024467460811138153, 0.008286122232675552, -0.016572244465351105, -0.020998850464820862, -0.005670900922268629, -0.028365517035126686, -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 message(self): encoding = self.encoding or settings.DEFAULT_CHARSET msg = SafeMIMEText(self.body, self.content_subtype, encoding) msg = self._create_message(msg) msg['Subject'] = self.subject msg['From'] = self.extra_headers.get('From', self.from_email) msg['To'] = se...
18,951
[ 0.049508657306432724, 0.06475222855806351, 0.04039326682686806, 0.02144862711429596, -0.044259071350097656, -0.06238003075122833, 0.04533534497022629, 0.02684098482131958, -0.014233189634978771, -0.001134619116783142, -0.0066663166508078575, 0.009928089566528797, 0.012124569155275822, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "msg", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _create_attachments(self, msg): if self.attachments: encoding = self.encoding or settings.DEFAULT_CHARSET body_msg = msg msg = SafeMIMEMultipart(_subtype=self.mixed_subtype, encoding=encoding) if self.body: msg.attach(body_msg) for ...
18,952
[ 0.004461254924535751, -0.03511439263820648, -0.022750522941350937, -0.025178246200084686, -0.003256778698414564, -0.06297064572572708, -0.003042475786060095, -0.04452495276927948, -0.006200706586241722, 0.02298828959465027, 0.028181616216897964, -0.007871330715715885, -0.0037635972257703543,...
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": "row", "annotation": null, "type_comment": null}}], "kwarg": null,...
def __init__(self, row): self._id = int(row["id"]) self._side = row["side"] self._price = float(row["price"]) self._qty = int(row["qty"]) self._status = row["status"] self._imagined = row["imagined"] self._requested = row["requested"] self._confirmed = row...
18,953
[ 0.01728212647140026, -0.006334094796329737, -0.0408465713262558, -0.04376911371946335, 0.02977772429585457, -0.014808320440351963, -0.03458726406097412, -0.07271840423345566, -0.046944789588451385, -0.022505884990096092, 0.022505884990096092, -0.062178835272789, 0.010476282797753811, -0.00...
8
{"_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": "id"}}, {"_type": "Constant", "_fields": {"kind": null, "v...
class Order(object): schema = [ "id", "side", "price", "qty", "status", "imagined", "requested", "confirmed", "filled", "offset", "cancelled", "parent" ] def __init__(self, row): self._id = int(row["id"]) self._side = row["side"] self._price = float(row["price"]) self._qty = int(...
18,954
[ 0.023625139147043228, -0.011485900729894638, 0.023963473737239838, -0.008149215020239353, 0.028233500197529793, 0.011497567407786846, 0.0002692463749554008, -0.016181761398911476, 0.03007684275507927, 0.04645694047212601, -0.002486472949385643, -0.04267691820859909, -0.03675021603703499, 0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def _equivalent(self, a, b): a = float(a) b = float(b) margin = 0.001 if a < b + margin and a > b - margin: return True else: return False
18,955
[ 0.024717286229133606, 0.010659816674888134, 0.04318392649292946, -0.013927789404988289, 0.013000566512346268, -0.030423270538449287, 0.023640930652618408, 0.006866633426398039, -0.013746235519647598, -0.01593785174190998, 0.015613648109138012, -0.018790844827890396, -0.03439152240753174, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __init__(self): global _GDOC if _GDOC is None: f = open('auth.yaml', 'r') auth = yaml.safe_load(f) f.close() gc = gspread.login(auth["gdoc-login"], auth["gdoc-password"]) spreadsheet = gc.open("Silverbot 2014") schema = { ...
18,956
[ 0.050510745495557785, -0.020213766023516655, 0.02000073902308941, -0.030367987230420113, 0.012568512000143528, 0.004278264939785004, -0.001966048963367939, -0.024805651977658272, -0.01629646122455597, 0.037539850920438766, 0.02358667179942131, -0.010674950666725636, 0.013337771408259869, 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": "sheet", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _add(self, sheet, values): flat = [] count = 0 id = sheet.row_count + 1 while count < len(values): added = False for key, value in iter(values.items()): if len(flat)+1 == self.schema[sheet.title][key]: if value == "%ID%": ...
18,957
[ 0.06770279258489609, -0.01918736658990383, 0.022111758589744568, -0.03435632586479187, 0.003765941597521305, -0.011192630976438522, 0.009598943404853344, -0.0254148468375206, -0.010046017356216908, -0.0020696900319308043, 0.02073371782898903, -0.024278752505779266, -0.023668628185987473, 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": "sheet", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _select(self, sheet, header, value): result = [] column = sheet.col_values(self.schema[sheet.title][header]) headers = sheet.row_values(1) for i in range(1, len(column)): if column[i] == value: row = sheet.row_values(i+1) block = {} ...
18,958
[ 0.026895157992839813, -0.034435857087373734, 0.012864888645708561, -0.032744914293289185, 0.014075971208512783, -0.03555553779006004, -0.02920306846499443, -0.008066262118518353, -0.022176509723067284, -0.016760917380452156, 0.018486136570572853, -0.05936586484313011, -0.0036075387615710497,...
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": "criteria", "annotation": null, "type_comment": null}}], "kwarg": ...
def query_orders(self, criteria): sheet = self._spreadsheet.worksheet("Book") # Collect data set in memory, tediously inefficient columns = {} rows = 0 for key, value in iter(criteria.items()): column = sheet.col_values(self.schema[sheet.title][key]) ...
18,959
[ 0.024023860692977905, -0.040684085339307785, -0.02232101932168007, -0.026946302503347397, 0.0134386345744133, -0.0375775508582592, -0.03447101637721062, -0.026670167222619057, -0.05554942414164543, -0.04183465242385864, 0.012575708329677582, -0.03012187033891678, -0.0046885646879673, 0.025...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "id", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def get_order(self, id): sheet = self._spreadsheet.worksheet("Book") headers = sheet.row_values(1) row = sheet.row_values(id) block = {} for i in range(0, len(headers)): block[headers[i]] = None if i < len(row): block[headers[i]] = row[i] ...
18,960
[ 0.048108384013175964, -0.01715339906513691, -0.01106446422636509, -0.030479468405246735, 0.025561928749084473, 0.008878246881067753, 0.004830555059015751, 0.00023739597236271948, -0.05771150439977646, -0.0051089064218103886, 0.017826082184910774, -0.048433128744363785, -0.03477071598172188, ...
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": "order", "annotation": null, "type_comment": null}}], "kwarg": nul...
def update(self, order): sheet = self._spreadsheet.worksheet("Book") old = self.get_order(order.id) # Compute order delta update = {} for field in Order.schema: if getattr(old, field) != getattr(order, field): update[field] = getattr(order, field) ...
18,961
[ 0.020903153344988823, -0.0195628609508276, 0.06162639707326889, 0.003479346167296171, 0.02595294453203678, 0.022473597899079323, 0.06233038753271103, -0.0056488607078790665, 0.027306774631142616, 0.052393265068531036, -0.0345497727394104, -0.03189626336097717, -0.006681156810373068, -0.029...
15
{"_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 conc(self): # Concentration over time def C_0(r, a, p): return r * a / 100 * p def C_t(c, h): return c * np.exp(-(np.log(2) / h) * 1) if self.grass_type == "Short Grass": self.plant_surface_conc = 240 elif self.grass_type == "Tall Grass":...
18,962
[ 0.018229490146040916, 0.025620978325605392, 0.010788154788315296, -0.015067812986671925, -0.027002431452274323, 0.010916330851614475, 0.044405896216630936, 0.0066224317997694016, -0.03130345046520233, 0.04346593841910362, -0.024011656641960144, -0.023726820945739746, 0.0008651886601001024, ...
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 no_dose_bird(self): ####Initial Leslie Matrix and pesticide conc########### S = self.l_m.shape[1] n_f = np.zeros(shape=(S, self.time_steps)) n_f[:, 0] = self.init_pop_size.squeeze() for i in range(self.time_steps): n = np.dot(self.l_m, init_pop_size) i...
18,963
[ 0.038065649569034576, 0.012054122053086758, 0.03417257219552994, -0.010323865339159966, -0.036940984427928925, 0.033913034945726395, 0.054387737065553665, -0.0022619504015892744, -0.024238014593720436, 0.045851804316043854, -0.015759754925966263, -0.01260924618691206, 0.0005357487825676799, ...
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 dose_bird(self): ####Initial Leslie Matrix and pesticide conc########### S = self.l_m.shape[1] n_f = np.zeros(shape=(S, self.t)) l_m_temp = np.zeros(shape=(S, S), dtype=float) n_csum = np.sum(self.init_pop_size) n_f[:, 0] = self.init_pop_size.squeeze() fw_bi...
18,964
[ -0.019274087622761726, 0.026139527559280396, -0.0020437396597117186, -0.056296609342098236, -0.014836978167295456, -0.0007175338105298579, -0.004675491712987423, -0.023164503276348114, -0.02476643957197666, 0.03819218650460243, -0.019935203716158867, -0.031555596739053726, 0.0097133265808224...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "klass", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def setup_class(klass): x = np.linspace(-1, 1, 101) y = np.linspace(-1, 1, 101) xx, yy = np.meshgrid(x, y) zz = np.exp(-(xx ** 2 + yy ** 2) / 0.01) klass.img = zz klass.img_hor = 0 klass.img_ver = 0 example_scan = np.cumsum(np.random.normal(0, 0.01, len...
18,965
[ -0.0050154491327703, -0.0015601749764755368, -0.007439021952450275, -0.07437675446271896, -0.015645509585738182, 0.022485369816422462, -0.009929915890097618, -0.018069081008434296, -0.016009043902158737, 0.013922079466283321, -0.009943380951881409, -0.027844158932566643, 0.02633615769445896,...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "klass", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyarg...
class TestScanSet(object): @classmethod def setup_class(klass): x = np.linspace(-1, 1, 101) y = np.linspace(-1, 1, 101) xx, yy = np.meshgrid(x, y) zz = np.exp(-(xx ** 2 + yy ** 2) / 0.01) klass.img = zz klass.img_hor = 0 klass.img_ver = 0 exampl...
18,966
[ 0.015338038094341755, -0.04310741275548935, -0.007409492041915655, -0.014416716992855072, -0.03467278927564621, -0.005693370476365089, 0.015973879024386406, -0.0035003686789423227, -0.000033251879358431324, 0.028496049344539642, 0.01703793928027153, -0.0153899434953928, -0.04596220701932907,...
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_expo(self): img_clean = basket_weaving( self.img_hor, self.img_ver, expo_hor=self.expo_hor, expo_ver=self.expo_ver, ) diff_img = self.img - img_clean mean = np.mean(diff_img) std = np.std(diff_img) assert np.all(n...
18,967
[ 0.017127936705946922, -0.04017000272870064, -0.007181444205343723, -0.019854580983519554, -0.03538237512111664, -0.011450626887381077, 0.030697153881192207, -0.015809418633580208, 0.0013441205956041813, 0.02419416978955269, 0.008711181581020355, -0.02558949589729309, -0.05724673345685005, ...
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_no_expo(self): img_clean = basket_weaving(self.img_hor, self.img_ver) diff_img = self.img - img_clean mean = np.mean(diff_img) std = np.std(diff_img) assert np.all(np.abs(diff_img - mean) < std * 5)
18,968
[ 0.017962614074349403, -0.005260877311229706, 0.033767491579055786, -0.014292234554886818, 0.011633990332484245, 0.0009127288358286023, 0.0068068853579461575, -0.004893839359283447, -0.002595681231468916, -0.014614783227443695, 0.01525988057255745, -0.01971994712948799, 0.006184033118188381, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "job_id", "annotation":...
class Command(BaseCommand): def handle(self, job_id, **options): try: job = Job.objects.get(id=job_id) job.log_listener_port = find_free_udp_port(59000, 60000) rsyslog_conf_file = os.path.join(job.logdir, 'rsyslog.conf') rsyslog_log_file = os.path.join(job.l...
18,969
[ 0.022427700459957123, -0.0001654056686675176, 0.05128849297761917, -0.012645874172449112, -0.004976283758878708, -0.033487334847450256, -0.03394998610019684, -0.008625191636383533, 0.028970949351787567, 0.03981027007102966, -0.0006657534977421165, 0.019200138747692108, 0.020599115639925003, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "start_port", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "end_port", "annotation": null, "type_comment": null}}], "kw...
def find_free_udp_port(start_port, end_port): ports_in_use = set() stdout, stderr = run_cmd(['netstat', '-lun']) for l in stdout.split('\n')[2:]: parts = re.split('\s+', l, 4) if len(parts) != 5: continue _, __, ___, local, ____ = parts port = local.split(':')[-1]...
18,970
[ 0.042583584785461426, -0.0030037055257707834, 0.0007288943161256611, -0.0029669853392988443, -0.0198229867964983, -0.015663333237171173, 0.03198469057679176, 0.02669699303805828, 0.026038968935608864, 0.010434388183057308, 0.04143204167485237, -0.01916496269404888, 0.010786901228129864, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "child", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def testfunc(child): child.expect("OK") child.expect("OK") child.expect("OK") child.expect("OK") child.expect("OK") child.expect("OK") child.expect("OK")
18,971
[ 0.0007070969440974295, 0.004249249119311571, 0.014626424759626389, -0.012433646246790886, 0.0005096727982163429, -0.010181603021919727, 0.00358845223672688, 0.0061101471073925495, -0.0023364941589534283, -0.01124243438243866, 0.0303433109074831, 0.0012912205420434475, -0.007811032235622406, ...
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": "job_id", "annotation": null, "type_comment": null}}], "kwarg": {"...
def handle(self, job_id, **options): try: job = Job.objects.get(id=job_id) job.log_listener_port = find_free_udp_port(59000, 60000) rsyslog_conf_file = os.path.join(job.logdir, 'rsyslog.conf') rsyslog_log_file = os.path.join(job.logdir, 'logfile') rs...
18,972
[ -0.013470854610204697, 0.0015506208874285221, 0.042298901826143265, -0.03898904100060463, -0.011935134418308735, 0.007461212109774351, -0.03556698188185692, -0.04187815636396408, -0.003656975692138076, -0.012047333642840385, 0.0345010943710804, -0.018330460414290428, 0.009985682554543018, ...
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 config_docbook(self): catalog = self.catalog version = self.version docbook = join_path(prefix, 'docbook') ent_dir = join_path(prefix, 'ent') xmlcatalog = which('xmlcatalog') # create docbook xmlcatalog('--noout', '--create', docbook) xmlcatalog('--no...
18,973
[ 0.006832676474004984, 0.005026035010814667, 0.0877271518111229, -0.017005538567900658, 0.008980689570307732, -0.008676080964505672, 0.010818841867148876, 0.015240912325680256, 0.007946072146296501, 0.0032167674507945776, 0.004243507049977779, -0.049115441739559174, 0.00153354462236166, 0.0...
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": "expressions", "annotation": null, "type_comment": null}}, {"_type...
def collapse_group_by(self, expressions, having): # If the DB can group by primary key, then group by the primary key of # query's main model. Note that for PostgreSQL the GROUP BY clause must # include the primary key of every table, but for MySQL it is enough to # have the main table's...
18,974
[ -0.014155644923448563, -0.01068964321166277, 0.05114876478910446, -0.046796634793281555, 0.016152242198586464, -0.030442489311099052, -0.012562855146825314, -0.025170577690005302, -0.0283561572432518, -0.005939314141869545, 0.025148143991827965, -0.006202909629791975, 0.008479926735162735, ...
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": "node", "annotation": null, "type_comment": null}}, {"_type": "arg...
def compile(self, node, select_format=False): vendor_impl = getattr(node, 'as_' + self.connection.vendor, None) if vendor_impl: sql, params = vendor_impl(self, self.connection) else: sql, params = node.as_sql(self, self.connection) if select_format is FORCE or (se...
18,975
[ 0.041111722588539124, -0.01776270940899849, 0.02537841536104679, -0.031139293685555458, -0.018701033666729927, -0.0016229747561737895, -0.008755880407989025, -0.0008585400064475834, -0.05804521590471268, -0.00914321281015873, -0.005842708982527256, -0.060052793473005295, 0.018177317455410957...
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": "order_by", "annotation": null, "type_comment": null}}, {"_type": ...
def get_extra_select(self, order_by, select): extra_select = [] select_sql = [t[1] for t in select] if self.query.distinct and not self.query.distinct_fields: for expr, (sql, params, is_ref) in order_by: without_ordering = self.ordering_parts.search(sql).group(1) ...
18,976
[ 0.034462910145521164, -0.008040239103138447, 0.04590627923607826, -0.01146550290286541, -0.018437767401337624, -0.012682882137596607, 0.011277362704277039, -0.015228312462568283, -0.03236016631126404, 0.022886738181114197, -0.008588059805333614, -0.0643661841750145, 0.05533543974161148, 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": "combinator", "annotation": null, "type_comment": null}}, {"_type"...
def get_combinator_sql(self, combinator, all): features = self.connection.features compilers = [ query.get_compiler(self.using, self.connection) for query in self.query.combined_queries ] if not features.supports_slicing_ordering_in_compound: for query...
18,977
[ -0.00016974601021502167, -0.017055857926607132, 0.009144937619566917, -0.015414177440106869, 0.0034348603803664446, -0.01173416618257761, 0.0303876344114542, 0.04239724949002266, 0.03384728729724884, 0.012824947945773602, 0.02765517123043537, -0.028646791353821754, 0.03880538418889046, -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": "expressions", "annotation": null, "type_comment": null}}], "kwarg...
def get_converters(self, expressions): converters = {} for i, expression in enumerate(expressions): if expression: backend_converters = self.connection.ops.get_db_converters(expression) field_converters = expression.get_db_converters(self.connection) ...
18,978
[ -0.014414225704967976, -0.018033893778920174, -0.01178271695971489, -0.027410658076405525, -0.0021736803464591503, -0.05361834168434143, -0.015466829761862755, -0.01317902747541666, 0.027324732393026352, 0.011256414465606213, -0.0018487694906070828, -0.0186461228877306, 0.05177091434597969, ...
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": "row", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def apply_converters(self, row, converters): row = list(row) for pos, (convs, expression) in converters.items(): value = row[pos] for converter in convs: value = converter(value, expression, self.connection, self.query.context) row[pos] = value ...
18,979
[ 0.0017392607405781746, 0.009429249912500381, 0.026053255423903465, -0.029159361496567726, 0.03759022057056427, 0.016787761822342873, -0.027109753340482712, -0.03930174559354782, -0.02007347345352173, -0.03038489818572998, -0.01809781976044178, -0.04745791479945183, 0.06994020193815231, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "alias", "annotation": null, "type_comment": null}}, {"_type": "ar...
def as_subquery_condition(self, alias, columns, compiler): qn = compiler.quote_name_unless_alias qn2 = self.connection.ops.quote_name for index, select_col in enumerate(self.query.select): lhs_sql, lhs_params = self.compile(select_col) rhs = '%s.%s' % (qn(alias), qn2(col...
18,980
[ 0.05483891814947128, 0.01945466175675392, 0.020513208582997322, -0.03523010015487671, 0.015611004084348679, -0.006988468114286661, -0.008499210700392723, -0.006577381864190102, -0.03864211589097977, -0.047316040843725204, 0.003062593284994364, -0.006901112385094166, 0.052906814962625504, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def as_sql(self): # We don't need quote_name_unless_alias() here, since these are all # going to be column names (so we can avoid the extra overhead). qn = self.connection.ops.quote_name opts = self.query.get_meta() result = ['INSERT INTO %s' % qn(opts.db_table)] has_fie...
18,981
[ 0.03384042903780937, 0.010273367166519165, -0.013655283488333225, -0.05581224709749222, -0.003895052708685398, 0.0030841371044516563, -0.0011425931006669998, 0.03486138582229614, -0.026481039822101593, 0.011868610978126526, 0.049388736486434937, -0.062023062258958817, 0.05683320388197899, ...
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": "return_id", "annotation": null, "type_comment": null}}], "kwarg":...
def execute_sql(self, return_id=False): assert not ( return_id and len(self.query.objs) != 1 and not self.connection.features.can_return_ids_from_bulk_insert ) self.return_id = return_id with self.connection.cursor() as cursor: for sql, params in self....
18,982
[ 0.0063849035650491714, 0.0068893772549927235, -0.026864495128393173, -0.002626829780638218, -0.003070155158638954, -0.014930380508303642, -0.05511501803994179, -0.05120152607560158, -0.02910659834742546, -0.01245387364178896, -0.00025717326207086444, -0.0122704291716218, 0.006456243339926004...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def find_lib(name): possible = ['lib'+name+'.dylib', name+'.dylib', name+'.framework/'+name] for dylib in possible: try: return os.path.realpath(dyld_find(dylib)) except ValueError: pass raise ValueError("%s not found" % (name,))
18,983
[ 0.022901197895407677, 0.00683471979573369, 0.035547442734241486, -0.025200514122843742, -0.010950497351586819, 0.024027863517403603, -0.028189625591039658, -0.017336850985884666, -0.012945154681801796, -0.018394535407423973, 0.006702509243041277, -0.0010116994380950928, -0.004679109901189804...
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 MachOTest(unittest.TestCase): @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test') def test_find(self): self.assertEqual(find_lib('pthread'), '/usr/lib/libSystem.B.dylib') result = find_lib('z') # Issue #21093: dyld default search path ...
18,984
[ 0.02573077566921711, 0.040650490671396255, 0.09704702347517014, -0.04354262351989746, -0.025478286668658257, 0.006547460798174143, 0.013450698927044868, 0.02573077566921711, -0.06711577624082565, -0.008733773604035378, -0.041545674204826355, 0.00998473446816206, -0.0023283367045223713, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('target', '0011_auto_20201101_1147'), ] operations = [ migrations.AddField( model_name='target', name='tweet_solution_text', field=models.CharField(default='The solution for this GroundUp Target is...
18,985
[ 0.02439086325466633, 0.007380218245089054, 0.032575562596321106, -0.013512911275029182, 0.04101675748825073, 0.014678822830319405, -0.04015398398041725, -0.026466185227036476, -0.015261778607964516, -0.02411104552447796, -0.00013845195644535124, 0.013606184162199497, -0.014550572261214256, ...
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_find(self): self.assertEqual(find_lib('pthread'), '/usr/lib/libSystem.B.dylib') result = find_lib('z') # Issue #21093: dyld default search path includes $HOME/lib and # /usr/local/lib before /usr/lib, which caused test failures if # a local...
18,986
[ 0.016162460669875145, 0.05590715631842613, 0.09050977975130081, -0.015460744500160217, -0.024341469630599022, -0.01038768794387579, 0.022926535457372665, 0.024732589721679688, -0.03377436473965645, -0.0023826686665415764, -0.02703329548239708, -0.0018103680340573192, -0.0015227798139676452, ...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AlterModelManagers( name='user', managers=[ ('objects', django.contrib.auth.models.UserManager()), ], ), migrat...
18,987
[ -0.01814948208630085, -0.014362534508109093, -0.087847039103508, -0.07806936651468277, 0.007358582690358162, -0.012108097784221172, -0.006769642699509859, 0.012963010929524899, -0.017364228144288063, 0.0021103681065142155, 0.056538231670856476, -0.06388414651155472, -0.00008356179023394361, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "(?x)\n https?://\n (?:\n zonevideo\\.telequebec\\.tv/media|\n ...
class TeleQuebecIE(TeleQuebecBaseIE): _VALID_URL = r'''(?x) https?:// (?: zonevideo\.telequebec\.tv/media| coucou\.telequebec\.tv/videos )/(?P<id>\d+) ''' _TESTS = [{ ...
18,988
[ -0.017862001433968544, 0.004839704371988773, -0.09624525159597397, -0.07339386641979218, 0.016140663996338844, -0.015404729172587395, -0.020730897784233093, 0.016589708626270294, -0.017250802367925644, 0.0032898762729018927, 0.06935246288776398, -0.044754792004823685, -0.00016010861145332456...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https://squat\\.telequebec\\.tv/videos/(?P<id>\\d+)"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID_URL", "ctx": {"_type": "S...
class TeleQuebecSquatIE(InfoExtractor): _VALID_URL = r'https://squat\.telequebec\.tv/videos/(?P<id>\d+)' _TESTS = [{ 'url': 'https://squat.telequebec.tv/videos/9314', 'info_dict': { 'id': 'd59ae78112d542e793d83cc9d3a5b530', 'ext': 'mp4', 'title': 'Poupeflekta'...
18,989
[ -0.009866531938314438, -0.02608407661318779, -0.08806411176919937, -0.05678265169262886, -0.007674644235521555, -0.012483440339565277, 0.02202817238867283, -0.0020992944482713938, 0.0038616089150309563, -0.006344939116388559, 0.05119667574763298, -0.05372250825166702, 0.020704539492726326, ...
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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): media_id = self._match_id(url) media = self._download_json( 'https://mnmedias.api.telequebec.tv/api/v3/media/' + media_id, media_id)['media'] source_id = next(source_info['sourceId'] for source_info in media['streamInfos'] if source_info.get(...
18,990
[ -0.024776797741651535, 0.0018220829078927636, -0.08748351037502289, -0.066118523478508, 0.03891816362738609, -0.009053060784935951, 0.014364896342158318, -0.01166485995054245, 0.004350057803094387, -0.0008926588925532997, 0.07002445310354233, -0.04265938699245453, 0.02361207641661167, -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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): video_id = self._match_id(url) video = self._download_json( 'https://squat.api.telequebec.tv/v1/videos/%s' % video_id, video_id) media_id = video['sourceId'] return { '_type': 'url_transparent', 'url': 'http...
18,991
[ -0.0016266311286017299, -0.0076449159532785416, -0.07643581181764603, -0.06099908798933029, 0.006119271274656057, -0.009260697290301323, -0.016438238322734833, 0.029164187610149384, -0.02653353475034237, 0.03426524996757507, 0.06484491378068924, -0.0536012127995491, 0.0021282245870679617, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "(?x)\n https?://\n (?:\n [^/]+\\.telequebec\\.tv/emissions/|\n ...
class TeleQuebecEmissionIE(InfoExtractor): _VALID_URL = r'''(?x) https?:// (?: [^/]+\.telequebec\.tv/emissions/| (?:www\.)?telequebec\.tv/ ) (?P<id>[^?#&]+) ...
18,992
[ 0.0033521673176437616, -0.007095828652381897, -0.07732006162405014, -0.04812929406762123, 0.012931535951793194, -0.019697042182087898, 0.0018137182341888547, -0.002514125546440482, -0.008466057479381561, -0.0064412993378937244, 0.059898581355810165, -0.052949562668800354, 0.00410151109099388...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https?://video\\.telequebec\\.tv/player(?:-live)?/(?P<id>\\d+)"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID_URL", "ctx": {...
class TeleQuebecVideoIE(TeleQuebecBaseIE): _VALID_URL = r'https?://video\.telequebec\.tv/player(?:-live)?/(?P<id>\d+)' _TESTS = [{ 'url': 'https://video.telequebec.tv/player/31110/stream', 'info_dict': { 'id': '6202570652001', 'ext': 'mp4', 'title': 'Le coût d...
18,993
[ -0.019209399819374084, -0.0030271850991994143, -0.08055251091718674, -0.036232173442840576, 0.024029383435845375, -0.015647314488887787, 0.01965612918138504, 0.008146948181092739, -0.014189562760293484, 0.023018362000584602, 0.06663333624601364, -0.03712563216686249, 0.016329165548086166, ...
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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) media_id = self._search_regex( r'mediaId\s*:\s*(?P<id>\d+)', webpage, 'media id') return self.url_result( 'http://zonevideo.telequebec.tv/media/' + ...
18,994
[ 0.018839238211512566, -0.0024882853031158447, -0.057478055357933044, -0.017677348107099533, 0.023202259093523026, -0.025869866833090782, 0.001079640118405223, -0.02639153227210045, 0.019076358526945114, -0.010403670370578766, 0.05354185029864311, -0.04955822229385376, 0.02499251998960972, ...
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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): asset_id = self._match_id(url) asset = self._call_api(asset_id, asset_id)['asset'] stream = self._call_api( asset_id + '/streams/' + asset['streams'][0]['id'], asset_id)['stream'] stream_url = stream['url'] account_id = try_get( ...
18,995
[ 0.029947716742753983, 0.030199378728866577, 0.002041603671386838, -0.07826671749353409, -0.026575451716780663, 0.011740008369088173, 0.010399910621345043, -0.03392396867275238, -0.004303411114960909, -0.00702135544270277, 0.0459282211959362, 0.030753033235669136, -0.031155690550804138, 0.0...
13
{"_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": "vsync"}}, {"_type": "Constant", "_fields": {"kind": null,...
class Master(Receiver): __slots__ = [ "vsync", "hsync", "data", "clk", "VRANGE", "VSYNC", "VVALID", "HRANGE", "HSYNC", "HVALID", "strict", ] def _Translate(self, timing): idx = np.arange(sum(timing), dtype=np.int32) return ( idx, np.bitwise_or(idx < timing[0], idx >= timing[0]+timing[1]), idx >=...
18,996
[ 0.00820310227572918, 0.03147362172603607, -0.0014391940785571933, -0.03936028480529785, -0.03249596804380417, 0.0065843891352415085, 0.038410965353250504, -0.06085387244820595, 0.016917375847697258, 0.008580395951867104, 0.018304845318198204, 0.053356677293777466, -0.02314881421625614, -0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "vsync", "annotation": {"_type": "Name", "_fields": {"id": "Bus", ...
def __init__( self, vsync: Bus, hsync: Bus, data: Bus, clk: int, VTIMING, HTIMING, callbacks = list(), strict = True ): super(Master, self).__init__(callbacks) self.vsync = GetBus(vsync) self.hsync = GetBus(hsync) self.data = GetBus(data) self.clk = GetEvent(clk) self.VRANGE, self.VSYNC, self.VVALID = ...
18,997
[ 0.029075585305690765, 0.059463948011398315, -0.007791575975716114, -0.047211360186338425, 0.016664978116750717, 0.01051437295973301, 0.023155931383371353, -0.028054535388946533, 0.01777111366391182, 0.0025404670741409063, 0.0510038286447525, 0.041060756891965866, -0.01921760104596615, 0.01...
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": "frame", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _FrameBody(self, frame): it = iter(frame) for y in self.VRANGE: for x in self.HRANGE: self.hsync.value[0] = self.VSYNC[y] self.vsync.value[0] = self.HSYNC[x] if self.VVALID[y] and self.HVALID[x]: self.data.SetToNumber() self.data.values = next(it) elif self.strict: self.data.Se...
18,998
[ 0.005211482290178537, 0.006389420013874769, 0.0012173510622233152, 0.0019305091118440032, -0.037432245910167694, -0.015384580940008163, -0.025700461119413376, -0.007603053003549576, -0.04583248868584633, -0.009322365745902061, -0.024867575615644455, -0.04968755692243576, 0.02415367402136326,...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "language", "annotation...
class UniversalContractions(object): def __init__(self, language): if language == 'es': contraction_splitter = SpanishContractions() elif language == 'es-ancora': contraction_splitter = SpanishAncoraContractions() elif language == 'it': contraction_splitte...
18,999
[ 0.05814547836780548, 0.024061057716608047, 0.004728060215711594, -0.009312750771641731, 0.01931118033826351, 0.03333640843629837, 0.025320211425423622, -0.0027676448225975037, 0.003068408230319619, -0.0238491203635931, 0.05236085131764412, 0.04258682578802109, -0.028823401778936386, 0.0099...
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 _FrameEnd(self): self.hsync.value[0] = 1 self.vsync.value[0] = 1 self.data.SetToX() self.hsync.Write() self.vsync.Write() self.data.Write() yield self.clk
19,000
[ 0.024635503068566322, 0.002116583287715912, -0.00036336801713332534, -0.009710550308227539, -0.03558461740612984, -0.016434980556368828, -0.019398478791117668, -0.009065819904208183, -0.028141934424638748, 0.00957481749355793, -0.021626759320497513, -0.0347023531794548, 0.02787046879529953, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "language", "annotation": null, "type_comment": null}}], "kwarg": ...
def __init__(self, language): if language == 'es': contraction_splitter = SpanishContractions() elif language == 'es-ancora': contraction_splitter = SpanishAncoraContractions() elif language == 'it': contraction_splitter = ItalianContractions() elif la...