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
10,401
[ 0.02862369269132614, 0.02850974351167679, 0.021821007132530212, -0.0007096812478266656, 0.02351883053779602, -0.04216069355607033, 0.008466322906315327, 0.010352158918976784, 0.07342797517776489, 0.009691261686384678, -0.00794216338545084, -0.01398139726370573, 0.0076857805252075195, 0.005...
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 TestInitWithNoneArgument(SimpleTestCase): def test_none_not_allowed(self): # TaggedItem requires a content_type, initializing with None should # raise a ValueError. with six.assertRaisesRegex(self, ValueError, 'Cannot assign None: "TaggedItem.content_type" does not allow null...
10,402
[ 0.048967741429805756, 0.025128504261374474, 0.004457694478332996, -0.03298572078347206, 0.0026971178594976664, -0.0057287150993943214, -0.00244929944165051, -0.008070068433880806, 0.034323640167713165, 0.05974405258893967, 0.018122686073184013, 0.03498043492436409, -0.03965098038315773, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "out", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "err", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def _print_output(out, err): if len(err) != 0: print("Tracer:") print(" " + _("Program 'tracer' crashed with following error:") + "\n") print(err) print(_("Please visit ") + "https://github.com/FrostyX/tracer/issues " + "and submit the issue. Thank you") ...
10,403
[ 0.024777978658676147, 0.003958513960242271, -0.00042525038588792086, -0.04065178334712982, 0.01776859350502491, 0.0024198279716074467, -0.0021167283412069082, -0.02018013969063759, -0.028090542182326317, -0.01669532246887684, 0.05681709572672844, -0.04467986151576042, 0.027587031945586205, ...
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 _load(self): self._pickles = {} pickle_from_disk = pickle.load(open("files/merge_kitchens_improved_success.p", "rb")) self._pickles['merge_success'] = pickle_from_disk pickle_from_disk = pickle.load(open("files/merge_kitchens_improved_conflicts.p", "rb")) self._pickles['mer...
10,404
[ 0.023234311491250992, 0.05819905549287796, 0.032850246876478195, -0.004260462708771229, -0.0009982510237023234, 0.007098673842847347, 0.030484020709991455, -0.008936273865401745, 0.02478242665529251, 0.07521573454141617, 0.02100653573870659, -0.011661208234727383, 0.018413757905364037, -0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "st...
async def validate_path(self, path: str, **kwargs) -> WaterButlerPath: if path == '/': return WaterButlerPath('/', _ids=[self.folder]) try: obj_id, new_name = path.strip('/').split('/') except ValueError: obj_id, new_name = path.strip('/'), None if p...
10,405
[ 0.017954614013433456, 0.04117012396454811, 0.03561963886022568, -0.01418993715196848, -0.005475071258842945, -0.01155948918312788, 0.02881425991654396, -0.01830453611910343, 0.019245704635977745, 0.06699194759130478, 0.006473555229604244, -0.008820445276796818, 0.023842955008149147, -0.056...
12
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "st...
async def validate_v1_path(self, path: str, **kwargs) -> WaterButlerPath: if path == '/': return WaterButlerPath('/', _ids=[self.folder]) obj_id = path.strip('/') files_or_folders = 'folders' if path.endswith('/') else 'files' # Box file ids must be a valid base10 number ...
10,406
[ 0.04268034175038338, 0.05899561196565628, 0.020838933065533638, 0.0019767540507018566, -0.02593902125954628, 0.028445206582546234, 0.009630018845200539, 0.01598946377635002, 0.03508659824728966, 0.04909617826342583, 0.004063153639435768, -0.008351863361895084, -0.011440737172961235, -0.033...
14
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "base", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def revalidate_path(self, base: WaterButlerPath, path: str, folder: bool=None) -> WaterButlerPath: # TODO Research the search api endpoint response = await self.make_request( 'GET', self.build_url('folders', base.identifier, 'items', ...
10,407
[ 0.011055732145905495, 0.023174850270152092, 0.008853833191096783, -0.018123771995306015, 0.0058717322535812855, 0.036316897720098495, 0.033542849123477936, 0.02436537854373455, 0.00736278248950839, -0.008090970106422901, 0.032317645847797394, -0.009582020342350006, 0.016285967081785202, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dest_provider", "annotation": {"_type": "Attribute", "_field...
async def intra_copy(self, # type: ignore dest_provider: provider.BaseProvider, src_path: WaterButlerPath, dest_path: WaterButlerPath) -> Tuple[BaseBoxMetadata, bool]: if dest_path.identifier is not None: await dest_provider.delete(dest_path) ...
10,408
[ 0.011303599923849106, 0.0367765836417675, 0.0013605090789496899, -0.00857371836900711, -0.017466513440012932, 0.03639841824769974, 0.04377264156937599, 0.009820482693612576, 0.006470173131674528, -0.002616136334836483, 0.03625660762190819, -0.0013634634669870138, 0.005672480911016464, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dest_provider", "annotation": {"_type": "Attribute", "_field...
async def intra_move(self, # type: ignore dest_provider: provider.BaseProvider, src_path: WaterButlerPath, dest_path: WaterButlerPath) -> Tuple[BaseBoxMetadata, bool]: if dest_path.identifier is not None and str(dest_path).lower() != str(src_path).lower(): ...
10,409
[ 0.030067715793848038, 0.03379584848880768, -0.010577747598290443, -0.0403255932033062, 0.016743505373597145, -0.007456263992935419, -0.0053605688735842705, 0.01662217453122139, -0.0245527271181345, 0.008592351339757442, 0.002108104294165969, -0.04065649211406708, -0.007461779285222292, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def download(self, # type: ignore path: WaterButlerPath, revision: str=None, range: Tuple[int, int]=None, **kwargs) -> streams.ResponseStreamReader: if path.identifier is None: raise exceptions.DownloadError('"{}" not found'.format(str(path)), cod...
10,410
[ 0.02259051240980625, 0.06394852697849274, 0.049227457493543625, -0.06012551486492157, 0.003546834457665682, 0.018382718786597252, 0.03435743600130081, 0.0422765277326107, -0.0010038503678515553, 0.05377038195729256, 0.02059211954474449, -0.006277555599808693, -0.0065537309274077415, 0.0048...
9
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def revisions(self, path: WaterButlerPath, **kwargs) -> List[BoxRevision]: # from https://developers.box.com/docs/#files-view-versions-of-a-file : # Alert: Versions are only tracked for Box users with premium accounts. # Few users will have a premium account, return only current if not ...
10,411
[ 0.01633598655462265, 0.08114452660083771, 0.004473656881600618, -0.03362381458282471, 0.025271402671933174, 0.01481303945183754, 0.054207395762205124, 0.012082443572580814, -0.00789433903992176, 0.012445333413779736, -0.0033344211988151073, 0.004601560533046722, 0.018620407208800316, -0.04...
9
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def metadata(self, # type: ignore path: WaterButlerPath, raw: bool=False, folder=False, revision=None, **kwargs) -> Union[dict, BoxFileMetadata, List[BoxFolderMetadata]]: if path.identifier is None: raise exceptions.NotFoundError(str(path)) ...
10,412
[ 0.024412615224719048, 0.06826187670230865, 0.011359457857906818, -0.04919901117682457, 0.025907741859555244, -0.0031391819939017296, 0.04380253702402115, 0.00007222856220323592, -0.01768454536795616, 0.01429714821279049, 0.026374967768788338, -0.017754629254341125, 0.016668325290083885, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def _get_file_meta(self, path: WaterButlerPath, raw: bool=False, revision: str=None) -> Union[dict, BoxFileMetadata]: if revision: url = self.build_url('files', path.identifier, 'versions') else: url = self.build_url('files', path.identifier) ...
10,413
[ 0.02147255837917328, 0.039930250495672226, -0.02234352007508278, 0.003807666478678584, 0.02979136072099209, -0.002608698094263673, 0.032605238258838654, 0.0052397288382053375, 0.020255444571375847, 0.038612641394138336, 0.012226964347064495, 0.021673550829291344, 0.008274137042462826, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def create_folder(self, path: WaterButlerPath, folder_precheck: bool=True, **kwargs) -> BoxFolderMetadata: WaterButlerPath.validate_folder(path) if folder_precheck: if path.identifier is not None: raise exceptions.FolderNamingConflict(path.n...
10,414
[ 0.028987552970647812, -0.0056342873722314835, -0.004557350184768438, -0.015828728675842285, -0.005244458559900522, -0.004644290544092655, 0.008475269190967083, -0.037131886929273605, -0.04287555068731308, 0.06291106343269348, 0.021280722692608833, -0.013585110194981098, 0.0046386816538870335...
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": "find_links", "annotation": null, "type_comment": null}}, {"_type"...
def __init__(self, find_links, index_urls, use_mirrors=False, mirrors=None, main_mirror_url=None): self.find_links = find_links self.index_urls = index_urls self.dependency_links = [] self.cache = PageCache() # These are boring links that have already been logged some...
10,415
[ 0.005197894759476185, 0.05058010667562485, -0.017809029668569565, -0.023774130269885063, 0.017550213262438774, 0.0007849221583455801, 0.022097986191511154, -0.003959273919463158, 0.020409516990184784, 0.04503404349088669, 0.014579987153410912, -0.007579621393233538, -0.0035340755712240934, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Name", "_fields": {"id": "Wa...
async def _get_folder_meta(self, path: WaterButlerPath, raw: bool=False, folder: bool=False) -> Union[dict, List[BoxFolderMetadata]]: if folder: response = await self.make_request( 'GET', self.build_url('folders', path.identifier), ...
10,416
[ 0.01701318472623825, 0.011512214317917824, -0.01590552367269993, 0.00013816601131111383, -0.02163051627576351, 0.03527093306183815, 0.007118904031813145, 0.03751114755868912, -0.031213656067848206, 0.035743869841098785, 0.04313657805323601, -0.013130147010087967, -0.043111685663461685, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "req", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _get_queued_page(self, req, pending_queue, done, seen): while 1: try: location = pending_queue.get(False) except QueueEmpty: return if location in seen: continue seen.add(location) page = self._get_pa...
10,417
[ 0.00033967188210226595, -0.0037737111561000347, 0.013009452261030674, -0.044569194316864014, -0.019423246383666992, -0.019483868032693863, -0.027886057272553444, 0.017968321219086647, -0.04544214904308319, 0.061931297183036804, 0.0218844935297966, 0.002505198586732149, -0.050534386187791824,...
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": "req", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def find_requirement(self, req, upgrade): def mkurl_pypi_url(url): loc = posixpath.join(url, url_name) # For maximum compatibility with easy_install, ensure the path # ends in a trailing slash. Although this isn't in the spec # (and PyPI can handle it without th...
10,418
[ 0.03816954791545868, -0.011103082448244095, 0.030220258980989456, -0.05002867802977562, -0.02849215269088745, -0.004279762972146273, 0.013727644458413124, -0.011751122772693634, -0.010962674394249916, 0.04102092236280441, 0.04257621988654137, -0.01922518201172352, -0.008678333833813667, 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": "egg_info", "annotation": null, "type_comment": null}}, {"_type": ...
def _egg_info_matches(self, egg_info, search_name, link): match = self._egg_info_re.search(egg_info) if not match: logger.debug('Could not parse version from link: %s' % link) return None name = match.group(0).lower() # To match the "safe" name that pkg_resources ...
10,419
[ -0.0178353451192379, -0.03342084214091301, -0.0064947581849992275, -0.007912932895123959, 0.0026079986710101366, 0.002440942684188485, -0.012604926712810993, 0.02338305115699768, -0.01686425693333149, 0.01151846069842577, -0.004242504946887493, -0.0019722238648682833, 0.0029108631424605846, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def mkurl_pypi_url(url): loc = posixpath.join(url, url_name) # For maximum compatibility with easy_install, ensure the path # ends in a trailing slash. Although this isn't in the spec # (and PyPI can handle it without the slash) some other index # implementat...
10,420
[ -0.00039477666723541915, 0.0022281792480498552, 0.01344451867043972, 0.00449017807841301, 0.003868421074002981, -0.029615404084324837, 0.022643400356173515, -0.004495380911976099, -0.011966870166361332, 0.005054702050983906, -0.051780130714178085, -0.02688903734087944, 0.0041571869514882565,...
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 base_url(self): if not hasattr(self, "_base_url"): match = self._base_re.search(self.content) if match: self._base_url = match.group(1) else: self._base_url = self.url return self._base_url
10,421
[ 0.017975330352783203, 0.00159690051805228, 0.0213970597833395, -0.002421379555016756, -0.011919771321117878, 0.014418534003198147, 0.012054840102791786, 0.004749899730086327, -0.028319306671619415, 0.055242907255887985, 0.009038316085934639, -0.04947999492287636, -0.002934920135885477, -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 scraped_rel_links(self): for regex in (self._homepage_re, self._download_re): match = regex.search(self.content) if not match: continue href_match = self._href_re.search(self.content, pos=match.end()) if not href_match: continue...
10,422
[ 0.046818844974040985, 0.015930157154798508, 0.003332905238494277, -0.0229800995439291, -0.009569392539560795, -0.023183463141322136, 0.0003671844897326082, 0.01163692306727171, 0.01578328385949135, 0.020358966663479805, 0.008524328470230103, 0.010987289249897003, 0.04699961468577385, -0.02...
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": "BinOp", "_fields": {"...
def include_mustache_templates(): mustache_dir = settings.PROJECT_ROOT / 'templates' / 'discussion' / 'mustache' def is_valid_file_name(file_name): return file_name.endswith('.mustache') def read_file(file_name): return open(mustache_dir / file_name, "r").read().decode('utf-8') def temp...
10,423
[ -0.02507106401026249, -0.021134672686457634, -0.03191288560628891, -0.01644849218428135, 0.02938234992325306, -0.008628428913652897, -0.0007951862062327564, -0.004387435968965292, -0.014702890068292618, 0.06148268282413483, 0.022353079169988632, -0.03364677354693413, 0.03006184659898281, -...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": nu...
class Link(object): def __init__(self, url, comes_from=None): self.url = url self.comes_from = comes_from def __str__(self): if self.comes_from: return '%s (from %s)' % (self.url, self.comes_from) else: return str(self.url) def __repr__(self): ...
10,424
[ 0.0004305345064494759, 0.005624787881970406, 0.031697697937488556, -0.03155267611145973, 0.003009209642186761, 0.028155013918876648, -0.0031438730657100677, 0.03488818556070328, -0.0004972188035026193, 0.046821437776088715, 0.0019202486146241426, -0.02471591718494892, -0.016832929104566574, ...
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}}, {"_type": "arg", "_fields": {"arg": "root", "annotation": {...
class Solution: def hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool: if not root: return False if not root.left and not root.right: # reach bottom if root.val == targetSum: return True return False targetSum2...
10,425
[ 0.03925402835011482, 0.0037421942688524723, 0.03661859780550003, -0.023788219317793846, -0.0009413280058652163, 0.0693996399641037, 0.019372718408703804, 0.06796634197235107, 0.013581709004938602, 0.03807501867413521, 0.03791319578886032, -0.06042993441224098, -0.005736104678362608, -0.007...
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 main(): argument_spec = ec2_argument_spec() argument_spec.update(dict( instance_id = dict(required=True), key_file = dict(required=True), key_passphrase = dict(no_log=True, default=None, required=False), wait = dict(type='bool', default=False, required=False),...
10,426
[ 0.01230138260871172, -0.006123134400695562, 0.0458105243742466, -0.013591043651103973, 0.016556162387132645, 0.033795733004808426, -0.010333823040127754, 0.04969053342938423, -0.007958421483635902, 0.05193917080760002, -0.010300754569470882, -0.010036208666861057, -0.015189342200756073, -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": "root", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"...
def hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool: if not root: return False if not root.left and not root.right: # reach bottom if root.val == targetSum: return True return False targetSum2 = targetSum - root....
10,427
[ 0.0041773999109864235, -0.0012270899023860693, 0.06590932607650757, -0.030358733609318733, -0.009762067347764969, -0.015220354311168194, 0.0008270261459983885, -0.014359598979353905, 0.03833780437707901, 0.020357565954327583, 0.020699135959148407, -0.02806338295340538, -0.015261342748999596,...
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 UtilTest(unittest.TestCase): @unittest.skip("Enable once BEAM-1080 is fixed.") def test_create_application_client(self): pipeline_options = PipelineOptions() apiclient.DataflowApplicationClient( pipeline_options, DataflowRunner.BATCH_ENVIRONMENT_MAJOR_VERSION) def test_invalid_defa...
10,428
[ 0.025289084762334824, 0.03689642250537872, 0.03601072356104851, 0.0024007149040699005, -0.011921997182071209, 0.014346019364893436, -0.01085565984249115, -0.021186891943216324, 0.028738655149936676, 0.01943879760801792, 0.005343338940292597, -0.033773165196180344, 0.008111152797937393, 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_invalid_default_job_name(self): # Regexp for job names in dataflow. regexp = '^[a-z]([-a-z0-9]{0,61}[a-z0-9])?$' job_name = apiclient.Job._build_default_job_name('invalid.-_user_n*/ame') self.assertRegexpMatches(job_name, regexp) job_name = apiclient.Job._build_default_job_name( '...
10,429
[ 0.011180274188518524, -0.03910823538899422, 0.024928374215960503, -0.009777058847248554, 0.0028050101827830076, -0.03819926828145981, -0.031722892075777054, 0.03233644366264343, 0.07735294848680496, 0.027882512658834457, 0.021417496725916862, -0.05308357626199722, -0.018372461199760437, 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_split_int(self): number = 12345 split_number = apiclient.to_split_int(number) self.assertEqual((split_number.lowBits, split_number.highBits), (number, 0)) shift_number = number << 32 split_number = apiclient.to_split_int(shift_number) self.assertEqual((split_number....
10,430
[ 0.03525594621896744, -0.03342321515083313, 0.02761152945458889, -0.037619203329086304, -0.025200042873620987, 0.015264715068042278, -0.008247287012636662, 0.01757974363863468, -0.008024224080145359, 0.02084730751812458, 0.037763893604278564, -0.00781924743205309, -0.04075413569808006, 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_translate_distribution(self): metric_update = dataflow.CounterUpdate() distribution_update = DistributionData(16, 2, 1, 15) apiclient.translate_distribution(distribution_update, metric_update) self.assertEqual(metric_update.distribution.min.lowBits, distribution_update.min)...
10,431
[ 0.04456847161054611, -0.020774895325303078, 0.011823161505162716, -0.031806573271751404, -0.004120006691664457, 0.0051446398720145226, 0.0052918922156095505, -0.019596874713897705, 0.04064173251390457, 0.007454665843397379, 0.0034911150578409433, -0.02748716250061989, -0.03912012279033661, ...
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_translate_means(self): metric_update = dataflow.CounterUpdate() accumulator = Mock() accumulator.sum = 16 accumulator.count = 2 apiclient.MetricUpdateTranslators.translate_scalar_mean_int(accumulator, metric_update) self.as...
10,432
[ -0.01428450271487236, -0.02594977617263794, -0.01184716448187828, -0.04515746235847473, -0.01729176752269268, -0.06378309428691864, 0.0520450659096241, -0.01786169223487377, 0.022687865421175957, 0.0012580790789797902, 0.026847105473279953, -0.017946574836969376, -0.022251326590776443, -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 setUp(self): super(RenderMenuTagTest, self).setUp() self.placeholder_0 = MenuPlaceholder.objects.create( name='test_menu_placeholder_0' ) self.placeholder_1 = MenuPlaceholder.objects.create( name='test_unicode_äöü_menu_placeholder_1' ) self.men...
10,433
[ 0.0008830398437567055, 0.016412505879998207, 0.04386371001601219, 0.015998274087905884, -0.0017422892851755023, 0.003971579950302839, 0.08293577283620834, -0.0031179282814264297, -0.0011573279043659568, -0.0099751316010952, -0.013109852559864521, 0.008553311228752136, -0.008223045617341995, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class ThumbnailTests(GeoNodeBaseTestSupport): def setUp(self): super(ThumbnailTests, self).setUp() self.rb = ResourceBase.objects.create() def test_initial_behavior(self): self.assertFalse(self.rb.has_thumbnail()) missing = self.rb.get_thumbnail_url() self.assertTrue('m...
10,434
[ -0.006441993173211813, -0.009783880785107613, -0.012413671240210533, -0.0777411162853241, -0.009545410983264446, -0.04634260758757591, 0.010174705646932125, 0.009167834185063839, 0.03081558085978031, -0.00597167806699872, 0.026046186685562134, -0.013215194456279278, 0.0028748842887580395, ...
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_get_menu_placeholder_0(self): template = Template( "{% load base_tags %} {% get_menu 'test_menu_placeholder_0' %}" ) rendered = template.render(Context({})) # menu_placeholder_0 # first menu with ascii chars self.assertIn( self.menu_0_0.ti...
10,435
[ -0.01502828486263752, -0.010837334208190441, -0.013331335037946701, -0.0844360738992691, -0.017612274736166, -0.04088104888796806, 0.011807938106358051, 0.004521983675658703, 0.028513887897133827, -0.0056211440823972225, 0.022381730377674103, -0.014231232926249504, -0.002350981580093503, -...
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_get_menu_placeholder_1(self): template = Template( "{% load base_tags %} {% get_menu 'test_unicode_äöü_menu_placeholder_1' %}" ) rendered = template.render(Context({})) # menu_placeholder_0 # first menu self.assertNotIn( self.menu_0_0.titl...
10,436
[ -0.010946238413453102, -0.007972581312060356, -0.007403548341244459, -0.054480329155921936, 0.00632666889578104, -0.04792115092277527, 0.01014469750225544, -0.01139901764690876, 0.02151312120258808, 0.0005537364631891251, 0.01098295021802187, -0.017058754339814186, 0.00037610484287142754, ...
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_render_nav_menu_placeholder_0(self): template = Template( "{% load base_tags %} {% render_nav_menu 'test_menu_placeholder_0' %}" ) rendered = template.render(Context({})) # menu_placeholder_0 # first menu self.assertIn( self.menu_0_0.title...
10,437
[ -0.013061726465821266, -0.009777741506695747, -0.0084295142441988, -0.058431435376405716, 0.004121989011764526, -0.04583973437547684, 0.010792003944516182, -0.016129253432154655, 0.0190112441778183, 0.008478989824652672, 0.008256346918642521, -0.02225193753838539, -0.0034293218050152063, -...
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_render_nav_menu_placeholder_1(self): template = Template( "{% load base_tags %} {% render_nav_menu 'test_unicode_äöü_menu_placeholder_1' %}" ) rendered = template.render(Context({})) # menu_placeholder_0 # first menu self.assertNotIn( self...
10,438
[ 0.02458382211625576, 0.03011235035955906, 0.07839633524417877, -0.06004343926906586, -0.0029002113733440638, -0.0016908458201214671, 0.0044522774405777454, 0.007811311166733503, 0.024334585294127464, 0.05188659206032753, 0.015849201008677483, -0.0262378491461277, 0.008751614019274712, -0.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 DeleteResourcesCommandTests(GeoNodeBaseTestSupport): def setUp(self): super().setUp() def test_delete_resources_no_arguments(self): args = [] kwargs = {} with self.assertRaises(CommandError) as exception: call_command('delete_resources', *args, **kwargs) ...
10,439
[ 0.05050469562411308, 0.05141664296388626, 0.040712080895900726, -0.05927678942680359, 0.01027572900056839, -0.0057268328964710236, -0.025990592315793037, 0.05115608870983124, 0.03875790163874626, 0.01731620542705059, 0.016208836808800697, -0.04850708693265915, 0.05693177506327629, 0.009684...
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_delete_resources_no_arguments(self): args = [] kwargs = {} with self.assertRaises(CommandError) as exception: call_command('delete_resources', *args, **kwargs) self.assertIn( 'No configuration provided', exception.exception.args[0], ...
10,440
[ 0.046186208724975586, 0.018335286527872086, 0.035734981298446655, -0.06864037364721298, -0.016144635155797005, -0.02196354977786541, -0.024074332788586617, 0.03436582535505295, 0.02108500897884369, 0.03774307668209076, 0.02357230894267559, -0.07005517184734344, 0.044566038995981216, 0.0043...
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_delete_resources_too_many_arguments(self): args = [] kwargs = {'config_path': '/example/config.txt', 'map_filters': "*"} with self.assertRaises(CommandError) as exception: call_command('delete_resources', *args, **kwargs) self.assertIn( 'Too many config...
10,441
[ 0.05715375393629074, 0.046555981040000916, 0.025814034044742584, -0.07880290597677231, 0.023463554680347443, 0.008479250594973564, -0.020401746034622192, 0.03402009233832359, 0.025958361104130745, 0.013608036562800407, 0.012669906951487064, -0.030618082731962204, 0.08230800926685333, 0.013...
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_delete_resource_config_file_not_existing(self): args = [] kwargs = {'config_path': '/example/config.json'} with self.assertRaises(CommandError) as exception: call_command('delete_resources', *args, **kwargs) self.assertIn( 'Specified configuration file ...
10,442
[ 0.06516996771097183, 0.04165176302194595, 0.03963252529501915, -0.07906708866357803, 0.041018277406692505, -0.004780846647918224, -0.006295276340097189, 0.03505954146385193, 0.03895944356918335, 0.021914687007665634, 0.026091741397976875, -0.029536327347159386, 0.044977571815252304, -0.010...
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 test_delete_resource_config_file_empty(self): # create an empty config file config_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'delete_resources_config.json') open(config_file_path, 'a').close() args = [] kwargs = {'config_path': config_file_path} ...
10,443
[ 0.01934272050857544, 0.026627641171216965, 0.08990465104579926, -0.005609124433249235, 0.020056670531630516, 0.010834832675755024, -0.006286714691668749, 0.001698933425359428, 0.018998967483639717, 0.010570406913757324, 0.05552934110164642, -0.022291064262390137, -0.033767130225896835, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class ConfigurationTest(GeoNodeBaseTestSupport): @on_ogc_backend(geoserver.BACKEND_PACKAGE) def test_read_only_whitelist(self): web_client = Client() # set read-only flag config = Configuration.load() config.read_only = True config.maintenance = False config.sav...
10,444
[ 0.022028522565960884, 0.015170234255492687, 0.044280681759119034, 0.02329581417143345, 0.01372899953275919, -0.013393539935350418, -0.037198755890131, 0.03749694302678108, 0.03839150071144104, -0.0006755786016583443, 0.040702447295188904, -0.02954530529677868, -0.012635649181902409, 0.0121...
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_read_only_casual_user_privileges(self): web_client = Client() url_name = 'autocomplete_region' # set read-only flag config = Configuration.load() config.read_only = True config.maintenance = False config.save() # get user user = get_user...
10,445
[ 0.024874921888113022, -0.004300020635128021, 0.018913881853222847, 0.013871835544705391, 0.04463328421115875, -0.02349643036723137, -0.03996380418539047, 0.02953198365867138, 0.021683281287550926, -0.009922646917402744, 0.03410211578011513, -0.02534683793783188, -0.024030441418290138, 0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_read_only_whitelist(self): web_client = Client() # set read-only flag config = Configuration.load() config.read_only = True config.maintenance = False config.save() # post to whitelisted URLs as AnonymousUser for url_name in ReadOnlyMiddleware.W...
10,446
[ 0.01995261386036873, 0.008486256003379822, 0.04271905869245529, -0.006945044733583927, 0.007469440344721079, 0.031949762254953384, -0.007603736594319344, 0.005470981355756521, 0.032793913036584854, 0.005698006134480238, 0.053360454738140106, -0.04934434965252876, 0.00911936815828085, 0.010...
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_maintenance_false(self): web_client = Client() # set read-only flag config = Configuration.load() config.read_only = False config.maintenance = False config.save() # post not whitelisted URL as superuser response = web_client.get('/') s...
10,447
[ 0.022070487961173058, 0.023350315168499947, 0.04377530887722969, 0.010042725130915642, 0.018453016877174377, 0.008795546367764473, -0.027529342100024223, 0.02533535286784172, 0.018139589577913284, 0.025100281462073326, 0.05589449033141136, -0.0215742290019989, -0.008338465355336666, 0.0048...
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_maintenance_whitelist(self): web_client = Client() # set read-only flag config = Configuration.load() config.read_only = False config.maintenance = True config.save() # post to whitelisted URLs as AnonymousUser for url_name in MaintenanceMiddle...
10,448
[ 0.0166391059756279, 0.008288253098726273, 0.03941302374005318, -0.007292911410331726, 0.014773623086512089, 0.029622366651892662, -0.010792257264256477, 0.010892417281866074, 0.027043242007493973, 0.008870434015989304, 0.0572415292263031, -0.0410907045006752, 0.005881279241293669, 0.000766...
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_maintenance_true(self): web_client = Client() # set read-only flag config = Configuration.load() config.read_only = False config.maintenance = True config.save() # post not whitelisted URL as superuser response = web_client.get('/') sel...
10,449
[ 0.02008717507123947, 0.021838251501321793, 0.03633759915828705, -0.016752324998378754, 0.031140141189098358, 0.023154346272349358, -0.06611703336238861, 0.030649393796920776, 0.03611453250050545, -0.013205560855567455, 0.05955886468291283, 0.020499849691987038, 0.0019058278994634748, -0.00...
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_user_has_permissions_restored(self): self.la.is_approved = False self.la.save() l_manager = ManageResourceOwnerPermissions(self.la) l_manager.set_owner_permissions_according_to_workflow() self.assertEqual(self._retrieve_resource_perms_definition(self.la).sort(), ...
10,450
[ 0.018555106595158577, 0.04598388820886612, 0.04731845110654831, -0.027791686356067657, 0.0000313016826112289, 0.01081113051623106, -0.036150265485048294, -0.003989055287092924, 0.03418353945016861, 0.004308062605559826, 0.04169923812150955, -0.004591950215399265, -0.015148459933698177, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_remove_and_add_perms(self): l_manager = ManageResourceOwnerPermissions(self.la) l_manager.set_owner_permissions_according_to_workflow() self.assertEqual(self._retrieve_resource_perms_definition(self.la, ['read', 'download']).sort(), get_perms(self.user, self.la...
10,451
[ 0.007121933624148369, 0.056664612144231796, 0.10391473025083542, 0.020460987463593483, -0.006017284467816353, -0.0020774619188159704, -0.01654198206961155, 0.01775209978222847, 0.034793671220541, 0.011318489909172058, 0.00583410169929266, -0.016408758237957954, 0.045473795384168625, -0.016...
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": "resource", "annotation": null, "type_comment": null}}, {"_type": ...
def _retrieve_resource_perms_definition(self, resource, perm_key_bundle=[]): ret = [] if perm_key_bundle: for key in perm_key_bundle: ret.extend(resource.BASE_PERMISSIONS.get(key, [])) ret.extend(resource.PERMISSIONS.get(key, [])) else: [re...
10,452
[ 0.009361320175230503, 0.018202893435955048, 0.019277822226285934, 0.0001281829026993364, 0.010005095042288303, -0.02130955271422863, 0.025467514991760254, 0.02686137706041336, 0.007105153053998947, -0.010507121682167053, 0.014340242370963097, -0.0014957439852878451, -0.017057092860341072, ...
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): User = get_user_model() self.user = User.objects.create(username='test', email='test@test.com') self.admin = User.objects.create(username='admin', email='test@test.com', is_superuser=True) self.d = Document.objects.create(owner=self.user, title='test', is_approved=True) ...
10,453
[ 0.03348847106099129, 0.004777772352099419, 0.05524338781833649, 0.007641918025910854, 0.022082246840000153, -0.01500686351209879, -0.04882266744971275, -0.008774986490607262, 0.0019214954227209091, -0.02971157617866993, 0.01815427653491497, -0.03064320981502533, -0.012104948982596397, -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 TestOwnerRightsRequestUtils(TestCase): def setUp(self): User = get_user_model() self.user = User.objects.create(username='test', email='test@test.com') self.admin = User.objects.create(username='admin', email='test@test.com', is_superuser=True) self.d = Document.objects.create...
10,454
[ 0.0024624059442430735, 0.022294430062174797, 0.026893334463238716, -0.004490269813686609, 0.037298206239938736, -0.0210390854626894, -0.026796771213412285, -0.01409848127514124, 0.003874668153002858, -0.03906051814556122, 0.01038676593452692, -0.037467196583747864, 0.020628685131669044, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_get_concrete_resource(self): self.assertTrue(isinstance( OwnerRightsRequestViewUtils.get_resource(ResourceBase.objects.get(pk=self.d.id)), Document )) self.assertTrue(isinstance( OwnerRightsRequestViewUtils.get_resource(ResourceBase.objects.get(pk=self.la.id)), ...
10,455
[ -0.009124542586505413, 0.0020838335622102022, 0.008021813817322254, 0.010411059483885765, 0.04696328565478325, -0.007697481196373701, -0.021935658529400826, -0.02192484773695469, 0.045968666672706604, -0.034854888916015625, 0.033644046634435654, -0.03792523220181465, 0.012703006155788898, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestHtmlTagRemoval(SimpleTestCase): def test_not_tags_in_attribute(self): attribute_target_value = "This is not a templated text" r = ResourceBase() filtered_value = r._remove_html_tags(attribute_target_value) self.assertEqual(attribute_target_value, filtered_value) def t...
10,456
[ -0.0007460739579983056, 0.012155056931078434, -0.01317562349140644, 0.01359990332275629, 0.03497445583343506, 0.004348873160779476, -0.0007733081583864987, -0.01900087669491768, 0.05898642912507057, -0.030318841338157654, 0.04190054535865784, 0.01566397026181221, 0.02294553816318512, 0.030...
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_complex_tags_in_attribute(self): tagged_value = """<p style="display:none;" id="test">This is not a templated text<p> <div class="test_css">Something in container</div>""" attribute_target_value = """This is not a templated text Something in container""" r = ResourceBase...
10,457
[ -0.010157543234527111, 0.009222131222486496, 0.04173200950026512, 0.004502029623836279, 0.019855989143252373, 0.041387684643268585, 0.044188182801008224, -0.000006629796644119779, 0.030093874782323837, 0.04517524316906929, -0.008613825775682926, -0.0076267654076218605, -0.022277729585766792,...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "sh"}}, {"_type": ...
class ShellModule(ShellBase): # Common shell filenames that this plugin handles. # Note: sh is the default shell plugin so this plugin may also be selected # if the filename is not listed in any Shell plugin. COMPATIBLE_SHELLS = frozenset(('sh', 'zsh', 'bash', 'dash', 'ksh')) # Family of shells thi...
10,458
[ 0.036755044013261795, 0.05151171609759331, 0.030492568388581276, -0.053606800734996796, 0.003313419409096241, 0.009701145812869072, 0.005869648419320583, -0.022100849077105522, -0.04932554438710213, -0.010851164348423481, 0.08576177060604095, -0.04506705701351166, 0.025118224322795868, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "function", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def teardown_function(function): os.remove(file_name) os.remove(file_name_floats) engine = sqlalchemy.create_engine(url) metadata = sqlalchemy.MetaData() metadata.reflect(engine) for t in metadata.tables: if 'testtable' in t: # pass metadata.tables[t].drop(engine...
10,459
[ -0.007185924332588911, 0.012078087776899338, 0.04821677505970001, -0.0021459213458001614, 0.02824193798005581, 0.03273388743400574, 0.03930455818772316, 0.007604057900607586, 0.03820546343922615, 0.05022381991147995, 0.00980224646627903, 0.024454841390252113, -0.022053560242056847, -0.0078...
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": "path", "annotation": null, "type_comment": null}}, {"_type": "arg...
def checksum(self, path, python_interp): # The following test needs to be SH-compliant. BASH-isms will # not work if /bin/sh points to a non-BASH shell. # # In the following test, each condition is a check and logical # comparison (|| or &&) that sets the rc value. Every check ...
10,460
[ -0.00955310370773077, 0.0323026217520237, 0.04842216148972511, -0.02089609019458294, 0.007826766930520535, -0.025079544633626938, -0.006100429687649012, -0.016617316752672195, -0.06392741948366165, 0.01105702854692936, 0.04774433374404907, -0.00877466332167387, 0.04893052950501442, 0.02306...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_csv_postgres_load(): tbl = 'testtable' engine = sqlalchemy.create_engine(url) if engine.has_table(tbl): metadata = sqlalchemy.MetaData() metadata.reflect(engine) t = metadata.tables[tbl] t.drop(engine) csv = CSV(file_name) sql = resource(url + '::' + tbl,...
10,461
[ -0.013029713183641434, -0.000008898170563043095, 0.04731067270040512, -0.010710673406720161, 0.03569846600294113, -0.023451214656233788, 0.028168674558401108, 0.009950890205800533, 0.008374623954296112, -0.008692145347595215, 0.01363073568791151, 0.007354020141065121, 0.051347728818655014, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_simple_into(): tbl = 'testtable_into_2' csv = CSV(file_name, columns=['a', 'b']) sql = resource(url + '::' + tbl, dshape=csv.dshape) into(sql, csv, if_exists="replace") assert into(list, sql) == [(1, 2), (10, 20), (100, 200)]
10,462
[ -0.006726051215082407, 0.006201119627803564, 0.04035630822181702, -0.013844359666109085, 0.04164844751358032, -0.051777906715869904, 0.020155079662799835, -0.00275012431666255, 0.01464041043072939, 0.010665925219655037, 0.016601694747805595, 0.02935004234313965, 0.030319146811962128, 0.004...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_simple_float_into(): tbl = 'testtable_into_float' csv = CSV(file_name_floats, columns=['a', 'b']) sql = resource(url + '::' + tbl, dshape=csv.dshape) into(sql,csv, if_exists="replace") assert into(list, sql) == \ [(1.02, 2.02), (102.02, 202.02), (1002.02, 2002.02)]
10,463
[ 0.019040923565626144, -0.00813719816505909, 0.05917962267994881, -0.00973697192966938, 0.008197340182960033, -0.007998871617019176, 0.023383166640996933, -0.03711957484483719, 0.009009255096316338, -0.008040971122682095, -0.01746520586311817, -0.001948597258888185, 0.05138523131608963, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_append(): tbl = 'testtable_into_append' csv = CSV(file_name, columns=['a', 'b']) sql = resource(url + '::' + tbl, dshape=csv.dshape) into(sql, csv, if_exists="replace") assert into(list, sql) == [(1, 2), (10, 20), (100, 200)] into(sql, csv, if_exists="append") assert into(list, ...
10,464
[ -0.01384686678647995, 0.004416771698743105, 0.04563615098595619, -0.014213974587619305, 0.01133446954190731, -0.015062913298606873, 0.007537192665040493, 0.005982718430459499, -0.003369939513504505, -0.02186588943004608, 0.012183407321572304, -0.0036624791100621223, 0.06250019371509552, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_tryexcept_into(): tbl = 'testtable_into_2' csv = CSV(file_name, columns=['a', 'b']) sql = resource(url + '::' + tbl, dshape=csv.dshape) into(sql, csv, if_exists="replace", QUOTE="alpha", FORMAT="csv") # uses multi-byte character and # fai...
10,465
[ -0.002455724636092782, 0.025085262954235077, 0.09076004475355148, -0.017510127276182175, 0.016094213351607323, 0.010253571905195713, 0.010501356795430183, -0.012153255753219128, 0.01105592306703329, 0.012589829042553902, 0.016636980697512627, -0.017734313383698463, 0.03480786830186844, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_failing_argument(): tbl = 'testtable_into_2' csv = CSV(file_name, columns=['a', 'b']) sql = resource(url + '::' + tbl, dshape=csv.dshape) into(sql, csv, if_exists="replace", skipinitialspace="alpha")
10,466
[ 0.0024310240987688303, 0.02118651382625103, 0.05679292231798172, -0.031079774722456932, 0.03014644794166088, -0.022061506286263466, 0.005322878248989582, -0.029819784685969353, -0.026553140953183174, -0.00269935536198318, 0.04174303263425827, 0.005477460566908121, 0.05749291554093361, 0.03...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_no_header_no_columns(): tbl = 'testtable_into_2' csv = CSV(file_name) sql = resource(url + '::' + tbl, dshape=csv.dshape) into(sql, csv, if_exists="replace") assert into(list, sql) == [(1, 2), (10, 20), (100, 200)]
10,467
[ 0.003166589420288801, 0.006726732011884451, 0.04778341203927994, -0.003575279377400875, 0.030999882146716118, -0.012545264326035976, 0.03543189540505409, 0.003202917519956827, 0.030903005972504616, -0.002380996709689498, 0.029522543773055077, 0.005167656112462282, 0.02855379693210125, 0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_complex_into(): # data from: http://dummydata.me/generate this_dir = os.path.dirname(__file__) file_name = os.path.join(this_dir, 'dummydata.csv') tbl = 'testtable_into_complex' csv = CSV(file_name, schema='{Name: string, RegistrationDate: date, ZipCode: int64, Consts: float64}') sq...
10,468
[ 0.041921403259038925, 0.02338002622127533, -0.04700401797890663, -0.0019199575763195753, 0.01869385503232479, 0.00883866660296917, -0.002777648624032736, -0.0038221259601414204, -0.021631605923175812, -0.048264507204294205, 0.003565453924238682, 0.005839923862367868, 0.049646977335214615, ...
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": "model_instance", "annotation": null, "type_comment": null}}], "kw...
def get_value_for_datastore(self, model_instance): logger.info("get: Got type " + str(type(model_instance))) cred = super(CredentialsProperty, self).get_value_for_datastore( model_instance) if cred is None: cred = '' else: cred = cred.to_json() ...
10,469
[ 0.057238269597291946, -0.013289641588926315, -0.03973633423447609, -0.022397583350539207, 0.08697932213544846, -0.024498632177710533, -0.02139805629849434, 0.0107398247346282, 0.01050524227321148, -0.03588101267814636, 0.043612051755189896, 0.041939374059438705, 0.009368023835122585, -0.07...
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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul...
def make_value_from_datastore(self, value): logger.info("make: Got type " + str(type(value))) if value is None: return None if len(value) == 0: return None try: credentials = Credentials.new_from_json(value) except ValueError: crede...
10,470
[ 0.02125825174152851, 0.03184935823082924, -0.026830803602933884, 0.03891009837388992, 0.06343801319599152, -0.030632739886641502, -0.0168480072170496, 0.04792611673474312, 0.030871719121932983, 0.04757850989699364, 0.04362449795007706, -0.014371316879987717, 0.024788621813058853, 0.0293943...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request_handler", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment":...
def check_oauth(request_handler, *args, **kwargs): if self._in_error: self._display_error_message(request_handler) return user = users.get_current_user() # Don't use @login_decorator as this could be used in a # POST request. i...
10,471
[ 0.0340406596660614, 0.01744864322245121, -0.01720389351248741, 0.006480778567492962, 0.047807853668928146, 0.03934358060359955, 0.005328413564711809, -0.008275613188743591, 0.017071319743990898, 0.0066031538881361485, 0.033734723925590515, 0.0035922175738960505, 0.010748608969151974, 0.033...
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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul...
def validate(self, value): value = super(CredentialsProperty, self).validate(value) logger.info("validate: Got type " + str(type(value))) if value is not None and not isinstance(value, Credentials): raise db.BadValueError('Property %s must be convertible ' ...
10,472
[ 0.021312469616532326, 0.025744615122675896, -0.024281371384859085, 0.0332304872572422, 0.042497701942920685, -0.039231911301612854, -0.008169780485332012, 0.03988930955529213, 0.04334595799446106, 0.03161880001425743, 0.02795008383691311, -0.024853944778442383, 0.02903161384165287, 0.00918...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request_handler", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment":...
def setup_oauth(request_handler, *args, **kwargs): if self._in_error: self._display_error_message(request_handler) return user = users.get_current_user() # Don't use @login_decorator as this could be used in a # POST request. i...
10,473
[ 0.032477185130119324, 0.019563304260373116, -0.016868537291884422, 0.011315685696899891, 0.033107127994298935, -0.016681887209415436, -0.017930110916495323, 0.058421600610017776, 0.0057161711156368256, 0.036723483353853226, 0.024171236902475357, -0.010901554487645626, -0.009250864386558533, ...
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 get(self): error = self.request.get('error') if error: errormsg = self.request.get('error_description', error) self.response.out.write( 'The authorization request failed: %s' % _safe_html(errormsg...
10,474
[ 0.046906765550374985, 0.01463982556015253, 0.01346397865563631, -0.04266947880387306, -0.02877117693424225, -0.01990465447306633, -0.028326261788606644, -0.05627116933465004, -0.012213978916406631, 0.0011189085198566318, 0.00980931892991066, 0.020805077627301216, -0.009698090143501759, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "plotly_name", "annotat...
class LatsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="latsrc", parent_name="densitymapbox", **kwargs): super(LatsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "n...
10,475
[ 0.027702603489160538, 0.029876792803406715, 0.04558470845222473, -0.042506638914346695, -0.04558470845222473, 0.06459055095911026, 0.021802974864840508, -0.01063887495547533, 0.010919809341430664, -0.020276155322790146, 0.028264472261071205, -0.005246149841696024, 0.012776421383023262, -0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "depends", "ctx": {"_type": "Store", "_fields": {}}}}], "type...
class snapshot_target(catalyst.target.generic.generic_target): depends = () def __init__(self): generic_target.__init__(self) self.required_values = ["version_stamp","target"] self.valid_values = ["version_stamp","target"] def setup(self): self.settings["target_subpath"]="portage" st=self.settings["sto...
10,476
[ 0.031207744032144547, 0.04036273434758186, 0.04488637298345566, -0.0347081795334816, -0.019723616540431976, 0.061823103576898575, 0.01013780478388071, 0.031180817633867264, 0.012258261442184448, 0.012884301133453846, 0.06090760603547096, 0.007815399207174778, 0.009202110581099987, -0.04262...
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 run(self): if "PURGEONLY" in self.settings: self.purge() return if "PURGE" in self.settings: self.purge() self.setup() msg("Creating Portage tree snapshot " + self.settings["version_stamp"] + \ " from " + self.settings["portdir"] + "...") mytmp = self.settings["tmp_path"] if not os.path.e...
10,477
[ 0.0467907190322876, 0.0005305258673615754, 0.05241168290376663, -0.05182933062314987, -0.017318643629550934, 0.03506771847605705, 0.042131904512643814, -0.0075262668542563915, 0.011995186097919941, -0.0241929292678833, 0.0004474457527976483, -0.0015769395977258682, 0.022002778947353363, -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 setup(self): self.settings["target_subpath"]="portage" st=self.settings["storedir"] self.settings["snapshot_path"]=catalyst.util.normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\ +".tar.bz2") self.settings["tmp_path"]=catalyst.util.normpath(st+"/tmp/"+self.settings["target_subpath"]) x...
10,478
[ -0.03193671628832817, 0.07803475111722946, -0.012809106148779392, 0.006379967555403709, -0.008604966104030609, 0.020442940294742584, 0.015046397224068642, -0.007344953250139952, -0.023798877373337746, -0.003749306546524167, -0.018721947446465492, -0.059103824198246, -0.003847649088129401, ...
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": "label", "annotation": ...
class _CollapsibleMotif( IECoreMaya.UIElement ) : def __init__( self, label="", labelVisible=True, labelIndent=0, labelFont = "boldLabelFont", annotation="", collapsed = True, preExpandCommand = None, expandCommand = None, collapseCommand = None, ) : kw = {} if preExpandCommand is not None : ...
10,479
[ 0.006442259065806866, -0.005677769426256418, 0.08610629290342331, -0.051924850791692734, -0.07078023999929428, -0.03157069534063339, 0.012703216634690762, -0.05966039374470711, -0.017634626477956772, 0.03804921358823776, 0.008666228502988815, -0.015845781192183495, -0.02106727473437786, -0...
15
{"_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(): parser = argparse.ArgumentParser( description='Generate Base Map from Recorded Localization and Mobileye Lane Detection') parser.add_argument( '-i', '--input_file', help='Recorded localization and mobileye lane detection in CSV format', type=str, defau...
10,480
[ -0.021523820236325264, 0.04715533182024956, -0.00013253903307486326, 0.007704886607825756, 0.015528492629528046, 0.02312653139233589, -0.027495404705405235, -0.000707122206222266, -0.04447227343916893, 0.009598460048437119, -0.00807291641831398, -0.026759345084428787, 0.025643382221460342, ...
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": "label", "annotation": ...
class _CollapsibleQt( IECoreMaya.UIElement ) : def __init__( self, label="", labelVisible=True, labelIndent=0, labelFont = "boldLabelFont", annotation="", collapsed = True, preExpandCommand = None, expandCommand = None, collapseCommand = None, ) : IECoreMaya.UIElement.__init__( self, maya.cmds....
10,481
[ -0.024133242666721344, 0.07281403243541718, -0.014151091687381268, 0.02114248089492321, -0.01421582605689764, 0.006991390138864517, 0.03208271041512489, 0.014824336394667625, -0.01709006540477276, 0.03112463280558586, -0.0036154550034552813, -0.01987367309629917, 0.019135693088173866, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "label", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__( self, label="", labelVisible=True, labelIndent=0, labelFont = "boldLabelFont", annotation="", collapsed = True, preExpandCommand = None, expandCommand = None, collapseCommand = None, ) : kw = {} if preExpandCommand is not None : kw["preExpandCommand"] = preExpandCommand if ex...
10,482
[ -0.012740775011479855, 0.0646674633026123, -0.018498510122299194, 0.010111725889146328, 0.033689893782138824, 0.007244754582643509, -0.011527367867529392, 0.01887918822467327, 0.02626669593155384, 0.03235752508044243, -0.023102320730686188, -0.0005914616049267352, 0.03566465154290199, 0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "collapsed", "annotation": null, "type_comment": null}}], "kwarg":...
def setCollapsed( self, collapsed ) : maya.cmds.frameLayout( self.__frameLayout, edit=True, collapse=collapsed ) if self.__collapsibleIcon is not None : maya.cmds.iconTextButton( self.__collapsibleIcon, edit = True, image = "arrowRight.xpm" if collapsed else "arrowDown.xpm", )
10,483
[ -0.005617917515337467, 0.05975421145558357, 0.011763965710997581, 0.044084399938583374, -0.005617917515337467, -0.002938089659437537, 0.009790729731321335, 0.01258227787911892, -0.047009434551000595, 0.04981839284300804, -0.010580024681985378, -0.011415747925639153, 0.04220402240753174, 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": "label", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__( self, label="", labelVisible=True, labelIndent=0, labelFont = "boldLabelFont", annotation="", collapsed = True, preExpandCommand = None, expandCommand = None, collapseCommand = None, ) : IECoreMaya.UIElement.__init__( self, maya.cmds.formLayout() ) attachForm = [] attachControl ...
10,484
[ -0.029906317591667175, -0.01860027201473713, 0.0332798957824707, -0.011647963896393776, 0.002827936550602317, 0.024276088923215866, -0.010006763972342014, -0.010981226339936256, -0.008696082979440689, -0.0052712163887917995, 0.029199689626693726, -0.061453837901353836, -0.03154752030968666, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "IntegerField", "value": {"_type": "Name", "_fields": {"id": ...
class Issue(models.Model): num = models.IntegerField() cc = models.ManyToManyField(User, blank=True, related_name='test_issue_cc') client = models.ForeignKey(User, models.CASCADE, related_name='test_issue_client') def __str__(self): return six.text_type(self.num) class Meta: orderi...
10,485
[ 0.0068881153129041195, -0.03177080675959587, -0.0020217534620314837, -0.0018427512841299176, 0.02690860815346241, -0.06371922791004181, 0.008325682953000069, 0.03565612807869911, 0.003888094099238515, 0.062520332634449, -0.008569903671741486, -0.08645389974117279, 0.015086138620972633, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "environ", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start_response", "annotation": null, "type_comment": null}}], ...
def create_app(environ, start_response): routes = [ {'route': '/', 'view': index, 'method': 'GET'}, {'route': '/', 'view': create, 'method': 'POST'}, {'route': '/', 'view': update, 'method': 'PUT'}, {'route': '/', 'view': delete, 'method': 'DELETE'}, {'route': '/foo/bar', 'vi...
10,486
[ 0.047068413347005844, 0.06164443865418434, 0.017938053235411644, -0.03444453328847885, -0.016354646533727646, 0.022297848016023636, -0.0006249579018913209, 0.005932355299592018, -0.06429067999124527, -0.014196440577507019, 0.0079224593937397, -0.03878263756632805, -0.02448858879506588, 0.0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "migrate_engine", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl...
def downgrade(migrate_engine): meta = sqlalchemy.schema.MetaData(migrate_engine) images_table = get_images_table(meta) image_locations_table = get_image_locations_table(meta) image_records = image_locations_table.select().execute().fetchall() for image_location in image_records: images_ta...
10,487
[ 0.05715927481651306, 0.05867120623588562, 0.01889909990131855, -0.020925503224134445, -0.02454783022403717, 0.015948740765452385, 0.0026694978587329388, 0.0048770178109407425, -0.0678267702460289, -0.02011704072356224, 0.0270887091755867, -0.02211194671690464, -0.03706323355436325, 0.01637...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "migrate_engine", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl...
def upgrade(migrate_engine): meta = sqlalchemy.schema.MetaData(migrate_engine) images_table = get_images_table(meta) image_locations_table = get_image_locations_table(meta) image_records = images_table.select().execute().fetchall() for image in image_records: if image.location is not None:...
10,488
[ 0.020211398601531982, 0.00910737831145525, -0.023469721898436546, -0.030892817303538322, 0.005022226367145777, 0.02392294630408287, 0.007625209633260965, -0.014086732640862465, 0.0028847178909927607, 0.02261226810514927, 0.031137803569436073, 0.007784450892359018, -0.0025876713916659355, -...
12
{"_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 decorator(f): @functools.wraps(f) def wrapper(*args, **kw): if type(key_fn) is str: cache_key = key_fn else: cache_key = key_fn(*args, **kw) out = memcache.get(cache_key) if out is None: context = f(*arg...
10,489
[ 0.03568157181143761, -0.025316601619124413, 0.04892444610595703, -0.026193466037511826, 0.041437387466430664, -0.011545360088348389, 0.01907738670706749, 0.0017284314380958676, -0.011860131286084652, 0.025316601619124413, -0.008470719680190086, 0.01492915116250515, 0.023990066722035408, 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 TestDistanceFile(unittest.TestCase): def test_original_file_format(self): distance_file = DistanceFile("test") distance_file.original_file_format = "pdb" distogram = Distogram("test") distance_file.add(distogram) self.assertTrue(distogram in distance_file.child_list) ...
10,490
[ 0.04518602415919304, 0.0029206646140664816, 0.011602976359426975, -0.01842501200735569, 0.006068117450922728, 0.014698329381644726, 0.014428635127842426, -0.06565825641155243, -0.013276305980980396, 0.011731693521142006, 0.009629305452108383, -0.03162776306271553, 0.04626479744911194, 0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "submission", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "extra_class", "annotation": null, "type_comment": null}}, {...
def submission_thumb(submission, extra_class=None, thumb_width="200", thumb_height="150", is_homepage=False): vars = locals() flags = submission.get_flags() # Dict of metadata associated with flags for demos # TODO: Move to a constant or DB table? Too much view stuff here? fla...
10,491
[ 0.0010185027495026588, 0.009533185511827469, -0.016552124172449112, -0.032429128885269165, 0.0069083585403859615, 0.004187501035630703, 0.026236630976200104, 0.015388121828436852, 0.0045308819971978664, -0.018996531143784523, 0.027773113921284676, 0.01805368810892105, 0.0038004701491445303, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kw", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": nu...
def wrapper(*args, **kw): if type(key_fn) is str: cache_key = key_fn else: cache_key = key_fn(*args, **kw) out = memcache.get(cache_key) if out is None: context = f(*args, **kw) t = jingo.env.get_template(te...
10,492
[ -0.0006354114739224315, 0.00005445190618047491, 0.022258341312408447, -0.042496439069509506, -0.0051635075360536575, 0.01727903261780739, 0.04734502732753754, 0.007682871539145708, 0.0038978836964815855, -0.010142816230654716, 0.02367251366376877, -0.00867516826838255, 0.00382361002266407, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kw", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": nu...
def submission_listing_cache_key(*args, **kw): ns_key = memcache.get(DEMOS_CACHE_NS_KEY) if ns_key is None: ns_key = random.randint(1, 10000) memcache.set(DEMOS_CACHE_NS_KEY, ns_key) full_path = args[0].get_full_path() username = args[0].user.username return 'demos_%s:%s' % ( ...
10,493
[ 0.02230902388691902, -0.00827697105705738, -0.0828128233551979, -0.00646099541336298, -0.03912162408232689, 0.019172828644514084, 0.016704825684428215, -0.026425955817103386, 0.03157750889658928, -0.016079740598797798, 0.00030395371140912175, 0.0197871346026659, 0.028085660189390182, -0.02...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tag", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def tag_title(tag): if not tag: return '' name = (isinstance(tag, basestring)) and tag or tag.name if name in TAG_DESCRIPTIONS: return TAG_DESCRIPTIONS[name]['title'] else: return name
10,494
[ 0.0009028198546729982, -0.0212508887052536, -0.09285393357276917, 0.0056662000715732574, -0.030261941254138947, 0.004748212639242411, -0.0016513228183612227, -0.014191878959536552, 0.03663509711623192, -0.009369805455207825, -0.03087393194437027, -0.028784718364477158, 0.01371705811470747, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tag", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def tag_description(tag): if not tag: return '' name = (isinstance(tag, basestring)) and tag or tag.name if name in TAG_DESCRIPTIONS and 'description' in TAG_DESCRIPTIONS[name]: return TAG_DESCRIPTIONS[name]['description'] else: return name
10,495
[ 0.015477308072149754, -0.03477064520120621, -0.022363217547535896, -0.02013542316854, 0.04257325455546379, 0.04157128185033798, 0.011021719314157963, -0.016244778409600258, -0.022363217547535896, 0.019463887438178062, -0.03997238725423813, 0.0326601043343544, 0.011746551841497421, -0.06493...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "timestamp", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "to", "annotation": null, "type_comment": null}}], "kwarg": n...
def date_diff(timestamp, to=None): if not timestamp: return "" compare_with = to or datetime.date.today() delta = timestamp - compare_with if delta.days == 0: return u"today" elif delta.days == -1: return u"yesterday" elif delta.days == 1: return u"tomorrow" ...
10,496
[ 0.008503003977239132, -0.02745787613093853, 0.01626121997833252, -0.010482900775969028, 0.010284289717674255, -0.01006705965846777, -0.04230399429798126, 0.015218514949083328, 0.01616191305220127, 0.024205630645155907, -0.013294477947056293, -0.03368927538394928, -0.016931528225541115, 0.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 BanUser(TestCase): def setUp(self): # Set up some banned users self.banned_usernames = ['deanj', 'r1cky', 'mythmon'] for username in self.banned_usernames: twitter_account(username=username, banned=True, save=True) # Now a few normal users self.normal_user...
10,497
[ 0.01869027502834797, -0.02811613492667675, 0.01782095991075039, -0.002347150817513466, -0.019435403868556023, -0.006377047393471003, -0.007941815070807934, 0.025110788643360138, -0.0017168974736705422, 0.00724636297672987, -0.01690196990966797, -0.01942298375070095, -0.013399871997535229, ...
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): # Set up some banned users self.banned_usernames = ['deanj', 'r1cky', 'mythmon'] for username in self.banned_usernames: twitter_account(username=username, banned=True, save=True) # Now a few normal users self.normal_usernames = ['willkg', 'marcell', ...
10,498
[ 0.028556762263178825, -0.030479302629828453, 0.010702923871576786, 0.004331578034907579, 0.017689717933535576, 0.0018580651376396418, -0.0491420142352581, 0.036645498126745224, 0.014970026910305023, 0.036293815821409225, -0.006312732584774494, -0.048813775181770325, -0.008880027569830418, ...
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 test_multiple_unban_account(self): data = {'usernames': self.banned_usernames[1:]} self.client.post(reverse('customercare.api.unban'), data=json.dumps(data), content_type='application/json') num_banned = TwitterAccount.objects.filter(banned=...
10,499
[ 0.03912581875920296, -0.0421464741230011, 0.005749949254095554, 0.0028526766691356897, 0.017184440046548843, -0.002106431871652603, -0.05275444686412811, 0.04535740986466408, 0.021525146439671516, 0.02725725807249546, -0.008758713491261005, -0.03691384196281433, -0.006112665869295597, 0.03...
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 test_single_unban_account(self): data = {'usernames': self.banned_usernames[:1]} self.client.post(reverse('customercare.api.unban'), data=json.dumps(data), content_type='application/json') num_banned = TwitterAccount.objects.filter(banned=Tr...
10,500
[ -0.009317715652287006, -0.022838367149233818, 0.0028774410020560026, -0.01687213033437729, 0.030000265687704086, -0.003152201883494854, 0.0023007451090961695, 0.023913254961371422, -0.0011699983151629567, 0.019782783463597298, -0.008327368646860123, -0.007928814738988876, -0.0130919031798839...
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 IgnoreUser(TestCase): def setUp(self): # Set up some ignored users self.ignored_usernames = ['deanj', 'r1cky', 'mythmon'] for username in self.ignored_usernames: twitter_account(username=username, ignored=True, save=True) # Now a few normal users self.norm...