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
901
[ 0.004820710048079491, 0.009629817679524422, -0.0031093868892639875, 0.002200065180659294, 0.04251042380928993, 0.005925818346440792, -0.030931437388062477, -0.02369167096912861, -0.021672891452908516, -0.03747507184743881, -0.007437003776431084, -0.03329828381538391, 0.08367499709129333, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Repositories"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class RepositoryPane(TraitsDockPane): name = 'Repositories' id = 'pychron.pipeline.repository' def traits_view(self): v = View(UItem('object.repositories', editor=myTabularEditor(adapter=RepositoryTabularAdapter(), editable=False,...
902
[ -0.003960148897022009, 0.037511322647333145, 0.007752836681902409, 0.01709345355629921, 0.03850368782877922, -0.002484008902683854, -0.002490211045369506, -0.015356818214058876, -0.013372092507779598, 0.006171257700771093, 0.024585794657468796, -0.028108684346079826, 0.07437761127948761, -...
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 traits_view(self): v = View(UItem('object.repositories', editor=myTabularEditor(adapter=RepositoryTabularAdapter(), editable=False, multi_select=True, ...
903
[ 0.020222187042236328, 0.025244252756237984, -0.022588137537240982, -0.018715566024184227, 0.012030638754367828, 0.00373306917026639, -0.01828031986951828, -0.017666513100266457, -0.030690403655171394, -0.02401663549244404, -0.013447976671159267, -0.041337184607982635, 0.07008572667837143, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Editor Options"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n...
class EditorOptionsPane(TraitsDockPane): name = 'Editor Options' id = 'pychron.pipeline.editor_options' def traits_view(self): v = View(UItem('object.active_editor_options', style='custom', editor=InstanceEditor())) return v
904
[ 0.025581760331988335, 0.0360039584338665, -0.020000915974378586, 0.01588749699294567, 0.03697454184293747, -0.011173243634402752, -0.05670969933271408, 0.01894945092499256, 0.014084989205002785, 0.012929534539580345, 0.0007369632367044687, -0.04508582875132561, 0.044739194214344025, 0.0042...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Search"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class SearcherPane(TraitsDockPane): name = 'Search' id = 'pychron.browser.searcher.pane' add_search_entry_button = Button def _add_search_entry_button_fired(self): self.model.add_search_entry() def traits_view(self): v = View(VGroup(HGroup(UItem('search_entry'), ...
905
[ -0.025861041620373726, 0.04577452689409256, 0.006212429143488407, -0.0396343357861042, -0.02301969937980175, -0.02981002815067768, -0.059571899473667145, -0.011395473033189774, -0.008945416659116745, 0.035709429532289505, 0.031158462166786194, -0.03616693243384361, 0.014303034171462059, -0...
13
{"_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 index(request): header = None filters = {} for f in AVAILABLE_FILTERS: value = request.GET.get(f) if value: filters[f] = value if 'source' in filters: if filters['source'] != BearingSource.SWIVEL.value: if filters['source'] != BearingSource.ROLLING.v...
906
[ 0.006718261633068323, 0.05005713552236557, 0.024439359083771706, 0.004114855080842972, 0.019597599282860756, 0.0077237593941390514, -0.011316652409732342, -0.015216958709061146, 0.012936976738274097, 0.0355062372982502, 0.013667083345353603, -0.03755566105246544, 0.06732351332902908, -0.01...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def traits_view(self): v = View(VGroup(HGroup(UItem('search_entry'), UItem('search_entry', editor=myEnumEditor(name='search_entries'), width=-35), icon_button_editor('pane.add_search_entry_button', 'add')), UItem('object.analy...
907
[ -0.007210555020719767, 0.06481198966503143, -0.004925091285258532, 0.009667566977441311, -0.03800620883703232, -0.025721151381731033, 0.010652584955096245, -0.037187207490205765, -0.0355270616710186, -0.016800647601485252, 0.018693210557103157, -0.03116641938686371, 0.03774058818817139, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Bearing", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "ty...
class BearingView(DetailView): model = Bearing context_object_name = 'item' def get_context_data(self, **kwargs): context = super(BearingView, self).get_context_data(**kwargs) context['swivel_source'] = BearingSource.SWIVEL.value context['default_gost'] = DefaultISO.ROLLING.label ...
908
[ 0.005719373002648354, 0.017729511484503746, 0.015443939715623856, -0.015160963870584965, -0.03743985295295715, -0.02725272998213768, 0.033108148723840714, 0.006927461363375187, 0.01307129766792059, -0.00039521357393823564, 0.03465363010764122, 0.006889368407428265, 0.06456197798252106, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def unpack(args): kms_client = get_client(profile=args.profile, region=args.region) context = None if args.encryption_context: context = parse_kv(args.encryption_context) try: files.unpack(kms_client, args.source_path, '.', context) except EncryptionError as e: print(e, file=...
909
[ 0.042442481964826584, -0.018272271379828453, 0.0015042581362649798, -0.029807278886437416, 0.00260019744746387, 0.04741036146879196, -0.01206809189170599, -0.0144499521702528, 0.0007769401418045163, -0.015402696095407009, -0.0029886674601584673, 0.0035557770170271397, -0.03479784354567528, ...
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 TestTimestampSigner(TestCase): def test_timestamp_signer(self): value = 'hello' _time = time.time time.time = lambda: 123456789 try: signer = signing.TimestampSigner('predictable-key') ts = signer.sign(value) self.assertNotEqual(ts, ...
910
[ 0.03561466187238693, -0.0024974781554192305, 0.027518263086676598, -0.02526266686618328, 0.018460266292095184, 0.03751411288976669, -0.010268894024193287, 0.034308791160583496, 0.036398183554410934, 0.03815517574548721, -0.011735031381249428, -0.03245683014392853, 0.05555887520313263, 0.02...
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 cli(): common_args = ArgumentParser(add_help=False, description=__doc__) common_args.add_argument('--profile', help='AWS client profile') common_args.add_argument('--region', help='AWS region') common_args.add_argument('-c', '--encryption-context', help='key=val,key=val'...
911
[ 0.01722041517496109, -0.0405811108648777, -0.04670014977455139, 0.03320852294564247, 0.014617699198424816, 0.0007369933882728219, 0.017581608146429062, 0.003821742255240679, -0.011218233965337276, 0.019366327673196793, 0.03390966355800629, -0.01113324798643589, 0.028194312006235123, -0.016...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "actual", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "target", "annotation": null, "type_comment": null}}], "kwarg": ...
def assert_state_equal(actual, target): for key in actual: if isinstance(actual[key], dict): assert_state_equal(actual[key], target[key]) elif isinstance(actual[key], np.ndarray): assert_array_equal(actual[key], target[key]) else: assert actual[key] == tar...
912
[ 0.059649236500263214, -0.02088911458849907, -0.0013553268508985639, -0.027662036940455437, 0.0007671521743759513, 0.033151667565107346, -0.0033389313612133265, -0.005177719984203577, 0.003050785046070814, -0.018453240394592285, 0.024121105670928955, 0.02942061983048916, -0.04522410035133362,...
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_timestamp_signer(self): value = 'hello' _time = time.time time.time = lambda: 123456789 try: signer = signing.TimestampSigner('predictable-key') ts = signer.sign(value) self.assertNotEqual(ts, signing.Signer('predictable-key')....
913
[ -0.02237274870276451, -0.036873605102300644, 0.02377409115433693, -0.05147194489836693, -0.005151459481567144, -0.0604405403137207, -0.022531161084771156, -0.02491953782737255, 0.0006069948431104422, 0.018436802551150322, -0.010199340991675854, 0.015341660939157009, -0.006915323901921511, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def gauss_from_uint(x, n, bits): if bits in (64, 63): doubles = uniform_from_uint64(x) elif bits == 32: doubles = uniform_from_uint32(x) else: # bits == 'dsfmt' doubles = uniform_from_dsfmt(x) gauss = [] loc = 0 x1 = x2 = 0.0 while len(gauss) < n: r2 = 2 ...
914
[ 0.0031025654170662165, -0.021302316337823868, 0.02752353623509407, -0.02681560441851616, 0.0033144087065011263, -0.03651212900876999, -0.027931133285164833, -0.021956617012619972, 0.027416273951530457, 0.0034592130687087774, 0.014308806508779526, 0.030913028866052628, 0.015842659398913383, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bits", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def uniform32_from_uint(x, bits): if bits == 64: return uniform32_from_uint64(x) elif bits == 53: return uniform32_from_uint53(x) elif bits == 32: return uniform32_from_uint32(x) else: raise NotImplementedError
915
[ 0.018275845795869827, -0.05778513848781586, 0.058303602039813995, -0.03174411877989769, -0.021480895578861237, -0.02317768521606922, 0.02523975633084774, 0.0023787468671798706, 0.013421140611171722, -0.009656387381255627, 0.035915397107601166, -0.003101944923400879, -0.0059328749775886536, ...
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_raw(self): bit_generator = self.bit_generator(*self.data1['seed']) uints = bit_generator.random_raw(1000) assert_equal(uints, self.data1['data']) bit_generator = self.bit_generator(*self.data1['seed']) uints = bit_generator.random_raw() assert_equal(uints, self....
916
[ -0.006270843092352152, 0.04425987973809242, 0.009421863593161106, -0.052038636058568954, 0.04542461410164833, -0.00461213756352663, 0.003512399969622493, -0.004401549231261015, -0.035649169236421585, 0.045216627418994904, 0.014413579367101192, -0.044592659920454025, 0.01958208531141281, 0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}], "kwarg": n...
def _read_csv(cls, filename): with open(filename) as csv: seed = csv.readline() seed = seed.split(',') seed = [int(s.strip(), 0) for s in seed[1:]] data = [] for line in csv: data.append(int(line.split(',')[-1].strip(), 0)) ...
917
[ -0.01259886659681797, -0.05042024329304695, 0.04734795168042183, -0.0300787091255188, -0.027551503852009773, -0.04098038375377655, -0.01611713506281376, -0.00922306440770626, 0.011991841718554497, 0.024912802502512932, 0.006178647745400667, -0.01686042919754982, -0.005893717519938946, 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_gauss_inv(self): n = 25 rs = RandomState(self.bit_generator(*self.data1['seed'])) gauss = rs.standard_normal(n) assert_allclose(gauss, gauss_from_uint(self.data1['data'], n, self.bits)) rs = RandomState(self.bit_generator(*self.data2['seed'])) ...
918
[ 0.007634212262928486, -0.04492556303739548, 0.06425512582063675, -0.028464103117585182, -0.03015122190117836, -0.007682415656745434, 0.007423322647809982, -0.0037026230711489916, 0.03644176572561264, 0.015979424118995667, 0.006046513095498085, 0.009791314601898193, -0.017859356477856636, 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 test_uniform_double(self): rs = Generator(self.bit_generator(*self.data1['seed'])) vals = uniform_from_uint(self.data1['data'], self.bits) uniforms = rs.random(len(vals)) assert_allclose(uniforms, vals) assert_equal(uniforms.dtype, np.float64) rs = Generator(self.bit...
919
[ 0.0189143568277359, 0.010515452362596989, 0.004242272581905127, -0.03753508999943733, 0.021703796461224556, 0.020871859043836594, -0.012784930877387524, 0.020786218345165253, -0.00244840607047081, -0.027184801176190376, 0.021422406658530235, -0.004918222315609455, 0.01732388697564602, 0.02...
10
{"_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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class TestPhilox(Base): @classmethod def setup_class(cls): cls.bit_generator = Philox cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv( join(pwd, './data/philox-testset-1.csv')) cls.data2 = cls._read_csv( join(pwd, './data/philox-tests...
920
[ -0.002983112819492817, -0.04272068291902542, 0.06516633182764053, -0.029148338362574577, -0.019153941422700882, -0.032392341643571854, 0.011992083862423897, -0.010000360198318958, 0.039023470133543015, 0.029529985040426254, 0.013894358649849892, 0.007943041622638702, -0.016649378463625908, ...
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_uniform_float(self): rs = Generator(self.bit_generator(*self.data1['seed'])) vals = uniform32_from_uint(self.data1['data'], self.bits) uniforms = rs.random(len(vals), dtype=np.float32) assert_allclose(uniforms, vals) assert_equal(uniforms.dtype, np.float32) rs =...
921
[ 0.02511770650744438, 0.008290654048323631, 0.051244258880615234, -0.008523465134203434, -0.005771769676357508, 0.03898288682103157, -0.004675618372857571, 0.00004799703310709447, 0.015145640820264816, 0.01699519343674183, 0.06575613468885422, -0.02946350909769535, 0.01265585795044899, 0.02...
11
{"_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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class TestPCG64(Base): @classmethod def setup_class(cls): cls.bit_generator = PCG64 cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv(join(pwd, './data/pcg64-testset-1.csv')) cls.data2 = cls._read_csv(join(pwd, './data/pcg64-testset-2.csv')) cls.seed_e...
922
[ 0.012793367728590965, 0.015259264968335629, 0.026538914069533348, -0.0496109239757061, -0.0024170675314962864, 0.0025177786592394114, 0.012707916088402271, -0.009900211356580257, -0.006695765536278486, -0.003332623513415456, 0.025025194510817528, -0.012976478785276413, 0.006811735685914755, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def setup_class(cls): cls.bit_generator = Philox cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv( join(pwd, './data/philox-testset-1.csv')) cls.data2 = cls._read_csv( join(pwd, './data/philox-testset-2.csv')) cls.seed_error_type = Typ...
923
[ 0.008018975146114826, 0.017686938866972923, 0.05667638033628464, -0.04179883003234863, -0.017405999824404716, 0.007933471351861954, 0.040333062410354614, 0.008892328478395939, -0.008525886572897434, 0.025944100692868233, 0.04253171384334564, -0.014083591289818287, 0.015366138890385628, 0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def setup_class(cls): cls.bit_generator = PCG64 cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv(join(pwd, './data/pcg64-testset-1.csv')) cls.data2 = cls._read_csv(join(pwd, './data/pcg64-testset-2.csv')) cls.seed_error_type = (ValueError, TypeError) ...
924
[ 0.029847579076886177, -0.03532465919852257, 0.05019820109009743, -0.003170363139361143, -0.03771146014332771, 0.010973005555570126, 0.016933728009462357, -0.009459271095693111, 0.009823571890592575, 0.0180517565459013, 0.028993355110287666, -0.05456981807947159, -0.0052415416575968266, 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 test_advance_symmetry(self): rs = Generator(self.bit_generator(*self.data1['seed'])) state = rs.bit_generator.state step = -0x9e3779b97f4a7c150000000000000000 rs.bit_generator.advance(step) val_neg = rs.integers(10) rs.bit_generator.state = state rs.bit_genera...
925
[ 0.03801671415567398, 0.014602705836296082, 0.05103756859898567, -0.003905602963641286, -0.0006912426906637847, 0.0452069453895092, -0.009288471192121506, -0.009634910151362419, 0.0182501133531332, 0.008615204133093357, 0.06337861716747284, -0.03644793480634689, 0.011399785056710243, 0.0242...
11
{"_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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class TestPCG64DXSM(Base): @classmethod def setup_class(cls): cls.bit_generator = PCG64DXSM cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv(join(pwd, './data/pcg64dxsm-testset-1.csv')) cls.data2 = cls._read_csv(join(pwd, './data/pcg64dxsm-testset-2.csv')) ...
926
[ 0.021039864048361778, -0.05920929089188576, 0.06640749424695969, 0.002927653258666396, -0.03444854915142059, 0.014274634420871735, -0.00704260403290391, 0.016615403816103935, 0.03891360014677048, 0.04383868724107742, 0.06245660036802292, -0.02542373351752758, -0.0367487296462059, 0.0255590...
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_advange_large(self): rs = Generator(self.bit_generator(38219308213743)) pcg = rs.bit_generator state = pcg.state["state"] initial_state = 287608843259529770491897792873167516365 assert state["state"] == initial_state pcg.advance(sum(2**i for i in (96, 64, 32, 16,...
927
[ 0.029847579076886177, -0.03532465919852257, 0.05019820109009743, -0.003170363139361143, -0.03771146014332771, 0.010973005555570126, 0.016933728009462357, -0.009459271095693111, 0.009823571890592575, 0.0180517565459013, 0.028993355110287666, -0.05456981807947159, -0.0052415416575968266, 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 test_advance_symmetry(self): rs = Generator(self.bit_generator(*self.data1['seed'])) state = rs.bit_generator.state step = -0x9e3779b97f4a7c150000000000000000 rs.bit_generator.advance(step) val_neg = rs.integers(10) rs.bit_generator.state = state rs.bit_genera...
928
[ 0.019337406381964684, 0.024095119908452034, 0.05208960548043251, -0.03963126242160797, -0.010674200020730495, 0.01031859777867794, 0.03141562268137932, 0.0014883182011544704, -0.0031299132388085127, 0.017914997413754463, 0.03936149552464485, -0.015499355271458626, 0.015339947305619717, 0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def setup_class(cls): cls.bit_generator = PCG64DXSM cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv(join(pwd, './data/pcg64dxsm-testset-1.csv')) cls.data2 = cls._read_csv(join(pwd, './data/pcg64dxsm-testset-2.csv')) cls.seed_error_type = (ValueError, TypeErr...
929
[ 0.020592615008354187, -0.05973062664270401, 0.06545748561620712, 0.0031410763040184975, -0.03513723611831665, 0.013132976368069649, -0.006372470874339342, 0.016645362600684166, 0.03727811947464943, 0.04651067405939102, 0.06251377612352371, -0.0235898494720459, -0.03674289956688881, 0.02487...
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_advange_large(self): rs = Generator(self.bit_generator(38219308213743)) pcg = rs.bit_generator state = pcg.state initial_state = 287608843259529770491897792873167516365 assert state["state"]["state"] == initial_state pcg.advance(sum(2**i for i in (96, 64, 32, 16,...
930
[ -0.030312303453683853, -0.026483381167054176, 0.02891327440738678, -0.03168679028749466, 0.016849713400006294, 0.012266051955521107, 0.017659679055213928, 0.00855371542274952, 0.012253779917955399, 0.023390790447592735, 0.02677791379392147, -0.01277534756809473, 0.02717062458395958, 0.0399...
11
{"_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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class TestMT19937(Base): @classmethod def setup_class(cls): cls.bit_generator = MT19937 cls.bits = 32 cls.dtype = np.uint32 cls.data1 = cls._read_csv(join(pwd, './data/mt19937-testset-1.csv')) cls.data2 = cls._read_csv(join(pwd, './data/mt19937-testset-2.csv')) cl...
931
[ -0.018204424530267715, -0.08099406212568283, 0.024649320170283318, -0.022448917850852013, -0.029002029448747635, -0.02669340930879116, 0.003174351528286934, 0.0059368787333369255, 0.02556314878165722, 0.022533085197210312, 0.021739497780799866, -0.0010318144923076034, 0.0034238507505506277, ...
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_state_tuple(self): rs = Generator(self.bit_generator(*self.data1['seed'])) bit_generator = rs.bit_generator state = bit_generator.state desired = rs.integers(2 ** 16) tup = (state['bit_generator'], state['state']['key'], state['state']['pos']) bit_...
932
[ -0.013762014918029308, -0.008890102617442608, 0.04022742807865143, -0.05495699495077133, -0.00869659148156643, 0.006818401161581278, 0.0534999743103981, 0.004063721746206284, -0.012987973168492317, 0.02863956056535244, 0.025566158816218376, -0.017620842903852463, 0.006687496788799763, 0.03...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def setup_class(cls): cls.bit_generator = MT19937 cls.bits = 32 cls.dtype = np.uint32 cls.data1 = cls._read_csv(join(pwd, './data/mt19937-testset-1.csv')) cls.data2 = cls._read_csv(join(pwd, './data/mt19937-testset-2.csv')) cls.seed_error_type = ValueError cls.inv...
933
[ 0.0013509311247617006, 0.0026530867908149958, 0.0566149540245533, -0.054628461599349976, -0.011930761858820915, 0.0024047757033258677, 0.036560866981744766, -0.0015282962704077363, -0.013739886693656445, 0.02558787725865841, 0.0310980211943388, -0.020799018442630768, -0.009453562088310719, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def setup_class(cls): cls.bit_generator = SFC64 cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv( join(pwd, './data/sfc64-testset-1.csv')) cls.data2 = cls._read_csv( join(pwd, './data/sfc64-testset-2.csv')) cls.seed_error_type = (Value...
934
[ -0.007932564243674278, 0.022281529381871223, 0.05560072511434555, -0.041191112250089645, 0.009442661888897419, 0.012711509130895138, 0.008478382602334023, 0.014300447888672352, -0.02527746744453907, 0.008005339652299881, 0.03194858506321907, -0.013888051733374596, 0.013463526032865047, 0.0...
8
{"_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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class TestSFC64(Base): @classmethod def setup_class(cls): cls.bit_generator = SFC64 cls.bits = 64 cls.dtype = np.uint64 cls.data1 = cls._read_csv( join(pwd, './data/sfc64-testset-1.csv')) cls.data2 = cls._read_csv( join(pwd, './data/sfc64-testset-2...
935
[ 0.04123993590474129, -0.0007265352760441601, 0.04381169006228447, -0.0028013763949275017, 0.01257175114005804, -0.004615382757037878, 0.009380018338561058, 0.004563717637211084, 0.04360503330826759, -0.037382300943136215, 0.03933408111333847, -0.014844998717308044, 0.009890925139188766, -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": "resources", "annotation": null, "type_comment": null}}, {"_type":...
def process(self, resources, event=None): session = utils.local_session(self.manager.session_factory) subscription_id = session.get_subscription_id() message = { 'event': event, 'account_id': subscription_id, 'account': subscription_id, 'region': '...
936
[ 0.018418200314044952, 0.003972040954977274, 0.05491803586483002, -0.00785703957080841, 0.030963929370045662, 0.00017118365212809294, -0.010108538903295994, 0.01796557940542698, 0.01436782069504261, -0.03237982094287872, 0.010491526685655117, -0.027412595227360725, 0.008623013272881508, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestDefaultRNG: def test_seed(self): for args in [(), (None,), (1234,), ([1234, 5678],)]: rg = default_rng(*args) assert isinstance(rg.bit_generator, PCG64) def test_passthrough(self): bg = Philox() rg = default_rng(bg) assert rg.bit_generator is bg...
937
[ -0.0017608572961762547, -0.05767562612891197, -0.005996976979076862, 0.01739726960659027, 0.0771154910326004, -0.0038990413304418325, 0.03153444081544876, 0.037450920790433884, -0.02465200237929821, -0.0447559617459774, 0.028998805209994316, 0.017477767542004585, -0.0038487310521304607, -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": "queue_uri", "annotation": null, "type_comment": null}}, {"_type":...
def send_to_azure_queue(self, queue_uri, message, session): try: queue_service, queue_name = StorageUtilities.get_queue_client_by_uri(queue_uri, session) return StorageUtilities.put_queue_message( queue_service, queue_name, self.pack(messag...
938
[ 0.0013350825756788254, -0.006259980145841837, -0.02885633520781994, -0.011714272201061249, -0.015838120132684708, -0.02064044214785099, -0.0012529236264526844, -0.02605763077735901, -0.021986788138747215, 0.053896255791187286, 0.009821967221796513, 0.02336493879556656, -0.026842115446925163,...
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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class CustomFormatter(optparse.IndentedHelpFormatter): def __init__(self, *args, **kwargs): optparse.IndentedHelpFormatter.__init__(self, *args, **kwargs) # taken and modified from from optparse.py's format_option def format_option_preserve_nl(self, option): # The help f...
939
[ -0.0049082753248512745, 0.025411441922187805, 0.0018160894978791475, -0.018296238034963608, -0.022008519619703293, -0.02510208636522293, -0.011214179918169975, -0.02839452587068081, -0.01215329859405756, 0.06805847585201263, -0.0047204517759382725, 0.004463575314730406, -0.030294859781861305...
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": "option", "annotation": null, "type_comment": null}}], "kwarg": nu...
def format_option_preserve_nl(self, option): # The help for each option consists of two parts: # * the opt strings and metavars # eg. ("-x", or "-fFILENAME, --file=FILENAME") # * the user-supplied help string # eg. ("turn on expert mode", "read dat...
940
[ 0.009770488366484642, -0.009535728022456169, -0.0008000006200745702, -0.03666727617383003, -0.033447712659835815, -0.01097782514989376, 0.003364893374964595, -0.001699215266853571, -0.0072440230287611485, 0.012531712651252747, 0.017416957765817642, -0.014789880253374577, -0.0210725050419569,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vehicle", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def do_build_parameters(vehicle): # build succeeded # now build parameters progress("Building fresh parameter descriptions") param_parse_path = os.path.join( find_root_dir(), "Tools/autotest/param_metadata/param_parse.py") cmd_param_build = ["python", param_parse_path, '--vehicle', vehicle] ...
941
[ 0.005483698099851608, 0.0134847741574049, -0.006913150195032358, 0.037633977830410004, -0.019918685778975487, 0.043693311512470245, 0.0265729371458292, 0.024303441867232323, 0.03128820285201073, 0.025537341833114624, 0.0531458742916584, 0.06288488209247589, -0.0006534441490657628, 0.021328...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "what", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cmd", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def run_cmd_blocking(what, cmd, quiet=False, check=False, **kw): if not quiet: progress_cmd(what, cmd) p = subprocess.Popen(cmd, **kw) ret = os.waitpid(p.pid, 0) _, sts = ret if check and sts != 0: progress("(%s) exited with code %d" % (what, sts,)) sys.exit(1) return ret
942
[ 0.053479552268981934, 0.013502701185643673, -0.004894729238003492, 0.008107154630124569, 0.002585712121799588, -0.029041877016425133, 0.0005903973360545933, -0.020309390500187874, 0.021515781059861183, 0.005174191202968359, -0.008937238715589046, -0.009330145083367825, 0.0385601744055748, ...
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 __call__(self, value): state = base.instance_state(value) m = base._state_mapper(state) key = [ m._get_state_attr_by_column(state, state.dict, col) for col in self._cols(m) ] if self.composite: return tuple(key) else: ...
943
[ 0.03329967334866524, 0.052998967468738556, -0.01472665835171938, -0.01472665835171938, 0.04683629795908928, 0.03147212043404579, 0.00692237913608551, -0.029198309406638145, -0.017924871295690536, -0.018201129510998726, -0.01028528530150652, -0.029410814866423607, 0.05440150573849678, 0.044...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cols", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _reduce_from_cols(cls, cols): def _table_key(c): if not isinstance(c.table, expression.TableClause): return None else: return c.table.key colkeys = [(c.key, _table_key(c)) for c in cols] return _SerializableColumnGetterV2, (colkeys,)
944
[ 0.056256745010614395, 0.012070495635271072, -0.0011959434486925602, 0.003925078082829714, 0.001120773726142943, -0.035409677773714066, 0.0037733842618763447, -0.01340323407202959, 0.010678162798285484, -0.00034605158725753427, -0.012243860401213169, -0.00017277183360420167, 0.046851728111505...
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 __call__(self, value): state = base.instance_state(value) m = base._state_mapper(state) key = [m._get_state_attr_by_column( state, state.dict, m.mapped_table.columns[k]) for k in self.colkeys] if self.composite: return tuple(key) ...
945
[ 0.05264449492096901, 0.04019278287887573, 0.0645032748579979, -0.03047282062470913, 0.03549162298440933, -0.00721055967733264, 0.029413999989628792, -0.039070431143045425, -0.048748042434453964, -0.025454016402363777, -0.023823434486985207, -0.02150462009012699, 0.0316375195980072, -0.0151...
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": "mapper", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _cols(self, mapper): cols = [] metadata = getattr(mapper.local_table, 'metadata', None) for (ckey, tkey) in self.colkeys: if tkey is None or \ metadata is None or \ tkey not in metadata: cols.append(mapper.local_table.c[ckey...
946
[ 0.03028053231537342, 0.020751846954226494, -0.009303120896220207, -0.018331164494156837, -0.03043457493185997, -0.010139357298612595, -0.009974310174584389, 0.011168146505951881, 0.04269202798604965, 0.038840942084789276, 0.018518216907978058, -0.057656243443489075, 0.02821194939315319, 0....
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 before: if pos_arg is None: if named_arg not in kw: raise sa_exc.ArgumentError( "Missing argument %s" % argument) value = kw[named_arg] else: if len(args) > pos_arg: ...
947
[ 0.03511811047792435, 0.06142575293779373, -0.011285311542451382, -0.03296498954296112, -0.012287626042962074, 0.03321247547864914, -0.014514990150928497, 0.031603824347257614, 0.02318933606147766, 0.039721328765153885, 0.07429496943950653, -0.03902836889028549, -0.025466198101639748, 0.005...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def remove(fn): def remove(self, value, _sa_initiator=None): __before_delete(self, _sa_initiator) # testlib.pragma exempt:__eq__ fn(self, value) __del(self, value, _sa_initiator) _tidy(remove) return remove
948
[ 0.036944761872291565, -0.01732298918068409, -0.032206449657678604, -0.03190150856971741, -0.009593909606337547, 0.022905753925442696, -0.0009536733268760145, -0.00013496933388523757, -0.009541131556034088, 0.011476333253085613, 0.0840698629617691, -0.005098963622003794, 0.005280755460262299,...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __setitem__(fn): def __setitem__(self, index, value): if not isinstance(index, slice): existing = self[index] if existing is not None: __del(self, existing) value = __set(self, value) fn(self, index, value) ...
949
[ 0.04391883313655853, 0.028665143996477127, -0.011655193753540516, -0.037483297288417816, -0.022168202325701714, 0.04976485297083855, 0.0010915229795500636, 0.019896116107702255, -0.019785581156611443, 0.019097814336419106, 0.0667625218629837, -0.016555532813072205, 0.026577280834317207, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __delitem__(fn): def __delitem__(self, index): if not isinstance(index, slice): item = self[index] __del(self, item) fn(self, index) else: # slice deletion requires __getslice__ and a slice-groking # __ge...
950
[ 0.03576050326228142, -0.041668955236673355, -0.029896313324570656, -0.02894476428627968, 0.01834496110677719, 0.004356651566922665, 0.006599981803447008, -0.000809092482086271, -0.025559023022651672, 0.07457481324672699, -0.008243061602115631, -0.009792093187570572, 0.013852769508957863, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __iadd__(fn): def __iadd__(self, iterable): # list.__iadd__ takes any iterable and seems to let TypeError # raise as-is instead of returning NotImplemented for value in iterable: self.append(value) return self _tidy(__iadd__) re...
951
[ 0.03558434545993805, 0.04742138832807541, -0.0034595890901982784, -0.04102694243192673, 0.0046127852983772755, 0.013667512685060501, -0.027749931439757347, 0.006351732183247805, -0.0003727676812559366, 0.00035198419936932623, 0.0622359924018383, 0.00283417827449739, 0.016376608982682228, -...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def pop(fn): def pop(self, index=-1): __before_delete(self) item = fn(self, index) __del(self, item) return item _tidy(pop) return pop
952
[ 0.04958111792802811, -0.010235583409667015, -0.034807875752449036, -0.03012087382376194, -0.015278704464435577, 0.016507893800735474, -0.001668595359660685, 0.00433088093996048, -0.009046601131558418, 0.002198467729613185, 0.08882326632738113, -0.01781749725341797, 0.010775507427752018, -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": "index", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __setitem__(self, index, value): if not isinstance(index, slice): existing = self[index] if existing is not None: __del(self, existing) value = __set(self, value) fn(self, index, value) else: ...
953
[ 0.05197756737470627, 0.03025701455771923, -0.012283019721508026, -0.0381295308470726, -0.025751659646630287, 0.04647629335522652, -0.002584650879725814, 0.02468460239470005, -0.01720334216952324, 0.008471252396702766, 0.0699041336774826, -0.033837586641311646, 0.02544339932501316, -0.03480...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __delitem__(self, index): if not isinstance(index, slice): item = self[index] __del(self, item) fn(self, index) else: # slice deletion requires __getslice__ and a slice-groking # __getitem__ for stepped deletion ...
954
[ 0.050679177045822144, -0.022446773946285248, 0.02668224461376667, -0.06561928242444992, 0.004305655136704445, 0.008373294025659561, 0.0036160177551209927, 0.0038479312788695097, -0.02553488314151764, 0.045943260192871094, 0.04718827083706856, -0.03837556019425392, 0.00025689747417345643, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __setslice__(fn): def __setslice__(self, start, end, values): for value in self[start:end]: __del(self, value) values = [__set(self, value) for value in values] fn(self, start, end, values) _tidy(__setslice__) re...
955
[ 0.055370815098285675, 0.006856223568320274, -0.026974918320775032, -0.0087804663926363, -0.0034251513425260782, 0.007193705998361111, 0.03448242321610451, 0.018899019807577133, 0.024985548108816147, 0.006258228328078985, 0.03242200240492821, -0.022652773186564445, -0.030195804312825203, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __setitem__(fn): def __setitem__(self, key, value, _sa_initiator=None): if key in self: __del(self, self[key], _sa_initiator) value = __set(self, value, _sa_initiator) fn(self, key, value) _tidy(__setitem__) return __setitem__
956
[ -0.002327516907826066, 0.04593907296657562, 0.015140615403652191, -0.02355729416012764, 0.02929379977285862, -0.010215213522315025, -0.009074965491890907, 0.003940909635275602, 0.005075280088931322, -0.0107324393466115, 0.01066190842539072, 0.008875127881765366, 0.012319383211433887, -0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def pop(fn): def pop(self, key, default=Unspecified): if key in self: __del(self, self[key]) if default is Unspecified: return fn(self, key) else: return fn(self, key, default) _tidy(pop) return pop
957
[ 0.0565599761903286, 0.0727902352809906, -0.020164862275123596, -0.020988669246435165, -0.023361729457974434, 0.0009636713657528162, -0.014041629619896412, -0.00850244052708149, 0.020054200664162636, 0.013660464435815811, 0.047903843224048615, 0.009473796002566814, 0.0003383224247954786, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def popitem(fn): def popitem(self): __before_delete(self) item = fn(self) __del(self, item[1]) return item _tidy(popitem) return popitem
958
[ -0.009340336546301842, 0.0031244473066180944, -0.006309403106570244, -0.015468213707208633, 0.021464072167873383, 0.00015505345072597265, 0.049023017287254333, 0.023565372452139854, -0.00008663740300107747, -0.010401989333331585, -0.004111838527023792, -0.012266756035387516, -0.0015677243936...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def setdefault(fn): def setdefault(self, key, default=None): if key not in self: self.__setitem__(key, default) return default else: return self.__getitem__(key) _tidy(setdefault) return setdefault
959
[ 0.004664151463657618, -0.013877005316317081, -0.012422344647347927, -0.004698786418884993, 0.023470843210816383, -0.0012670560972765088, 0.018945230171084404, 0.02572210319340229, -0.014223353937268257, 0.05065915361046791, -0.004465001635253429, -0.035442933440208435, -0.014073269441723824,...
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": "__other", "annotation": null, "type_comment": null}}], "kwarg": {...
def update(self, __other=Unspecified, **kw): if __other is not Unspecified: if hasattr(__other, 'keys'): for key in list(__other): if (key not in self or self[key] is not __other[key]): se...
960
[ -0.017113668844103813, 0.011373606510460377, -0.02421477437019348, -0.01181742548942566, 0.019338682293891907, 0.008965147659182549, 0.034724414348602295, 0.011521546170115471, -0.026013722643256187, 0.05022849887609482, 0.010071736760437489, -0.022380322217941284, -0.015870973467826843, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def update(fn): def update(self, __other=Unspecified, **kw): if __other is not Unspecified: if hasattr(__other, 'keys'): for key in list(__other): if (key not in self or self[key] is not __other[key]): ...
961
[ 0.015686238184571266, 0.04759243503212929, 0.00429581617936492, -0.01426731701940298, 0.013668506406247616, 0.019864894449710846, -0.025137033313512802, 0.04894626885652542, -0.004949952010065317, 0.022520489990711212, 0.039104945957660675, -0.02725890651345253, -0.03795939311385155, 0.027...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def discard(fn): def discard(self, value, _sa_initiator=None): # testlib.pragma exempt:__hash__ if value in self: __del(self, value, _sa_initiator) # testlib.pragma exempt:__hash__ fn(self, value) _tidy(discard) return discard
962
[ 0.00981929525732994, 0.0267645251005888, -0.006008732598274946, -0.005127049051225185, 0.013865376822650433, 0.005887954030185938, 0.002859432017430663, 0.007494308520108461, 0.016860684379935265, 0.02210247330367565, 0.019288333132863045, -0.007017233408987522, -0.018841452896595, -0.0095...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def add(fn): def add(self, value, _sa_initiator=None): if value not in self: value = __set(self, value, _sa_initiator) # testlib.pragma exempt:__hash__ fn(self, value) _tidy(add) return add
963
[ 0.010801644064486027, 0.050013262778520584, -0.011734819039702415, -0.02527499385178089, -0.00008896223152987659, 0.018346328288316727, -0.027031557634472847, 0.03708300366997719, 0.020517636090517044, 0.03457014262676239, 0.07465393841266632, -0.02510421723127365, -0.030154336243867874, 0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def remove(fn): def remove(self, value, _sa_initiator=None): # testlib.pragma exempt:__hash__ if value in self: __del(self, value, _sa_initiator) # testlib.pragma exempt:__hash__ fn(self, value) _tidy(remove) return remove
964
[ 0.031793221831321716, 0.06739076226949692, -0.006249949801713228, -0.027643058449029922, 0.012104646302759647, 0.004276769235730171, -0.019219214096665382, 0.004165603779256344, 0.004693638067692518, 0.003003002144396305, 0.05543433874845505, 0.00048364544636569917, 0.0023437312338501215, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def pop(fn): def pop(self): __before_delete(self) item = fn(self) __del(self, item) return item _tidy(pop) return pop
965
[ 0.019335461780428886, 0.01213799137622118, -0.04048749431967735, 0.0005642376490868628, 0.02673936076462269, -0.010582896880805492, 0.04288206249475479, -0.008649351075291634, 0.009736540727317333, 0.025982456281781197, 0.022652078419923782, -0.005982983857393265, 0.02470260113477707, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __ior__(fn): def __ior__(self, value): if not _set_binops_check_strict(self, value): return NotImplemented for item in value: self.add(item) return self _tidy(__ior__) return __ior__
966
[ 0.00119416369125247, 0.029248647391796112, -0.0280712079256773, 0.0001935916516231373, 0.004007305484265089, 0.012229306623339653, 0.0402737557888031, 0.01788903959095478, 0.04436802864074707, 0.026773350313305855, 0.03684847801923752, -0.018116500228643417, 0.013781384564936161, 0.0245790...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __isub__(fn): def __isub__(self, value): if not _set_binops_check_strict(self, value): return NotImplemented for item in value: self.discard(item) return self _tidy(__isub__) return __isub__
967
[ -0.02227611280977726, -0.014094611629843712, -0.025321874767541885, -0.001298271818086505, 0.021027224138379097, 0.006690480280667543, 0.0510515496134758, 0.012042864225804806, -0.033006370067596436, 0.017790306359529495, 0.011265493929386139, -0.04480710253119469, 0.027526548132300377, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __iand__(fn): def __iand__(self, other): if not _set_binops_check_strict(self, other): return NotImplemented want, have = self.intersection(other), set(self) remove, add = have - want, want - have for item in remove: self.remov...
968
[ -0.03255079314112663, -0.004936909768730402, 0.022659074515104294, -0.012117056176066399, 0.008782031945884228, 0.010142291896045208, 0.045652247965335846, 0.01975957117974758, -0.011955972760915756, 0.04591475427150726, 0.011424994096159935, -0.038302067667245865, -0.007505296263843775, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def intersection_update(fn): def intersection_update(self, other): want, have = self.intersection(other), set(self) remove, add = have - want, want - have for item in remove: self.remove(item) for item in add: self.add(item) ...
969
[ 0.012128870002925396, -0.02361781895160675, -0.014658926986157894, -0.01247845683246851, 0.03621478006243706, 0.03958028927445412, 0.044510047882795334, -0.01392420381307602, -0.0025167257990688086, 0.027777304872870445, 0.00035958515945822, -0.07029648870229721, -0.031237617135047913, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def symmetric_difference_update(fn): def symmetric_difference_update(self, other): want, have = self.symmetric_difference(other), set(self) remove, add = have - want, want - have for item in remove: self.remove(item) for item in add: ...
970
[ -0.006769837345927954, -0.005876550450921059, -0.03136712685227394, -0.0012856947723776102, 0.028559653088450432, 0.015032739378511906, 0.055077508091926575, -0.003598669311031699, 0.000549132062587887, 0.0007744476897642016, -0.005024737678468227, -0.07462772727012634, 0.014177736826241016,...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def __ixor__(fn): def __ixor__(self, other): if not _set_binops_check_strict(self, other): return NotImplemented want, have = self.symmetric_difference(other), set(self) remove, add = have - want, want - have for item in remove: se...
971
[ -0.013635545037686825, -0.023110894486308098, 0.011932575143873692, 0.010830653831362724, 0.008844837546348572, 0.02590400166809559, 0.05270368233323097, 0.033635132014751434, -0.0024807972367852926, 0.03940990939736366, 0.011909005232155323, -0.0701458677649498, -0.005978072993457317, -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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def intersection_update(self, other): want, have = self.intersection(other), set(self) remove, add = have - want, want - have for item in remove: self.remove(item) for item in add: self.add(item)
972
[ 0.001274604583159089, -0.001917353947646916, -0.012139092199504375, -0.0012598198372870684, 0.010103459469974041, 0.010999884456396103, 0.03774946182966232, 0.010725976899266243, -0.022896194830536842, 0.002949176821857691, 0.017779100686311722, -0.05826764181256294, 0.022074472159147263, ...
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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __iand__(self, other): if not _set_binops_check_strict(self, other): return NotImplemented want, have = self.intersection(other), set(self) remove, add = have - want, want - have for item in remove: self.remove(item) for it...
973
[ 0.03616752102971077, -0.028556937351822853, -0.014531388878822327, 0.004526688251644373, 0.026211682707071304, 0.05095183104276657, 0.0396394208073616, -0.012806936167180538, -0.007150730583816767, 0.020796900615096092, -0.004736497066915035, -0.09151095896959305, -0.029200732707977295, -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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def symmetric_difference_update(self, other): want, have = self.symmetric_difference(other), set(self) remove, add = have - want, want - have for item in remove: self.remove(item) for item in add: self.add(item)
974
[ 0.01311324443668127, -0.0030787885189056396, -0.028289247304201126, -0.0008663888438604772, 0.0283383596688509, 0.028313802555203438, 0.04957985132932663, -0.0021041969303041697, -0.006912693381309509, -0.00671624019742012, -0.007029337342828512, -0.0871269479393959, 0.008226473815739155, ...
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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __ixor__(self, other): if not _set_binops_check_strict(self, other): return NotImplemented want, have = self.symmetric_difference(other), set(self) remove, add = have - want, want - have for item in remove: self.remove(item) ...
975
[ -0.013932882808148861, 0.044286664575338364, 0.02916901186108589, -0.04303080961108208, 0.009709182195365429, 0.017972946166992188, 0.012007633224129677, 0.0030389323364943266, 0.0004039321793243289, -0.009489999152719975, 0.036182843148708344, -0.04338623955845833, -0.013612995855510235, ...
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_query_iterator_with_transient_failures(self): self._mock_datastore.run_query.side_effect = ( self.transient_retriable_datastore_failure) query_iterator = helper.QueryIterator("project", None, self._query, self._mock_datastore) fail_count = 5 sel...
976
[ 0.029541701078414917, 0.005716156680136919, 0.02561674267053604, 0.019288036972284317, -0.0015589518006891012, -0.01500309631228447, -0.0029335583094507456, 0.022156275808811188, -0.0355800986289978, -0.054856523871421814, 0.03388470411300659, -0.0032311235554516315, -0.0030975821428000927, ...
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._mock_datastore = MagicMock() self._query = query_pb2.Query() self._query.kind.add().name = 'dummy_kind' patch_retry(self, helper) self._retriable_errors = [ RPCError("dummy", code_pb2.INTERNAL, "failed"), SocketError(errno.ECONNRESET, "Connection Reset"), ...
977
[ 0.006692627444863319, 0.05035293474793434, 0.03174016624689102, -0.034412529319524765, 0.014100228436291218, 0.0036246846430003643, -0.005300771910697222, 0.003557289484888315, 0.005807700101286173, 0.001240216544829309, 0.01830802671611309, -0.05265023186802864, -0.0152840381488204, -0.04...
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_query_iterator_with_non_retriable_failures(self): self._mock_datastore.run_query.side_effect = ( self.non_retriable_datastore_failure) query_iterator = helper.QueryIterator("project", None, self._query, self._mock_datastore) self.assertRaises(tuple(...
978
[ 0.06049701198935509, 0.020769385620951653, 0.03965706005692482, 0.03819873556494713, 0.006780040450394154, 0.02342730388045311, 0.0019993181340396404, 0.04045679047703743, 0.024768022820353508, 0.02188665233552456, 0.011890062130987644, -0.014618542976677418, 0.004107422661036253, -0.02234...
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_is_key_valid(self): key = entity_pb2.Key() # Complete with name, no ancestor datastore_helper.add_key_path(key, 'kind', 'name') self.assertTrue(helper.is_key_valid(key)) key = entity_pb2.Key() # Complete with id, no ancestor datastore_helper.add_key_path(key, 'kind', 12) self.a...
979
[ 0.026221387088298798, 0.011448191478848457, 0.022872718051075935, -0.015560074709355831, 0.04205361381173134, 0.03403100743889809, 0.03665787726640701, 0.0071174027398228645, 0.06716272234916687, 0.03455164656043053, -0.022742558270692825, -0.02664736658334732, -0.00080092967255041, -0.012...
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_compare_path_with_different_kind(self): p1 = Key.PathElement() p1.kind = 'dummy1' p2 = Key.PathElement() p2.kind = 'dummy2' self.assertLess(helper.compare_path(p1, p2), 0)
980
[ 0.03537255898118019, -0.004052136093378067, 0.013264709152281284, -0.015079880133271217, 0.052779581397771835, 0.038328029215335846, 0.04335465654730797, 0.010518682189285755, 0.0659046620130539, 0.039095986634492874, -0.004153948277235031, -0.03995702788233757, -0.00015944558253977448, -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_compare_path_with_different_id(self): p1 = Key.PathElement() p1.kind = 'dummy' p1.id = 10 p2 = Key.PathElement() p2.kind = 'dummy' p2.id = 15 self.assertLess(helper.compare_path(p1, p2), 0)
981
[ 0.020378515124320984, 0.0132705457508564, 0.012290135957300663, -0.02418343909084797, 0.04717637971043587, 0.038049232214689255, 0.04582248255610466, -0.00021391751943156123, 0.07353072613477707, 0.031233051791787148, -0.01849939674139023, -0.038492750376462936, -0.0006441232981160283, -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_compare_path_of_different_type(self): p1 = Key.PathElement() p1.kind = 'dummy' p1.id = 10 p2 = Key.PathElement() p2.kind = 'dummy' p2.name = 'dummy' self.assertLess(helper.compare_path(p1, p2), 0)
982
[ 0.03238765522837639, 0.007757384795695543, 0.01897912099957466, -0.027507640421390533, 0.03825748711824417, 0.033331431448459625, 0.03784314543008804, -0.011590039357542992, 0.07352251559495926, 0.024492157623171806, -0.008988898247480392, -0.02232837677001953, -0.010260694660246372, -0.02...
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_compare_path_with_different_name(self): p1 = Key.PathElement() p1.kind = 'dummy' p1.name = "dummy1" p2 = Key.PathElement() p2.kind = 'dummy' p2.name = 'dummy2' self.assertLess(helper.compare_path(p1, p2), 0)
983
[ 0.023961393162608147, 0.0018377777887508273, 0.04787493497133255, -0.0625891163945198, 0.023901578038930893, 0.02234642021358013, 0.029643699526786804, 0.0180159043520689, 0.054215192794799805, 0.034117769449949265, -0.011544056236743927, -0.008403833024203777, -0.010551147162914276, -0.01...
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_key_comparator_with_multiple_paths_2(self): k1 = Key() k2 = Key() p11 = k1.path.add() p21 = k2.path.add() p22 = k2.path.add() p11.kind = p21.kind = p22.kind = 'dummy' self.assertLess(helper.key_comparator(k1, k2), 0)
984
[ 0.02529226616024971, 0.007098537404090166, 0.052063893526792526, -0.048747263848781586, 0.01894534006714821, 0.020555932074785233, 0.033643487840890884, 0.016976837068796158, 0.04784056171774864, 0.0310188177973032, -0.011226425878703594, -0.00015201829955913126, -0.017811959609389305, -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_key_comparator_with_multiple_paths_1(self): k1 = Key() k2 = Key() p11 = k1.path.add() p12 = k1.path.add() p21 = k2.path.add() p11.kind = p12.kind = p21.kind = 'dummy' self.assertGreater(helper.key_comparator(k1, k2), 0)
985
[ 0.02939716912806034, 0.000006460513304773485, 0.0506150908768177, -0.0530688650906086, 0.023202594369649887, 0.024309197440743446, 0.029036318883299828, 0.016117924824357033, 0.05042263865470886, 0.029854243621230125, -0.0020793925505131483, -0.0024883549194782972, -0.02083301730453968, -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_key_comparator_with_multiple_paths_4(self): k1 = Key() k2 = Key() p11 = k1.path.add() p12 = k2.path.add() p21 = k2.path.add() p11.kind = p12.kind = 'dummy' # make path2 greater than path1 p21.kind = 'dummy1' self.assertLess(helper.key_comparator(k1, k2), 0)
986
[ 0.026362458243966103, -0.002722018165513873, 0.048763472586870193, -0.05918584018945694, 0.02449963614344597, 0.013275548815727234, 0.03772802650928497, 0.01860463246703148, 0.059798918664455414, 0.023403165861964226, -0.015079420059919357, -0.0021840990521013737, -0.013994739390909672, -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_key_comparator_with_multiple_paths_3(self): k1 = Key() k2 = Key() p11 = k1.path.add() p12 = k1.path.add() p21 = k2.path.add() p22 = k2.path.add() p11.kind = p12.kind = p21.kind = p22.kind = 'dummy' self.assertEqual(helper.key_comparator(k1, k2), 0)
987
[ 0.036008674651384354, 0.005158092826604843, 0.03388780355453491, -0.03386475145816803, -0.024874109774827957, -0.0076881516724824905, 0.008633321151137352, -0.04725850373506546, -0.01977941207587719, 0.02000994235277176, 0.0423482283949852, 0.009353725239634514, 0.02362925186753273, 0.0044...
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": "revision", "annotation...
class CommitInfo(object): def __init__(self, revision, committer_email, changelog_data, committer_list=CommitterList()): self._revision = revision self._committer_email = committer_email self._changelog_data = changelog_data # Derived values: self._committer = committer_list...
988
[ 0.00718285609036684, -0.020252414047718048, -0.012799525633454323, -0.011870615184307098, -0.031582966446876526, -0.06152413412928581, -0.0043718209490180016, -0.009677954018115997, -0.00137041334528476, -0.010995711199939251, 0.005325034726411104, -0.01814616285264492, 0.024043666198849678,...
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 to_json(self): return { "bug_id": self.bug_id(), "author_name": self.author_name(), "author_email": self.author_email(), "reviewer_text": self.reviewer_text(), "changed_files": self.changed_files(), }
989
[ 0.03176911175251007, -0.0030567909125238657, 0.013314819894731045, -0.02653402090072632, -0.049147702753543854, -0.05407203361392021, 0.01691245101392269, -0.028040006756782532, -0.014330762438476086, 0.0317930169403553, 0.012089712545275688, -0.01216142624616623, 0.003179301740601659, -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": "bugs", "annotation": null, "type_comment": null}}], "kwarg": null...
def blame_string(self, bugs): string = "r%s:\n" % self.revision() string += " %s\n" % urls.view_revision_url(self.revision()) string += " Bug: %s (%s)\n" % (self.bug_id(), bugs.bug_url_for_bug_id(self.bug_id())) author_line = "\"%s\" <%s>" % (self.author_name(), self.author_email()) ...
990
[ -0.00578902754932642, -0.00536583736538887, 0.05564410984516144, -0.02230972982943058, -0.018012719228863716, 0.00481785973533988, 0.027908863499760628, -0.01698187179863453, -0.004874827805906534, 0.016678042709827423, 0.004739189986139536, 0.016482723876833916, 0.016547828912734985, 0.01...
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 CreateContextTests(TestCase): def test_by_name(self): ctx = _tevent.Context(_tevent.backend_list()[0]) self.assertTrue(ctx is not None) def test_no_name(self): ctx = _tevent.Context() self.assertTrue(ctx is not None)
991
[ -0.0033222862984985113, -0.023508941754698753, 0.025009511038661003, -0.010015172883868217, -0.0067582521587610245, 0.025805268436670303, 0.030602548271417618, -0.006780988071113825, -0.015164858661592007, 0.0264191385358572, -0.01762033812701702, 0.012038669548928738, -0.015017075464129448,...
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 ContextTests(TestCase): def setUp(self): super(ContextTests, self).setUp() self.ctx = _tevent.Context() def test_signal_support(self): self.assertTrue(type(self.ctx.signal_support) is bool) def test_reinitialise(self): self.ctx.reinitialise() def test_loop_wait(...
992
[ 0.002702719997614622, -0.008388213813304901, 0.006839207839220762, 0.0023838069755584, -0.023304762318730354, -0.04022054746747017, 0.05458502471446991, -0.004202146548777819, -0.013635536655783653, -0.008549009449779987, 0.0318591333925724, -0.0026384012307971716, -0.031494658440351486, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "_step", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "new_date", "annotation": null, "type_comment": null}}], "kwarg":...
def change_date(_step, new_date): button_css = 'div.post-preview .edit-button' world.css_click(button_css) date_css = 'input.date' date = world.css_find(date_css) for i in range(len(date.value)): date._element.send_keys(Keys.END, Keys.BACK_SPACE) date._element.send_keys(new_date) sav...
993
[ 0.061059147119522095, 0.006714930292218924, -0.006866902578622103, -0.03870231285691261, -0.02996671386063099, 0.005372507032006979, -0.03701373189687729, 0.037464018911123276, -0.02016167715191841, 0.02327992580831051, 0.04140404611825943, -0.023257412016391754, -0.004170799162238836, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sender", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, ...
def handle_waitinglistentry_save(sender, **kwargs): if kwargs.get("created"): try: survey = Survey.objects.get(active=True) SurveyInstance.objects.create( survey=survey, entry=kwargs.get("instance") ) except Survey.DoesNotExist: ...
994
[ 0.045230526477098465, 0.02351236343383789, 0.030271906405687332, -0.020946240052580833, 0.009085744619369507, 0.007281113415956497, -0.018567882478237152, 0.015563640743494034, -0.012465516105294228, 0.05257422849535942, 0.008480723947286606, -0.03936808183789253, 0.0015607973327860236, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "email address"}}], "func": {"_type": "Name", "_fields": {"i...
class WaitingListEntry(models.Model): email = models.EmailField(_("email address"), unique=True) created = models.DateTimeField(_("created"), default=timezone.now, editable=False) class Meta: verbose_name = _("waiting list entry") verbose_name_plural = _("waiting list entries") def __...
995
[ 0.028633343055844307, 0.04963112622499466, -0.01427471823990345, 0.003990837838500738, -0.005042300093919039, 0.027605479583144188, -0.052693743258714676, -0.026451755315065384, -0.004835154395550489, 0.033667776733636856, -0.0021147243678569794, -0.061713770031929016, -0.02804599143564701, ...
12
{"_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": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo...
class Survey(models.Model): label = models.CharField(max_length=100, unique=True) active = models.BooleanField(default=True) def __unicode__(self): return self.label def save(self, *args, **kwargs): if self.active: Survey.objects.filter(active=True).update(active=False) ...
996
[ 0.01981513574719429, -0.0026087730657309294, 0.009352568536996841, -0.0034948494285345078, -0.0055939569137990475, 0.02103503607213497, -0.041762351989746094, -0.015078406780958176, -0.029277605935931206, -0.003736631479114294, 0.007638114038854837, -0.07842529565095901, -0.0202657300978899,...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Survey", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load"...
class SurveyInstance(models.Model): survey = models.ForeignKey(Survey, related_name="instances") entry = models.OneToOneField(WaitingListEntry) code = models.CharField(max_length=200, unique=True) def generate_hash(self): return hashlib.md5((self.entry.email + SURVEY_SECRET).encode("utf-8")).h...
997
[ 0.022854547947645187, 0.03209459409117699, 0.0012413811637088656, 0.019131118431687355, -0.009051589295268059, 0.007378329988569021, -0.02291165664792061, -0.02700057625770569, -0.026863517239689827, 0.002901077037677169, 0.006955732125788927, -0.05948350206017494, -0.00637323223054409, -0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "TEXT_FIELD", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"...
class SurveyQuestion(models.Model): TEXT_FIELD = 0 TEXT_AREA = 1 RADIO_CHOICES = 2 CHECKBOX_FIELD = 3 BOOLEAN_FIELD = 4 FIELD_TYPE_CHOICES = [ (TEXT_FIELD, "text field"), (TEXT_AREA, "textarea"), (RADIO_CHOICES, "radio choices"), (CHECKBOX_FIELD, "checkbox field...
998
[ 0.04229861497879028, 0.04434286430478096, -0.02707546204328537, 0.022704243659973145, -0.014407625421881676, -0.036361586302518845, -0.012548226863145828, -0.018017686903476715, -0.02198658138513565, 0.03599188104271889, -0.010982416570186615, -0.032925501465797424, -0.005882660858333111, ...
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 form_field(self): kwargs = dict( label=self.question, help_text=self.help_text, required=self.required ) field_class = forms.CharField if self.kind == SurveyQuestion.TEXT_AREA: kwargs.update({"widget": forms.Textarea()}) elif s...
999
[ -0.007089428137987852, 0.055502258241176605, 0.05135728046298027, -0.030784040689468384, -0.049815550446510315, -0.013054152019321918, -0.046378254890441895, -0.028863197192549706, -0.024149548262357712, 0.0667240247130394, 0.016516724601387978, 0.005541380029171705, -0.022671004757285118, ...
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 run(self): if 'align' in self.options: if isinstance(self.state, states.SubstitutionDef): # Check for align_v_values. if self.options['align'] not in self.align_v_values: raise self.error( 'Error in "%s" directive: "%s" ...
1,000
[ 0.0029652209486812353, 0.03874677047133446, 0.009996423497796059, -0.029321223497390747, -0.03468989580869675, 0.003555835923179984, -0.03150755912065506, -0.04127320274710655, -0.029102588072419167, 0.051063138991594315, 0.03566160425543785, -0.007992280647158623, 0.010300081223249435, -0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "left"}}, {"_type": "Constant", "_fields": {"kind": null,...
class Image(Directive): align_h_values = ('left', 'center', 'right') align_v_values = ('top', 'middle', 'bottom') align_values = align_v_values + align_h_values def align(argument): # This is not callable as self.align. We cannot make it a # staticmethod because we're saving an unboun...