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
19,101
[ -0.004891260992735624, 0.039908312261104584, 0.002196355490013957, -0.03088577464222908, 0.013691882602870464, -0.006876340601593256, 0.009630524553358555, 0.00532293226569891, 0.01127817202359438, -0.020671581849455833, 0.0017540444387122989, -0.0012554945424199104, 0.004082637373358011, ...
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": "Attribute", "_fields"...
def update_rapydscript(): d = os.path.dirname base = d(d(d(d(d(abspath(__file__)))))) base = os.path.join(base, 'rapydscript') raw = subprocess.check_output(['node', '--harmony', os.path.join(base, 'bin', 'export')]) if isinstance(raw, type('')): raw = raw.encode('utf-8') path = P(COMPIL...
19,102
[ 0.01776338927447796, 0.01901528425514698, 0.02745148353278637, -0.044481780380010605, 0.009845992550253868, -0.017582934349775314, -0.021879984065890312, -0.023504065349698067, 0.02039124257862568, -0.01793256402015686, 0.03879749774932861, -0.029865048825740814, 0.03471473604440689, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": ...
def compile_pyj(data, filename='<stdin>', beautify=True, private_scope=True, libdir=None, omit_baselib=False): if isinstance(data, bytes): data = data.decode('utf-8') c = compiler() c.g.current_options = { 'beautify':beautify, 'private_scope':private_scope, 'omit_baselib': om...
19,103
[ 0.016549939289689064, -0.0036543388850986958, 0.07266512513160706, -0.03359180688858032, 0.016842754557728767, 0.02331983484327793, -0.01667877659201622, -0.0006229652208276093, -0.024924464523792267, -0.002717328956350684, 0.02433883398771286, -0.009539932943880558, 0.04120501130819321, -...
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 compiler(): c = getattr(tls, 'compiler', None) if c is None: c = tls.compiler = Context() c.eval('exports = {}; sha1sum = Duktape.sha1sum;', noreturn=True) buf = BytesIO() decompress(P(COMPILER_PATH, data=True, allow_user_override=False), buf) c.eval(buf.getvalue(), f...
19,104
[ 0.01619766093790531, 0.029067354276776314, 0.022201966494321823, -0.06153249368071556, -0.06581462919712067, -0.07112076133489609, -0.004418866243213415, -0.020642708986997604, -0.044543568044900894, 0.0013112599262967706, 0.05534200742840767, -0.007604289799928665, 0.0032756044529378414, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source_files", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def create_pot(source_files): ctx = compiler() ctx.g.gettext_options = { 'package_name': __appname__, 'package_version': __version__, 'bugs_address': 'https://bugs.launchpad.net/calibre' } ctx.eval('catalog = {}') for fname in source_files: with open(fname, 'rb') as f...
19,105
[ 0.03411974385380745, -0.006023278459906578, 0.04609329253435135, 0.02083202637732029, -0.012381183914840221, -0.007081915624439716, 0.04132334142923355, 0.02647808939218521, 0.007197513710707426, 0.02479887194931507, 0.030956001952290535, -0.017948152497410774, 0.02694048173725605, -0.0160...
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 init_ctx(self): self.prompt = self.ps1 self.ctx = compiler() self.ctx.g.Duktape.write = self.output.write self.ctx.eval(r'''console = { log: function() { Duktape.write(Array.prototype.slice.call(arguments).join(' ') + '\n');}}; console['error'] = console['log']...
19,106
[ 0.037474606186151505, 0.035861775279045105, -0.012748481705784798, -0.03697652742266655, -0.022200146690011024, 0.012114022858440876, 0.04053424298763275, 0.005689380690455437, 0.022520340979099274, 0.038352176547050476, 0.006753730587661266, 0.04923878610134125, 0.0001794608251657337, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "num", "annotation": null, "type_comment": null}}], "kwarg": null,...
def completer(text, num): if self.completions is None: self.to_repl.put(('complete', text)) self.completions = filter(None, self.get_from_repl()) if self.completions is None: return None try: return self.completi...
19,107
[ 0.043912116438150406, 0.03521664813160896, 0.007205730304121971, -0.007487054448574781, 0.013452401384711266, 0.008343813940882683, 0.01583086885511875, 0.029180970042943954, 0.004728161264210939, 0.04554891213774681, -0.012148081324994564, 0.010862942785024643, 0.01976940408349037, 0.0259...
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 __call__(self): if hasattr(self, 'readline'): history = os.path.join(cache_dir(), 'pyj-repl-history.txt') self.readline.parse_and_bind("tab: complete") try: self.readline.read_history_file(history) except EnvironmentError as e: ...
19,108
[ -0.012648596428334713, 0.003039295319467783, 0.029249878600239754, 0.003893930232152343, 0.020831724628806114, 0.021504750475287437, -0.01400532852858305, -0.09648827463388443, -0.003995418082922697, -0.01655855029821396, -0.010821813717484474, -0.06999459862709045, 0.03756120428442955, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "UUIDField", "value": {"_type": "Name", "_fields": {"id": "mo...
class ArchiveMedicalDocuments(models.Model): local_uid = models.UUIDField(null=True, default=None, blank=True, help_text='uid_localid', db_index=True) direction = models.ForeignKey(Napravleniya, null=True, help_text='Направление', db_index=True, on_delete=models.SET_NULL) status = models.SmallIntegerField(d...
19,109
[ 0.012720175087451935, 0.05009220913052559, -0.036687906831502914, -0.006296312436461449, 0.009589411318302155, 0.015711793676018715, -0.034577541053295135, -0.06437776982784271, -0.017590250819921494, 0.002258207881823182, 0.0037105341907590628, -0.0878932774066925, 0.06623303145170212, 0....
16
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "IntegerField", "value": {"_type": "Name", "_fields": {"id": ...
class CdaFields(models.Model): code = models.IntegerField(default=-1, blank=True, help_text='code документа', db_index=True) title = models.CharField(max_length=255, default="", help_text='Наименование', db_index=True) is_doc_refferal = models.BooleanField(default=False, blank=True, help_text="Это исследова...
19,110
[ 0.011843936517834663, 0.02384154684841633, 0.0003649776626843959, -0.04943937808275223, -0.012941613793373108, -0.025356341153383255, -0.009385139681398869, -0.08228188008069992, -0.01881418563425541, 0.021097354590892792, -0.004300150088965893, 0.0145881287753582, 0.032622963190078735, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def loadDefinitionFile(filename): result = [] try: f = open(filename, 'r') except: sys.exit(0) # if cmake was not used (because of skipnative or systems that do not use cmake), this script won't work. for line in f: theLine = line.rstrip("\r\n").strip() if (len(theLi...
19,111
[ 0.01695169508457184, 0.03200635686516762, -0.040518686175346375, 0.0177056435495615, -0.007284121587872505, -0.005441810470074415, -0.0282122902572155, -0.028917597606778145, -0.008500168099999428, 0.002220805734395981, 0.014057503081858158, -0.07388701289892197, 0.07481121271848679, 0.010...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "is_doc_refferal", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "is_treatment", "annotation": null, "type_comment": nul...
def get_cda_params(is_doc_refferal, is_treatment, is_form): if is_doc_refferal: return [{"id": -1, "label": "Пусто"}, *[{"id": x.pk, "label": f"{x.title} - {x.code}"} for x in CdaFields.objects.filter(is_doc_refferal=True).order_by("title")]] if is_treatment: return [{"id": -1, "...
19,112
[ 0.02346102148294449, -0.021482892334461212, -0.02269529365003109, -0.03381960466504097, -0.032032907009124756, -0.015633590519428253, -0.00019957422045990825, -0.05866318568587303, -0.0038711747620254755, 0.06478900462388992, -0.005875890143215656, -0.008779271505773067, -0.00904514826834201...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "string", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def loadDefinitionString(string): splitted = string.split(';') result = [] for line in splitted: theLine = line.strip() if (len(theLine) > 0): result.append(theLine) result = sorted(result) return result
19,113
[ 0.028622813522815704, 0.01149634551256895, 0.021467110142111778, -0.022423624992370605, 0.03167397528886795, 0.02212093025445938, 0.004555555526167154, -0.05429132655262947, -0.015679586678743362, 0.046905577182769775, 0.018900258466601372, 0.017943743616342545, 0.017568401992321014, 0.028...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arrNative", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "arrManaged", "annotation": null, "type_comment": null}}], "k...
def getDiff(arrNative, arrManaged): result = [[], []] iF = 0 # From file (native) nF = len(arrNative) iS = 0 # From string (managed) nS = len(arrManaged) while (iS < nS) and (iF < nF): if (arrNative[iF] == arrManaged[iS]): if (debug == 1): print("Both have "...
19,114
[ 0.053787536919116974, -0.014102279208600521, -0.005189480260014534, -0.002587677678093314, 0.0014788748230785131, -0.01812504418194294, 0.011463751085102558, 0.06897460669279099, 0.03774167597293854, -0.02271280437707901, 0.0408378504216671, -0.024837186560034752, 0.062194664031267166, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def subscription_create(): conekta.api_key = '1tv5yJp3xnVZ7eK67m4h' plan = conekta.Plan.find('gold-plan') customer = conekta.Customer.create({ 'name':request.form['name'], 'email':request.form['email'], 'cards':[request.form['token_id']], 'plan':plan.id }) return r...
19,115
[ 0.0129520483314991, 0.025061894208192825, -0.007764848414808512, -0.03562770411372185, -0.045887257903814316, -0.03279484063386917, 0.03246306627988815, 0.007362888660281897, -0.014968229457736015, 0.03172294795513153, 0.010891204699873924, 0.022548047825694084, -0.028201011940836906, 0.04...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arrDefinitions", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "referencedFilename", "annotation": null, "type_comment"...
def printPotentiallyCritical(arrDefinitions, referencedFilename, arrIgnore): f = open(referencedFilename, 'r') content = f.read() f.close() for keyword in arrDefinitions: skip = 0 if (keyword[-2:] == "=1"): key = keyword[:-2] else: key = keyword ...
19,116
[ -0.01619318313896656, -0.026310622692108154, 0.035212911665439606, -0.03626956045627594, 0.004629454109817743, -0.05082493647933006, 0.03764320909976959, 0.05053435638546944, 0.01512332446873188, 0.007330519612878561, 0.018425360321998596, 0.043930284678936005, -0.02086886763572693, 0.0067...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "alert_filename", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class MempoolCoinbaseTest(BitcoinTestFramework): alert_filename = None # Set by setup_network def setup_network(self): args = ["-checkmempool", "-debug=mempool"] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) self.nodes.append(start_node(1, self.op...
19,117
[ 0.0023951770272105932, -0.022730812430381775, 0.025110408663749695, -0.02350134775042534, -0.008725186809897423, -0.016940459609031677, 0.02708207443356514, 0.04722932353615761, 0.0023413528688251972, 0.042379479855298996, 0.022515514865517616, 0.020713821053504944, 0.00024645819212310016, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setup_network(self): args = ["-checkmempool", "-debug=mempool"] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) self.nodes.append(start_node(1, self.options.tmpdir, args)) connect_nodes(self.nodes[1], 0) self.is_network_split = False ...
19,118
[ 0.021336331963539124, -0.028466345742344856, 0.04898359999060631, -0.02450522780418396, -0.0004084903921466321, -0.04135676845908165, 0.01883881352841854, 0.025243740528821945, 0.013857202604413033, 0.003189036389812827, 0.03534123674035072, 0.05497227609157562, -0.0363885834813118, -0.029...
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 run_test(self): start_count = self.nodes[0].getblockcount() # Mine three blocks. After this, nodes[0] blocks # 101, 102, and 103 are spend-able. new_blocks = self.nodes[1].generate(4) self.sync_all() node0_address = self.nodes[0].getnewaddress() node1_addres...
19,119
[ -0.02216065488755703, 0.035874877125024796, -0.026215393096208572, -0.056384433060884476, 0.018656283617019653, 0.04636552557349205, -0.010181770659983158, 0.009833579882979393, -0.0231602992862463, 0.042928546667099, 0.026237856596708298, -0.013399726711213589, -0.010625433176755905, 0.02...
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": "fplist", "annotation":...
class buildParseTree(): def __init__(self,fplist): self.fplist = fplist.split() def parseTree(self): # create an empty stack self.pStack = Stack() # create an empty Tree, self.eTree = BinaryTree('') # push an empty Tree up the stack. self.pStack.push(self.eTree) # start at very top of tree, and as ...
19,120
[ 0.0021750677842646837, 0.040635451674461365, 0.02734859474003315, -0.03710292652249336, 0.028875557705760002, 0.055061835795640945, -0.009218755178153515, 0.04827026650309563, 0.004609377589076757, 0.02737138420343399, 0.02661929838359356, -0.03218017891049385, 0.0008752974681556225, 0.025...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pt", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def evaluate(cls,pt): opers = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv} leftC = pt.getLeftChild() rightC = pt.getRightChild() if leftC and rightC: f = opers[pt.getRootVal()] return f(cls.evaluate(leftC),cls.evaluate(rightC)) else: return pt.getRootVal()
19,121
[ -0.005895329639315605, 0.01873166114091873, -0.00573141360655427, -0.02163693495094776, 0.05222708359360695, 0.007381879724562168, -0.0036457215901464224, 0.01573595218360424, -0.03606155887246132, 0.06873174756765366, 0.009371482767164707, -0.0041459486819803715, -0.03739549592137337, -0....
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 parseTree(self): # create an empty stack self.pStack = Stack() # create an empty Tree, self.eTree = BinaryTree('') # push an empty Tree up the stack. self.pStack.push(self.eTree) # start at very top of tree, and as name suggests, currentTree # tracks what is your current postition in the stack. se...
19,122
[ 0.03735378757119179, -0.0379638709127903, 0.07287731766700745, 0.0012037028791382909, -0.031946223229169846, -0.03047647513449192, 0.012083824723958969, 0.011272690258920193, 0.027065549045801163, 0.029977314174175262, -0.013463446870446205, -0.038296643644571304, -0.01778949797153473, 0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_cities_weights_saaty_precision_3(): cu = ahpy.Compare('Culture', culture, precision=3, random_index='Saaty') f = ahpy.Compare('Family', family, precision=3, random_index='Saaty') h = ahpy.Compare('Housing', housing, precision=3, random_index='Saaty') j = ahpy.Compare('Jobs', jobs, precision=3, ...
19,123
[ 0.024745911359786987, -0.042987652122974396, 0.07559049129486084, 0.027000509202480316, -0.030279923230409622, -0.021329855546355247, 0.002104290761053562, 0.01796845719218254, 0.010958708822727203, 0.03839647397398949, -0.019457856193184853, -0.020209388807415962, -0.006066916044801474, -...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_cities_weights_dd_precision_4(): cu = ahpy.Compare('Culture', culture, precision=4) f = ahpy.Compare('Family', family, precision=4) h = ahpy.Compare('Housing', housing, precision=4) j = ahpy.Compare('Jobs', jobs, precision=4) t = ahpy.Compare('Transportation', transportation, precision=4) ...
19,124
[ 0.01374884694814682, -0.03202395513653755, 0.06697820872068405, 0.008875920437276363, -0.03063729777932167, -0.025783993303775787, 0.0016875368310138583, 0.032573387026786804, 0.00579518498852849, 0.040370069444179535, -0.021231569349765778, -0.020682137459516525, -0.01830127276480198, -0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_cities_target_weights(): cu = ahpy.Compare('Culture', culture, precision=4) f = ahpy.Compare('Family', family, precision=4) h = ahpy.Compare('Housing', housing, precision=4) j = ahpy.Compare('Jobs', jobs, precision=4) t = ahpy.Compare('Transportation', transportation, precision=4) cr =...
19,125
[ 0.026151644065976143, 0.018507955595850945, 0.004257244523614645, -0.00662430003285408, 0.021700888872146606, 0.028694933280348778, -0.011348044499754906, -0.0017847944982349873, 0.030132444575428963, 0.016379334032535553, 0.00008514704677509144, 0.0009502777829766273, 0.006299478001892567, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_compose_verbose_report(): assert compose.report(verbose=True) == {'Criteria': {'name': 'Criteria', 'global_weight': 1.0, 'local_weight': 1.0, 'target_weights': {'Odyssey': 0.219, 'Accord Sedan': 0.215, ...
19,126
[ -0.022907521575689316, 0.020299555733799934, -0.01774481311440468, -0.03940689563751221, -0.034041937440633774, -0.012720487080514431, -0.02801700495183468, -0.010149777866899967, -0.011656010523438454, 0.051520634442567825, -0.04930652305483818, -0.033871620893478394, 0.01586068980395794, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "default_language", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poso...
def get_language_list_for_templates(default_language): # type: (Text) -> List[Dict[str, Dict[str, str]]] language_list = [l for l in get_language_list() if 'percent_translated' not in l or l['percent_translated'] >= 5.] formatted_list = [] lang_len = len(lan...
19,127
[ -0.03476637229323387, -0.007977885194122791, -0.02156766504049301, -0.05611894652247429, -0.01927011087536812, 0.011624638922512531, -0.01944609358906746, -0.04200121760368347, -0.012367676943540573, 0.052325539290905, -0.035900481045246124, -0.045951053500175476, -0.008882240392267704, -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 get_language_list(): # type: () -> List[Dict[str, Any]] path = os.path.join(settings.STATIC_ROOT, 'locale', 'language_options.json') with open(path, 'r') as reader: languages = ujson.load(reader) lang_list = [] for lang_info in languages['languages']: name = lang_info...
19,128
[ 0.00981023907661438, -0.016315456479787827, 0.038032401353120804, -0.04345855489373207, -0.02814200520515442, 0.014712275005877018, -0.00003268506043241359, -0.010204868391156197, 0.02769804745912552, 0.0068011898547410965, -0.0029319727327674627, 0.0061383359134197235, 0.00874350592494011, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Return", "_fields": {"val...
def main(): if len(sys.argv) < 2 or len(sys.argv) > 3: return usage() if len(sys.argv) == 3: arg_type = sys.argv[1] arg_id = sys.argv[2] if arg_type not in ["id", "uuid"]: return usage() else: arg_type = None arg_id = sys.argv[1] arg_log = '%s"...
19,129
[ -0.028344951570034027, -0.024767300114035606, 0.0016714128432795405, -0.055778224021196365, -0.0100284768268466, 0.011893276125192642, -0.04779411852359772, -0.029256630688905716, 0.03613566979765892, 0.027433272451162338, 0.03345588222146034, -0.045307718217372894, 0.005666918121278286, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class UrlTagTests(SimpleTestCase): # Successes @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url01': '{% url "template_tests.views.client" client.id %}'}) def test_url01(self): output = self.engine.render_to_string('url01', {'client': {'id': 1}}) self.assertEqual(output,...
19,130
[ -0.015922797843813896, -0.015108425170183182, 0.04152081906795502, -0.005946739576756954, 0.011425518430769444, -0.03996500372886658, -0.0179648045450449, 0.014683007262647152, -0.011145957745611668, 0.05382148548960686, 0.0018019501585513353, 0.005518282297998667, 0.004330149851739407, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "gt", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def todosage(gt): if gt == '0/0': return 0 elif gt == '0/1': return 1 elif gt == '1/1': return 2 else: return np.nan
19,131
[ 0.0026928011793643236, -0.003987055271863937, 0.04469878971576691, -0.020967943593859673, -0.026931431144475937, -0.02390865422785282, -0.012761312536895275, -0.046887222677469254, -0.010962692089378834, 0.03107577934861183, 0.008534897118806839, -0.02924296446144581, 0.029325030744075775, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "curlist", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "keep", "annotation": null, "type_comment": null}}, {"_type": "...
def ld_calc(curlist, keep, ld_outfile, winsz): varlist=[var.var_id for var in curlist] df=pd.DataFrame(index=keep, columns=varlist) for var in curlist: gtlist=[todosage(var.genotype(s).get_format('GT')) for s in keep] df[var.var_id]=gtlist df.to_csv('./df.csv') cc=df.corr().stack().r...
19,132
[ -0.008193819783627987, 0.0019418545998632908, -0.022449452430009842, -0.04215610772371292, 0.051352545619010925, -0.0015024883905425668, -0.014486120082437992, 0.004667365457862616, -0.012607648968696594, -0.0040997909381985664, -0.0016839969903230667, -0.009363542310893536, 0.01493556983768...
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": "data", "annotation": n...
class KnxEmi1Frame(object): def __init__(self, data=None, message_code=0x11, knx_source=None, knx_destination=None): self.message_code = message_code self.knx_source = knxmap.utils.pack_knx_address(knx_source) \ if isinstance(knx_source, (str, bytes)) else knx_source ...
19,133
[ -0.012774879112839699, 0.013833795674145222, 0.0710831731557846, -0.055362336337566376, -0.03562304377555847, -0.03736075386404991, 0.01155984029173851, -0.040564652532339096, -0.014241071417927742, 0.03125161677598953, 0.06005958095192909, -0.036301836371421814, 0.003088506869971752, 0.02...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vcf_in", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "exclude_file", "annotation": null, "type_comment": null}}, {"_t...
def calc_ld(vcf_in, exclude_file, ld_outfile, winsz, minpos): vcf = Vcf() header = [] in_header = True maxwin=100 exclude = [] keep = [] if exclude_file is not None: for line in exclude_file: exclude.append(line.rstrip()) if ld_outfile is not None: outf=o...
19,134
[ -0.011589029803872108, 0.0019866523798555136, 0.013913292437791824, -0.0014284529024735093, 0.018303565680980682, -0.010184788145124912, 0.011223173700273037, -0.030731912702322006, -0.02140258252620697, -0.018142158165574074, 0.012611275538802147, -0.005364096257835627, 0.000121895995107479...
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": "data", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, data=None, message_code=0x11, knx_source=None, knx_destination=None): self.message_code = message_code self.knx_source = knxmap.utils.pack_knx_address(knx_source) \ if isinstance(knx_source, (str, bytes)) else knx_source self.knx_destination = knxm...
19,135
[ 0.007402327377349138, -0.03154090419411659, -0.028084365651011467, -0.01258713286370039, 0.027728546410799026, 0.009956606663763523, -0.0044413963332772255, 0.0012413988588377833, 0.0010563406394794583, -0.017460595816373825, -0.024043267592787743, -0.0033802902325987816, 0.02361119911074638...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "message_code", "annotation": null, "type_comment": null}}], "kwar...
def pack(self, message_code=None,): message_code = message_code if message_code else self.message_code # TODO: do not include message code here? #emi = bytearray(struct.pack('!B', message_code)) # message code #emi = bytearray(struct.pack('!B', self.message_code)) emi = bytearra...
19,136
[ 0.008327072486281395, -0.026177920401096344, 0.008451729081571102, -0.013213617727160454, 0.007815979421138763, 0.041834812611341476, -0.0578407384455204, -0.03986523300409317, -0.019508784636855125, 0.05594595894217491, -0.005952360574156046, -0.03602580726146698, -0.035726629197597504, -...
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": "module", "annotation": null, "type_comment": null}}, {"_type": "a...
def collect(self, module=None, collected_facts=None): platform_facts = {} # platform.system() can be Linux, Darwin, Java, or Windows platform_facts['system'] = platform.system() platform_facts['kernel'] = platform.release() platform_facts['machine'] = platform.machine() ...
19,137
[ 0.013083942234516144, -0.03079153411090374, 0.027053264901041985, -0.007285935804247856, 0.004682059399783611, 0.04889262840151787, -0.0504666343331337, -0.053270336240530014, -0.02587275765836239, 0.03571030870079994, 0.021704096347093582, -0.05572972446680069, -0.004316225182265043, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "platform"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},...
class PlatformFactCollector(BaseFactCollector): name = 'platform' _fact_ids = set(['system', 'kernel', 'machine', 'python_version', 'architecture', 'machine_id']) def collect(self, module=None, collecte...
19,138
[ 0.01919584721326828, 0.021505121141672134, 0.0010133145842701197, -0.001855237758718431, -0.02239515446126461, -0.01279723085463047, 0.037886541336774826, 0.0060859015211462975, -0.02492092363536358, 0.0009013087837956846, -0.01681440696120262, -0.02864944003522396, 0.020001687109470367, -...
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": "aggregate", "annotation": null, "type_comment": null}}], "kwarg":...
def _marshall_aggregate(self, aggregate): _aggregate = {} for key, value in self._build_aggregate_items(aggregate): # NOTE(danms): The original API specified non-TZ-aware timestamps if isinstance(value, datetime.datetime): value = value.replace(tzinfo=None) ...
19,139
[ 0.05636733025312424, 0.04608704149723053, 0.041295383125543594, -0.009893685579299927, 0.004568411037325859, -0.06930480897426605, 0.02598385699093342, 0.0027837902307510376, -0.029403358697891235, 0.008837343193590641, -0.017979608848690987, -0.04386545717716217, 0.01922108419239521, -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": "aggregate", "annotation": null, "type_comment": null}}], "kwarg":...
def _build_aggregate_items(self, aggregate): keys = aggregate.obj_fields # NOTE(rlrossit): Within the compute API, metadata will always be # set on the aggregate object (at a minimum to {}). Because of this, # we can freely use getattr() on keys in obj_extra_fields (in this # cas...
19,140
[ 0.00782708264887333, -0.019829336553812027, 0.021115681156516075, -0.017191238701343536, 0.0048156180419027805, -0.027907148003578186, -0.028822850435972214, -0.03364119306206703, -0.03050163947045803, -0.020494312047958374, -0.01500009186565876, 0.02308880351483822, 0.02973855286836624, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "device.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comme...
class UserBasicTemplate(TemplateView): template_name = "device.html" def get_context_data(self, **kwargs): context = super(UserBasicTemplate, self).get_context_data(**kwargs) device_wifi_total = REDIS_INS.hget("analytics_wifi_user_", "device_wifi_total") context['device_wifi_total'] = d...
19,141
[ 0.0092838229611516, -0.03644407168030739, 0.011440911330282688, -0.010296820662915707, 0.009355328977108002, -0.014765926636755466, -0.03146250545978546, 0.0020736651495099068, -0.032797280699014664, -0.016732333227992058, -0.02536068670451641, 0.018055187538266182, 0.001731033786199987, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): context = super(UserBasicTemplate, self).get_context_data(**kwargs) device_wifi_total = REDIS_INS.hget("analytics_wifi_user_", "device_wifi_total") context['device_wifi_total'] = device_wifi_total user_wifi_total = REDIS_INS.hget("analytics_wifi_user...
19,142
[ 0.047459784895181656, 0.049054283648729324, 0.0060438537038862705, 0.002299419604241848, 0.03533690422773361, 0.0029339948669075966, -0.01571050100028515, -0.012287019751966, 0.013834620825946331, -0.045912183821201324, 0.03432861715555191, -0.032499633729457855, -0.0037488306406885386, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_get_inner_objects(self): property = ['summary.name'] # Get the fake datastores directly from the cluster cluster_refs = fake._get_object_refs('ClusterComputeResource') cluster = fake._get_object(cluster_refs[0]) expected_ds = cluster.datastore.ManagedObjectReference ...
19,143
[ 0.027278106659650803, 0.041409846395254135, 0.007342256605625153, 0.001871614484116435, -0.004223900381475687, -0.015333419665694237, 0.004827743861824274, 0.01571795716881752, 0.019959881901741028, -0.026749366894364357, 0.030498605221509933, -0.022219039499759674, -0.022940045222640038, ...
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 VMwareVIMUtilTestCase(test.NoDBTestCase): def setUp(self): super(VMwareVIMUtilTestCase, self).setUp() fake.reset() self.vim = fake.FakeVim() self.vim._login() def test_get_inner_objects(self): property = ['summary.name'] # Get the fake datastores directly ...
19,144
[ 0.05183691531419754, -0.019201114773750305, -0.013251817785203457, -0.019371792674064636, -0.03801211342215538, -0.008564307354390621, -0.04008461534976959, -0.024528663605451584, -0.013007993809878826, 0.016982320696115494, 0.009210439398884773, -0.020956646651029587, 0.03186775743961334, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "duration", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flush_cache", "annotation": null, "type_comment": null}}, {"_...
def discover_devices (duration=8, flush_cache=True, lookup_names=False, lookup_class=False, device_id=-1): #this is order of items in C-code btAddresIndex = 0 namesIndex = 1 classIndex = 2 devices = bt.discover_devices(duration=duration, flush_cache=flush_cache) ret = list...
19,145
[ 0.02701631374657154, 0.02006831206381321, -0.02559790201485157, -0.013397343456745148, 0.05208231136202812, 0.027836332097649574, 0.011297428980469704, 0.022960541769862175, 0.005867570638656616, -0.00674853753298521, -0.0289444662630558, -0.05075255036354065, 0.07814563065767288, 0.029941...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dict_or_list", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def _access(dict_or_list): if expr == '_': return dict_or_list try: result = eval(compiled_expr, {}, {'_': Dots(dict_or_list)}) except (KeyError, IndexError): # allow defaults for missing fields if use_default: result = default ...
19,146
[ 0.03803721442818642, -0.01335179153829813, 0.042985700070858, -0.0057608820497989655, -0.004332776181399822, -0.04442235827445984, 0.006322432309389114, -0.0060487836599349976, -0.003885245881974697, 0.023111939430236816, 0.01907561719417572, 0.025312533602118492, 0.01009080745279789, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "proto", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__ (self, proto = RFCOMM, sockfd = None): if proto not in [ RFCOMM ]: raise ValueError ("invalid protocol") if sockfd: self._sockfd = sockfd else: self._sockfd = bt.socket (bt.SOCK_STREAM, bt.BTHPROTO_RFCOMM) self._proto = proto # u...
19,147
[ 0.03616917133331299, -0.030245471745729446, 0.01792244054377079, -0.015025448054075241, -0.02091672085225582, -0.008036993443965912, -0.019208792597055435, -0.019911421462893486, -0.010009759105741978, -0.02063567005097866, 0.021219391375780106, 0.01522002276033163, 0.012733797542750835, -...
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": "proto", "annotation": ...
class BluetoothSocket: def __init__ (self, proto = RFCOMM, sockfd = None): if proto not in [ RFCOMM ]: raise ValueError ("invalid protocol") if sockfd: self._sockfd = sockfd else: self._sockfd = bt.socket (bt.SOCK_STREAM, bt.BTHPROTO_RFCOMM) self....
19,148
[ 0.03911856934428215, -0.013422120362520218, 0.03515986353158951, -0.010224703699350357, -0.0018505190964788198, -0.007419644854962826, -0.018470054492354393, -0.0161042008548975, -0.004734635353088379, 0.0073200915940105915, 0.057670608162879944, -0.02609466202557087, 0.059029217809438705, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sock", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def advertise_service (sock, name, service_id = "", service_classes = [], \ profiles = [], provider = "", description = "", protocols = []): if service_id != "" and not is_valid_uuid (service_id): raise ValueError ("invalid UUID specified for service_id") for uuid in service_classes: if ...
19,149
[ 0.010984247550368309, -0.048300739377737045, 0.03580843284726143, 0.0004926600959151983, -0.01648171804845333, 0.021968495100736618, 0.03148746117949486, 0.002383752726018429, 0.008481507189571857, 0.023551423102617264, -0.002791517646983266, 0.018481770530343056, -0.020813383162021637, 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": "timeout", "annotation": null, "type_comment": null}}], "kwarg": n...
def settimeout (self, timeout): if timeout < 0: raise ValueError ("invalid timeout") if timeout == 0: self.setblocking (False) else: self.setblocking (True) bt.settimeout (self._sockfd, timeout) self._timeout = timeout
19,150
[ 0.01697181910276413, -0.035736434161663055, 0.033417750149965286, -0.03267672657966614, -0.01403163094073534, -0.00032681209268048406, -0.03714676946401596, -0.0021379112731665373, -0.02350955456495285, 0.00501983379945159, 0.022589251399040222, -0.0359276682138443, 0.050341762602329254, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "uuid", "annotation": null, "type_comment": null}}, {"_type": "arg...
def find_service (name = None, uuid = None, address = None): if address is not None: addresses = [ address ] else: addresses = discover_devices (lookup_names = False) results = [] for addr in addresses: uuidstr = uuid or PUBLIC_BROWSE_GROUP if not is_valid_uuid (uuidstr...
19,151
[ 0.0011564571177586913, -0.03253400698304176, 0.04894078150391579, -0.01949245110154152, 0.002265876391902566, -0.028211908414959908, -0.03511436656117439, -0.01748192124068737, -0.024405881762504578, -0.03268452733755112, 0.003725391114130616, -0.0123857157304883, -0.03853333741426468, -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": "host", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, host, user_agent=None, session=None, retries=5, batch_size=50, parallel_requests=4): self.host = str(host) if session is not None: self._session = session else: self.retries = int(retries) self._session = requests.Session()...
19,152
[ 0.03820718824863434, -0.017957622185349464, 0.06841695308685303, -0.026844998821616173, -0.018238019198179245, 0.0017357205506414175, 0.043083664029836655, 0.027186350896954536, -0.00819247867912054, 0.017421208322048187, 0.01586073637008667, -0.0032123783603310585, -0.03284306451678276, -...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _score(self, context, models, rev_ids): logging.debug("Starting up thread pool with {0} workers" .format(self.workers)) with ThreadPoolExecutor(max_workers=self.workers) as executor: future_rev_ids = [] # A list of future results and the revids # This ...
19,153
[ 0.025829067453742027, -0.003447573399171233, 0.03260160982608795, -0.06436248868703842, -0.016604401171207428, -0.009096222929656506, -0.025759007781744003, -0.02405419573187828, -0.018811315298080444, 0.025011692196130753, -0.03035966493189335, -0.03825317695736885, 0.00839561503380537, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _score_request(self, context, rev_ids, models): url = self.host + "/v3/scores/{0}/".format(urllib.parse.quote(context)) params = {'revids': "|".join(str(rid) for rid in rev_ids), 'models': "|".join(urllib.parse.quote(model) for model in models)...
19,154
[ 0.035513803362846375, 0.034248679876327515, 0.0363948680460453, -0.01624327152967453, -0.03449718654155731, 0.011261851526796818, -0.004696203395724297, -0.002551425015553832, -0.02175559289753437, 0.021925028413534164, -0.01476353034377098, -0.041636090725660324, 0.010211347602307796, 0.0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_rename_model_with_self_referential_m2m(self): app_label = "test_rename_model_with_self_referential_m2m" project_state = self.apply_operations(app_label, ProjectState(), operations=[ migrations.CreateModel("ReflexivePony", fields=[ ("ponies", models.ManyToManyField("...
19,155
[ 0.04480494558811188, 0.030518267303705215, 0.05392921343445778, -0.005705667193979025, -0.05128797888755798, -0.01731209270656109, 0.01435871236026287, -0.017804322764277458, -0.013230185024440289, 0.020577620714902878, 0.010901096276938915, -0.01841660961508751, 0.009484433569014072, 0.04...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_alter_field_m2m(self): project_state = self.set_up_test_model("test_alflmm", second_model=True) project_state = self.apply_operations("test_alflmm", project_state, operations=[ migrations.AddField("Pony", "stables", models.ManyToManyField("Stable", related_name="ponies")) ]...
19,156
[ 0.03185664117336273, 0.030286245048046112, 0.06107102707028389, 0.001721517532132566, -0.05394192039966583, -0.016800764948129654, 0.018620431423187256, -0.014457630924880505, 0.003355790628120303, 0.017810305580496788, 0.025724612176418304, -0.005262702237814665, -0.009279057383537292, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_repoint_field_m2m(self): project_state = self.set_up_test_model("test_alflmm", second_model=True, third_model=True) project_state = self.apply_operations("test_alflmm", project_state, operations=[ migrations.AddField("Pony", "places", models.ManyToManyField("Stable", related_name="...
19,157
[ 0.0350872278213501, 0.03873297572135925, 0.04409148544073105, -0.03772978112101555, -0.04418935626745224, 0.010197073221206665, 0.002269414719194174, -0.0017754652071744204, -0.011958775110542774, 0.028089357540011406, 0.018228720873594284, -0.006343350280076265, 0.026645740494132042, 0.05...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_remove_field_m2m(self): project_state = self.set_up_test_model("test_rmflmm", second_model=True) project_state = self.apply_operations("test_rmflmm", project_state, operations=[ migrations.AddField("Pony", "stables", models.ManyToManyField("Stable", related_name="ponies")) ...
19,158
[ 0.006726021878421307, 0.023111090064048767, 0.08579237014055252, 0.01521755289286375, -0.04861415922641754, -0.054127104580402374, 0.049160897731781006, 0.008656691759824753, -0.02225681021809578, 0.000600842759013176, 0.046541109681129456, 0.0237831212580204, 0.018759962171316147, -0.0343...
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": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg...
def install(self, spec, prefix): mkdirp(prefix.bin) jar_file = 'igvtools.jar' install(jar_file, prefix.bin) install_tree('genomes', prefix.genomes) # Set up a helper script to call java on the jar file, # explicitly codes the path for java and the jar file. scrip...
19,159
[ 0.04181899130344391, 0.01223713904619217, 0.04081384092569351, -0.0382658988237381, -0.028845520690083504, 0.009280122816562653, -0.0025304113514721394, 0.008216531947255135, -0.008894424885511398, 0.027162475511431694, 0.023445751518011093, 0.0023302575573325157, 0.02372625842690468, 0.03...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_remove_field_m2m_with_through(self): project_state = self.set_up_test_model("test_rmflmmwt", second_model=True) self.assertTableNotExists("test_rmflmmwt_ponystables") project_state = self.apply_operations("test_rmflmmwt", project_state, operations=[ migrations.CreateModel("...
19,160
[ -0.021768903359770775, 0.005601407960057259, 0.03171628341078758, -0.04618082940578461, -0.016999447718262672, -0.02522886171936989, 0.011238857172429562, -0.025397054851055145, -0.025949686765670776, 0.032172806560993195, 0.009761166758835316, -0.03861217200756073, 0.04346572607755661, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestRegistrationFilesList(object): @pytest.fixture(autouse=True) def setUp(self): self.app = JSONAPITestApp() self.user = AuthUserFactory() self.node = ProjectFactory(creator=self.user) self.registration = RegistrationFactory(project=self.node, creator=self.user) #...
19,161
[ 0.008687117137014866, -0.030893560498952866, 0.02391671948134899, -0.022206442430615425, -0.01151042990386486, -0.03024202585220337, 0.0442500039935112, -0.0032016776967793703, 0.0044351802207529545, 0.007037922274321318, 0.015528221614658833, 0.0010231116320937872, -0.021446319296956062, ...
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 setUp(self): self.app = JSONAPITestApp() self.user = AuthUserFactory() self.node = ProjectFactory(creator=self.user) self.registration = RegistrationFactory(project=self.node, creator=self.user) # Note: folders/files added to node do not seem to get picked up by the Registrat...
19,162
[ 0.050183411687612534, 0.047822799533605576, 0.056003548204898834, 0.046357590705156326, -0.00792128685861826, 0.013644760474562645, 0.00040414079558104277, -0.044241175055503845, -0.003998800180852413, 0.06178298592567444, 0.025803960859775543, -0.023545097559690475, 0.012881630100309849, ...
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": "parent", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, parent, rect, real_surface, offset=(0, 0)): self.offset = offset self.x = self.y = 0 if rect.x < 0: self.x = rect.x if rect.y < 0: self.y = rect.y self.real_surface = real_surface if real_surface == None: self.mysubsurface = parent.mysubsurf...
19,163
[ 0.00727594830095768, -0.021443823352456093, 0.08487411588430405, -0.0073425122536718845, -0.013783851638436317, 0.03809504210948944, 0.059928007423877716, 0.016743386164307594, -0.012350167147815228, -0.024761777371168137, 0.00993338506668806, -0.006067557260394096, -0.0242292657494545, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def update_connections_time_zone(**kwargs): if kwargs['setting'] == 'TIME_ZONE': # Reset process time zone if hasattr(time, 'tzset'): if kwargs['value']: os.environ['TZ'] = kwargs['value'] else: os.environ.pop('TZ', None) time.tzset...
19,164
[ 0.01402429398149252, 0.004787643905729055, -0.023576227948069572, -0.007800356484949589, 0.05544325336813927, 0.03650286793708801, 0.010258403606712818, -0.013230245560407639, 0.015343815088272095, 0.006399095058441162, 0.02076202817261219, -0.022712117061018944, 0.021964777261018753, 0.00...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "op", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def compare(self, op, value, value_is_parent=False, alias_secondary=True): if op == operators.eq: if value is None: if self.uselist: return ~sql.exists([1], self.primaryjoin) else: return self._op...
19,165
[ 0.03638352081179619, 0.0221406202763319, -0.07537711411714554, -0.012769107706844807, 0.05917665734887123, 0.04146866127848625, 0.0366310253739357, -0.05193145573139191, 0.014580408111214638, 0.009523391723632812, 0.06556683778762817, -0.012476599775254726, 0.029700832441449165, 0.01603169...
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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _optimized_compare(self, value, value_is_parent=False, adapt_source=None, alias_secondary=True): if value is not None: value = attributes.instance_state(value) return self._lazy_strategy.lazy_clause( value, rev...
19,166
[ 0.07083931565284729, 0.006574629340320826, -0.03812821954488754, -0.016760675236582756, 0.02504841238260269, 0.019133560359477997, 0.01968916319310665, 0.01524434331804514, -0.03595210984349251, 0.053615640848875046, 0.006337340921163559, -0.038151368498802185, -0.022744975984096527, 0.002...
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": "session", "annotation": null, "type_comment": null}}, {"_type": "...
def merge(self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive): if load: for r in self._reverse_property: if (source_state, r) in _recursive: return ...
19,167
[ 0.06997368484735489, 0.03615561127662659, -0.01251980196684599, -0.029701974242925644, -0.00026122620329260826, 0.058184362947940826, 0.02937167137861252, -0.00588513258844614, -0.012011641636490822, 0.0665690079331398, 0.02089809626340866, -0.06189393624663353, 0.010963560082018375, 0.006...
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": "type_", "annotation": null, "type_comment": null}}, {"_type": "ar...
def cascade_iterator(self, type_, state, dict_, visited_states, halt_on=None): # assert type_ in self._cascade # only actively lazy load on the 'delete' cascade if type_ != 'delete' or self.passive_deletes: passive = attributes.PASSIVE_NO_INITIALIZE ...
19,168
[ 0.014866415411233902, 0.06104312464594841, 0.059800274670124054, 0.017842087894678116, -0.024104146286845207, 0.010958603583276272, 0.03800257295370102, -0.012273157946765423, -0.03616219758987427, 0.029613325372338295, -0.012787029147148132, -0.012380711734294891, -0.007319677621126175, -...
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 do_init(self): self._check_conflicts() self._process_dependent_arguments() self._setup_join_conditions() self._check_cascade_settings(self._cascade) self._post_init() self._generate_backref() super(RelationshipProperty, self).do_init() self._lazy_strat...
19,169
[ 0.05658251419663429, 0.030332893133163452, 0.00846381951123476, 0.02331055887043476, -0.02166154608130455, 0.037130873650312424, 0.0019308615010231733, -0.020573420450091362, 0.006147346924990416, -0.03894815221428871, -0.022076603025197983, -0.05878119915723801, 0.036682162433862686, -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": "key", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _add_reverse_property(self, key): other = self.mapper.get_property(key, _configure_mappers=False) self._reverse_property.add(other) other._reverse_property.add(self) if not other.mapper.common_parent(self.parent): raise sa_exc.ArgumentError( 'reverse_prop...
19,170
[ 0.0750286728143692, 0.01521576102823019, 0.05036171153187752, 0.012758002616465092, -0.009931580163538456, 0.030856044963002205, 0.0343862809240818, -0.019460981711745262, 0.005599780008196831, 0.05970119684934616, 0.013115494512021542, -0.06005868688225746, 0.01720431074500084, 0.02123727...
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": "cascade", "annotation": null, "type_comment": null}}], "kwarg": n...
def _check_cascade_settings(self, cascade): if cascade.delete_orphan and not self.single_parent \ and (self.direction is MANYTOMANY or self.direction is MANYTOONE): raise sa_exc.ArgumentError( 'On %s, delete-orphan cascade is not supported ' ...
19,171
[ 0.03262127935886383, 0.0019535108003765345, 0.060488227754831314, 0.00784346368163824, -0.0012694878969341516, 0.011615152470767498, 0.07112662494182587, -0.019641021266579628, -0.008937900885939598, 0.03488076105713844, -0.014427737332880497, -0.028667183592915535, -0.01489846222102642, 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": "cascade", "annotation": null, "type_comment": null}}], "kwarg": n...
def _set_cascade(self, cascade): cascade = CascadeOptions(cascade) if 'mapper' in self.__dict__: self._check_cascade_settings(cascade) self._cascade = cascade if self._dependency_processor: self._dependency_processor.cascade = cascade
19,172
[ 0.0030597145669162273, 0.038664888590574265, 0.055629219859838486, -0.04260457679629326, -0.03119455836713314, -0.0013367750216275454, 0.005667334422469139, -0.00798163004219532, -0.04985962435603142, -0.010565030388534069, -0.013498266227543354, -0.0402364581823349, 0.059159863740205765, ...
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": "source_polymorphic", "annotation": null, "type_comment": null}}, ...
def _create_joins(self, source_polymorphic=False, source_selectable=None, dest_polymorphic=False, dest_selectable=None, of_type=None): if source_selectable is None: if source_polymorphic and self.parent.with_polymorphic: source_selectable =...
19,173
[ -0.01099889911711216, 0.045261483639478683, 0.05350169911980629, 0.0004702298028860241, 0.008879132568836212, 0.027204658836126328, 0.0158236064016819, -0.03962469846010208, -0.03761838376522064, 0.0023168146144598722, 0.005636786110699177, -0.046551257371902466, 0.031217286363244057, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __clause_element__(self): adapt_from = self._source_selectable() if self._of_type: of_type = inspect(self._of_type).mapper else: of_type = None pj, sj, source, dest, \ secondary, target_adapter = self.property._create_j...
19,174
[ 0.014410093426704407, 0.003596327966079116, 0.020679660141468048, 0.02636687643826008, 0.0016928452532738447, 0.023244483396410942, 0.018982168287038803, -0.0682961568236351, -0.003701646812260151, -0.01521547231823206, -0.003943260759115219, -0.07166635990142822, 0.05967240780591965, -0.0...
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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __negated_contains_or_equals(self, other): if self.property.direction == MANYTOONE: state = attributes.instance_state(other) def state_bindparam(x, state, col): o = state.obj() # strong ref return sql.bindparam( ...
19,175
[ -0.003571651875972748, 0.04092656821012497, 0.063663549721241, -0.03253698721528053, -0.0004278382984921336, 0.012608691118657589, 0.014140701852738857, -0.010085736401379108, -0.04036726430058479, 0.016025317832827568, -0.0036598031874746084, -0.0678948238492012, 0.01978239230811596, 0.02...
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": "criterion", "annotation": null, "type_comment": null}}], "kwarg":...
def _criterion_exists(self, criterion=None, **kwargs): if getattr(self, '_of_type', None): info = inspect(self._of_type) target_mapper, to_selectable, is_aliased_class = \ info.mapper, info.selectable, info.is_aliased_class if self.property...
19,176
[ 0.021116290241479874, 0.021886957809329033, 0.04800157621502876, -0.02820643037557602, -0.016866609454154968, 0.011901307851076126, 0.025123760104179382, -0.03426167368888855, -0.060992829501628876, 0.030782662332057953, 0.0032890988513827324, -0.012528851628303528, 0.034349750727415085, -...
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": "parent_selectable", "annotation": null, "type_comment": null}}, {...
def __init__(self, parent_selectable, child_selectable, parent_local_selectable, child_local_selectable, primaryjoin=None, secondary=None, secondaryjoin=None, parent_equivalents=None, ...
19,177
[ 0.056169189512729645, 0.06895601004362106, -0.02209208905696869, -0.0003995882871095091, -0.007638334296643734, 0.03074324131011963, 0.04302365705370903, -0.08271345496177673, -0.037263255566358566, -0.005230254493653774, 0.00940021499991417, -0.053004130721092224, 0.04247504845261574, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "element", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "annotations", "annotation": null, "type_comment": null}}], "kw...
def _annotate_columns(element, annotations): def clone(elem): if isinstance(elem, expression.ColumnClause): elem = elem._annotate(annotations.copy()) elem._copy_internals(clone=clone) return elem if element is not None: element = clone(element) return element
19,178
[ -0.012762664817273617, 0.047990281134843826, 0.06284863501787186, -0.038809143006801605, 0.0222653616219759, 0.001660477020777762, -0.03803296014666557, -0.02185509353876114, -0.02945059724152088, 0.023595960810780525, 0.014381560496985912, 0.011587302200496197, 0.02326331101357937, 0.0340...
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 _annotate_from_fk_list(self): def check_fk(col): if col in self.consider_as_foreign_keys: return col._annotate({"foreign": True}) self.primaryjoin = visitors.replacement_traverse( self.primaryjoin, {}, check_fk ) if self...
19,179
[ 0.013498972170054913, 0.010801686905324459, 0.06428320705890656, -0.08305129408836365, 0.009722772985696793, 0.028403041884303093, 0.028503404930233955, -0.019985001534223557, -0.030560869723558426, 0.001286699203774333, -0.022481558844447136, 0.013034787960350513, 0.02677212469279766, 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 _log_joins(self): if self.prop is None: return log = self.prop.logger log.info('%s setup primary join %s', self.prop, self.primaryjoin) log.info('%s setup secondary join %s', self.prop, self.secondaryjoin) log.info('%s synchronize...
19,180
[ 0.00977124460041523, 0.02620832249522209, 0.03806121647357941, -0.005491348914802074, 0.010425315238535404, 0.026344824582338333, 0.003674170235171914, -0.048185091465711594, -0.027436837553977966, 0.04072299972176552, -0.01184152066707611, -0.033829666674137115, 0.028096595779061317, 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 _check_remote_side(self): if not self.local_remote_pairs: raise sa_exc.ArgumentError( 'Relationship %s could ' 'not determine any unambiguous local/remote column ' 'pairs based on join condition and remote_side ' 'arguments. ' ...
19,181
[ 0.038173649460077286, 0.06184370443224907, 0.08563342690467834, -0.03460758179426193, 0.00633036345243454, 0.014730959199368954, 0.020989522337913513, -0.03812578320503235, -0.004747772589325905, 0.04284064471721649, -0.021563922986388206, -0.03420071676373482, 0.01273252721875906, 0.00933...
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 _annotate_present_fks(self): if self.secondary is not None: secondarycols = util.column_set(self.secondary.c) else: secondarycols = set() def is_foreign(a, b): if isinstance(a, schema.Column) and \ isinstance(b, schema.Column): ...
19,182
[ 0.01658991165459156, -0.012899178080260754, 0.0616021566092968, -0.057923685759305954, -0.014113074168562889, 0.024167565628886223, 0.03452859818935394, -0.008184601552784443, -0.025896448642015457, 0.03644140437245369, 0.006523158401250839, -0.025896448642015457, 0.009484329260885715, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _setup_pairs(self): sync_pairs = [] lrp = util.OrderedSet([]) secondary_sync_pairs = [] def go(joincond, collection): def visit_binary(binary, left, right): if "remote" in right._annotations and \ "remote" not in left._annotations and ...
19,183
[ 0.015735790133476257, 0.01219879649579525, 0.06368779391050339, -0.03834846243262291, -0.034340597689151764, 0.02336825057864189, 0.0384579636156559, -0.014366984367370605, -0.02798933908343315, -0.012582061812281609, -0.03151538223028183, -0.028514960780739784, 0.01893332041800022, -0.007...
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": "annotation", "annotation": null, "type_comment": null}}], "kwarg"...
def _gather_join_annotations(self, annotation): s = set( self._gather_columns_with_annotation( self.primaryjoin, annotation) ) if self.secondaryjoin is not None: s.update( self._gather_columns_with_annotation( self.secon...
19,184
[ 0.02497342973947525, 0.03791750967502594, 0.03927081078290939, -0.012060674838721752, 0.01636492647230625, -0.006246489938348532, 0.019710589200258255, -0.07167486846446991, -0.06435701251029968, 0.012117062695324421, -0.012223572470247746, -0.03202814236283302, 0.04175186529755592, 0.0104...
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": "reverse_direction", "annotation": null, "type_comment": null}}], ...
def create_lazy_clause(self, reverse_direction=False): binds = util.column_dict() lookup = collections.defaultdict(list) equated_columns = util.column_dict() if reverse_direction and self.secondaryjoin is None: for l, r in self.local_remote_pairs: lookup[r].a...
19,185
[ 0.03290342167019844, -0.0019028797978535295, 0.04660623520612717, -0.003605319419875741, 0.03867192938923836, -0.008361217565834522, 0.013036418706178665, -0.019408853724598885, -0.008673591539263725, 0.0048990692012012005, -0.020554225891828537, -0.043774042278528214, 0.025656336918473244, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}], "kwarg": null, "var...
def is_foreign(a, b): if isinstance(a, schema.Column) and \ isinstance(b, schema.Column): if a.references(b): return a elif b.references(a): return b if secondarycols: if a in secondaryco...
19,186
[ 0.031616341322660446, 0.024530727416276932, 0.019842060282826424, 0.014217999763786793, 0.005878371186554432, 0.03423544764518738, -0.0030341867823153734, 0.016439562663435936, -0.00588129460811615, 0.061689283698797226, 0.016252484172582626, -0.05677846074104309, 0.027430450543761253, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "binary", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def visit_binary(binary): c, f = binary.left, binary.right if ( isinstance(c, expression.ColumnClause) and isinstance(f, expression.ColumnClause) and pt.is_derived_from(c.table) and pt.is_derived_from(f.table) and mt...
19,187
[ 0.05716570094227791, 0.055276669561862946, 0.05091390758752823, -0.00513580534607172, -0.00025949592236429453, 0.011328568682074547, -0.0014013131149113178, -0.05001436546444893, -0.020801838487386703, 0.02439999394118786, -0.025277044624090195, -0.044324781745672226, 0.039849575608968735, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "binary", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def visit_binary(binary): if not isinstance(binary.left, sql.ColumnElement) or \ not isinstance(binary.right, sql.ColumnElement): return if "foreign" not in binary.left._annotations and \ "foreign" not in binary.right._annotations: ...
19,188
[ 0.03583277761936188, 0.05153506621718407, 0.02312079444527626, 0.011573121882975101, 0.002338165184482932, 0.014811559580266476, 0.0027437652461230755, -0.009670778177678585, -0.03596002608537674, 0.07059668004512787, 0.00595834432169795, -0.04886287823319435, 0.03807232528924942, -0.00160...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "binary", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def visit_binary(binary): equated = binary.left.compare(binary.right) if isinstance(binary.left, expression.ColumnClause) and \ isinstance(binary.right, expression.ColumnClause): # assume one to many - FKs are "remote" if fn(binary.left): ...
19,189
[ 0.07174377888441086, 0.027086470276117325, 0.03737796097993851, -0.006440738216042519, 0.015870800241827965, 0.009179050102829933, -0.010730760172009468, -0.03970552608370781, -0.05937573313713074, 0.04741843789815903, 0.025329386815428734, -0.0558159276843071, 0.05371655523777008, -0.0012...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "left", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "right", "annotation": null, "type_comment": null}}], "kwarg": nul...
def proc_left_right(left, right): if isinstance(left, expression.ColumnClause) and \ isinstance(right, expression.ColumnClause): if self.child_selectable.c.contains_column(right) and \ self.parent_selectable.c.contains_column(left): ...
19,190
[ 0.02555268257856369, 0.05530313029885292, 0.008267403580248356, 0.02618722803890705, -0.018792325630784035, -0.023221945390105247, 0.0017282228218391538, -0.08332078158855438, -0.03773108497262001, -0.06238076090812683, -0.008035549893975258, -0.03624234348535538, 0.046663541346788406, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "col", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def col_to_bind(col): if (reverse_direction and col in lookup) or \ (not reverse_direction and "local" in col._annotations): if col in lookup: for tobind, equated in lookup[col]: if equated in binds: ...
19,191
[ 0.03835693374276161, 0.013826335780322552, 0.05928121134638786, -0.013813592493534088, -0.024441393092274666, 0.020299864932894707, 0.04383649304509163, 0.0042211739346385, 0.0012671486474573612, 0.04967286437749863, 0.009824981912970543, -0.04844952002167702, 0.0343300923705101, -0.032597...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "joincond", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "collection", "annotation": null, "type_comment": null}}], "kw...
def go(joincond, collection): def visit_binary(binary, left, right): if "remote" in right._annotations and \ "remote" not in left._annotations and \ self.can_be_synced_fn(left): lrp.add((left, right)) elif "remot...
19,192
[ 0.01079158391803503, 0.04882293567061424, -0.004677125718444586, -0.0020328399259597063, -0.041404444724321365, 0.02346097305417061, 0.03639696538448334, -0.05726146697998047, -0.03349911794066429, 0.014442872256040573, 0.0032224063761532307, -0.00006764662975911051, 0.03975846618413925, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "element", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def replace(element): if "remote" in element._annotations: v = element._annotations.copy() del v['remote'] v['local'] = True return element._with_annotations(v) elif "local" in element._annotations: ...
19,193
[ 0.03339189663529396, 0.02534625120460987, 0.054937444627285004, -0.02059537172317505, -0.02616068720817566, 0.019497117027640343, 0.004951403941959143, -0.019719235599040985, -0.018991177901625633, 0.056023359298706055, -0.003072646912187338, -0.03020819090306759, 0.04235069826245308, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "binary", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "left", "annotation": null, "type_comment": null}}, {"_type": "a...
def visit_binary(binary, left, right): if "remote" in right._annotations and \ "remote" not in left._annotations and \ self.can_be_synced_fn(left): lrp.add((left, right)) elif "remote" in left._annotations and \ ...
19,194
[ 0.006307073403149843, 0.013194107450544834, 0.025870392099022865, -0.051699358969926834, -0.04378703609108925, 0.04668683931231499, -0.02193494513630867, -0.0035652052611112595, -0.010030213743448257, 0.04229570925235748, 0.010687848553061485, -0.015783216804265976, 0.03133859485387802, -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": "args", "annotation": null, "type_comment": null}}], "kwarg": null...
def parse_args(self, args): parser = argparse.ArgumentParser() parser.add_argument('--config', action='store', dest='config', default="config.yaml", help='Global config file (default: config.yaml)') parser.add_argument('--debug', action='store_true', dest='debug', help='Suppresses alerts and pri...
19,195
[ 0.0020349479746073484, 0.00904871616512537, 0.037954818457365036, -0.04091895371675491, -0.025033043697476387, 0.02931714616715908, -0.009436600841581821, 0.003835428273305297, 0.008238210342824459, 0.029872920364141464, 0.005766168236732483, -0.029826605692505836, 0.00986501108855009, -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": "args", "annotation": null, "type_comment": null}}], "kwarg": null...
def __init__(self, args): self.parse_args(args) self.debug = self.args.debug self.verbose = self.args.verbose if self.verbose or self.debug: elastalert_logger.setLevel(logging.INFO) if self.debug: elastalert_logger.info("Note: In debug mode, alerts will ...
19,196
[ 0.026385601609945297, -0.00706916069611907, 0.03579631820321083, -0.03926693648099899, -0.009733305312693119, 0.04166967049241066, -0.010422979481518269, -0.00028000635211355984, -0.02289273589849472, 0.01423843577504158, 0.03281514346599579, -0.05303817242383957, 0.01322617195546627, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg...
def remove_duplicate_events(self, data, rule): new_events = [] for event in data: if event['_id'] in rule['processed_hits']: continue # Remember the new data's IDs rule['processed_hits'][event['_id']] = lookup_es_key(event, rule['timestamp_field']) ...
19,197
[ -0.015510782599449158, 0.03946125507354736, 0.03394124284386635, -0.03487645089626312, -0.02919676899909973, 0.02211427129805088, -0.03775050863623619, 0.03056536614894867, -0.03745397925376892, 0.025775272399187088, 0.03994026780128479, -0.057891715317964554, -0.0022182699758559465, 0.003...
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": "rule", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_hits_terms(self, rule, starttime, endtime, index, key, qk=None, size=None): rule_filter = copy.copy(rule['filter']) if qk: filter_key = rule['query_key'] if rule.get('raw_count_keys', True) and not rule['query_key'].endswith('.raw'): filter_key = add_raw_p...
19,198
[ 0.02985120564699173, 0.030467718839645386, -0.0057176691479980946, -0.03142232075333595, -0.040570590645074844, 0.005543653387576342, 0.009058777242898941, 0.023646291345357895, 0.020981360226869583, -0.009451556019484997, 0.04371282458305359, -0.032257597893476486, 0.01663593202829361, -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": "rule", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_named_key_value(self, rule, match, key_name): # search the match for the key specified in the rule to get the value if key_name in rule: try: key_value = lookup_es_key(match, rule[key_name]) if key_value is not None: # Only do the u...
19,199
[ 0.020739592611789703, -0.005544424057006836, 0.016971999779343605, -0.03287433460354805, -0.03938739746809006, 0.047588154673576355, -0.002923747757449746, 0.005413687322288752, -0.03758085519075394, 0.02999812737107277, 0.04654226079583168, -0.05129632353782654, 0.01553389523178339, -0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "rule", "annotation": null, "type_comment": null}}], "kwarg": null...
def remove_old_events(self, rule): # Anything older than the buffer time we can forget now = ts_now() remove = [] buffer_time = rule.get('buffer_time', self.buffer_time) if rule.get('query_delay'): buffer_time += rule['query_delay'] for _id, timestamp in rule[...
19,200
[ 0.01069705095142126, 0.006571923848241568, 0.04153406620025635, -0.02530405856668949, -0.027959877625107765, 0.039591383188962936, 0.01249218825250864, 0.009412175044417381, 0.017914487048983574, 0.04465711489319801, 0.0006877773557789624, -0.02832874096930027, -0.0010896852472797036, 0.00...
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 send_pending_alerts(self): pending_alerts = self.find_recent_pending_alerts(self.alert_time_limit) for alert in pending_alerts: _id = alert['_id'] alert = alert['_source'] try: rule_name = alert.pop('rule_name') alert_time = alert.p...