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
101
[ -0.0010022750357165933, 0.03205143287777901, 0.05158144235610962, -0.034102726727724075, 0.002482650801539421, 0.0050881654024124146, -0.029636893421411514, -0.0019137377385050058, -0.02715824916958809, 0.025577044114470482, 0.013910322450101376, 0.023675326257944107, -0.048419032245874405, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Try", "_fields": {"body": [{"_type": "Assign", "_fields": {"va...
def get_current_hg_branch(): try: hgroot = find_hg_root() with open(os.path.join(hgroot, "branch")) as f: branch = f.read().rstrip() except OSError: branch = "" return branch
102
[ 0.0027130870148539543, 0.020991448312997818, 0.007917056791484356, -0.007878650911152363, 0.009288688190281391, -0.03149265795946121, -0.0029572374187409878, 0.002264563459903002, -0.01503308117389679, -0.025918347761034966, 0.016580281779170036, 0.003722607856616378, -0.024645473808050156, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Try", "_fields": {"body": [{"_type": "Assign", "_fields": {"va...
def get_current_hg_bookmark(): try: hgroot = find_hg_root() with open(os.path.join(hgroot, "bookmarks.current")) as f: bookmark = f.read() except OSError: bookmark = "" return bookmark
103
[ -0.00963856466114521, -0.015487408265471458, 0.011116907931864262, -0.013269892893731594, -0.009609232656657696, -0.005212333984673023, 0.03531598299741745, 0.0016088718548417091, -0.010401202365756035, -0.008682334795594215, 0.019042471423745155, 0.010958514176309109, -0.037380971014499664,...
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 get_current_hg_id(): branch = get_current_hg_branch() bookmark = get_current_hg_bookmark() if bookmark: # If we have a bookmark, the default branch is no longer # an interesting name. if branch == "default": branch = "" branch += " " + bookmark return bran...
104
[ 0.03610673174262047, 0.04115757718682289, 0.023798136040568352, 0.011444036848843098, 0.015493814833462238, -0.01005050353705883, -0.01966872625052929, 0.03330828994512558, 0.018406014889478683, 0.004891586024314165, 0.0002150733780581504, -0.020863182842731476, -0.0008574495441280305, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"k...
class InputHandler(key.KeyStateHandler): inputs = [0]*16 keys = { key._0: 0x0, key._1: 0x1, key._2: 0x2, key._3: 0x3, key._4: 0x4, key._5: 0x5, key._6: 0x6, key._7: 0x7, key._8: 0x8, key._9: 0x9, key.A: 0xA, ...
105
[ 0.031163020059466362, 0.03465460613369942, 0.025153687223792076, 0.000702177407220006, -0.0023707766085863113, 0.018313024193048477, -0.033395737409591675, 0.049309778958559036, 0.02783769741654396, 0.04225534573197365, 0.018538670614361763, 0.002651350572705269, -0.054012734442949295, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def poll(self): self.log.debug('Polling kernel...') if not self.kernel_manager.is_alive(): if self._restarting: self._restart_count += 1 else: self._restart_count = 1 if self._restart_count >= self.restart_limit: self.l...
106
[ -0.012901384383440018, 0.008556289598345757, 0.07439552992582321, -0.0327790230512619, -0.01734021119773388, 0.017715133726596832, 0.0030529482755810022, -0.028360283002257347, 0.016081539914011955, 0.03154713287949562, -0.005409609992057085, -0.01691172644495964, -0.00849603395909071, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": ""}}, "targets": [{"_type": "Name", "_fields": {"id": "TMP_DIR", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_t...
class TestQgsProcessExecutablePt1(unittest.TestCase): TMP_DIR = '' @classmethod def setUpClass(cls): cls.TMP_DIR = tempfile.mkdtemp() # print('TMP_DIR: ' + cls.TMP_DIR) # subprocess.call(['open', cls.TMP_DIR]) @classmethod def tearDownClass(cls): shutil.rmtree(cls....
107
[ 0.009145388379693031, 0.03963194042444229, 0.0528734028339386, -0.06197834759950638, -0.04598691686987877, -0.024125799536705017, 0.018475648015737534, 0.019839080050587654, 0.009243601933121681, 0.005673260428011417, -0.0017779490444809198, -0.002215575659647584, 0.013657421804964542, 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": "arguments", "annotation": null, "type_comment": null}}], "kwarg":...
def run_process(self, arguments): call = [QGIS_PROCESS_BIN] + arguments print(' '.join(call)) myenv = os.environ.copy() myenv["QGIS_DEBUG"] = '0' p = subprocess.Popen(call, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=myenv) output, err = p.communicate() ...
108
[ 0.0017397061455994844, 0.05629862844944, 0.018997984007000923, -0.047192156314849854, -0.04728187620639801, -0.02250823564827442, 0.03375674784183502, 0.02949509769678116, -0.003036424983292818, -0.006913965102285147, 0.0047971587628126144, -0.008848529309034348, -0.01206719595938921, 0.03...
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": "arguments", "annotation": null, "type_comment": null}}, {"_type":...
def run_process_stdin(self, arguments, stdin_string: str): call = [QGIS_PROCESS_BIN] + arguments print(' '.join(call)) myenv = os.environ.copy() myenv["QGIS_DEBUG"] = '0' p = subprocess.Popen(call, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, env=myenv...
109
[ 0.002117085736244917, 0.01166892983019352, 0.019614608958363533, -0.05228996276855469, -0.006542117800563574, 0.008303908631205559, 0.012861075811088085, -0.01439970638602972, 0.019884750247001648, 0.012109377421438694, 0.026708753779530525, -0.024218754842877388, -0.00012846394383814186, ...
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 testPluginsJson(self): rc, output, err = self.run_process(['plugins', '--json']) res = json.loads(output) self.assertIn('gdal_version', res) self.assertIn('geos_version', res) self.assertIn('proj_version', res) self.assertIn('python_version', res) self.assertI...
110
[ -0.0075119053944945335, -0.00999864935874939, 0.07575204223394394, -0.04314662888646126, -0.0016115395119413733, 0.009972813539206982, -0.014390821568667889, -0.004330810625106096, 0.020475270226597786, 0.030435165390372276, 0.026417620480060577, -0.03268292546272278, 0.006898293271660805, ...
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 testAlgorithmsListJson(self): rc, output, err = self.run_process(['list', '--no-python', '--json']) res = json.loads(output) self.assertIn('gdal_version', res) self.assertIn('geos_version', res) self.assertIn('proj_version', res) self.assertIn('python_version', res) ...
111
[ 0.007033980917185545, -0.01081999484449625, 0.03986797481775284, -0.007814805023372173, -0.015695225447416306, -0.001045746961608529, 0.0027640527114272118, 0.003115095430985093, 0.009081183932721615, 0.023083530366420746, 0.010623148642480373, -0.006440160796046257, -0.011456465348601341, ...
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 testAlgorithmHelpJson(self): rc, output, err = self.run_process(['help', '--no-python', 'native:buffer', '--json']) res = json.loads(output) self.assertIn('gdal_version', res) self.assertIn('geos_version', res) self.assertIn('proj_version', res) self.assertIn('python...
112
[ 0.01927957683801651, 0.0024006543681025505, 0.09069826453924179, -0.0409381240606308, 0.0017826794646680355, -0.008450303226709366, 0.01616956852376461, 0.016714749857783318, 0.010971764102578163, 0.004692892078310251, -0.008778650313615799, 0.030108850449323654, 0.020952291786670685, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testAlgorithmRunLegacy(self): output_file = self.TMP_DIR + '/polygon_centroid.shp' rc, output, err = self.run_process(['run', '--no-python', 'native:centroids', '--INPUT={}'.format(TEST_DATA_DIR + '/polys.shp'), '--OUTPUT={}'.format(output_file)]) self.assertFalse(self._strip_ignorable_error...
113
[ -0.00006923969340277836, -0.003946894779801369, 0.062104154378175735, -0.029268840327858925, 0.0014080131659284234, -0.011692081578075886, 0.028317781165242195, 0.015145614743232727, 0.032050687819719315, 0.007103221956640482, 0.006027336232364178, 0.032288454473018646, -0.000117582101665902...
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 testAlgorithmRun(self): output_file = self.TMP_DIR + '/polygon_centroid.shp' rc, output, err = self.run_process(['run', '--no-python', 'native:centroids', '--', 'INPUT={}'.format(TEST_DATA_DIR + '/polys.shp'), 'OUTPUT={}'.format(output_file)]) self.assertFalse(self._strip_ignorable_errors(er...
114
[ -0.0014270171523094177, 0.0028584140818566084, 0.0408061221241951, -0.023474615067243576, 0.0019153417088091373, -0.002436513314023614, 0.028076106682419777, 0.001994174439460039, 0.03183671832084656, -0.013115419074892998, 0.005868653766810894, 0.02285563386976719, 0.014750467613339424, -...
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 testAlgorithmRunStdIn(self): output_file = self.TMP_DIR + '/polygon_centroid_json.shp' params = { 'inputs': { 'INPUT': TEST_DATA_DIR + '/polys.shp', 'OUTPUT': output_file } } rc, output, err = self.run_process_stdin(['run', '-...
115
[ -0.01345790270715952, -0.016154298558831215, 0.07978441566228867, -0.025062033906579018, -0.008660966530442238, 0.0046193827874958515, 0.045188698917627335, 0.002329252427443862, 0.03028629906475544, -0.010520757175981998, -0.005777990445494652, 0.020909102633595467, 0.009858695790171623, ...
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 testAlgorithmRunStdInExtraSettings(self): output_file = self.TMP_DIR + '/polygon_centroid_json.shp' params = { 'inputs': { 'INPUT': TEST_DATA_DIR + '/polys.shp', 'OUTPUT': output_file }, 'ellipsoid': 'EPSG:7019', 'dista...
116
[ -0.004889769479632378, -0.021185986697673798, 0.08074295520782471, -0.020643683150410652, -0.010574917308986187, -0.0004248043696861714, 0.046228356659412384, -0.00887569971382618, 0.039624303579330444, 0.010743633843958378, -0.021788546815514565, 0.017269352450966835, -0.0018001460703089833...
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 testAlgorithmRunStdInExtraSettingsBadDistanceUnit(self): output_file = self.TMP_DIR + '/polygon_centroid_json.shp' params = { 'inputs': { 'INPUT': TEST_DATA_DIR + '/polys.shp', 'OUTPUT': output_file }, 'distance_units': 'xxx', ...
117
[ -0.008503001183271408, 0.007796272169798613, 0.0719861388206482, -0.015414471738040447, -0.011430080980062485, -0.004215329419821501, 0.04342763125896454, -0.021858498454093933, 0.024618634954094887, -0.0006458635907620192, -0.014045532792806625, 0.02967146597802639, 0.008714462630450726, ...
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 testAlgorithmRunStdInExtraSettingsBadProjectPath(self): output_file = self.TMP_DIR + '/polygon_centroid_json.shp' params = { 'inputs': { 'INPUT': TEST_DATA_DIR + '/polys.shp', 'OUTPUT': output_file }, 'project_path': 'xxx', ...
118
[ -0.012398223392665386, -0.014004596509039402, 0.09983081370592117, -0.01612575352191925, -0.021608509123325348, -0.020045550540089607, 0.04507768154144287, -0.010177831165492535, 0.039421264082193375, -0.011889642104506493, 0.005702934693545103, 0.023543599992990494, -0.00888777058571577, ...
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 testAlgorithmRunStdInExtraSettingsBadAreaUnit(self): output_file = self.TMP_DIR + '/polygon_centroid_json.shp' params = { 'inputs': { 'INPUT': TEST_DATA_DIR + '/polys.shp', 'OUTPUT': output_file }, 'area_units': 'xxx', } ...
119
[ -0.0023244188632816076, 0.015454073436558247, 0.053136784583330154, -0.020184913650155067, -0.03754393756389618, -0.01875935308635235, 0.009461677633225918, -0.0061280131340026855, -0.01658947579562664, -0.003112891921773553, 0.03878026455640793, -0.01085569802671671, 0.010836775414645672, ...
8
{"_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 execute(): webnotes.reload_doc("utilities", "doctype", "address") webnotes.conn.auto_commit_on_many_writes = True for lead in webnotes.conn.sql("""select name as lead, lead_name, address_line1, address_line2, city, country, state, pincode, status, company_name from `tabLead` where not exists (select nam...
120
[ -0.00633013341575861, -0.0626411959528923, 0.010117755271494389, -0.007817077450454235, -0.021634219214320183, -0.0121112409979105, 0.03390885889530182, -0.025111380964517593, 0.01508512906730175, 0.007111187558621168, 0.06028822809457779, -0.04747763276100159, 0.01869301125407219, -0.0001...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lead", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def set_in_customer(lead): customer = webnotes.conn.get_value("Customer", {"lead_name": lead.lead}) if customer: customer_address = webnotes.conn.sql("""select name from `tabAddress` where customer=%s and (address_line1=%s or address_line2=%s or pincode=%s)""", (customer, lead.address_line1, lead.address_lin...
121
[ 0.04168922081589699, -0.05363116413354874, 0.021947357803583145, -0.010718164034187794, -0.03714375197887421, -0.018679460510611534, 0.012701763771474361, -0.009642313234508038, 0.01198901329189539, 0.016393277794122696, 0.05949455127120018, -0.03128036484122276, 0.016944650560617447, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lead", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def create_address_for(lead): address_title = lead.company_name or lead.lead_name or lead.lead for c in ['%', "'", '"', '#', '*', '?', '`']: address_title = address_title.replace(c, "") if webnotes.conn.get_value("Address", address_title.strip() + "-" + "Billing"): address_title += " " + lead.lead lead.u...
122
[ -0.0038603704888373613, 0.026886887848377228, -0.003340649651363492, 0.01986488327383995, 0.030374793335795403, 0.017635859549045563, -0.0006341315456666052, -0.04190104454755783, 0.02660970389842987, 0.060149017721414566, 0.0017497265944257379, -0.021308552473783493, 0.011416533030569553, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lines", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def _parse(lines): def coalesce_lines(): line_iter = iter(lines) try: buffer = '' while True: line = next(line_iter) if line.strip().endswith('\\'): # Continuation. buffer += line.strip()[:-1] else: if buffer: ...
123
[ -0.010568914003670216, 0.04717981070280075, -0.007662746123969555, -0.005046060308814049, 0.020331820473074913, 0.018742509186267853, 0.0010316326515749097, -0.04629433900117874, 0.06420813500881195, 0.06725053489208221, -0.002734465291723609, 0.011278427205979824, 0.004183291923254728, 0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "line", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def parse_line(line): if line and not (line.startswith('#') or line.startswith('!')): match = Properties._EXPLICIT_KV_SEP.search(line) if match: return normalize(line[:match.start()]), normalize(line[match.end():]) else: space_sep = line.find(' ') if space_sep...
124
[ 0.02030831389129162, 0.015406731516122818, 0.05221785977482796, -0.007044484838843346, -0.0062131863087415695, 0.019089076668024063, 0.038054995238780975, -0.004630640149116516, 0.022648265585303307, 0.06458265334367752, 0.013916552066802979, -0.019630959257483482, 0.022241851314902306, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def coalesce_lines(): line_iter = iter(lines) try: buffer = '' while True: line = next(line_iter) if line.strip().endswith('\\'): # Continuation. buffer += line.strip()[:-1] else: if buffer: # Continuation join, ...
125
[ 0.04390867054462433, -0.023180633783340454, 0.03590795770287514, -0.014941805973649025, 0.012132031843066216, 0.04176562279462814, 0.010036607272922993, -0.004812928382307291, -0.007298268843442202, -0.01771586202085018, 0.014751313254237175, -0.03616988658905029, 0.01964460499584675, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestMemoryDockerCollector(CollectorTestCase): def setUp(self): config = get_collector_config('MemoryDockerCollector', { 'interval': 10, 'byte_unit': 'megabyte', 'memory_path': fixtures_path, }) self.collector = MemoryDockerCollector(config, None) ...
126
[ 0.03013838455080986, -0.052647918462753296, 0.033065732568502426, -0.03175729513168335, -0.035349950194358826, -0.06613146513700485, 0.01651068963110447, 0.03656968101859093, -0.026080014184117317, 0.07730861008167267, -0.015257695689797401, -0.049321386963129044, -0.005325223784893751, -0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "iterable", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "r", "annotation": null, "type_comment": null}}], "kwarg": nul...
def permutations(iterable, r=None): pool = tuple(iterable) n = len(pool) r = n if r is None else r if r > n: return indices = range(n) cycles = range(n, n - r, -1) yield tuple(pool[i] for i in indices[:r]) while n: for i in reversed...
127
[ -0.0035538238007575274, -0.01782163791358471, -0.012954825535416603, -0.05802828073501587, -0.0031103251967579126, 0.0014741949271410704, 0.0023108606692403555, -0.005739220883697271, 0.003682204755023122, -0.015032265335321426, 0.027963748201727867, 0.05560071021318436, -0.02476589195430278...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vi", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def varint_to_int(vi): b = ord(vi[0]) p = 1 i = b & 0x7f shift = 7 while b & 0x80 != 0: b = ord(vi[p]) p += 1 i |= (b & 0x7F) << shift shift += 7 return i
128
[ 0.043837159872055054, 0.025103330612182617, 0.01681048981845379, -0.024316510185599327, 0.006656753830611706, 0.019295843318104744, -0.0043524932116270065, -0.0034126793034374714, -0.032571885734796524, -0.03514466434717178, 0.04381218180060387, 0.019795412197709084, -0.002490038052201271, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, ...
def wrapper(*args): key = args try: with lock: pos, result = data[key] # The key is in the cache. Set the key's reference bit clock_refs[pos] = 1 # Record a cache hit ...
129
[ 0.0446479357779026, -0.03443719074130058, 0.018013298511505127, 0.012787516228854656, -0.0009331756155006588, -0.06487677246332169, 0.03939807042479515, -0.04862145707011223, -0.003091520396992564, -0.0011702323099598289, -0.0034647907596081495, -0.019458215683698654, -0.0013418161543086171,...
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 AWDWriter(object): def __init__(self): self.__block_addr = 1 def write(self, awd, file): def write_blocks(blocks): for b in blocks: b.write_block(file, self.__block_addr) self.__block_addr += 1 write_blocks(awd.texture_blocks) ...
130
[ 0.0484071746468544, -0.004873559344559908, 0.03673294186592102, 0.008340509608387947, -0.0036342560779303312, -0.057553231716156006, 0.019742097705602646, -0.06221301108598709, -0.002689287532120943, -0.009362934157252312, 0.026967233046889305, -0.01844082958996296, 0.007795216049998999, -...
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": "awd", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def write(self, awd, file): def write_blocks(blocks): for b in blocks: b.write_block(file, self.__block_addr) self.__block_addr += 1 write_blocks(awd.texture_blocks) write_blocks(awd.material_blocks) write_blocks(awd.mesh_data_blocks) ...
131
[ 0.009243729524314404, 0.028941230848431587, 0.06876037269830704, -0.026795586571097374, -0.008495248854160309, -0.03308282047510147, 0.023452376946806908, -0.0013168571749702096, 0.008694843389093876, 0.000007211917363747489, 0.021094663068652153, -0.013110876083374023, 0.028467193245887756,...
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 _open(self): # parse area file directory s = self.fp.read(256) if not _accept(s) or len(s) != 256: raise SyntaxError("not an McIdas area file") self.area_descriptor_raw = s self.area_descriptor = w = [0] + list(struct.unpack("!64i", s)) # get mode ...
132
[ 0.006883278489112854, 0.0141455652192235, 0.05609321594238281, -0.014817998744547367, -0.027410851791501045, -0.023706352338194847, 0.03697163984179497, 0.004224107600748539, -0.012342219240963459, -0.0171531792730093, 0.000864994537550956, -0.025405775755643845, 0.030614083632826805, 0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "MCIDAS"}}, "targets": [{"_type": "Name", "_fields": {"id": "format", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},...
class McIdasImageFile(ImageFile.ImageFile): format = "MCIDAS" format_description = "McIdas area file" def _open(self): # parse area file directory s = self.fp.read(256) if not _accept(s) or len(s) != 256: raise SyntaxError("not an McIdas area file") self.area_...
133
[ 0.03681424260139465, 0.017025744542479515, 0.02985120750963688, -0.009372021071612835, -0.01273561641573906, 0.05188584700226784, -0.016947129741311073, 0.005472159944474697, 0.008855408988893032, -0.04618064686655998, 0.01686851494014263, -0.05233507230877876, 0.03780254349112511, 0.01562...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def instrument_pymongo_collection(module): # Must name function explicitly as pymongo overrides the # __getattr__() method in a way that breaks introspection. for method in _methods: if hasattr(module.Collection, method): #newrelic.api.function_trace.wrap_function_trace( # ...
134
[ -0.02030729316174984, 0.062427327036857605, -0.01979825645685196, 0.004816889762878418, 0.03721379116177559, 0.020014869049191475, 0.029913997277617455, -0.028376057744026184, -0.025083567947149277, -0.008393681608140469, 0.017448026686906815, -0.021877724677324295, -0.00908683706074953, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inFilename", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def parse(inFilename): doc = minidom.parse(inFilename) rootNode = doc.documentElement rootObj = supermod.DoxygenType.factory() rootObj.build(rootNode) return rootObj
135
[ 0.000008440525562036783, 0.01528108213096857, -0.008954418823122978, -0.013845842331647873, 0.006933474447578192, -0.027206236496567726, -0.02279498428106308, -0.03037220612168312, -0.0053372979164123535, 0.009830337017774582, -0.003920526243746281, 0.003498396836221218, -0.03058326989412307...
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 get_git_version(self): VERSION_PFX = 'git version ' version = self.run_command(['version']) if version.startswith(VERSION_PFX): version = version[len(VERSION_PFX):].split()[0] else: version = '' # get first 3 positions of the git version because ...
136
[ 0.0029568469617515802, -0.004693776834756136, 0.0010071578435599804, 0.01935601979494095, -0.00432199239730835, 0.03455270454287529, -0.0012017636327072978, -0.004014108330011368, -0.010136931203305721, -0.010799172334372997, 0.004595021717250347, -0.013175105676054955, 0.006639834959059954,...
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}}, {"_type": "arg"...
def is_immutable_rev_checkout(self, url, dest): # type: (str, str) -> bool _, rev_options = self.get_url_rev_options(hide_url(url)) if not rev_options.rev: return False if not self.is_commit_id_equal(dest, rev_options.rev): # the current commit is different from r...
137
[ 0.008257647976279259, 0.032106660306453705, 0.024484215304255486, -0.0416000671684742, -0.014332504943013191, 0.015591363422572613, 0.00844243448227644, 0.00791117362678051, -0.016861770302057266, 0.028595715761184692, 0.01952962577342987, -0.017554720863699913, -0.016284313052892685, -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": "dest", "annotation": null, "type_comment": null}}, {"_type": "arg...
def fetch_new(self, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> None rev_display = rev_options.to_display() logger.info('Cloning %s%s to %s', url, rev_display, display_path(dest)) self.run_command(make_command('clone', '-q', url, dest)) if rev_options.rev: ...
138
[ -0.008171191439032555, 0.02738085761666298, 0.034022074192762375, -0.011627797968685627, -0.02475157007575035, 0.003737101797014475, 0.012273786589503288, 0.043677907437086105, -0.010494484566152096, 0.016943039372563362, -0.009536834433674812, 0.020716972649097443, 0.031914111226797104, -...
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": "dest", "annotation": null, "type_comment": null}}, {"_type": "arg...
def switch(self, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> None self.run_command( make_command('config', 'remote.origin.url', url), cwd=dest, ) cmd_args = make_command('checkout', '-q', rev_options.to_args()) self.run_command(cmd_ar...
139
[ -0.031141631305217743, 0.02375142276287079, 0.04967643693089485, -0.014721139334142208, -0.01752704754471779, -0.009558860212564468, 0.010285037569701672, -0.026181891560554504, -0.05908215790987015, 0.007543348707258701, -0.02414662018418312, 0.006026775110512972, 0.001801857608370483, -0...
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": "location", "annotation": null, "type_comment": null}}], "kwarg": n...
def get_repository_root(cls, location): loc = super(Git, cls).get_repository_root(location) if loc: return loc try: r = cls.run_command( ['rev-parse', '--show-toplevel'], cwd=location, log_failed_cmd=False, ) ...
140
[ 0.00954242330044508, 0.026266835629940033, 0.038975149393081665, -0.023805717006325722, -0.021422909572720528, 0.002413573209196329, 0.020729320123791695, 0.03123381733894348, -0.025327136740088463, 0.04427773877978325, 0.00601855106651783, 0.0044188243336975574, -0.028996437788009644, -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": "dest", "annotation": null, "type_comment": null}}, {"_type": "arg...
def update(self, dest, url, rev_options): # type: (str, HiddenText, RevOptions) -> None # First fetch changes from the default remote if self.get_git_version() >= parse_version('1.9.0'): # fetch tags in addition to everything else self.run_command(['fetch', '-q', '--tags'...
141
[ 0.016700662672519684, 0.011334768496453762, 0.02134176716208458, -0.022218825295567513, -0.011956018395721912, 0.0035112809855490923, 0.004793370608240366, -0.06154030188918114, 0.01624995283782482, 0.02752990461885929, 0.00764990272000432, -0.0017739125760272145, 0.013046251609921455, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestCVSMaildirSource(unittest.TestCase): def test_CVSMaildirSource_create_change_from_cvs1_11msg(self): m = message_from_string(cvs1_11_msg) src = CVSMaildirSource('/dev/null') src, chdict = src.parse(m) self.assertNotEqual(chdict, None) self.assertEqual(chdict['author...
142
[ 0.025164691731333733, 0.015857549384236336, 0.018690157681703568, -0.018348727375268936, -0.036065176129341125, -0.013050232082605362, 0.01949947513639927, -0.029666515067219734, -0.016123106703162193, 0.0025196305941790342, 0.020650221034884453, -0.007827609777450562, 0.0020612285006791353,...
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_CVSMaildirSource_create_change_from_cvs1_11msg(self): m = message_from_string(cvs1_11_msg) src = CVSMaildirSource('/dev/null') src, chdict = src.parse(m) self.assertNotEqual(chdict, None) self.assertEqual(chdict['author'], 'andy') self.assertEqual(len(chdict['fil...
143
[ 0.037639372050762177, 0.029462207108736038, 0.028290553018450737, -0.006212205160409212, -0.03400236368179321, -0.03624803572893143, 0.02307913638651371, -0.02846141904592514, -0.00011251231626374647, 0.012973623350262642, 0.008573819883167744, -0.0013272638898342848, 0.001509572030045092, ...
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_CVSMaildirSource_create_change_from_cvs1_12_with_no_path(self): msg = cvs1_12_msg.replace('Path: base/module/src', '') m = message_from_string(msg) src = CVSMaildirSource('/dev/null') try: assert src.parse(m)[1] except ValueError: pass els...
144
[ 0.03026879020035267, 0.016772590577602386, 0.01723884418606758, -0.021044496446847916, -0.034502893686294556, -0.010919195599853992, 0.02198960818350315, -0.03704839572310448, -0.014441313222050667, 0.0052012670785188675, 0.01667177863419056, -0.008367392234504223, 0.006634687073528767, 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_CVSMaildirSource_create_change_from_cvs1_12msg(self): m = message_from_string(cvs1_12_msg) src = CVSMaildirSource('/dev/null') src, chdict = src.parse(m) self.assertNotEqual(chdict, None) self.assertEqual(chdict['author'], 'andy') self.assertEqual(len(chdict['fil...
145
[ 0.025543371215462685, 0.04303458705544472, 0.0015215608291327953, -0.011903183534741402, -0.03026963584125042, -0.011364578269422054, 0.024142997339367867, -0.032558709383010864, 0.012933267280459404, 0.021678876131772995, 0.0031676741782575846, 0.005749614909291267, 0.014138396829366684, ...
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_CVSMaildirSource_create_change_with_bad_cvsmode(self): # Branch is indicated after 'Tag:' in modified file list msg = cvs1_11_msg.replace('Cvsmode: 1.11', 'Cvsmode: 9.99') m = message_from_string(msg) src = CVSMaildirSource('/dev/null') try: assert src.parse(...
146
[ 0.02670232392847538, 0.02037934772670269, 0.015167971141636372, -0.02854303829371929, -0.01932751014828682, 0.01402051281183958, 0.01789318583905697, -0.023582668974995613, 0.007070019841194153, 0.017056496813893318, 0.007321026176214218, 0.02643936313688755, 0.016171997413039207, 0.056847...
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_CVSMaildirSource_create_change_with_branch(self): # Branch is indicated after 'Tag:' in modified file list msg = cvs1_11_msg.replace(' GNUmakefile', ' Tag: Test_Branch\n GNUmakefile') m = message_from_string(msg) src = CVSMaildi...
147
[ 0.012733904644846916, -0.018659040331840515, 0.05792248249053955, 0.0277145653963089, -0.043373361229896545, 0.0024745147675275803, -0.045373525470495224, 0.03230397775769234, 0.01152147725224495, 0.03057781048119068, 0.03353695198893547, 0.02660488709807396, -0.03690708801150322, 0.027810...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bus", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reason", "annotation": null, "type_comment": null}}], "kwarg": nul...
def cb0(bus, reason): print('cb0') if reason == 0: print('pending') if reason == 1: print('full') if reason == 2: print('overflow')
148
[ 0.053358450531959534, 0.037034641951322556, 0.006140558049082756, -0.017573600634932518, -0.010157745331525803, -0.04228886961936951, 0.007862209342420101, -0.02349098213016987, 0.006453006062656641, 0.024766279384493828, -0.010240639559924603, -0.0002807647397276014, 0.021871354430913925, ...
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_CVSMaildirSource_create_change_with_no_files(self): # A message with no files is likely not for us msg = cvs1_11_msg.replace( 'Files: base/module/src/make GNUmakefile,1.362,1.363', '') m = message_from_string(msg) src = CVSMaildirSource('/dev/null') chdict = ...
149
[ 0.009178402833640575, -0.013867896050214767, 0.08017788082361221, 0.020334970206022263, -0.037266943603754044, 0.0016314663225784898, -0.054835252463817596, 0.03156761825084686, -0.007656738627701998, 0.03112495318055153, 0.03508128225803375, 0.02303246594965458, -0.04498593136668205, 0.03...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bus", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reason", "annotation": null, "type_comment": null}}], "kwarg": nul...
def cb1(bus, reason): print('cb1') if reason == 0: print('pending') if reason == 1: print('full') if reason == 2: print('overflow')
150
[ 0.014412427321076393, -0.013130083680152893, 0.06205428019165993, 0.02078232914209366, -0.043906331062316895, 0.0026134720537811518, -0.047864869236946106, 0.030859878286719322, 0.008272510021924973, 0.029912058264017105, 0.03911148011684418, 0.017144376412034035, -0.037522491067647934, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bus", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reason", "annotation": null, "type_comment": null}}], "kwarg": nul...
def cb0a(bus, reason): print('cb0a') if reason == 0: print('pending') if reason == 1: print('full') if reason == 2: print('overflow')
151
[ 0.04282775893807411, 0.04166073352098465, -0.022679995745420456, -0.016668695956468582, 0.04668115824460983, 0.008686658926308155, 0.0007541649392805994, -0.015402580611407757, 0.03860003501176834, 0.03184007480740547, 0.019531220197677612, -0.0010190859902650118, 0.014367667958140373, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _dec(func): def _wrapper(self, *args, **kwargs): @decorator def bound_func(*args2, **kwargs2): return func.__get__(self, type(self))(*args2, **kwargs2) # bound_func has the signature that 'decorator' expects i.e. no # 'self' argument, but it i...
152
[ 0.009084555320441723, -0.020941155031323433, 0.07692787051200867, 0.0200506541877985, -0.04619119316339493, -0.0008496572263538837, -0.05808369815349579, 0.031225016340613365, -0.0032962930854409933, 0.0281800739467144, 0.03740107640624046, 0.013975133188068867, -0.04610501229763031, 0.042...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bus", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reason", "annotation": null, "type_comment": null}}], "kwarg": nul...
def cb1a(bus, reason): print('cb1a') if reason == 0: print('pending') if reason == 1: print('full') if reason == 2: print('overflow')
153
[ 0.02928636595606804, -0.00598202645778656, -0.045892879366874695, -0.023478176444768906, -0.016228163614869118, 0.0010903137736022472, -0.03542177751660347, 0.019602641463279724, 0.005675255786627531, 0.0028069508261978626, 0.003888317383825779, -0.015389658510684967, 0.004205313511192799, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "middleware_class", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poso...
def make_middleware_decorator(middleware_class): def _make_decorator(*m_args, **m_kwargs): middleware = middleware_class(*m_args, **m_kwargs) def _decorator(view_func): @wraps(view_func, assigned=available_attrs(view_func)) def _wrapped_view(request, *args, **kwargs): ...
154
[ 0.028457025066018105, 0.02609778568148613, -0.0072917211800813675, -0.029981134459376335, 0.026995548978447914, 0.005034262780100107, -0.01667126454412937, -0.006842839065939188, 0.015961404889822006, 0.019343677908182144, 0.003961643669754267, 0.02290341630578041, 0.028331754729151726, 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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def _wrapper(self, *args, **kwargs): @decorator def bound_func(*args2, **kwargs2): return func.__get__(self, type(self))(*args2, **kwargs2) # bound_func has the signature that 'decorator' expects i.e. no # 'self' argument, but it is a closure over self so...
155
[ 0.003965477924793959, 0.021781226620078087, -0.0430537611246109, -0.03574710711836815, 0.0005238651065155864, -0.011757699772715569, -0.0019364943727850914, -0.011017785407602787, 0.012393563985824585, 0.016994906589388847, 0.0316082127392292, 0.005375939421355724, 0.020058613270521164, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "view_func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs...
def _decorator(view_func): @wraps(view_func, assigned=available_attrs(view_func)) def _wrapped_view(request, *args, **kwargs): if hasattr(middleware, 'process_request'): result = middleware.process_request(request) if result is not None: ...
156
[ 0.025269757956266403, 0.003929268103092909, -0.02776084467768669, -0.03457966819405556, -0.014619304798543453, 0.004164126701653004, -0.013426537625491619, 0.017828162759542465, -0.00012188251275802031, 0.021892013028264046, 0.017997050657868385, -0.011969884857535362, 0.006275217514485121, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "m_kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "m_args", "annotation": null, "type_comm...
def _make_decorator(*m_args, **m_kwargs): middleware = middleware_class(*m_args, **m_kwargs) def _decorator(view_func): @wraps(view_func, assigned=available_attrs(view_func)) def _wrapped_view(request, *args, **kwargs): if hasattr(middleware, 'process_request'): ...
157
[ 0.03567800670862198, -0.02157173864543438, 0.03868734464049339, -0.03044060245156288, -0.00032982442644424736, 0.0378192663192749, -0.005812505725771189, -0.013151382096111774, 0.0016828053630888462, -0.011827562935650349, 0.06047610193490982, -0.03246611729264259, -0.021803226321935654, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestNetworkCollector(CollectorTestCase): def setUp(self): config = get_collector_config('NetworkCollector', { 'interfaces': ['eth', 'em', 'bond', 'veth', 'br-lxc'], 'interval': 10, 'byte_unit': ['bit', 'megabit', 'megabyte'], }) self.collector = N...
158
[ 0.009484159760177135, 0.019930317997932434, -0.020462244749069214, -0.026845378801226616, 0.001475533819757402, -0.0280450452119112, -0.0067396387457847595, 0.01284549105912447, -0.002970873611047864, 0.020088763907551765, 0.0415356419980526, -0.014441275037825108, 0.0023073784541338682, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}},...
def _wrapped_view(request, *args, **kwargs): if hasattr(middleware, 'process_request'): result = middleware.process_request(request) if result is not None: return result if hasattr(middleware, 'process_view'): ...
159
[ 0.03556976094841957, -0.018812166526913643, 0.029894009232521057, -0.029765598475933075, 0.021329017356038094, 0.025142814964056015, -0.02043014205992222, -0.008199023082852364, -0.005422141402959824, -0.013251983560621738, 0.04468692094087601, -0.04229848459362984, -0.013367553241550922, ...
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": "publish_mock", "annotation": null, "type_comment": null}}], "kwar...
def test_should_work_with_real_data(self, publish_mock): NetworkCollector.PROC = self.getFixturePath('proc_net_dev_1') self.collector.collect() self.assertPublishedMany(publish_mock, {}) NetworkCollector.PROC = self.getFixturePath('proc_net_dev_2') self.collector.collect() ...
160
[ 0.016202887520194054, -0.02719532884657383, 0.016668105497956276, -0.03094365820288658, 0.0008124704472720623, 0.02823210135102272, -0.02585284225642681, 0.0022696005180478096, 0.005472960416227579, 0.0008099781698547304, 0.02538762427866459, -0.04287983104586601, -0.013783751986920834, -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": "publish_mock", "annotation": null, "type_comment": null}}], "kwar...
def test_should_work_with_virtual_interfaces_and_bridges(self, publish_mock): NetworkCollector.PROC = self.getFixturePath('proc_net_dev_1') self.collector.collect() self.assertPublishedMany(publish_mock, {}) NetworkCollector....
161
[ 0.02655395120382309, -0.0175991952419281, 0.03298186883330345, -0.01920986920595169, -0.00019683189748320729, 0.021086525171995163, -0.00590703496709466, -0.005053673405200243, 0.019475853070616722, -0.01567820832133293, 0.051866646856069565, -0.03629187494516373, -0.019741835072636604, 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": "publish_mock", "annotation": null, "type_comment": null}}], "kwar...
def test_z_issue_208_b(self, publish_mock): NetworkCollector.PROC = self.getFixturePath('208-b_1') self.collector.collect() self.assertPublishedMany(publish_mock, {}) NetworkCollector.PROC = self.getFixturePath('208-b_2') self.collector.collect() metrics = { ...
162
[ 0.027681106701493263, -0.020916590467095375, 0.03183475509285927, -0.01932930387556553, 0.004290868062525988, 0.02247420884668827, -0.002959475154057145, -0.0036381518002599478, 0.02321593277156353, -0.012661213055253029, 0.05509519204497337, -0.03951900824904442, -0.017222810536623, 0.000...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "publish_mock", "annotation": null, "type_comment": null}}], "kwar...
def test_z_issue_208_a(self, publish_mock): NetworkCollector.PROC = self.getFixturePath('208-a_1') self.collector.collect() self.assertPublishedMany(publish_mock, {}) NetworkCollector.PROC = self.getFixturePath('208-a_2') self.collector.collect() metrics = { ...
163
[ 0.00033782850368879735, 0.016522524878382683, 0.0028665841091424227, -0.024921298027038574, 0.0037762748543173075, -0.014957010746002197, -0.0016395591665059328, -0.016882169991731644, 0.04214195907115936, 0.03135260194540024, -0.00015337811782956123, -0.059024129062891006, -0.00141213636379...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class Simple_Terminated_TestCase(ParserTest): def __init__(self, *args, **kwargs): ParserTest.__init__(self, *args, **kwargs) self.ks = """ %post ls /tmp %end """ def runTest(self): self.parser.readKickstartFromString(self.ks) self.assertEqual(len(self.handler.scripts), 1) ...
164
[ -0.02248084358870983, 0.007528700865805149, 0.015445193275809288, -0.051055558025836945, 0.008642217144370079, -0.008642217144370079, -0.01790490187704563, 0.021339628845453262, 0.03394840285181999, 0.015013081952929497, -0.008221185766160488, -0.00038709930959157646, 0.004539933986961842, ...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class Script_Includes_Percent_Sign(ParserTest): def __init__(self, *args, **kwargs): ParserTest.__init__(self, *args, **kwargs) self.ks = """ %post echo "# Added by kickstart %wheel ALL=(ALL) ALL" >> /etc/sudoers %end """ def runTest(self): self.parser.readKickstartFromString(self.ks) ...
165
[ 0.014088956639170647, 0.00526103051379323, 0.02965155988931656, -0.05398906022310257, 0.004549326375126839, -0.024605436250567436, -0.008300427347421646, -0.01605381816625595, 0.029785526916384697, 0.004136258736252785, 0.01950349286198616, -0.039230264723300934, -0.027195481583476067, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class Simple_Header_TestCase(ParserTest): def __init__(self, *args, **kwargs): ParserTest.__init__(self, *args, **kwargs) self.ks = """ %post --interpreter /usr/bin/python --erroronfail --log=/tmp/blah --nochroot ls /tmp %end """ def runTest(self): self.parser.readKickstartFromString(se...
166
[ 0.01651284471154213, 0.01957077905535698, 0.012002391740679741, -0.053019873797893524, 0.0071155778132379055, -0.0003530223330017179, -0.013666613958775997, 0.010561634786427021, 0.04424595460295677, 0.020229410380125046, 0.001372394966892898, -0.044434137642383575, -0.00030836620135232806, ...
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 runTest(self): self.parser.readKickstartFromString(self.ks) self.assertEqual(len(self.handler.scripts), 1) # Verify the script defaults. script = self.handler.scripts[0] self.assertEqual(script.interp, "/bin/sh") self.assertTrue(script.inChroot) self.assertEq...
167
[ 0.0064544412307441235, 0.019491631537675858, 0.03289142996072769, -0.03717579320073128, -0.010197682306170464, -0.0003605170641094446, 0.004454512614756823, -0.019670145586133003, 0.03248976916074753, 0.0473511628806591, 0.007971820421516895, -0.055919893085956573, -0.00900386180728674, 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class Multiple_Terminated_TestCase(ParserTest): def __init__(self, *args, **kwargs): ParserTest.__init__(self, *args, **kwargs) self.ks = """ %post ls /tmp %end %post ls /var %end """ def runTest(self): self.parser.readKickstartFromString(self.ks) self.assertEqual(len(self.hand...
168
[ 0.024115044623613358, 0.015112253837287426, 0.02276402711868286, -0.059157777577638626, 0.010987468995153904, 0.00013889389811083674, -0.013091707602143288, 0.007789266761392355, 0.03943054750561714, 0.025824736803770065, 0.020707612857222557, -0.04464332014322281, -0.01549484208226204, 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 runTest(self): self.parser.readKickstartFromString(self.ks) self.assertEqual(len(self.handler.scripts), 1) # Verify the changes we made in the header. script = self.handler.scripts[0] self.assertEqual(script.interp, "/usr/bin/python") self.assertFalse(script.inChroot...
169
[ 0.012311088852584362, 0.016647813841700554, 0.019313834607601166, -0.06365270912647247, 0.00568454759195447, -0.00014209517394192517, -0.017015133053064346, 0.008839338086545467, 0.044244084507226944, 0.023413581773638725, 0.0034895241260528564, -0.05137716978788376, -0.0014848251594230533, ...
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 runTest(self): self.parser.readKickstartFromString(self.ks) self.assertEqual(len(self.handler.scripts), 2) # Verify the script defaults. script = self.handler.scripts[0] self.assertEqual(script.interp, "/bin/sh") self.assertTrue(script.inChroot) self.assertFa...
170
[ -0.005642350297421217, 0.03143690526485443, 0.03362707421183586, -0.022262245416641235, 0.009167985059320927, -0.008306608535349369, -0.004250125493854284, -0.022542692720890045, 0.0030899380799382925, -0.014903818257153034, 0.005598947871476412, -0.03993048146367073, 0.019751565530896187, ...
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 model(self): T = current.T db = current.db auth = current.auth person_id = self.pr_person_id location_id = self.gis_location_id organisation_id = self.org_organisation_id UNKNOWN_OPT = current.messages.UNKNOWN_OPT settings = current.deployment_sett...
171
[ 0.03759494051337242, -0.021904023364186287, 0.01774689182639122, -0.014877565205097198, -0.02101159654557705, -0.048032961785793304, 0.031811103224754333, -0.03748197481036186, -0.0566183440387249, 0.021169748157262802, -0.018142269924283028, -0.030726635828614235, 0.033189285546541214, -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": {"_type": "arg", "_fields": {"arg...
class Config(FieldSet): def __init__(self, *args): FieldSet.__init__(self, *args) self._size = (4 + self["size"].value) * 8 def createFields(self): yield UInt32(self, "size") while not self.eof: yield Photoshop8BIM(self, "item[]")
172
[ -0.01874251663684845, 0.04316543787717819, 0.03877859190106392, 0.0032866192050278187, -0.017209932208061218, -0.0323670469224453, 0.004042365588247776, 0.020486006513237953, -0.0038384899962693453, 0.03143905848264694, 0.007075897417962551, -0.033716846257448196, 0.023987047374248505, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def prep(r): # Location Filter s3db.gis_location_filter(r) if r.component_name == "log": s3db.asset_log_prep(r) #if r.method == "update": # We don't want to exclude fields in update forms #pass #elif r.method != "read": ...
173
[ -0.01345848198980093, 0.007205045782029629, 0.0038717971183359623, -0.011231087148189545, 0.03218741714954376, -0.003362006042152643, 0.00005228625377640128, -0.00527306878939271, 0.006190692540258169, -0.006457352079451084, -0.03676769509911537, 0.01912631094455719, -0.002846986521035433, ...
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": "default", "annotation": null, "type_comment": null}}], "kwarg": n...
def value(self, default=False): if default: return self._defaultValue settings = QtCore.QSettings() defaultValue = self._defaultValue if self.type == "font": defaultValue = self._defaultValue.toStorableString() value = settings.value(self._key, defaultV...
174
[ 0.025420736521482468, 0.04795743525028229, -0.0038162004202604294, -0.0024797578807920218, 0.04721582308411598, -0.034134652465581894, 0.01777803525328636, 0.003960402216762304, -0.0010776517447084188, 0.001511545036919415, -0.02249549701809883, 0.005407571792602539, -0.028799181804060936, ...
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": "key", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def __init__(self, key, defaultValue): self._key = key self._defaultValue = defaultValue self.type = "normal" if isinstance(defaultValue, Font): self.type = "font" elif defaultValue == True or defaultValue == False: self.type = "bool" elif isinstan...
175
[ 0.04432055354118347, 0.05879257246851921, 0.009800746105611324, -0.030943458899855614, -0.002613829681649804, -0.014757649973034859, -0.01600728929042816, -0.023136187344789505, 0.006486224941909313, 0.006135135889053345, 0.018458964303135872, 0.04036931321024895, 0.0005214270204305649, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class LiveMigrationOps(object): def __init__(self): self._livemigrutils = utilsfactory.get_livemigrationutils() self._pathutils = pathutils.PathUtils() self._vmops = vmops.VMOps() self._volumeops = volumeops.VolumeOps() self._serial_console_ops = serialconsoleops.SerialConsol...
176
[ 0.04623885825276375, 0.03969775140285492, 0.028595414012670517, -0.022605665028095245, -0.011390548199415207, -0.03736701235175133, 0.027242081239819527, -0.01937270350754261, -0.0012421210994943976, -0.012248911894857883, 0.01608961820602417, 0.014723755419254303, -0.0022633858025074005, ...
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 __init__(self): self._livemigrutils = utilsfactory.get_livemigrationutils() self._pathutils = pathutils.PathUtils() self._vmops = vmops.VMOps() self._volumeops = volumeops.VolumeOps() self._serial_console_ops = serialconsoleops.SerialConsoleOps() self._imagecache = im...
177
[ 0.04595855250954628, 0.051328521221876144, 0.023537196218967438, -0.0381244458258152, -0.012425314635038376, 0.0013977026101201773, -0.021433377638459206, 0.015087051317095757, -0.009252151474356651, 0.0062417155131697655, 0.017574438825249672, 0.04881788790225983, -0.0071076517924666405, ...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def live_migration(self, context, instance_ref, dest, post_method, recover_method, block_migration=False, migrate_data=None): LOG.debug("live_migration called", instance=instance_ref) instance_name = instance_ref["name"] if migrate_data and 'is_shar...
178
[ 0.054153911769390106, 0.02890615351498127, 0.004906945861876011, -0.030253984034061432, -0.032949645072221756, -0.019266758114099503, -0.001627625897526741, -0.011131636798381805, -0.02811189740896225, -0.008279531262814999, 0.019748125225305557, 0.028833948075771332, -0.02572912536561489, ...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def pre_live_migration(self, context, instance, block_device_info, network_info): LOG.debug("pre_live_migration called", instance=instance) self._livemigrutils.check_live_migration_config() if CONF.use_cow_images: boot_from_volume = self._block_dev_man.is_...
179
[ 0.03903743624687195, 0.06813967227935791, 0.01649639569222927, -0.002011219272390008, 0.023541158065199852, 0.006269949022680521, -0.011979393661022186, 0.010649571195244789, -0.013913681730628014, 0.001860103104263544, -0.0015262736706063151, 0.07332707941532135, -0.009391185827553272, 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": "ctxt", "annotation": null, "type_comment": null}}, {"_type": "arg...
def check_can_live_migrate_destination(self, ctxt, instance_ref, src_compute_info, dst_compute_info, block_migration=False, disk_over_commit=False): LOG.debug("check_can_live_migrate_...
180
[ 0.040840063244104385, 0.058309219777584076, 0.024952569976449013, 0.002937592566013336, -0.014955016784369946, -0.0006595198065042496, 0.002643980784341693, -0.006055188365280628, 0.010693958029150963, -0.008710972964763641, 0.03248319402337074, 0.05141598358750343, -0.02530667372047901, 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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def post_live_migration(self, context, instance, block_device_info, migrate_data): self._volumeops.disconnect_volumes(block_device_info) if not migrate_data.is_shared_instance_path: self._pathutils.get_instance_dir(instance.name, ...
181
[ 0.022288361564278603, -0.021659744903445244, -0.02055690623819828, 0.004593321587890387, -0.04422381520271301, 0.009534036740660667, -0.0045547219924628735, 0.024880031123757362, -0.028673795983195305, 0.009291412308812141, 0.039658065885305405, -0.04305480793118477, 0.016013212502002716, ...
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}}, {"_type": "ar...
def __setitem__(self, index, entity): if isinstance(index, slice): step = index.step or 1 start = index.start or 0 if start < 0: start += len(self) stop = index.stop or len(self) if stop < 0: stop += len(self) ...
182
[ 0.04072248935699463, 0.0038586498703807592, -0.041010983288288116, 0.014913085848093033, -0.001236515585333109, 0.021448656916618347, -0.006968316622078419, 0.009148689918220043, -0.01621132344007492, -0.03013686090707779, 0.040744680911302567, -0.04598201438784599, 0.0020291893742978573, ...
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": "index", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _order_entity(self, index, entity, reorder=True): have = self._get_order_value(entity) # Don't disturb existing ordering if reorder is False if have is not None and not reorder: return should_be = self.ordering_func(index, self) if have != should_be: ...
183
[ 0.007778978440910578, -0.02242285944521427, 0.029449433088302612, -0.035518404096364975, -0.020308667793869972, -0.02676316723227501, -0.030444348230957985, -0.009650658816099167, 0.014438679441809654, -0.007244212552905083, 0.0605902224779129, -0.0322849377989769, 0.043975166976451874, -0...
6
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "...
def handle(self, **options): call_command('loaddata', 'customers.json') call_command('loaddata', 'paymenttypes.json') call_command('loaddata', 'orders.json') call_command('loaddata', 'producttype.json') call_command('loaddata', 'products.json') call_command('loaddata', 'o...
184
[ 0.040221698582172394, -0.00957407895475626, 0.033529821783304214, -0.007889369502663612, 0.0035425852984189987, -0.023996833711862564, -0.050435613840818405, -0.028669405728578568, -0.008675958961248398, -0.011704913340508938, 0.004458315670490265, -0.010753962211310863, 0.0347273163497448, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Loads content data."}}, "targets": [{"_type": "Name", "_fields": {"id": "help", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen...
class Command(BaseCommand): help = 'Loads content data.' def handle(self, **options): call_command('loaddata', 'customers.json') call_command('loaddata', 'paymenttypes.json') call_command('loaddata', 'orders.json') call_command('loaddata', 'producttype.json') call_comman...
185
[ 0.018170563504099846, -0.01195021066814661, 0.003820834681391716, -0.0004998994991183281, 0.0009928317740559578, 0.011537750251591206, -0.005724284797906876, 0.03513718768954277, -0.010278073139488697, 0.012986935675144196, -0.013410544022917747, -0.026687318459153175, 0.03016536310315132, ...
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": "widget", "annotation":...
class ReceptiveCollectionPanel(CollectionPanel): def drag_data_received(self, widget, context, x, y, data, info, stamp): uris = data.get_uris() tracks, playlists = self.tree.get_drag_data(uris) tracks = [ t for t in tracks if not self.collection.loc_is_member(t.get_loc_for_io()) ...
186
[ -0.0038645402528345585, 0.0007950864383019507, 0.009062680415809155, -0.02841147407889366, 0.0017278814921155572, -0.02695031277835369, -0.017823850736021996, 0.0367145836353302, 0.007781264837831259, 0.014971107244491577, -0.020189542323350906, -0.026370486244559288, 0.011347195133566856, ...
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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def drag_data_received(self, widget, context, x, y, data, info, stamp): uris = data.get_uris() tracks, playlists = self.tree.get_drag_data(uris) tracks = [ t for t in tracks if not self.collection.loc_is_member(t.get_loc_for_io()) ] self.add_tracks_func(tracks)
187
[ 0.061699219048023224, 0.006058467552065849, 0.007676641456782818, 0.008153451606631279, -0.004276390187442303, -0.004207848571240902, -0.004571416415274143, -0.045559197664260864, -0.018285665661096573, 0.029705265536904335, 0.004067785572260618, -0.001788037596270442, 0.02002602070569992, ...
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}}, {"_type": "a...
def __init__(self, parent, main, device, name): label = device.get_name() panel.Panel.__init__(self, parent, name, label) self.device = device self.main = main self.notebook = self.builder.get_object("device_notebook") self.collectionpanel = ReceptiveCollectionPanel( ...
188
[ -0.0202803798019886, 0.012079508043825626, 0.02829926274716854, -0.05409618094563484, -0.020621608942747116, -0.02609264850616455, 0.028435753658413887, -0.020553363487124443, -0.0016151508316397667, 0.017846278846263885, -0.013785653747618198, -0.004635028075426817, -0.0041146534495055676, ...
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": "tracks", "annotation": null, "type_comment": null}}], "kwarg": nu...
def add_tracks_func(self, tracks): locs = [t['__loc'] for t in tracks] # FIXME: lib = self.collection.get_libraries()[0] # TODO: there should be a queue for ipod and such devices, # otherwise you'll have to write the database on every track add and # that won't be good ...
189
[ 0.006543762981891632, 0.0185034591704607, -0.034657273441553116, -0.02429533563554287, 0.01029732171446085, 0.003533279523253441, -0.04356243088841438, -0.05098731070756912, -0.004690479952841997, 0.02471827156841755, -0.0002261533954879269, -0.012699835002422333, 0.03564412519335747, 0.00...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "append-items"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "replace-items"}}, {"_ty...
class FlatPlaylistDevicePanel(panel.Panel): __gsignals__ = { 'append-items': (GObject.SignalFlags.RUN_LAST, None, (object, bool)), 'replace-items': (GObject.SignalFlags.RUN_LAST, None, (object,)), 'queue-items': (GObject.SignalFlags.RUN_LAST, None, (object,)), } ui_info = ('device.u...
190
[ 0.03303772211074829, 0.006877026055008173, -0.018525389954447746, 0.002642317907884717, 0.012634129263460636, -0.009192699566483498, -0.007139507681131363, -0.047176748514175415, -0.009536842815577984, 0.021780164912343025, 0.00926852785050869, 0.011887514032423496, 0.018817035481333733, -...
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}}, {"_type": "a...
def __init__(self, parent, main, device, name): label = device.get_name() panel.Panel.__init__(self, parent, name, label) self.device = device self.main = main self.notebook = self.builder.get_object("device_notebook") self.fppanel = FlatPlaylistPanel(self, name, label...
191
[ -0.03750620037317276, 0.01279957965016365, 0.051433712244033813, -0.010847765952348709, 0.025187218561768532, -0.03799660503864288, -0.005065887235105038, 0.017634976655244827, 0.010416209697723389, 0.06928446888923645, -0.005933904554694891, -0.029483169317245483, -0.027619628235697746, 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": "subnet", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _validate_with_subnet(self, subnet): if self.gateway_ip: if self.gateway_ip not in subnet: raise ValueError("gateway_ip is not in the subnet") if self.allocation_pools: if subnet.version != self.allocation_pools[0].version: raise ValueError("a...
192
[ 0.021998006850481033, -0.01876300573348999, 0.010630710981786251, -0.0007092117448337376, -0.020624374970793724, 0.03133471682667732, 0.04487195238471031, 0.03764545917510986, -0.030339332297444344, 0.030319424346089363, 0.015179620124399662, 0.009227218106389046, 0.013547188602387905, -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 test_docker_binary_build_image(): docker_path = "/bin/docker" dockerfile = "src/test/repo/Dockerfile" docker = DockerBinary(docker_path) digest = Digest(sha256().hexdigest(), 123) tags = ["test:0.1.0", "test:latest"] build_request = docker.build_image(tags, digest, dockerfile) assert bu...
193
[ -0.012529452331364155, 0.05150333419442177, 0.01981540583074093, -0.041088003665208817, 0.03174765035510063, -0.032607629895210266, 0.03377816081047058, -0.024915574118494987, -0.00491204671561718, 0.007285953965038061, -0.026778867468237877, -0.015622996725142002, 0.023625601083040237, 0....
24
{"_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": "scriptString", "annotation": null, "type_comment": null}}, {"_typ...
def __init__(self, scriptString, scriptType="dml", isResource=False, scriptFormat="auto"): self.sc = get_spark_context() self.scriptString = scriptString self.scriptType = scriptType self.isResource = isResource if scriptFormat != "auto": if scriptFormat == "url" and ...
194
[ 0.014035678468644619, 0.04614124447107315, -0.0331561379134655, -0.011745425872504711, 0.05408358946442604, -0.027840230613946915, 0.019257035106420517, 0.012102620676159859, 0.030718805268406868, -0.0007301494479179382, 0.020738346502184868, -0.012753977440297604, -0.007364529184997082, 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}}, {"_type": "arg"...
def _setInput(self, key, val): # `in` is a reserved word ("keyword") in Python, so `script_java.in(...)` is not # allowed. Therefore, we use the following code in which we retrieve a function # representing `script_java.in`, and then call it with the arguments. This is in # lieu of addi...
195
[ 0.014241323806345463, -0.0056787836365401745, -0.004963389597833157, -0.042590875178575516, 0.009849140420556068, -0.009982236661016941, -0.005867336876690388, -0.025643255561590195, 0.013598023913800716, 0.01271071471273899, -0.020186301320791245, -0.024911224842071533, 0.04667250066995621,...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "is_usable", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ...
class TemplateLoader(tLoaderCls): is_usable = True def get_template_sources(self, template_name): bits = template_name.split('/', 2) if len(bits) == 3: dash_name, panel_name, remainder = bits key = os.path.join(dash_name, panel_name) if key in panel_template_...
196
[ -0.006339605897665024, 0.019274499267339706, 0.03170458599925041, -0.02053324319422245, 0.011073003523051739, 0.05632874369621277, -0.012770995497703552, 0.004189253319054842, 0.049825236201286316, 0.08250010758638382, 0.015314704738557339, -0.08716794103384018, 0.044003553688526154, 0.019...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): argument_spec = aci_argument_spec() argument_spec.update( aep=dict(type='str', aliases=['aep_name']), # Not required for querying all objects domain=dict(type='str', aliases=['domain_name', 'domain_profile']), # Not required for querying all objects domain_type=dict(type='s...
197
[ 0.012546706013381481, -0.014703171327710152, 0.04981537535786629, -0.05513947084546089, -0.02117256633937359, 0.00825957115739584, -0.009544163942337036, 0.005128053482621908, 0.007965507917106152, 0.014476174488663673, -0.023607617244124413, -0.009425506927073002, 0.062114451080560684, -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": "template_name", "annotation": null, "type_comment": null}}], "kwa...
def get_template_sources(self, template_name): bits = template_name.split('/', 2) if len(bits) == 3: dash_name, panel_name, remainder = bits key = os.path.join(dash_name, panel_name) if key in panel_template_dirs: template_dir = panel_template_dirs[key...
198
[ 0.012517530471086502, -0.009436647407710552, -0.012757719494402409, -0.06108185276389122, -0.006378859747201204, -0.01782015897333622, 0.02900741435587406, -0.03665650263428688, 0.008434321731328964, -0.017496827989816666, -0.024573160335421562, -0.03043007105588913, 0.0739411935210228, -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": "template_name", "annotation": null, "type_comment": null}}, {"_ty...
def load_template_source(self, template_name, template_dirs=None): for path in self.get_template_sources(template_name): try: with open(path) as file: return (file.read().decode(settings.FILE_CHARSET), path) except IOError: pass ...
199
[ -0.04537561908364296, -0.015770651400089264, -0.00027229744591750205, -0.03550729528069496, -0.0021681729704141617, -0.0547773540019989, -0.06424907594919205, -0.026805441826581955, -0.030351506546139717, 0.026455501094460487, -0.041199661791324615, -0.0647156611084938, 0.00923259649425745, ...
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": "request", "annotation"...
class List(View): def get(self, request, app_label=None, actor=None): ar = action_request(app_label, actor, request, request.GET, True) ar.renderer = settings.SITE.plugins.bootstrap3.renderer context = dict( title=ar.get_title(), heading=ar.get_title(), ) ...
200
[ -0.032835736870765686, -0.02501062862575054, 0.02550588734447956, -0.016516920179128647, 0.003293478861451149, -0.05125940591096878, -0.02837839536368847, -0.02922033704817295, -0.017433151602745056, 0.000942541635595262, -0.0358072966337204, -0.08062832057476044, -0.012598175555467606, -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": "request", "annotation": null, "type_comment": null}}, {"_type": "...
def get(self, request, app_label=None, actor=None): ar = action_request(app_label, actor, request, request.GET, True) ar.renderer = settings.SITE.plugins.bootstrap3.renderer context = dict( title=ar.get_title(), heading=ar.get_title(), ) if isinstance(ar...