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 |
|---|---|---|---|---|---|
15,801 | [
0.008192210458219051,
-0.02541714534163475,
0.038125716149806976,
-0.015162873081862926,
-0.0008405140251852572,
0.0029698163270950317,
0.014445634558796883,
-0.017426658421754837,
-0.007161179557442665,
-0.0013455229345709085,
0.02328784205019474,
-0.014893908984959126,
-0.00924005080014467... | 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": "Name", "_fields": {"i... | def test_patch_extractor_all_patches():
lenas = lena_collection
i_h, i_w = lenas.shape[1:3]
p_h, p_w = 8, 8
expected_n_patches = len(lenas) * (i_h - p_h + 1) * (i_w - p_w + 1)
extr = PatchExtractor(patch_size=(p_h, p_w), random_state=0)
patches = extr.transform(lenas)
assert_true(patches.sha... | |
15,802 | [
-0.0010479477932676673,
-0.02431298978626728,
0.015923380851745605,
-0.022661587223410606,
0.01567024737596512,
-0.02115483395755291,
0.031678006052970886,
-0.01688770391047001,
-0.010095255449414253,
-0.0063102878630161285,
0.01601981371641159,
-0.00204918603412807,
-0.019431106746196747,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_patch_extractor_color():
lenas = _make_images(orange_lena)
i_h, i_w = lenas.shape[1:3]
p_h, p_w = 8, 8
expected_n_patches = len(lenas) * (i_h - p_h + 1) * (i_w - p_w + 1)
extr = PatchExtractor(patch_size=(p_h, p_w), random_state=0)
patches = extr.transform(lenas)
assert_true(patches... | |
15,803 | [
-0.009148729033768177,
0.009455939754843712,
0.00930847879499197,
-0.04455781355500221,
-0.01817457377910614,
-0.012976571917533875,
0.022278906777501106,
-0.03214650973677635,
-0.03647203370928764,
0.04337812587618828,
0.04480358213186264,
0.0011266946094110608,
0.01704403944313526,
-0.04... | 14 | {"_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": "List", "_fields": {"c... | def test_extract_patches_strided():
image_shapes_1D = [(10,), (10,), (11,), (10,)]
patch_sizes_1D = [(1,), (2,), (3,), (8,)]
patch_steps_1D = [(1,), (1,), (4,), (2,)]
expected_views_1D = [(10,), (9,), (3,), (2,)]
last_patch_1D = [(10,), (8,), (8,), (2,)]
image_shapes_2D = [(10, 20), (10, 20),... | |
15,804 | [
0.008537611924111843,
-0.03936288505792618,
0.03877873346209526,
-0.02190571464598179,
0.0157608799636364,
0.018018854781985283,
0.025478031486272812,
-0.03713861107826233,
-0.01799638755619526,
0.008543228730559349,
0.001482848427258432,
-0.011750450357794762,
-0.004830490797758102,
-0.00... | 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": "Name", "_fields": {"i... | def test_extract_patches_square():
# test same patch size for all dimensions
lena = downsampled_lena
i_h, i_w = lena.shape
p = 8
expected_n_patches = ((i_h - p + 1), (i_w - p + 1))
patches = extract_patches(lena, patch_shape=p)
assert_true(patches.shape == (expected_n_patches[0], expected_n... | |
15,805 | [
0.07546107470989227,
0.06443653255701065,
-0.016555817797780037,
-0.05261366441845894,
-0.0034926882945001125,
0.023360619321465492,
0.03295957297086716,
0.03999246656894684,
0.03919414058327675,
0.06147131323814392,
0.018950803205370903,
-0.003986891824752092,
-0.021193727850914,
-0.02016... | 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": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def _delete_path(self, path):
log.info("Deleting %s", path)
if self.dry_run:
return
is_tree = os.path.isdir(path) and not os.path.islink(path)
remover = rmtree if is_tree else os.unlink
remover(path) | |
15,806 | [
0.018879907205700874,
-0.0005751292919740081,
0.0354854054749012,
-0.0039686099626123905,
-0.028522932901978493,
-0.02499527856707573,
0.017881952226161957,
0.009759066626429558,
-0.02907993085682392,
0.02064373344182968,
0.018554991111159325,
-0.0017826833063736558,
-0.013669655658304691,
... | 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 initialize_options(self):
# the --user option seems to be an opt-in one,
# so the default should be False.
self.user = 0
self.zip_ok = self.local_snapshots_ok = None
self.install_dir = self.script_dir = self.exclude_scripts = None
self.index_url = None
self.fi... | |
15,807 | [
0.03963669016957283,
0.0031853134278208017,
0.04150399565696716,
-0.02240767516195774,
-0.03156992420554161,
-0.02303011156618595,
0.0207146517932415,
0.008564711548388004,
-0.037545304745435715,
0.05920605733990669,
0.02761123515665531,
-0.016482090577483177,
-0.029926694929599762,
-0.007... | 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 finalize_options(self):
self.version and self._render_version()
py_version = sys.version.split()[0]
prefix, exec_prefix = get_config_vars('prefix', 'exec_prefix')
self.config_vars = {
'dist_name': self.distribution.get_name(),
'dist_version': self.distributi... | |
15,808 | [
0.017757147550582886,
0.06943350285291672,
-0.004146071150898933,
-0.02610793337225914,
-0.03403649106621742,
0.013781142421066761,
-0.0035743005573749542,
-0.03281671181321144,
0.026412878185510635,
0.007389037869870663,
0.020114602521061897,
0.016056496649980545,
0.029391951858997345,
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": "attrs", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _expand_attrs(self, attrs):
for attr in attrs:
val = getattr(self, attr)
if val is not None:
if os.name == 'posix' or os.name == 'nt':
val = os.path.expanduser(val)
val = subst_vars(val, self.config_vars)
setattr(sel... | |
15,809 | [
0.06807836145162582,
0.048477500677108765,
0.009742718189954758,
-0.014774095267057419,
-0.02018846571445465,
0.027050863951444626,
-0.0021969645749777555,
0.0239239614456892,
-0.04020904377102852,
-0.021048888564109802,
0.03242326155304909,
-0.008494055829942226,
0.002332061529159546,
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": "spec", "annotation": null, "type_comment": null}}], "kwarg": null... | def check_editable(self, spec):
if not self.editable:
return
if os.path.exists(os.path.join(self.build_directory, spec.key)):
raise DistutilsArgError(
"%r already exists in %s; can't do a checkout there" %
(spec.key, self.build_directory)
... | |
15,810 | [
0.08019806444644928,
0.03211230784654617,
0.06464994698762894,
0.010999469086527824,
0.005561762023717165,
0.007342825178056955,
-0.00578624103218317,
0.0267011821269989,
-0.048133015632629395,
-0.028875084593892097,
-0.014945573173463345,
0.03950829803943634,
-0.017651135101914406,
-0.004... | 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 cant_write_to_target(self):
msg = self.__cant_write_msg % (sys.exc_info()[1], self.install_dir,)
if not os.path.exists(self.install_dir):
msg += '\n' + self.__not_exists_id
else:
msg += '\n' + self.__access_msg
raise DistutilsError(msg) | |
15,811 | [
0.026532039046287537,
-0.013821037486195564,
0.045925021171569824,
-0.013407494872808456,
0.007786576636135578,
0.006839781068265438,
0.01471341960132122,
0.03904715180397034,
-0.04875452443957329,
0.02905682660639286,
0.03558645024895668,
-0.02692381665110588,
0.013723093084990978,
-0.026... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg... | def easy_install(self, spec, deps=False):
tmpdir = tempfile.mkdtemp(prefix="easy_install-")
download = None
if not self.editable:
self.install_site_py()
try:
if not isinstance(spec, Requirement):
if URL_SCHEME(spec):
# It's a u... | |
15,812 | [
0.026238461956381798,
0.0441899448633194,
0.03806763514876366,
-0.0288404431194067,
0.010981890372931957,
-0.011391866020858288,
0.06397812068462372,
-0.0010105908149853349,
-0.045873578637838364,
0.02693815529346466,
0.03828629106283188,
0.010878029279410839,
0.008035529404878616,
-0.0575... | 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": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg... | def install_item(self, spec, download, tmpdir, deps, install_needed=False):
# Installation is also needed if file in tmpdir or is not an egg
install_needed = install_needed or self.always_copy
install_needed = install_needed or os.path.dirname(download) == tmpdir
install_needed = instal... | |
15,813 | [
0.007969710975885391,
0.014725878834724426,
0.049148496240377426,
-0.025717778131365776,
-0.011779536493122578,
0.01315060630440712,
0.02835490182042122,
0.03484268859028816,
-0.0596969872713089,
0.05605635792016983,
0.04126046597957611,
0.001655494561418891,
-0.03435260429978371,
-0.02679... | 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": "requirement", "annotation": null, "type_comment": null}}, {"_type... | def process_distribution(self, requirement, dist, deps=True, *info):
self.update_pth(dist)
self.package_index.add(dist)
if dist in self.local_index[dist.key]:
self.local_index.remove(dist)
self.local_index.add(dist)
self.install_egg_scripts(dist)
self.installe... | |
15,814 | [
0.02618078887462616,
0.021139217540621758,
-0.007451795507222414,
0.02263178862631321,
0.013720590621232986,
0.04387051239609718,
0.0012666117399930954,
0.006965328007936478,
-0.005715991370379925,
-0.028148770332336426,
-0.002993432804942131,
0.008369449526071548,
-0.016606226563453674,
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": "dist", "annotation": null, "type_comment": null}}], "kwarg": null... | def should_unzip(self, dist):
if self.zip_ok is not None:
return not self.zip_ok
if dist.has_metadata('not-zip-safe'):
return True
if not dist.has_metadata('zip-safe'):
return True
return False | |
15,815 | [
0.04737221822142601,
0.021990971639752388,
0.01576019637286663,
-0.02652660943567753,
-0.059513069689273834,
0.014695009216666222,
0.051862042397260666,
-0.016985734924674034,
-0.04263041540980339,
0.01030826848000288,
0.040316782891750336,
0.025197988376021385,
-0.003705249633640051,
-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": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg... | def maybe_move(self, spec, dist_filename, setup_base):
dst = os.path.join(self.build_directory, spec.key)
if os.path.exists(dst):
msg = ("%r already exists in %s; build directory %s will not be "
"kept")
log.warn(msg, spec.key, self.build_directory, setup_base)... | |
15,816 | [
0.012212419882416725,
0.01514181774109602,
0.03877492994070053,
-0.05989430099725723,
-0.009728370234370232,
-0.011697796173393726,
0.019090566784143448,
0.02614685148000717,
-0.0334901362657547,
0.005868691485375166,
0.013241668231785297,
-0.01695289835333824,
0.03734981641173363,
-0.0407... | 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": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg... | def install_eggs(self, spec, dist_filename, tmpdir):
# .egg dirs or files are already built, so just return them
if dist_filename.lower().endswith('.egg'):
return [self.install_egg(dist_filename, tmpdir)]
elif dist_filename.lower().endswith('.exe'):
return [self.install_e... | |
15,817 | [
0.04526153579354286,
0.008931553922593594,
0.0277731791138649,
-0.0358719527721405,
-0.04555300995707512,
-0.002551686717197299,
0.06878754496574402,
0.01671803742647171,
-0.0338316448032856,
0.004671369679272175,
0.031583141535520554,
0.014479944482445717,
0.00023991191119421273,
-0.05408... | 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": "egg_path", "annotation": null, "type_comment": null}}, {"_type": ... | def install_egg(self, egg_path, tmpdir):
destination = os.path.join(self.install_dir,
os.path.basename(egg_path))
destination = os.path.abspath(destination)
if not self.dry_run:
ensure_directory(destination)
dist = self.egg_distribution(egg... | |
15,818 | [
0.008705775253474712,
0.02206006832420826,
0.02289598621428013,
-0.009633440524339676,
0.0043324995785951614,
-0.02093871496617794,
0.023813456296920776,
0.015525639988481998,
-0.026137715205550194,
0.06854523718357086,
0.03861531242728233,
-0.006809670012444258,
-0.0032213409431278706,
-0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dist_filename", "annotation": null, "type_comment": null}}, {"_ty... | def install_exe(self, dist_filename, tmpdir):
# See if it's valid, get data
cfg = extract_wininst_cfg(dist_filename)
if cfg is None:
raise DistutilsError(
"%s is not a valid distutils Windows .exe" % dist_filename
)
# Create a dummy distribution ob... | |
15,819 | [
0.0476548932492733,
0.03311796486377716,
0.02927059680223465,
-0.06269460171461105,
-0.07309997826814651,
0.0018184821819886565,
0.019214976578950882,
0.03832065314054489,
-0.03497606888413429,
0.011279781349003315,
-0.005120714660733938,
-0.0013061375357210636,
0.026385070756077766,
-0.03... | 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": "setup_script", "annotation": null, "type_comment": null}}, {"_typ... | def run_setup(self, setup_script, setup_base, args):
sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg)
sys.modules.setdefault('distutils.command.egg_info', egg_info)
args = list(args)
if self.verbose > 2:
v = 'v' * (self.verbose - 1)
args.insert(0,... | |
15,820 | [
0.011939586140215397,
-0.00055362016428262,
0.05272076651453972,
-0.020782621577382088,
-0.046607065945863724,
-0.007527993526309729,
0.044066306203603745,
0.021874355152249336,
-0.04216073453426361,
0.00008102704305201769,
-0.020246680825948715,
0.017884567379951477,
0.007135962136089802,
... | 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": "setup_script", "annotation": null, "type_comment": null}}, {"_typ... | def build_and_install(self, setup_script, setup_base):
args = ['bdist_egg', '--dist-dir']
dist_dir = tempfile.mkdtemp(
prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script)
)
try:
self._set_fetcher_options(os.path.dirname(setup_script))
args.appen... | |
15,821 | [
0.06496308743953705,
-0.013958285562694073,
0.02019122987985611,
-0.03954847529530525,
-0.0061945379711687565,
-0.006600556895136833,
0.05337507650256157,
0.008564813062548637,
0.024163635447621346,
-0.006820026785135269,
0.04459628090262413,
0.010721104219555855,
0.02219937928020954,
-0.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": "egg_path", "annotation": null, "type_comment": null}}, {"_type": ... | def unpack_and_compile(self, egg_path, destination):
to_compile = []
to_chmod = []
def pf(src, dst):
if dst.endswith('.py') and not src.startswith('EGG-INFO/'):
to_compile.append(dst)
elif dst.endswith('.dll') or dst.endswith('.so'):
to_ch... | |
15,822 | [
0.006075163371860981,
-0.04159942641854286,
0.02247009612619877,
-0.03530688211321831,
-0.0193924717605114,
0.016360610723495483,
0.02757277525961399,
0.0713917538523674,
-0.03775525465607643,
0.02766430377960205,
0.0058549246750772,
0.007591094356030226,
-0.017504708841443062,
-0.01235626... | 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": "dist", "annotation": null, "type_comment": null}}], "kwarg": null... | def update_pth(self, dist):
if self.pth_file is None:
return
for d in self.pth_file[dist.key]: # drop old entries
if self.multi_version or d.location != dist.location:
log.info("Removing %s from easy-install.pth file", d)
self.pth_file.remove(d)
... | |
15,823 | [
0.048448849469423294,
-0.0016714733792468905,
0.0570211224257946,
-0.05224548280239105,
-0.03371600806713104,
0.009336372837424278,
0.039279624819755554,
0.02867770753800869,
-0.03684404864907265,
0.03856327757239342,
0.027770336717367172,
-0.0029653729870915413,
0.021669458597898483,
-0.0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "src", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dst", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def process(src, dst):
s = src.lower()
for old, new in prefixes:
if s.startswith(old):
src = new + src[len(old):]
parts = src.split('/')
dst = os.path.join(egg_tmp, *parts)
dl = dst.lower()
... | |
15,824 | [
0.027889039367437363,
0.00025744710001163185,
0.08136302977800369,
-0.008382312953472137,
-0.01114241499453783,
0.0013980520889163017,
0.007584282662719488,
0.016896629706025124,
-0.030529137700796127,
0.03194519132375717,
0.005400201305747032,
-0.03703337907791138,
0.03067314438521862,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lines", "annotation": n... | class RewritePthDistributions(PthDistributions):
@classmethod
def _wrap_lines(cls, lines):
yield cls.prelude
for line in lines:
yield line
yield cls.postlude
_inline = lambda text: textwrap.dedent(text).strip().replace('\n', '; ')
prelude = _inline("""
impor... | |
15,825 | [
0.017867671325802803,
-0.008307226002216339,
0.06486957520246506,
-0.04578590765595436,
0.025386983528733253,
-0.001814685296267271,
-0.018512891605496407,
0.024841025471687317,
0.012544593773782253,
0.0444706492125988,
0.02930794283747673,
-0.010224278084933758,
-0.017656732350587845,
0.0... | 13 | {"_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 ReindexTest(SyscoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def reindex(self, justchainstate=False):
self.nodes[0].generatetoaddress(3, self.nodes[0].get_deterministic_priv_key().address)
blockcount = self.nodes[0].getblo... | |
15,826 | [
0.04920583218336105,
-0.015112869441509247,
0.07292481511831284,
0.004806408192962408,
0.00018300260126125067,
-0.012553134933114052,
-0.031306106597185135,
0.049426816403865814,
-0.0028574494644999504,
0.0354311466217041,
0.053379978984594345,
0.03228825703263283,
-0.03714991360902786,
-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": "justchainstate", "annotation": null, "type_comment": null}}], "kw... | def reindex(self, justchainstate=False):
self.nodes[0].generatetoaddress(3, self.nodes[0].get_deterministic_priv_key().address)
blockcount = self.nodes[0].getblockcount()
self.stop_nodes()
extra_args = [["-reindex-chainstate" if justchainstate else "-reindex"]]
self.start_nodes(e... | |
15,827 | [
0.04116510972380638,
0.03151703625917435,
-0.019517939537763596,
-0.027746524661779404,
0.014072878286242485,
-0.001008473103865981,
-0.02634921856224537,
0.03699536621570587,
0.09971892833709717,
0.053186386823654175,
0.029476525261998177,
0.005838747136294842,
0.0066871121525764465,
0.01... | 9 | {"_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 check_exp(func):
def _func(*args, **kwargs):
if not args[0].payload:
print('not, it\'s payload is None.'
'Please make sure you\'re not wrong.')
return None
else:
return func(*args, **kwargs)
return _func | |
15,828 | [
0.017226362600922585,
-0.040978047996759415,
0.010354079306125641,
-0.01826116256415844,
0.011644534766674042,
-0.03532926365733147,
0.010974958539009094,
0.018285511061549187,
0.018078550696372986,
0.004857469350099564,
0.040880657732486725,
0.011723666451871395,
-0.014986327849328518,
-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": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def __init__(self):
self._version = '1.0'
self.payload = []
self._headers = {
'user-agent': 'Mozilla/5.0 \
(X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0'}
self.exp = []
self._proxies = {}
self.lock = Lock()
self.quest = Queue()
... | |
15,829 | [
0.01945762149989605,
-0.02111891470849514,
-0.00838612113147974,
-0.01511094719171524,
0.05006639286875725,
0.007032052148133516,
-0.05398067459464073,
-0.03026740998029709,
0.028355784714221954,
0.006554145831614733,
-0.04016689956188202,
-0.03634364902973175,
-0.0009821262210607529,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def findDeviceNumber(self):
command = 'solaar-cli show'
retvalue, out, stderr = run_through_shell(command, enable_shell=True)
for line in out.split('\n'):
if line.count(self.nameOfDevice) > 0 and line.count(':') > 0:
numberOfDevice = line.split(':')[0]
... | |
15,830 | [
0.01418085116893053,
0.024397633969783783,
0.024112923070788383,
-0.0350852869451046,
0.007539394777268171,
-0.029588155448436737,
-0.02965385839343071,
-0.009395498782396317,
-0.03633363917469978,
0.0350852869451046,
0.019699884578585625,
-0.07770449668169022,
-0.01046316884458065,
-0.001... | 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 queryFeatures:
def __init__(self):
self.query_ranker = {} # key: query, value: list of q-d features
self.ranker_query = {} # key: features, value: query
def add(self,query,ranker):
if query in self.query_ranker.keys():
self.query_ranker[query].append(r... | |
15,831 | [
0.02933097444474697,
-0.025519751012325287,
-0.0013447118690237403,
-0.05065322667360306,
-0.0003206868132110685,
0.01971278339624405,
-0.027760133147239685,
-0.034661538898944855,
0.05217256769537926,
-0.0036663718055933714,
0.024090541526675224,
0.008047347888350487,
-0.033399712294340134,... | 13 | {"_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 TestNodeLogList(ApiTestCase):
def setUp(self):
super(TestNodeLogList, self).setUp()
self.user = AuthUserFactory()
self.contrib = AuthUserFactory()
self.creator = AuthUserFactory()
self.user_auth = Auth(self.user)
self.NodeLogFactory = ProjectFactory()
se... | |
15,832 | [
0.013906540349125862,
-0.01188524067401886,
-0.00784841738641262,
0.0015419627306982875,
0.018260996788740158,
0.016412951052188873,
-0.04225093498826027,
-0.05022062733769417,
0.04275914654135704,
0.015384976752102375,
-0.025549225509166718,
-0.021448874846100807,
-0.01886161044239998,
-0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "numberOfDevice", "annotation": null, "type_comment": null}}], "kw... | def findBatteryStatus(self, numberOfDevice):
command = 'solaar-cli show -v %s' % (numberOfDevice)
retvalue, out, stderr = run_through_shell(command, enable_shell=True)
for line in out.split('\n'):
if line.count('Battery') > 0:
if line.count(':') > 0:
... | |
15,833 | [
-0.004030031152069569,
-0.018523050472140312,
0.03789135068655014,
-0.055834800004959106,
0.002704800106585026,
-0.04257645085453987,
0.015987299382686615,
-0.0013048547552898526,
0.0021191625855863094,
0.026444250717759132,
0.014369250275194645,
0.0418519489467144,
-0.02796570025384426,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
super(TestNodeLogList, self).setUp()
self.user = AuthUserFactory()
self.contrib = AuthUserFactory()
self.creator = AuthUserFactory()
self.user_auth = Auth(self.user)
self.NodeLogFactory = ProjectFactory()
self.pointer = ProjectFactory()
s... | |
15,834 | [
0.0047926572151482105,
-0.06446975469589233,
-0.04809686914086342,
-0.01715138740837574,
-0.014390135183930397,
0.010716576129198074,
-0.016494525596499443,
-0.004893010947853327,
0.035348888486623764,
-0.02576357312500477,
0.008490544743835926,
0.002870728727430105,
-0.029510118067264557,
... | 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_add_tag(self):
user_auth = Auth(self.user)
self.public_project.add_tag("Jeff Spies", auth=user_auth)
assert_equal("tag_added", self.public_project.logs[OSF_LATEST].action)
res = self.app.get(self.public_url, auth=self.user.auth)
assert_equal(res.status_code, 200)
... | |
15,835 | [
0.0087517648935318,
-0.05496108531951904,
-0.006057471502572298,
-0.030281106010079384,
0.004272736608982086,
0.008758015930652618,
-0.0382327102124691,
0.0037913895212113857,
0.020529139786958694,
0.005329199600964785,
0.034581974148750305,
-0.02205444686114788,
-0.006657592486590147,
-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_project_add_remove_contributor(self):
self.public_project.add_contributor(self.contrib, auth=self.user_auth)
assert_equal('contributor_added', self.public_project.logs[OSF_LATEST].action)
self.public_project.remove_contributor(self.contrib, auth=self.user_auth)
assert_equal('con... | |
15,836 | [
0.013451753184199333,
-0.056787725538015366,
-0.05622242018580437,
-0.023781467229127884,
-0.029473086819052696,
0.031271792948246,
-0.026158329099416733,
-0.011299730278551579,
0.049978338181972504,
-0.010252625681459904,
0.031734317541122437,
-0.01765301823616028,
-0.018218325451016426,
... | 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_tag(self):
user_auth = Auth(self.user)
self.public_project.add_tag("Jeff Spies", auth=user_auth)
assert_equal("tag_added", self.public_project.logs[OSF_LATEST].action)
self.public_project.remove_tag("Jeff Spies", auth=self.user_auth)
assert_equal("tag_removed", se... | |
15,837 | [
0.005207340233027935,
-0.025319522246718407,
-0.00521357636898756,
-0.04562503099441528,
-0.002888982417061925,
0.031356293708086014,
-0.03674449026584625,
-0.02771427482366562,
0.02616766281425953,
0.001881814212538302,
-0.004069209098815918,
-0.03659481555223465,
-0.020954087376594543,
-... | 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_addon(self):
self.public_project.add_addon('github', auth=self.user_auth)
assert_equal('addon_added', self.public_project.logs[OSF_LATEST].action)
old_log_length = len(list(self.public_project.logs))
self.public_project.delete_addon('github', auth=self.user_auth)
... | |
15,838 | [
0.006331657990813255,
0.01091624703258276,
-0.037309881299734116,
-0.06312897801399231,
0.01927638053894043,
0.025256279855966568,
-0.014398659579455853,
-0.003670016536489129,
-0.005291038192808628,
0.03470686450600624,
0.03325292840600014,
-0.005018425174057484,
-0.04131992906332016,
0.0... | 13 | {"_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 TestNodeLogFiltering(TestNodeLogList):
def test_filter_action_not_equal(self):
self.public_project.add_tag("Jeff Spies", auth=self.user_auth)
assert_equal("tag_added", self.public_project.logs[OSF_LATEST].action)
url = '/{}nodes/{}/logs/?filter[action][ne]=tag_added'.format(API_BASE, ... | |
15,839 | [
-0.05617969110608101,
0.0021137052681297064,
-0.016095926985144615,
-0.03029690496623516,
-0.01785711571574211,
-0.03219185397028923,
0.030185436829924583,
-0.015271066688001156,
-0.012283734045922756,
0.028245899826288223,
0.02268366515636444,
-0.017400098964571953,
0.03640533238649368,
-... | 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": "if_name", "annotation": null, "type_comment": null}}], "kwarg": n... | def _get_interface_type(self, if_name):
if_type = None
if_id = None
for interface_type, interface_regex in iteritems(self.IF_TYPE_MAP):
match = interface_regex.match(if_name)
if match:
if_type = interface_type
if_id = match.group(1)
... | |
15,840 | [
0.002729860134422779,
0.0011650386732071638,
-0.008842957206070423,
-0.05747325345873833,
-0.002644831780344248,
-0.001314957276917994,
-0.012661777436733246,
0.00816869642585516,
0.0012075529666617513,
-0.022817455232143402,
0.03050283156335354,
-0.009010029956698418,
-0.011002977378666401,... | 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 test_filter_date_not_equal(self):
self.public_project.add_pointer(self.pointer, auth=Auth(self.user), save=True)
assert_equal('pointer_created', self.public_project.logs[OSF_LATEST].action)
assert_equal(len(self.public_project.logs), 2)
date_pointer_added = str(self.public_project.lo... | |
15,841 | [
-0.0015472730156034231,
-0.028749331831932068,
-0.013693513348698616,
-0.023323601111769676,
-0.002188789425417781,
0.004301242996007204,
-0.006347636226564646,
0.0036788105498999357,
-0.010317111387848854,
0.018391117453575134,
0.030534422025084496,
-0.009653574787080288,
-0.001876105321571... | 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": "interface_qos_config", "annotation": null, "type_comment": null}}... | def _set_interface_qos_config(self, interface_qos_config, interface, if_type, if_id):
interface_qos_config = interface_qos_config[0].get(interface)
trust = interface_qos_config[0].get("Trust mode")
rewrite_dscp = interface_qos_config[0].get("DSCP rewrite")
rewrite_pcp = interface_qos_con... | |
15,842 | [
0.04733419418334961,
-0.012718806974589825,
-0.013814840465784073,
-0.048586804419755936,
-0.006841176189482212,
0.028569137677550316,
-0.020210376009345055,
-0.0018367595039308071,
0.004341979045420885,
0.04827365279197693,
-0.00898506585508585,
-0.025317169725894928,
-0.0007091095903888345... | 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 load_current_config(self):
self._current_config = dict()
for interface in self._required_config.get("interfaces"):
if_type, if_id = self._get_interface_type(interface)
if not if_id:
self._module.fail_json(
msg='unsupported interface: {0}'.f... | |
15,843 | [
0.02717585861682892,
-0.001244407962076366,
0.058524880558252335,
-0.01552367489784956,
-0.010872856713831425,
0.005936077330261469,
-0.01572479121387005,
-0.008723425678908825,
-0.006580278277397156,
0.02777920663356781,
0.019797399640083313,
-0.004433989059180021,
0.028734510764479637,
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 generate_commands(self):
trust = self._required_config.get("trust")
rewrite_pcp = self._required_config.get("rewrite_pcp")
rewrite_dscp = self._required_config.get("rewrite_dscp")
for interface in self._required_config.get("interfaces"):
ignored1, ignored2, current_trust,... | |
15,844 | [
0.02769419550895691,
-0.003188328118994832,
0.004665502347052097,
-0.02268758974969387,
0.004907939117401838,
-0.0009760907269082963,
-0.012877349741756916,
-0.005942524876445532,
-0.010599570348858833,
0.02177422307431698,
0.013553918339312077,
-0.022123783826828003,
-0.012009087018668652,
... | 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": "interface", "annotation": null, "type_comment": null}}], "kwarg":... | def _get_current_rewrite_config(self, interface):
current_interface_qos_config = self._current_config.get(interface)
current_rewrite_pcp = current_interface_qos_config.get('rewrite_pcp')
current_rewrite_dscp = current_interface_qos_config.get('rewrite_dscp')
if_type = current_interface_q... | |
15,845 | [
-0.0010296690743416548,
-0.009919798001646996,
0.02228788658976555,
-0.013929929584264755,
0.005939818453043699,
-0.0035880121868103743,
-0.007567991968244314,
0.0024573360569775105,
-0.024012545123696327,
0.03584393858909607,
0.007580052595585585,
-0.0002789001155178994,
0.04271845147013664... | 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": "if_type", "annotation": null, "type_comment": null}}, {"_type": "... | def _add_interface_trust_cmds(self, if_type, if_id, interface, trust, current_trust):
current_rewrite_pcp, current_rewrite_dscp, ignored1, ignored2, ignored3 = self._get_current_rewrite_config(
interface)
if trust == "L3" and trust != current_trust:
self._add_no_rewrite_cmd(if_... | |
15,846 | [
0.01059153862297535,
-0.01820474863052368,
0.02058279514312744,
-0.021390868350863457,
-0.02475014701485634,
-0.0045165554620325565,
0.005670946557074785,
0.0022727076429873705,
-0.011665122583508492,
0.04111941158771515,
0.006435730494558811,
-0.030314311385154724,
0.03437776863574982,
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": "if_type", "annotation": null, "type_comment": null}}, {"_type": "... | def _add_interface_rewrite_cmds(self, if_type, if_id, interface, rewrite_pcp, rewrite_dscp):
current_rewrite_pcp, current_rewrite_dscp, ignored1, ignored2, ignored3 = self._get_current_rewrite_config(
interface)
if rewrite_pcp == "enabled" and rewrite_pcp != current_rewrite_pcp:
... | |
15,847 | [
0.012847814708948135,
0.016598686575889587,
0.023130377754569054,
-0.03606441989541054,
-0.017460957169532776,
-0.0012934041442349553,
-0.00813227891921997,
-0.03591352328658104,
0.054279863834381104,
-0.021578293293714523,
0.020425008609890938,
-0.07152525335550308,
0.007210728246718645,
... | 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 TestParsePoaXml(unittest.TestCase):
def setUp(self):
self.passes = []
self.passes.append('elife-02935-v2.xml')
self.passes.append('elife-04637-v2.xml')
self.passes.append('elife-15743-v1.xml')
self.passes.append('elife-02043-v2.xml')
self.passes.append('elife-1... | |
15,848 | [
0.0033878774847835302,
0.006781672593206167,
0.01912597380578518,
-0.014024925418198109,
0.013196448795497417,
0.0012079484295099974,
-0.09099040180444717,
0.02331569790840149,
-0.015717385336756706,
0.021374696865677834,
-0.00915466621518135,
-0.007195910904556513,
-0.017267819494009018,
... | 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": "namedPipe", "annotatio... | class DiscordRequestAPI:
def __init__(self, namedPipe):
self.namedPipe = namedPipe
self.token = "Bot " + getAuthenticationToken()
self.discordRest = RestAPI(self.token)
def getBotName(self):
return self.discordRest.getBotName()
def getGuilds(self):
return self.discordRest.getGuildNames()
def getGuildCh... | |
15,849 | [
0.06123580411076546,
0.027266239747405052,
-0.03281007334589958,
0.0008582977461628616,
0.08775924146175385,
-0.03056355193257332,
-0.006929791532456875,
-0.003967645578086376,
0.01945776864886284,
-0.046089909970760345,
0.0117851747199893,
-0.014620501548051834,
0.016975725069642067,
-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": "content", "annotation": null, "type_comment": null}}], "kwarg": n... | def deserialize(self, content):
try:
content = content.decode('utf-8')
except AttributeError:
pass
body = json.loads(content)
if self._data_wrapper and isinstance(body, dict) and 'data' in body:
body = body['data']
return body | |
15,850 | [
0.0003424039750825614,
0.010221563279628754,
0.0024205739609897137,
-0.007439434994012117,
-0.041891250759363174,
-0.054662074893713,
0.01829831302165985,
-0.048828184604644775,
0.013873872347176075,
-0.03978320583701134,
0.006173995789140463,
0.005132229533046484,
0.05681914463639259,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vec", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "viewer", "annotation": null, "type_comment": null}}], "kwarg": nul... | def view(vec, viewer):
if (isinstance(vec, PISM.IceModelVec2S)):
v_global = PISM.IceModelVec2S()
else:
v_global = PISM.IceModelVec2V()
v_global.create(vec.get_grid(), "", PISM.WITHOUT_GHOSTS)
v_global.copy_from(vec)
v_global.get_vec().view(viewer) | |
15,851 | [
-0.009171095676720142,
0.019902419298887253,
0.02533150464296341,
-0.01297018676996231,
-0.049673594534397125,
-0.041961248964071274,
0.0004713188100140542,
-0.045665204524993896,
0.02233789674937725,
-0.028540752828121185,
-0.02828705683350563,
-0.007103476207703352,
0.03627846762537956,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "grid", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "design_var", "annotation": null, "type_comment": null}}, {"_type"... | def createDesignVec(grid, design_var, name=None, **kwargs):
if name is None:
name = design_var
if design_var == "tauc":
design_vec = PISM.model.createYieldStressVec(grid, name=name, **kwargs)
elif design_var == "hardav":
design_vec = PISM.model.createAveragedHardnessVec(grid, name=na... | |
15,852 | [
-0.004815642721951008,
-0.011001397855579853,
0.04640835151076317,
0.003028759267181158,
0.0005264472565613687,
-0.015361461788415909,
-0.005193605087697506,
-0.043411653488874435,
0.029130082577466965,
-0.017804717645049095,
-0.015401957556605339,
-0.01111613679677248,
-0.01604989357292652,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssarun", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_lin(ssarun):
grid = ssarun.grid
PISM.verbPrintf(1, grid.com, "\nTest Linearization (Comparison with finite differences):\n")
S = 250
d_viewer = PETSc.Viewer().createDraw(title="d", size=S)
Td_viewer = PETSc.Viewer().createDraw(title="Td", size=S)
Td_fd_viewer = PETSc.Viewer().createDr... | |
15,853 | [
-0.0024323000106960535,
-0.023945719003677368,
0.06389085948467255,
-0.008113231509923935,
0.005899621173739433,
-0.017895851284265518,
-0.009328546933829784,
-0.016974348574876785,
0.028019027784466743,
-0.004584142472594976,
-0.019965894520282745,
-0.05334032326936722,
0.003729415358975529... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssarun", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_j_design(ssarun):
grid = ssarun.grid
S = 250
d_viewer = PETSc.Viewer().createDraw(title="d", size=S)
drhs_viewer = PETSc.Viewer().createDraw(title="drhs", size=S)
drhs_fd_viewer = PETSc.Viewer().createDraw(title="drhs_fd", size=S)
d_drhs_viewer = PETSc.Viewer().createDraw(title="d_drhs... | |
15,854 | [
-0.008347857743501663,
-0.020828191190958023,
0.04303387552499771,
-0.01971854455769062,
-0.009661576710641384,
-0.039998289197683334,
-0.007219078950583935,
-0.04453891143202782,
0.013315757736563683,
-0.03188639134168625,
-0.021618973463773727,
-0.020866455510258675,
0.02765187993645668,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssarun", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_j_design_transpose(ssarun):
grid = ssarun.grid
S = 250
r_viewer = PETSc.Viewer().createDraw(title="r", size=S)
JStarR_viewer = PETSc.Viewer().createDraw(title="JStarR", size=S)
JStarR_indirect_viewer = PETSc.Viewer().createDraw(title="JStarR (ind)", size=S)
d_JStarR_viewer = PETSc.View... | |
15,855 | [
-0.016890745609998703,
-0.01056607160717249,
0.03340724855661392,
-0.0051395767368376255,
-0.02230476588010788,
-0.028068076819181442,
-0.015069439075887203,
-0.042314186692237854,
0.011214756406843662,
-0.023452438414096832,
-0.026596061885356903,
-0.006430708337575197,
0.020283862948417664... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssarun", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_linearization_transpose(ssarun):
grid = ssarun.grid
S = 250
r_viewer = PETSc.Viewer().createDraw(title="r", size=S)
TStarR_viewer = PETSc.Viewer().createDraw(title="TStarR", size=S)
TStarR_indirect_viewer = PETSc.Viewer().createDraw(title="TStarR (ind)", size=S)
d_TStarR_viewer = PETSc... | |
15,856 | [
-0.017595352604985237,
-0.0014755792217329144,
0.01225102785974741,
-0.04468896985054016,
0.029089991003274918,
0.01394980400800705,
0.014966589398682117,
-0.019752921536564827,
0.014854990877211094,
0.029313188046216965,
0.02792440727353096,
-0.006615306716412306,
-0.007861489430069923,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": nu... | class _TestNetworkObject(object):
def _compare(self, obj, db_obj):
for field in obj.fields:
db_val = db_obj[field]
obj_val = obj[field]
if isinstance(obj_val, netaddr.IPAddress):
obj_val = str(obj_val)
if isinstance(obj_val, netaddr.IPNetwork):... | |
15,857 | [
0.01595274545252323,
-0.030310215428471565,
-0.016291135922074318,
-0.03852829337120056,
0.016774551942944527,
-0.005994364619255066,
0.028038157150149345,
0.031929660588502884,
-0.013982822187244892,
-0.0007666683522984385,
0.023989543318748474,
0.00019601028179749846,
-0.0113602876663208,
... | 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": "set_host", "annotation": null, "type_comment": null}}, {"_type": ... | def test_save(self, set_host, update):
result = dict(fake_network, injected=True)
network = network_obj.Network._from_db_object(self.context,
network_obj.Network(),
fake_network)
network.o... | |
15,858 | [
0.016005147248506546,
0.021303705871105194,
0.014439664781093597,
-0.0029804387595504522,
0.011341541074216366,
8.873408319232112e-7,
0.02404056489467621,
-0.01126490905880928,
0.013574818149209023,
0.025638889521360397,
-0.00009040185250341892,
-0.02817869372665882,
0.04540995508432388,
-... | 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": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _compare(self, obj, db_obj):
for field in obj.fields:
db_val = db_obj[field]
obj_val = obj[field]
if isinstance(obj_val, netaddr.IPAddress):
obj_val = str(obj_val)
if isinstance(obj_val, netaddr.IPNetwork):
obj_val = str(obj_val... | |
15,859 | [
0.005024143494665623,
-0.03438379615545273,
-0.004861788358539343,
-0.02651992067694664,
0.018762312829494476,
0.0006298628868535161,
0.026236537843942642,
0.01939992420375347,
-0.026921378448605537,
0.0016117404447868466,
0.00812364462763071,
0.002283299108967185,
-0.0029829007107764482,
... | 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": "set_host", "annotation": null, "type_comment": null}}, {"_type": ... | def test_save_with_host_and_other(self, set_host, update):
result = dict(fake_network, injected=True)
network = network_obj.Network._from_db_object(self.context,
network_obj.Network(),
fake_networ... | |
15,860 | [
0.01124142948538065,
-0.021563051268458366,
-0.01029251515865326,
-0.023460879921913147,
0.02636001631617546,
-0.011555793695151806,
0.018931707367300987,
0.02668602392077446,
-0.029922809451818466,
0.0002183084434363991,
0.022843794897198677,
0.005213205702602863,
-0.005478086415678263,
-... | 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": "get", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def test_save_with_host(self, get, set_host, update):
result = dict(fake_network, injected=True)
network = network_obj.Network._from_db_object(self.context,
network_obj.Network(),
fake_network)
... | |
15,861 | [
0.024354485794901848,
0.00007103858661139384,
0.04005756229162216,
-0.05400732159614563,
0.014692039228975773,
-0.012062061578035355,
0.025685472413897514,
0.022882722318172455,
0.008709000423550606,
0.03007516637444496,
0.019440075382590294,
-0.019824014976620674,
-0.020719870924949646,
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_compat_version_1_1(self):
network = network_obj.Network._from_db_object(self.context,
network_obj.Network(),
fake_network)
primitive = network.obj_to_primitive(target_version='1.1')
... | |
15,862 | [
0.039567265659570694,
0.024525275453925133,
0.034397002309560776,
-0.03656690567731857,
-0.05593530833721161,
0.004450312815606594,
0.008418424986302853,
-0.012409976683557034,
0.025248577818274498,
0.04093350097537041,
0.012014839798212051,
0.00048513099318370223,
-0.026440685614943504,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "m", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def m2f_loc(m, f):
c0 = 1./6
c1 = 1./9
c2 = 1./18
c3 = 1./36
c4 = 1./12
f[0] = c1*m[0] - c1*m[3] + c1*m[4]
f[1] = c1*m[0] + c0*m[1] - c3*m[3] - c2*m[4] - c0*m[5] + 0.25*m[7]
f[2] = c1*m[0] + c0*m[2] - c3*m[3] - c2*m[4] - c0*m[6] - 0.25*m[7]
f[3] = c1*m[0] - c0*m[1] - c3*m[3] - c2*m[... | |
15,863 | [
-0.005160769447684288,
-0.006741100922226906,
-0.004200841765850782,
-0.048101335763931274,
-0.03913789242506027,
-0.04511352255940437,
-0.007864617742598057,
-0.040989845991134644,
-0.02113693207502365,
0.030297914519906044,
0.03787856549024582,
0.0037995856255292892,
-0.03447097912430763,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "floc", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def getf(f, floc, i, j):
floc[0] = f[i, j, 0]
floc[1] = f[i-1, j, 1]
floc[2] = f[i, j-1, 2]
floc[3] = f[i+1, j, 3]
floc[4] = f[i, j+1, 4]
floc[5] = f[i-1, j-1, 5]
floc[6] = f[i+1, j-1, 6]
floc[7] = f[i+1, j+1, 7]
floc[8] = f[i-1, j+1, 8] | |
15,864 | [
0.021543556824326515,
0.009365672245621681,
0.007714752573519945,
-0.04836001247167587,
-0.06950182467699051,
-0.009202463552355766,
0.003122936934232712,
-0.02130502089858055,
0.019384179264307022,
0.03414829447865486,
0.029352467507123947,
0.0002807112177833915,
-0.028574088588356972,
-0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "m", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def f2m_loc(f, m):
m[0] = f[0] + f[1] + f[2] + f[3] + f[4] + f[5] + f[6] + f[7] + f[8]
m[1] = f[1] - f[3] + f[5] - f[6] - f[7] + f[8]
m[2] = f[2] - f[4] + f[5] + f[6] - f[7] - f[8]
m[3] = -4.*f[0] - f[1] - f[2] - f[3] - f[4] + 2.*f[5] + 2.*f[6] + 2.*f[7] + 2.*f[8]
m[4] = 4.*f[0] - 2.*f[1] - 2.*f[2] ... | |
15,865 | [
-0.014352472499012947,
-0.02002919651567936,
0.0262057576328516,
-0.024396821856498718,
-0.07064367830753326,
-0.00382911111228168,
0.00840797834098339,
-0.016577938571572304,
0.017994144931435585,
0.0681682899594307,
0.03698796406388283,
-0.018755801022052765,
-0.044961560517549515,
-0.00... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "f2", "annotation": null, "type_comment": null}}], "kwarg": null, "v... | def one_time_step(f1, f2):
nx, ny, ns = f1.shape
floc = np.zeros(ns)
mloc = np.zeros(ns)
periodic_bc(f1)
for i in range(1, nx-1):
for j in range(1, ny-1):
getf(f1, floc, i, j)
f2m_loc(floc, mloc)
relaxation_loc(mloc)
m2f_loc(mloc, floc)
... | |
15,866 | [
-0.004446369130164385,
-0.013095470145344734,
0.08117973804473877,
-0.004321505315601826,
-0.0463884212076664,
0.02377893775701523,
-0.01603129133582115,
-0.01631147414445877,
-0.01718856580555439,
0.07450409233570099,
0.024802211672067642,
-0.026946214959025383,
-0.0046900054439902306,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def periodic_bc(f):
nx, ny, ns = f.shape
for j in xrange(ny):
for k in xrange(ns):
f[0, j, k] = f[nx-2, j, k]
f[nx-1, j, k] = f[1, j, k]
for i in xrange(nx):
for k in xrange(ns):
f[i, 0, k] = f[i, ny-2, k]
f[i, ny-1, k] = f[i, 1, k] | |
15,867 | [
-0.006328963674604893,
-0.0020203774329274893,
0.03640173003077507,
-0.025409013032913208,
-0.03248906880617142,
-0.008873358368873596,
0.008937405422329903,
0.015359527431428432,
-0.0012438130797818303,
0.030183391645550728,
-0.022765638306736946,
-0.07224451005458832,
-0.048349324613809586... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "downloader middleware"}}, "targets": [{"_type": "Name", "_fields": {"id": "component_name", "ctx": {"_type": "Store", "_fields": {}}}}], ... | class DownloaderMiddlewareManager(MiddlewareManager):
component_name = 'downloader middleware'
@classmethod
def _get_mwlist_from_settings(cls, settings):
return build_component_list(
settings.getwithbase('DOWNLOADER_MIDDLEWARES'))
def _add_middleware(self, mw):
if hasattr(... | |
15,868 | [
-0.004259852692484856,
-0.016730034723877907,
0.0010158796794712543,
-0.019728589802980423,
0.022060800343751907,
-0.029842766001820564,
-0.009067060425877571,
0.05640139803290367,
0.03529252111911774,
0.02817690186202526,
0.021561041474342346,
-0.048524241894483566,
-0.019419215619564056,
... | 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": "download_func", "annotation": null, "type_comment": null}}, {"_ty... | def download(self, download_func, request, spider):
@defer.inlineCallbacks
def process_request(request):
for method in self.methods['process_request']:
response = yield method(request=request, spider=spider)
assert response is None or isinstance(response, (Res... | |
15,869 | [
0.012999177910387516,
-0.025706492364406586,
-0.02254088968038559,
-0.022159220650792122,
0.017938416451215744,
-0.037740275263786316,
-0.018645625561475754,
0.07018209248781204,
0.04139979928731918,
0.010288209654390812,
0.001449498115107417,
-0.05576849356293678,
-0.029994649812579155,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def process_request(request):
for method in self.methods['process_request']:
response = yield method(request=request, spider=spider)
assert response is None or isinstance(response, (Response, Request)), \
'Middleware %s.process_request must return None... | |
15,870 | [
0.015387294813990593,
-0.023595310747623444,
-0.005455594975501299,
-0.010429653339087963,
0.018539173528552055,
-0.02812613546848297,
-0.0038221997674554586,
0.0651388168334961,
0.05253130570054054,
0.01462121307849884,
-0.005964491982012987,
-0.05563940852880478,
-0.006528108846396208,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "response", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def process_response(response):
assert response is not None, 'Received None in process_response'
if isinstance(response, Request):
defer.returnValue(response)
for method in self.methods['process_response']:
response = yield method(request=request, res... | |
15,871 | [
-0.028616705909371376,
-0.005644164513796568,
-0.011333572678267956,
-0.0061757792718708515,
-0.03384236618876457,
-0.048456113785505295,
0.01913812942802906,
0.020744282752275467,
-0.006492485757917166,
-0.026173539459705353,
-0.01961318776011467,
-0.037484489381313324,
-0.00041779823368415... | 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": "media", "annotation": ... | class BinNewz(MovieProvider, Base):
def buildUrl(self, media, api_key):
query = tryUrlencode({
't': 'movie',
'imdbid': getIdentifier(media).replace('tt', ''),
'apikey': api_key,
'extended': 1
})
return query | |
15,872 | [
0.005098875146359205,
-0.0051156384870409966,
0.023021768778562546,
-0.004970355425029993,
-0.013254281133413315,
-0.018260957673192024,
-0.004883744288235903,
0.05958838760852814,
0.05695094168186188,
0.026285050436854362,
0.012371406890451908,
-0.07071930170059204,
-0.02031727135181427,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "_failure", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def process_exception(_failure):
exception = _failure.value
for method in self.methods['process_exception']:
response = yield method(request=request, exception=exception,
spider=spider)
assert response is None or isinstance(... | |
15,873 | [
-0.010905032977461815,
-0.005996700841933489,
-0.04031234234571457,
-0.019131824374198914,
-0.026014158502221107,
-0.04379085451364517,
-0.02908720076084137,
0.026867780834436417,
-0.0027556014247238636,
-0.008050731383264065,
-0.009629933163523674,
-0.020081479102373123,
-0.0082908123731613... | 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": "media", "annotation": null, "type_comment": null}}, {"_type": "ar... | def buildUrl(self, media, api_key):
query = tryUrlencode({
't': 'movie',
'imdbid': getIdentifier(media).replace('tt', ''),
'apikey': api_key,
'extended': 1
})
return query | |
15,874 | [
0.024868585169315338,
0.024889172986149788,
-0.027441907674074173,
0.017138326540589333,
-0.033535536378622055,
-0.025177383795380592,
-0.03326790779829025,
-0.01062267366796732,
-0.003998942673206329,
0.017333898693323135,
-0.026700790971517563,
-0.03555301949381828,
0.00009006627806229517,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Character", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "... | class CharacterView(generic.DetailView):
model = Character
template_name = "characters/character.html"
def get_queryset(self):
# Because team_slug and character slug are unique together, we'll need
# to filter by team_slug provided by the URL, then the view can perform
# its regular... | |
15,875 | [
0.017139414325356483,
0.01485973596572876,
-0.030472394078969955,
0.007618098519742489,
-0.022315748035907745,
-0.010980100370943546,
-0.025913037359714508,
0.018990345299243927,
-0.023549702018499374,
0.049943771213293076,
-0.021625569090247154,
-0.010927814058959484,
-0.010917357169091702,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_queryset(self):
# Because team_slug and character slug are unique together, we'll need
# to filter by team_slug provided by the URL, then the view can perform
# its regular, configured logic inherited from generic.DetailView
query_set = (
super(CharacterView, self)
... | |
15,876 | [
0.0595642551779747,
0.014724123291671276,
-0.008970252238214016,
-0.05297568440437317,
-0.0077905417419970036,
-0.003241421654820442,
0.009554542601108551,
-0.04106728360056877,
0.018908757716417313,
0.05444475635886192,
0.01593722216784954,
-0.0204557366669178,
0.0034834849648177624,
-0.0... | 8 | {"_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 log(*args):
if not logfile:
return
for a in args:
logfile.write(str(a))
logfile.flush() | |
15,877 | [
0.0742921531200409,
0.02250780537724495,
-0.01816316694021225,
-0.007430386263877153,
0.01990804821252823,
0.02106739953160286,
-0.0304944459348917,
-0.016593944281339645,
-0.023983342573046684,
0.05611727386713028,
0.02241411991417408,
-0.0304944459348917,
-0.0413384772837162,
0.029487332... | 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": "size", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _read(self, size, channel):
if not size:
return ''
assert size > 0
# tell the client we need at most size bytes
self.out.write(struct.pack('>cI', channel, size))
self.out.flush()
length = self.in_.read(4)
length = struct.unpack('>I', length)[0]
... | |
15,878 | [
0.05090302973985672,
0.012163623236119747,
0.01962685026228428,
0.026695385575294495,
0.03760317713022232,
0.02398039773106575,
-0.014794888906180859,
0.04628635570406914,
-0.04150223731994629,
0.010525062680244446,
0.05697886273264885,
-0.005845596082508564,
-0.04834352806210518,
0.035235... | 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": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def read(self, size=-1):
if size < 0:
# if we need to consume all the clients input, ask for 4k chunks
# so the pipe doesn't fill up risking a deadlock
size = self.maxchunksize
s = self._read(size, self.channel)
buf = s
while s:
... | |
15,879 | [
0.05334683880209923,
0.007823733612895012,
0.012011249549686909,
-0.0008416085038334131,
0.013876277022063732,
0.01818108931183815,
0.0014948081225156784,
0.02676725573837757,
-0.04762272536754608,
0.031623367220163345,
-0.0016348318895325065,
0.008480599150061607,
-0.047763481736183167,
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": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def readline(self, size=-1):
if size < 0:
size = self.maxchunksize
s = self._read(size, 'L')
buf = s
# keep asking for more until there's either no more or
# we got a full line
while s and s[-1] != '\n':
s = self._read(size,... | |
15,880 | [
0.046774327754974365,
0.023935208097100258,
0.015297564677894115,
0.005146844312548637,
-0.00891762226819992,
0.016083888709545135,
0.03264433518052101,
-0.0010104553075507283,
-0.008566159754991531,
0.03297792747616768,
0.004551144782453775,
-0.0012100146850571036,
0.008834224194288254,
-... | 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": "ui", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def __init__(self, ui, repo, mode):
self.cwd = os.getcwd()
logpath = ui.config("cmdserver", "log", None)
if logpath:
global logfile
if logpath == '-':
# write log on a special 'd' (debug) channel
logfile = channeledoutput(sys.stdout, sys.s... | |
15,881 | [
0.05139278620481491,
0.03470681607723236,
0.015517951920628548,
0.004074157681316137,
0.053217120468616486,
0.022236835211515427,
-0.0349292978644371,
0.01095711998641491,
-0.02607460878789425,
-0.01739790476858616,
0.013215288519859314,
-0.064252108335495,
0.005795593373477459,
0.02047924... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def _read(self, size):
if not size:
return ''
data = self.client.read(size)
# is the other end closed?
if not data:
raise EOFError
return data | |
15,882 | [
0.04691027104854584,
0.024095986038446426,
0.01677863672375679,
0.0007140387897379696,
0.023396875709295273,
-0.0015380416298285127,
-0.07112277299165726,
0.04795893654227257,
0.04518580064177513,
0.03467584773898125,
0.021858835592865944,
-0.05294591933488846,
-0.0004831868573091924,
0.02... | 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 serveone(self):
cmd = self.client.readline()[:-1]
if cmd:
handler = self.capabilities.get(cmd)
if handler:
handler(self)
else:
# clients are expected to check what commands are supported by
# looking at the servers c... | |
15,883 | [
0.019805990159511566,
0.019702700898051262,
0.012582098133862019,
-0.07039260864257812,
0.0025112549774348736,
0.007940472103655338,
0.008721607737243176,
0.02675229124724865,
0.017210811376571655,
0.057326335459947586,
0.029980124905705452,
-0.01093590259552002,
0.017520684748888016,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file_path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "noclear", "annotation": null, "type_comment": null}}, {"_typ... | def slide(file_path, noclear=False, format_rst=True, formatter="terminal",
style="native", auto_all=False, delimiter='...'):
if noclear:
demo_class = Demo
else:
demo_class = ClearDemo
demo = demo_class(file_path, format_rst=format_rst, formatter=formatter,
sty... | |
15,884 | [
0.06856570392847061,
-0.03027017042040825,
0.04874466732144356,
-0.010469331406056881,
0.046913377940654755,
-0.02857353165745735,
-0.05170705169439316,
0.01769350655376911,
0.04018068686127663,
-0.01741073466837406,
0.049310214817523956,
-0.043681688606739044,
-0.028411947190761566,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def serve(self):
hellomsg = 'capabilities: ' + ' '.join(sorted(self.capabilities))
hellomsg += '\n'
hellomsg += 'encoding: ' + encoding.encoding
# write the hello msg in -one- chunk
self.cout.write(hellomsg)
try:
while self.serveone():
pass
... | |
15,885 | [
0.006475224159657955,
0.02718675695359707,
0.0008840288501232862,
-0.04220886901021004,
0.014960880391299725,
-0.02698265202343464,
-0.02036965824663639,
-0.026492800563573837,
-0.03224855661392212,
0.023451639339327812,
-0.021492233499884605,
-0.05474090203642845,
0.016256947070360184,
0.... | 13 | {"_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": "ForeignKey", "value": {"_type": "Name", "_fields": {"id": "m... | class File(models.Model):
author = models.ForeignKey(to=User, blank=False)
name = models.CharField(max_length=100, blank=False, null=True)
file = models.FileField(upload_to=user_directory_path, null=True)
date = models.DateTimeField(default=datetime.now, blank=False, null=True, editable=True)
slug =... | |
15,886 | [
-0.007073810324072838,
0.04475001245737076,
0.0099958386272192,
-0.007139107212424278,
-0.009712886065244675,
-0.03791562467813492,
-0.012689327821135521,
-0.03669675067067146,
-0.05136674642562866,
0.04407528042793274,
-0.021395554766058922,
-0.03164713829755783,
0.010153638198971748,
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 Post(File):
def __init__(self, *args, **kwargs):
self._meta.get_field('location').default = "articolFiles"
super(Post, self).__init__(*args, **kwargs)
REQUIRED = ['name', 'file']
class Meta(File.Meta):
abstract = False
get_latest_by = 'date'
verbose_name = 'Fi... | |
15,887 | [
0.030726803466677666,
0.03294709324836731,
0.007771022617816925,
0.022764375433325768,
-0.01684359647333622,
-0.009914753027260303,
0.007069206330925226,
0.03797465190291405,
0.03067576140165329,
0.06329108774662018,
-0.004568187519907951,
-0.020569603890180588,
-0.046575095504522324,
0.00... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_reply(self):
if self.has("whatsup", "what's up", "wassup", "whats up", 'notifications', 'open tasks'):
n = get_notifications()
open_items = sorted(n.get('open_count_doctype').items())
if open_items:
return ("Following items need your attention:\n\n"
+ "\n\n".join(["{0} [{1}](#List/{1})".for... | |
15,888 | [
0.0028572813607752323,
0.0029526283033192158,
0.036388132721185684,
-0.02808513678610325,
-0.0174563005566597,
-0.01686858758330345,
0.00024012573703657836,
-0.02533414401113987,
-0.013092225417494774,
0.0077903117053210735,
-0.0045016249641776085,
-0.021932916715741158,
-0.01025995332747697... | 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 TestSlugify(TestCase):
def test_uses_custom_mappings(self):
mapping = {'c++': 'cpp'}
with override_settings(OSCAR_SLUG_MAP=mapping):
self.assertEqual('cpp', utils.slugify('c++'))
def test_uses_blacklist(self):
blacklist = ['the']
with override_settings(OSCAR_S... | |
15,889 | [
-0.013458008877933025,
0.025656644254922867,
0.012340623885393143,
-0.009173670783638954,
0.0033552420791238546,
-0.0022733539808541536,
-0.06277111917734146,
0.04269522428512573,
-0.035064905881881714,
0.053683873265981674,
0.0015101676108315587,
-0.038349151611328125,
0.03024965338408947,
... | 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_reply(self):
if self.query.endswith(' ' + _('list')) and self.startswith(_('list')):
self.query = _('list') + ' ' + self.query.replace(' ' + _('list'), '')
if self.startswith(_('list'), _('show')):
like = None
if ' ' + _('like') + ' ' in self.query:
self.query, like = self.query.split(' ' + _('... | |
15,890 | [
-0.019321808591485023,
0.0056519960053265095,
0.006470716558396816,
-0.015787193551659584,
-0.010174721479415894,
0.001695316401310265,
-0.05682486295700073,
0.05253363773226738,
-0.044222209602594376,
0.07073746621608734,
-0.007475766818970442,
-0.045351479202508926,
-0.00042982836021110415... | 13 | {"_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 ListBot(BotParser):
def get_reply(self):
if self.query.endswith(' ' + _('list')) and self.startswith(_('list')):
self.query = _('list') + ' ' + self.query.replace(' ' + _('list'), '')
if self.startswith(_('list'), _('show')):
like = None
if ' ' + _('like') + ' ' in self.query:
self.query, like =... | |
15,891 | [
-0.016921035945415497,
0.03222817927598953,
0.03652361407876015,
0.0034388310741633177,
0.007814961485564709,
-0.011272413656115532,
-0.06813106685876846,
0.03955276682972908,
-0.02842932567000389,
0.045139312744140625,
0.028752105310559273,
-0.04819329455494881,
0.03433865308761597,
0.007... | 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_reply(self):
if self.startswith('find', 'search'):
query = self.query.split(None, 1)[1]
if self.has('from'):
text, table = query.split('from')
if self.has('in'):
text, table = query.split('in')
if table:
text = text.strip()
self.tables = self.reply.identify_tables(table.strip())... | |
15,892 | [
-0.014028101228177547,
0.005156382918357849,
0.04020095616579056,
-0.004246097523719072,
-0.020636945962905884,
-0.015820138156414032,
-0.07049434632062912,
0.03985852748155594,
-0.040132470428943634,
0.07387296110391617,
0.014050929807126522,
-0.061545584350824356,
0.0101986238732934,
-0.... | 13 | {"_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 FindBot(BotParser):
def get_reply(self):
if self.startswith('find', 'search'):
query = self.query.split(None, 1)[1]
if self.has('from'):
text, table = query.split('from')
if self.has('in'):
text, table = query.split('in')
if table:
text = text.strip()
self.tables = self.reply.ide... | |
15,893 | [
0.008780324831604958,
-0.009141305461525917,
0.035949431359767914,
-0.030683359131217003,
-0.0010205667931586504,
0.01736954227089882,
-0.015978705137968063,
-0.0015726549318060279,
-0.04312657564878464,
-0.0012707316782325506,
0.017645586282014847,
-0.051301728934049606,
0.07279069721698761... | 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": "query", "annotation": null, "type_comment": null}}], "kwarg": nul... | def identify_tables(self, query=None):
if not query:
query = self.query
self.tables = []
for t in self.all_tables:
if t in query or t[:-1] in query:
self.tables.append(t)
return self.tables | |
15,894 | [
-0.003617231734097004,
0.006581597495824099,
0.028584953397512436,
0.020774085074663162,
0.002115933457389474,
0.00016238944954238832,
-0.03867791220545769,
0.07519137114286423,
-0.008346100337803364,
0.04808859899640083,
-0.005593475420027971,
-0.04808859899640083,
-0.00616987980902195,
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": "query", "annotation": null, "type_comment": null}}], "kwarg": nul... | def get_reply(self, query):
self.query = query.lower()
self.setup()
self.pre_process()
# basic replies
if self.query.split()[0] in ("hello", "hi"):
return _("Hello {0}").format(frappe.utils.get_fullname())
if self.query == "help":
return help_text.format(frappe.utils.get_fullname())
# build using... | |
15,895 | [
-0.027422523126006126,
0.04159935936331749,
-0.007734408136457205,
-0.010021558031439781,
-0.03433635085821152,
-0.0036082265432924032,
0.022464120760560036,
0.02805105224251747,
-0.0024210037663578987,
0.012675350531935692,
-0.009684015065431595,
-0.08543349802494049,
0.025141192600131035,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "VacanciesPlugin", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}... | class CMSVacanciesPlugin(VacancyStudentshipPluginMixin, ArkestraGenericPlugin, AutocompleteMixin, CMSPluginBase):
model = VacanciesPlugin
name = _("Vacancies & Studentships")
form = VacanciesStudentshipsPluginForm
menu_cues = menu_dict
fieldsets = (
(None, {
'fields': (('display... | |
15,896 | [
0.0151484040543437,
-0.025183623656630516,
0.012233411893248558,
-0.02611546590924263,
0.019676199182868004,
0.03411974757909775,
-0.007233721204102039,
-0.023988954722881317,
0.056483954191207886,
0.028934884816408157,
0.027477389201521873,
-0.0518486388027668,
-0.021898284554481506,
0.00... | 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": "p1_rhs_as_function", "annotation": null, "type_comment": null}}, ... | def _check_ode_rhs_as_function_ans(self, p1_rhs_as_function, p2_rhs_as_function):
constants = [1, 2, 3]
values_p1 = [4, 5, 6, 5] # y_1, y_2, y_3, y_4 in that order
values_p2 = [4, 5, 6] # y_1, y_2, y_3 in that order
p1_expected_ans = np.array([11, 14, 7, 8])
p2_expected_ans ... | |
15,897 | [
-0.024083537980914116,
-0.0022414056584239006,
-0.02405964583158493,
0.01753702014684677,
0.0013133352622389793,
-0.03982862830162048,
-0.0001295416004722938,
0.05791517347097397,
-0.004617205820977688,
-0.009915345348417759,
0.00407365383580327,
-0.030916763469576836,
-0.003321043448522687,... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def render(self, context, instance, placeholder):
self.entity = getattr(instance, "entity", None) or \
work_out_entity(context, None)
self.lister = VacanciesAndStudentshipsPluginLister(
entity=self.entity,
display=instance.display,
order_by=instance.order... | |
15,898 | [
0.03085336647927761,
0.007836970500648022,
-0.036658529192209244,
-0.008207855746150017,
0.03850758075714111,
-0.00524883484467864,
-0.003157901344820857,
0.009782775305211544,
-0.00797134917229414,
-0.0430012084543705,
0.02025356888771057,
-0.02246813103556633,
0.015480435453355312,
0.011... | 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": "data", "annotation": {... | class InputStream (object):
def __init__(self, data: str):
self.name = "<empty>"
self.strdata = data
self._loadString()
def _loadString(self):
self._index = 0
self.data = [ord(c) for c in self.strdata]
self._size = len(self.data)
@property
def i... | |
15,899 | [
0.021625306457281113,
-0.004838511347770691,
0.022084392607212067,
-0.011942243203520775,
0.001118263928219676,
-0.025539608672261238,
-0.03522871434688568,
0.015294770710170269,
-0.018315063789486885,
0.020538000389933586,
0.002130817621946335,
-0.021963579580187798,
-0.01563304290175438,
... | 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": "offset", "annotation": {"_type": "Name", "_fields": {"id": "int",... | def LA(self, offset: int):
if offset==0:
return 0 # undefined
if offset<0:
offset += 1 # e.g., translate LA(-1) to use offset=0
pos = self._index + offset - 1
if pos < 0 or pos >= self._size: # invalid
return Token.EOF
return self.data[pos] | |
15,900 | [
0.033741336315870285,
0.004724206868559122,
-0.015663370490074158,
-0.025090787559747696,
0.03147371485829353,
0.007815937511622906,
0.0005193346878513694,
0.006267447490245104,
0.018413908779621124,
-0.01539041567593813,
0.028492216020822525,
-0.0017532056663185358,
0.010361759923398495,
... | 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 TestInputStream(unittest.TestCase):
def testStream(self):
stream = InputStream("abcde")
self.assertEqual(0, stream.index)
self.assertEqual(5, stream.size)
self.assertEqual(ord("a"), stream.LA(1))
stream.consume()
self.assertEqual(1, stream.index)
st... |