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
12,501
[ 0.038929589092731476, -0.013665961101651192, 0.06456119567155838, -0.047837208956480026, 0.012891937978565693, -0.02243400178849697, 0.026139164343476295, 0.010055964812636375, 0.01924908347427845, 0.01680012419819832, 0.0035941351670771837, -0.034057047218084335, -0.020441841334104538, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test03(self): app = Application(self.inst, "mgtest") self.assertEqual(app.config.get("a.key1"), None) self.assertEqual(app.config.get("a.key2"), "value2") self.assertTrue("a" in app.config._config) self.assertFalse("b" in app.config._config) self.assertFalse("c" in ap...
12,502
[ 0.04578680545091629, -0.002353658201172948, 0.0626896470785141, -0.0646284967660904, 0.006257778964936733, -0.012378843501210213, 0.03743481636047363, 0.025503400713205338, 0.0189411211758852, 0.011651773005723953, 0.026895398274064064, -0.0431768074631691, -0.02539154328405857, 0.00533185...
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 test02(self): app = Application(self.inst, "mgtest") self.assertEqual(app.config.get("a.key1"), "value1") app.config.set("a.key2", "value2") app.config.delete("a.key1") app.config.store() self.assertEqual(app.config.get("a.key1"), None) self.assertEqual(app.co...
12,503
[ 0.01869290880858898, -0.018558524549007416, 0.06810615956783295, 0.014500107616186142, -0.01474200002849102, -0.04561016336083412, 0.01920357160270214, 0.022724449634552002, 0.0019636962097138166, 0.021703125908970833, 0.0026742552872747183, -0.0065680514089763165, -0.017631269991397858, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def Bill(): otr=pd.read_csv('/media/james/ext4data1/current/projects/pfizer/outer_test_results.csv').set_index('subjects') #Per subject accuracy acc= otr['scores']*100 n= len(otr.index) runs= 10000 distribution= [] for i in range(runs): sample= np.random.choice(acc, n...
12,504
[ -0.01969968155026436, 0.006501591298729181, 0.08392203599214554, -0.05011933296918869, 0.0029392901342362165, -0.016024263575673103, -0.0013617492513731122, 0.041571203619241714, -0.009564438834786415, 0.013636634685099125, 0.007796340622007847, -0.06131264939904213, -0.006212709005922079, ...
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 test09(self): app = Application(self.inst, "mgtest") app.modules.load(["mg.test.testcore.TestJoin"]) self.assertEqual(app.hooks.call("join.empty"), None) self.assertEqual(app.hooks.call("join.single"), "single") self.assertEqual(app.hooks.call("join.prio1"), "prio2") ...
12,505
[ 0.024872053414583206, -0.03463296219706535, 0.044602662324905396, -0.021935949102044106, -0.024467522278428078, 0.04264526069164276, -0.049926795065402985, -0.012455600313842297, 0.02810829132795334, 0.04092274606227875, -0.016311682760715485, -0.021126890555024147, -0.01710769161581993, -...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_legendre(): assert legendre(0, x) == 1 assert legendre(1, x) == x assert legendre(2, x) == ((3*x**2-1)/2).expand() assert legendre(3, x) == ((5*x**3-3*x)/2).expand() assert legendre(4, x) == ((35*x**4-30*x**2+3)/8).expand() assert legendre(5, x) == ((63*x**5-70*x**3+15*x)/8).expand() ...
12,506
[ 0.015421483665704727, 0.04209400713443756, 0.10036567598581314, -0.019442984834313393, -0.032149095088243484, -0.02213544398546219, 0.026374632492661476, -0.007808128837496042, -0.03246989846229553, 0.05907367914915085, 0.01093596313148737, 0.018881579861044884, -0.014779876917600632, 0.00...
11
{"_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 Main(args): pwd = os.environ.get('PWD', '') is_integration_bot = 'nacl-chrome' in pwd # This environment variable check mimics what # buildbot_chrome_nacl_stage.py does. is_win64 = (sys.platform in ('win32', 'cygwin') and ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or ...
12,507
[ 0.04221566393971443, 0.0008752808789722621, 0.0308125838637352, -0.019422980025410652, -0.010291079059243202, 0.028116818517446518, -0.003101813606917858, -0.028602056205272675, 0.018304238095879555, 0.013135110028088093, 0.0009982751216739416, -0.02405969426035881, 0.020150836557149887, 0...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"i...
def test_assoc_legendre(): Plm=assoc_legendre Q=(1-x**2)**Rational(1,2) assert Plm(0, 0, x) == 1 assert Plm(1, 0, x) == x assert Plm(1, 1, x) == -Q assert Plm(2, 0, x) == (3*x**2-1)/2 assert Plm(2, 1, x) == -3*x*Q assert Plm(2, 2, x) == 3*Q**2 assert Plm(3, 0, x) == (5*x**3-3*x...
12,508
[ 0.01928139291703701, -0.05860237032175064, 0.022535784170031548, 0.024215469136834145, 0.015887027606368065, 0.032380610704422, 0.008672544732689857, 0.003260223427787423, -0.004272117279469967, 0.03338375315070152, 0.03326711058616638, -0.019059767946600914, -0.03977589309215546, -0.01136...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_chebyshev(): assert chebyshevt(0, x) == 1 assert chebyshevt(1, x) == x assert chebyshevt(2, x) == 2*x**2-1 assert chebyshevt(3, x) == 4*x**3-3*x for n in range(1, 4): for k in range(n): z = chebyshevt_root(n, k) assert chebyshevt(n, z) == 0 for n in range...
12,509
[ -0.033907871693372726, 0.01728336699306965, -0.01623624563217163, -0.03494322672486305, -0.03588445857167244, -0.043343719094991684, -0.014765571802854538, -0.0022780748549848795, -0.004353196360170841, 0.027978111058473587, 0.02713100239634514, -0.008400492370128632, 0.035860925912857056, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "log_file", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "regex", "annotation": null, "type_comment": null}}], "kwarg":...
def get_amount_list(log_file, regex): log_list = file(log_file).readlines() amount_list = [] for line in log_list: m = re.search(regex, line) try: amount_list.append(m.group()) except: # Example: # 78.174.192.97 - - [03/Apr/2010:19:55:49 +0300]...
12,510
[ 0.009908324107527733, -0.02611573226749897, -0.005510146263986826, -0.01535634882748127, 0.001433445606380701, 0.014461804181337357, -0.040950264781713486, -0.04785813391208649, 0.06063024327158928, 0.03108542412519455, 0.030986031517386436, -0.028724821284413338, -0.01658634841442108, -0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_laguerre(): alpha = Symbol("alpha") # generalized Laguerre polynomials: assert laguerre_l(0, alpha, x) == 1 assert laguerre_l(1, alpha, x) == -x + alpha + 1 assert laguerre_l(2, alpha, x).expand() == (x**2/2 - (alpha+2)*x + (alpha+2)*(alpha+1)/2).expand() assert laguerre_l(3, alpha, x)...
12,511
[ 0.01393149048089981, 0.00946103036403656, -0.01991274394094944, -0.05681571736931801, -0.02506430074572563, -0.0027150928508490324, -0.004823391791433096, 0.016271980479359627, -0.015491818077862263, -0.01483548991382122, 0.04425879940390587, -0.011052316054701805, -0.006389910355210304, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def print_output(): regex_podcast = '(?<=oi_podcast_E)\w+.(mp3|ogg)' regex_edergi = '(?<=oi_say)\w+_(buyuk|kucuk).pdf' # podcasts amount_list = get_amount_list(LOGPODCAST, regex_podcast) for episode in range(1, COUNT_OF_PODCAST + 1): if episode < 10: # dirty hacking episode = "0...
12,512
[ 0.046275872737169266, 0.008589859120547771, 0.03237716108560562, -0.04875941202044487, -0.0036341713275760412, -0.0037851203233003616, 0.022602494806051254, 0.002304110210388899, 0.00007405051292153075, -0.020039208233356476, 0.00710315303876996, 0.00526328245177865, 0.008743656799197197, ...
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": "input_lines", "annotation": null, "type_comment": null}}, {"_type...
def insert_input(self, input_lines, source): self.input_lines.insert(self.line_offset + 1, '', source='internal padding after '+source, offset=len(input_lines)) self.input_lines.insert(self.line_offset + 1, '', ...
12,513
[ 0.06979983299970627, -0.016689926385879517, -0.043013788759708405, -0.0499567985534668, 0.03284577280282974, -0.03149003908038139, -0.03132570534944534, 0.01038370095193386, 0.0074668158777058125, 0.03906983137130737, 0.03588590770959854, -0.026744963601231575, 0.03444800525903702, -0.0384...
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": "i", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def __getitem__(self, i): if isinstance(i, slice): assert i.step in (None, 1), 'cannot handle slice with stride' return self.__class__(self.data[i.start:i.stop], items=self.items[i.start:i.stop], parent=self, parent_off...
12,514
[ 0.05017910897731781, -0.01186092384159565, -0.0625108852982521, -0.029282357543706894, -0.01326226256787777, -0.03829576447606087, 0.009999947622418404, -0.030089527368545532, -0.010986489243805408, 0.03995494544506073, 0.07035837322473526, -0.00043966976227238774, 0.012993205338716507, -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": "i", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def __setitem__(self, i, item): if isinstance(i, slice): assert i.step in (None, 1), 'cannot handle slice with stride' if not isinstance(item, ViewList): raise TypeError('assigning non-ViewList to ViewList slice') self.data[i.start:i.stop] = item.data ...
12,515
[ 0.053691960871219635, 0.01048671081662178, 0.0235762782394886, -0.0074590095318853855, -0.04332356154918671, -0.017951099202036858, -0.012820676900446415, -0.024845438078045845, -0.02027430757880211, 0.01354130171239376, 0.015122375451028347, -0.0072976755909621716, 0.021532714366912842, -...
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": "item", "annotation": null, "type_comment": null}}, {"_type": "arg...
def append(self, item, source=None, offset=0): if source is None: self.extend(item) else: if self.parent: self.parent.insert(len(self.data) + self.parent_offset, item, source, offset) self.data.append(item) ...
12,516
[ 0.09238100051879883, 0.022457392886281013, -0.011944781057536602, -0.04397604987025261, -0.001452479395084083, 0.008791599422693253, -0.0009725820273160934, 0.012131324969232082, -0.01694534160196781, 0.03827144205570221, 0.057046107947826385, -0.02038736455142498, 0.01143930945545435, -0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "i", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def __delitem__(self, i): try: del self.data[i] del self.items[i] if self.parent: del self.parent[i + self.parent_offset] except TypeError: assert i.step is None, 'cannot handle slice with stride' del self.data[i.start:i.stop] ...
12,517
[ 0.007611389271914959, 0.010182804428040981, 0.003015322843566537, -0.0052159130573272705, -0.003562086960300803, -0.02431746944785118, 0.012039637193083763, -0.036378759890794754, -0.0010603704722598195, 0.04590653255581856, 0.04837508872151375, 0.015060373581945896, 0.005841172765940428, ...
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": "top", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def get_2D_block(self, top, left, bottom, right, strip_indent=True): block = self[top:bottom] indent = right for i in range(len(block.data)): # get slice from line, care for combining characters ci = utils.column_indices(block.data[i]) try: lef...
12,518
[ 0.027539458125829697, 0.025056734681129456, -0.0035910827573388815, -0.04727606847882271, -0.006806627381592989, -0.03809624910354614, 0.00563828693702817, -0.002198462374508381, -0.06325729936361313, -0.0034763349685817957, 0.036281149834394455, 0.008710396476089954, 0.024117888882756233, ...
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": "i", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def insert(self, i, item, source=None, offset=0): if source is None: if not isinstance(item, ViewList): raise TypeError('inserting non-ViewList with no source given') self.data[i:i] = item.data self.items[i:i] = item.items if self.parent: ...
12,519
[ 0.011310231871902943, -0.013098654337227345, 0.02075803652405739, 0.009484807029366493, -0.007073519751429558, -0.014603395946323872, -0.004588229116052389, 0.0030156506691128016, 0.02033868245780468, 0.0491877906024456, -0.012549793347716331, -0.04546293616294861, -0.06280446797609329, -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": "response", "annotation": null, "type_comment": null}}], "kwarg": ...
def apply(self, response): updated_headers = self.update_headers(response) if updated_headers: response.headers.update(updated_headers) warning_header_value = self.warning(response) if warning_header_value is not None: response.headers.update({'Warnin...
12,520
[ 0.0450783334672451, -0.014041537418961525, 0.011973932385444641, 0.007088931743055582, -0.0014427793212234974, 0.012530595995485783, 0.015927376225590706, -0.0344676598906517, 0.013712083920836449, 0.06348229199647903, -0.0008633955148980021, -0.05907443165779114, 0.0031894512940198183, -0...
8
{"_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": "A", "annotation": null, "type_comment": null}}], "kwarg": null, "var...
def solution(X, A): path = [None] * (X + 1) leaves_cnt = 0 for i, a in enumerate(A): if path[a] is None: path[a] = i leaves_cnt += 1 if leaves_cnt == X: return i return -1
12,521
[ -0.0011692752595990896, -0.03224281594157219, 0.018140526488423347, -0.0345984548330307, 0.004337952006608248, 0.00820793118327856, -0.0004761888412758708, 0.004911087453365326, 0.021558307111263275, -0.018855631351470947, 0.006635752040892839, -0.05068831145763397, -0.056535348296165466, ...
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": "response", "annotation": null, "type_comment": null}}], "kwarg": ...
def update_headers(self, response): headers = {} if 'expires' not in response.headers: date = parsedate(response.headers['date']) expires = expire_after(timedelta(days=1), date=datetime(*date[:6])) headers['expires'] = datetime_to_h...
12,522
[ 0.015991266816854477, 0.00606753071770072, 0.025773389264941216, -0.021198231726884842, -0.013921552337706089, 0.03361651673913002, -0.00992373563349247, -0.02596946805715561, 0.028235260397195816, 0.0066503188572824, 0.01057188306003809, -0.04993458092212677, -0.04666661098599434, -0.0126...
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": "resp", "annotation": null, "type_comment": null}}], "kwarg": null...
def update_headers(self, resp): headers = resp.headers if 'expires' in headers: return {} if 'cache-control' in headers and headers['cache-control'] != 'public': return {} if resp.status not in self.cacheable_by_default_statuses: return {} ...
12,523
[ 0.007557687349617481, -0.011087194085121155, -0.014217761345207691, -0.015403497964143753, 0.01459453720599413, -0.011170306243002415, -0.009762936271727085, 0.04583371803164482, 0.03933987021446228, 0.041955139487981796, 0.042597874999046326, 0.0011109357001259923, 0.006516012363135815, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def auth(method): @functools.wraps(method) def wrapper(*args, **kwargs): if 'authed' in flask.session: return method(*args, **kwargs) else: return flask.redirect('/') return wrapper
12,524
[ 0.0018977074651047587, 0.000431395776104182, 0.038162436336278915, 0.004264056216925383, -0.04906268045306206, 0.01567922905087471, 0.01946307346224785, -0.006919689476490021, -0.009540609084069729, 0.04612354934215546, -0.02846561186015606, -0.0468178316950798, -0.021777350455522537, 0.05...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "min", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "max", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def gen_word(min, max): # gen_word(2, 3) vowels = list('aeiou') word = '' syllables = min + int(random.random() * (max - min)) def word_part(type): if type is 'c': return random.sample([ch for ch in list(string.lowercase) if ch not in vowels], 1)[0] if type is 'v': ...
12,525
[ 0.0708971694111824, -0.018307622522115707, -0.04336842522025108, 0.009019196964800358, -0.01607525907456875, 0.035560764372348785, 0.008329295553267002, 0.0038645686581730843, -0.003227952402085066, 0.07596766203641891, 0.05743568018078804, 0.00678122416138649, 0.009720315225422382, 0.0557...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "id", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def validate(id): try: id_encoded = id.encode('utf-8') if not re.match(r'^[A-Za-z0-9]+', id): return False if sys.getsizeof(id_encoded) < 1 or sys.getsizeof(id_encoded) > 50: return False return True except: return False
12,526
[ 0.007271943148225546, -0.03230820223689079, 0.08331569284200668, -0.017829246819019318, 0.008440648205578327, -0.028905972838401794, 0.0000033256610549869947, 0.002877936465665698, -0.0019527114927768707, 0.014725684188306332, -0.04482633247971535, -0.03350288048386574, 0.06446058303117752, ...
11
{"_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": "os"}}, {"_type": "Constant", "_fields": {"kind": null, "...
class HelloReuseConan(ConanFile): settings = "os", "compiler", "build_type", "arch" requires = "Hello/0.1@%s/%s" % (username, channel) generators = "cmake" def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): # equal to ./bin/greet, but portab...
12,527
[ 0.021906977519392967, 0.009783699177205563, 0.059015631675720215, -0.05077672749757767, 0.018089767545461655, 0.01744050718843937, 0.010376989841461182, -0.026821216568350792, 0.004975805524736643, 0.026171954348683357, -0.011451628990471363, -0.017977826297283173, 0.01941067911684513, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestPathDwimRelativeStackDataLoader(unittest.TestCase): def setUp(self): self._loader = DataLoader() def test_none(self): self.assertRaisesRegex(AnsibleFileNotFound, 'on the Ansible Controller', self._loader.path_dwim_relative_stack, None, None, None) def test_empty_strings(self): ...
12,528
[ 0.030965112149715424, 0.036266446113586426, 0.06911696493625641, -0.03582281991839409, 0.02182641066610813, 0.024244174361228943, 0.026573210954666138, -0.018998293206095695, 0.018754299730062485, 0.019275560975074768, -0.009166426956653595, -0.014706210233271122, 0.01473948173224926, 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 TestPathDwimRelativeDataLoader(unittest.TestCase): def setUp(self): self._loader = DataLoader() def test_all_slash(self): self.assertEqual(self._loader.path_dwim_relative('/', '/', '/'), '/') def test_path_endswith_role(self): self.assertEqual(self._loader.path_dwim_relative...
12,529
[ 0.013260803185403347, 0.00310112489387393, 0.01164334174245596, -0.050046149641275406, 0.058751896023750305, 0.012594789266586304, -0.02356022410094738, 0.009585835970938206, 0.007837550714612007, -0.01831536926329136, 0.0048969825729727745, -0.01054322998970747, 0.01548481173813343, 0.001...
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_parse_from_vault_1_1_file(self): vaulted_data = """$ANSIBLE_VAULT;1.1;AES256 33343734386261666161626433386662623039356366656637303939306563376130623138626165 6436333766346533353463636566313332623130383662340a393835656134633665333861393331 3766623334646463626363653062633262303563313536373262333231353430...
12,530
[ 0.03399201110005379, 0.01628643088042736, 0.03849724680185318, -0.06618192791938782, 0.01929367519915104, 0.020656509324908257, -0.008886579424142838, -0.0125583466142416, 0.017852000892162323, 0.00920194573700428, 0.018617890775203705, 0.01071119960397482, 0.0065269614569842815, 0.0035084...
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 TestDataLoaderWithVault(unittest.TestCase): def setUp(self): self._loader = DataLoader() vault_secrets = [('default', TextVaultSecret('ansible'))] self._loader.set_vault_secrets(vault_secrets) self.test_vault_data_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'vau...
12,531
[ -0.0328352265059948, -0.011941983364522457, 0.033818189054727554, -0.024929674342274666, -0.03063923865556717, -0.014357567764818668, -0.00020734424469992518, -0.010577334091067314, -0.02748120203614235, 0.02419767901301384, -0.022963743656873703, -0.03316985070705414, 0.01174329873174429, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "docutilsconf", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": nu...
def with_conf_app(docutilsconf='', *args, **kwargs): default_kw = { 'srcdir': root, 'cleanenv': True, } default_kw.update(kwargs) def generator(func): @wraps(func) def deco(*args2, **kwargs2): app = TestApp(*args, **default_kw) (app.srcdir / 'docut...
12,532
[ 0.001761582912877202, 0.024155523627996445, 0.014779825694859028, -0.039179932326078415, -0.02168639563024044, -0.022874372079968452, 0.012799864634871483, -0.005465274211019278, 0.008979705162346363, 0.014034428633749485, 0.013708317652344704, -0.023899292573332787, -0.0026059779338538647, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def generator(func): @wraps(func) def deco(*args2, **kwargs2): app = TestApp(*args, **default_kw) (app.srcdir / 'docutils.conf').write_text(docutilsconf) try: cwd = os.getcwd() os.chdir(app.srcdir) func(app, *args2, **kw...
12,533
[ -0.010548176243901253, 0.018771035596728325, 0.08065591752529144, -0.015782948583364487, 0.008486844599246979, -0.033273376524448395, 0.009716903790831566, -0.04333851486444473, -0.0016246326267719269, -0.008144225925207138, 0.01549087930470705, -0.04439445585012436, -0.00744775403290987, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "app", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def test_html_with_default_docutilsconf(app): app.builder.build(['contents']) result = (app.outdir / 'contents.html').text(encoding='utf-8') assert regex_count(r'<th class="field-name">', result) == 1 assert regex_count(r'<th class="field-name" colspan="2">', result) == 1 assert regex_count(r'<td c...
12,534
[ 0.005335111636668444, 0.01176156010478735, 0.031439557671546936, -0.07011699676513672, -0.02257314883172512, -0.016160836443305016, 0.028182508423924446, -0.012191309593617916, -0.018411366268992424, 0.031914543360471725, 0.011908579617738724, -0.025287354364991188, 0.01371805090457201, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs2", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args2", "annotation": null, "type_commen...
def deco(*args2, **kwargs2): app = TestApp(*args, **default_kw) (app.srcdir / 'docutils.conf').write_text(docutilsconf) try: cwd = os.getcwd() os.chdir(app.srcdir) func(app, *args2, **kwargs2) finally: os.chd...
12,535
[ 0.0051215519197285175, 0.006772524677217007, 0.03196414187550545, -0.019398251548409462, -0.037316884845495224, -0.013109867461025715, -0.01951792649924755, 0.0034678590018302202, 0.010596689768135548, 0.015568647533655167, -0.01691771298646927, -0.06431994587182999, 0.002696770476177335, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cursor", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parameter_name", "annotation": null, "type_comment": null}}], "...
def get_configuration_facts(cursor, parameter_name=''): facts = {} cursor.execute(""" select c.parameter_name, c.current_value, c.default_value from configuration_parameters c where c.node_name = 'ALL' and (? = '' or c.parameter_name ilike ?) """, parameter_name, parameter_na...
12,536
[ 0.003155024955049157, 0.014166346751153469, 0.08377017825841904, -0.026058800518512726, 0.0034193648025393486, -0.036655135452747345, 0.005599458701908588, -0.03838329389691353, 0.0013892058050259948, 0.00441987719386816, 0.030265500769019127, -0.04802459478378296, -0.010863518342375755, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "app", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def test_html_with_docutilsconf(app): app.builder.build(['contents']) result = (app.outdir / 'contents.html').text(encoding='utf-8') assert regex_count(r'<th class="field-name">', result) == 0 assert regex_count(r'<th class="field-name" colspan="2">', result) == 2 assert regex_count(r'<td class="op...
12,537
[ 0.010081402026116848, 0.01609635539352894, 0.03693690150976181, -0.04059186205267906, -0.018226400017738342, 0.07285718619823456, 0.009391558356583118, -0.025124838575720787, 0.022050797939300537, 0.04182631894946098, 0.018819423392415047, -0.08466925472021103, 0.014474617317318916, 0.0206...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): module = AnsibleModule( argument_spec=dict( parameter=dict(required=True, aliases=['name']), value=dict(default=None), db=dict(default=None), cluster=dict(default='localhost'), port=dict(default='5433'), login_user=dict(def...
12,538
[ 0.048269178718328476, 0.014420805498957634, 0.006627575494349003, -0.033615242689847946, -0.007032779045403004, 0.03525825962424278, 0.008931130170822144, 0.005761661101132631, 0.02400137111544609, 0.01253355573862791, 0.0075101424008607864, -0.04791393131017685, 0.0003070249513257295, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "configuration_facts", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cursor", "annotation": null, "type_comment": null}...
def present(configuration_facts, cursor, parameter_name, current_value): parameter_key = parameter_name.lower() changed = False if current_value and current_value.lower() != configuration_facts[parameter_key]['current_value'].lower(): cursor.execute("select set_config_parameter('{0}', '{1}')".format...
12,539
[ 0.036492932587862015, 0.03371438384056091, -0.0018136401195079088, -0.01483198069036007, -0.010184756480157375, -0.04625699296593666, -0.013012225739657879, -0.046687472611665726, -0.0324033759534359, 0.020486917346715927, 0.00924552883952856, -0.007763308938592672, 0.034242697060108185, -...
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": "parent", "annotation":...
class MultiPageWidgetExtensionFactory(QExtensionFactory): def __init__(self, parent=None): super(MultiPageWidgetExtensionFactory, self).__init__(parent) def createExtension(self, obj, iid, parent): if iid != Q_TYPEID['QDesignerContainerExtension']: return None if isinstance(...
12,540
[ 0.04924239590764046, 0.021789181977510452, 0.00861645583063364, -0.008207065984606743, -0.028397219255566597, -0.0148728983476758, -0.015460493974387646, -0.028397219255566597, -0.03756755590438843, 0.0162311103194952, -0.0011763942893594503, 0.005924114491790533, 0.039763811975717545, -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}}, {"_type": "arg", "_fields": {"arg": "widget", "annotation":...
class MultiPageWidgetContainerExtension(QPyDesignerContainerExtension): def __init__(self, widget, parent=None): super(MultiPageWidgetContainerExtension, self).__init__(parent) self._widget = widget def addWidget(self, widget): self._widget.addPage(widget) def coun...
12,541
[ 0.025228746235370636, 0.03152405470609665, 0.0003964262723457068, 0.020560715347528458, -0.02553757280111313, -0.013683387078344822, 0.010547610931098461, 0.029172221198678017, -0.02282940223813057, 0.028364522382616997, 0.004457197152078152, 0.0072455438785254955, 0.04102640599012375, -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": "formEditor", "annotation": null, "type_comment": null}}], "kwarg"...
def initialize(self, formEditor): if self.initialized: return manager = formEditor.extensionManager() if manager: self.factory = MultiPageWidgetExtensionFactory(manager) manager.registerExtensions(self.factory, Q_TYPEID['QDesignerContainerExtension']) ...
12,542
[ 0.04011828079819679, 0.04288724809885025, -0.0196258295327425, 0.015324423089623451, -0.040773533284664154, -0.00046765911974944174, -0.0074508399702608585, -0.012840809300541878, -0.01824134774506092, 0.03200162202119827, -0.0007999084773473442, 0.009321476332843304, 0.028873326256871223, ...
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": "parent", "annotation":...
class MultiPageWidgetPlugin(QPyDesignerCustomWidgetPlugin): def __init__(self, parent=None): super(MultiPageWidgetPlugin, self).__init__(parent) self.initialized = False def initialize(self, formEditor): if self.initialized: return manager = formEditor.extensio...
12,543
[ 0.03359983488917351, 0.04567939415574074, -0.012056812644004822, -0.003346902783960104, -0.035419728606939316, -0.0014786656247451901, 0.019290899857878685, -0.014354431070387363, 0.0011274826247245073, 0.0014672912657260895, 0.01706152781844139, 0.04790876805782318, 0.029482318088412285, ...
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": "title", "annotation": null, "type_comment": null}}], "kwarg": nul...
def pageTitleChanged(self, title): widget = self.sender() if widget and isinstance(widget, PyMultiPageWidget): page = widget.widget(widget.getCurrentIndex()) form = QDesignerFormWindowInterface.findFormWindow(widget) if form: editor = form.core() ...
12,544
[ 0.07280568778514862, 0.08195570111274719, 0.00896267220377922, 0.04433022439479828, 0.027686670422554016, -0.007848500274121761, 0.015332183800637722, 0.03222223371267319, -0.004690859466791153, -0.0110332565382123, -0.014858907088637352, -0.012423506006598473, 0.012581264600157738, -0.020...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user", "annotation": null, "type_comment": null}}, {"_type": "arg...
def user_can_create_object(self, user, obj): roles = getattr(self, "can_be_created_by", None) assert isinstance(roles, tuple), \ "If `can_be_created_by` is None, then `user_can_create_object` method must be overridden with custom behavior." target_object = self._get_target_object(...
12,545
[ 0.04613267630338669, 0.08499787747859955, -0.0162827018648386, 0.04190647974610329, 0.05545400455594063, 0.023066338151693344, -0.02822071686387062, 0.01461394689977169, -0.01516690757125616, -0.031321242451667786, -0.02128896676003933, -0.026996305212378502, -0.00726747652515769, 0.024784...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user", "annotation": null, "type_comment": null}}, {"_type": "arg...
def user_can_read_object(self, user, obj): roles = getattr(self, "can_be_read_by", None) assert isinstance(roles, tuple), \ "If `can_be_read_by` is None, then `user_can_read_object` method must be overridden with custom behavior." target_object = self._get_target_object(obj) ...
12,546
[ 0.0429583415389061, 0.06277614086866379, -0.005884026642888784, 0.0402289442718029, 0.015278691425919533, 0.027293972671031952, 0.040248721837997437, 0.01707851141691208, -0.000761462259106338, 0.015110576525330544, -0.020668262615799904, -0.01118459552526474, -0.02875756286084652, 0.01075...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user", "annotation": null, "type_comment": null}}, {"_type": "arg...
def user_can_update_object(self, user, obj): roles = getattr(self, "can_be_updated_by", None) assert isinstance(roles, tuple), \ "If `can_be_updated_by` is None, then `user_can_update_object` method must be overridden with custom behavior." target_object = self._get_target_object(...
12,547
[ 0.058413755148649216, 0.09218420833349228, -0.008865694515407085, 0.03055693581700325, 0.019452236592769623, 0.041756708174943924, 0.0002819552319124341, 0.05548546463251114, 0.0074966223910450935, -0.003527262946590781, -0.0052528646774590015, -0.042441245168447495, -0.010895534418523312, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user", "annotation": null, "type_comment": null}}, {"_type": "arg...
def user_can_delete_object(self, user, obj): roles = getattr(self, "can_be_deleted_by", None) assert isinstance(roles, tuple), \ "If `can_be_deleted_by` is None, then `user_can_delete_object` method must be overridden with custom behavior." target_object = self._get_target_object(...
12,548
[ 0.03791353479027748, 0.06345780193805695, 0.06293515861034393, 0.03606250137090683, -0.010256906971335411, -0.0014549673069268465, 0.0014413567259907722, 0.003824563231319189, -0.007023041136562824, 0.029660100117325783, 0.0008438538061454892, -0.011411081068217754, 0.008041109889745712, -...
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": {"_type": "arg", "_fields": {"arg": "perms", "annotation": null, "type_comme...
def __init__(self, *perms): self.perms = [] for perm in perms: # ensure that perm is an instance of a subclass of BasePermissions assert isinstance(perm, BasePermissions), \ "each of the arguments to __init__ must be a subclass (or instance of a subclass) of BaseP...
12,549
[ 0.037977319210767746, 0.06363649666309357, 0.06259184330701828, 0.03610565885901451, -0.010239730589091778, -0.0014948808820918202, 0.001658107154071331, 0.003971840254962444, -0.006947999820113182, 0.02955484203994274, 0.0007345183403231204, -0.011360550299286842, 0.008204841986298561, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "perms", "annotation": null, "type_comme...
def __init__(self, *perms): self.perms = [] for perm in perms: # ensure that perm is an instance of a subclass of BasePermissions assert isinstance(perm, BasePermissions), \ "each of the arguments to __init__ must be a subclass (or instance of a subclass) of BaseP...
12,550
[ 0.024418173357844353, 0.019815592095255852, 0.05064127966761589, -0.030090821906924248, -0.009579040110111237, -0.013859312050044537, 0.001088600605726242, -0.014980948530137539, -0.008876405656337738, -0.0027766970451921225, 0.008031954988837242, -0.06673097610473633, -0.002688061911612749,...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CreditProvider.provider_url' db.add_column('credit_creditprovider', 'provider_url', self.gf('django.db.models.fields.URLField')(default='', unique=True, max_length=255), keep_defau...
12,551
[ 0.052734773606061935, 0.013572458177804947, 0.052140191197395325, -0.018374843522906303, -0.014464329928159714, 0.006374596152454615, 0.022742729634046555, 0.03880785405635834, 0.015264727175235748, -0.008066865615546703, 0.05483867600560188, -0.05451851710677147, 0.008604275062680244, 0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def backwards(self, orm): # Deleting field 'CreditProvider.provider_url' db.delete_column('credit_creditprovider', 'provider_url') # Deleting field 'CreditProvider.eligibility_duration' db.delete_column('credit_creditprovider', 'eligibility_duration') # Deleting field 'CreditPr...
12,552
[ 0.01824221946299076, -0.013318080455064774, 0.05606648325920105, 0.017852868884801865, 0.0048325276002287865, -0.03565993160009384, 0.02354425936937332, 0.00846837554126978, 0.023933609947562218, -0.012573733925819397, 0.014932739548385143, -0.025193272158503532, 0.020578322932124138, -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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding field 'CreditProvider.provider_url' db.add_column('credit_creditprovider', 'provider_url', self.gf('django.db.models.fields.URLField')(default='', unique=True, max_length=255), keep_default=False) # Adding field 'Cred...
12,553
[ 0.004333648830652237, 0.0032595209777355194, -0.00865015760064125, -0.07157805562019348, 0.06604743748903275, 0.005907703191041946, 0.00670187221840024, -0.02827013097703457, -0.016180479899048805, -0.03594900295138359, 0.014500726014375687, -0.020408429205417633, 0.023699374869465828, 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}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": n...
class TestStorageMixin(object): def open(self, name, *args, **kwargs): slog.debug('open: %s' % name) return super(TestStorageMixin, self).open(name, *args, **kwargs) def save(self, name, *args, **kwargs): slog.debug('save: %s' % name) return super(TestStorageMixin, self).save(na...
12,554
[ 0.012492325156927109, 0.00925894919782877, 0.008498496375977993, 0.0017008603317663074, 0.004310200456529856, 0.026354627683758736, 0.02707444503903389, -0.02147844061255455, 0.024427372962236404, -0.04871542379260063, 0.05568140745162964, 0.015673456713557243, 0.045441415160894394, 0.0100...
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": "mock_execute", "annotation": null, "type_comment": null}}, {"_typ...
def _test_mount_share(self, mock_execute, already_mounted=False): if already_mounted: err_msg = 'Device or resource busy' mock_execute.side_effect = [ None, processutils.ProcessExecutionError(err_msg)] remotefs.mount_share( mock.sentinel.mount_path, m...
12,555
[ 0.015741661190986633, 0.010005395859479904, 0.025518568232655525, -0.05546260252594948, 0.015104299411177635, 0.04300396144390106, -0.0019812367390841246, -0.010877260006964207, 0.015801791101694107, 0.025614775717258453, 0.026480626314878464, 0.011129800230264664, 0.019806353375315666, -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": "mock_execute", "annotation": null, "type_comment": null}}, {"_typ...
def test_remove_remote_dir_rsync(self, mock_execute, mock_mkdtemp): remotefs.RsyncDriver().remove_dir('host', 'dest', None, None) rsync_call_args = mock.call('rsync', '--archive', '--delete-excluded', '/tmp/Venus/', 'host:dest', ...
12,556
[ 0.02037372626364231, 0.023867394775152206, 0.021286163479089737, -0.04970373213291168, 0.01952132023870945, 0.025260061025619507, 0.0020394737366586924, -0.0002281089109601453, 0.0002736931783147156, 0.016231749206781387, 0.030110375955700874, -0.008349986746907234, 0.03438441455364227, 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": "mock_execute", "annotation": null, "type_comment": null}}, {"_typ...
def test_remove_remote_file_rsync(self, mock_execute, mock_mkdtemp): remotefs.RsyncDriver().remove_file('host', 'dest', None, None) rsync_call_args = mock.call('rsync', '--archive', '--delete', '--include', 'dest', '--exclude', '*',...
12,557
[ 0.010837173089385033, 0.004793807864189148, 0.04033132642507553, -0.04023919254541397, 0.027663005515933037, 0.007520375773310661, 0.02303331159055233, 0.0012006113538518548, -0.001237320713698864, 0.022422928363084793, 0.01739014871418476, 0.038603827357292175, 0.027409639209508896, -0.05...
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": "mock_execute", "annotation": null, "type_comment": null}}, {"_typ...
def test_create_remote_dir_rsync(self, mock_execute, mock_mkdtemp): remotefs.RsyncDriver().create_dir('host', 'dest_dir', None, None) mkdir_call_args = mock.call('mkdir', '-p', '/tmp/Jupiter/dest_dir', on_completion=None, on_execute=None) self.assertEqual(mock...
12,558
[ 0.027817511931061745, 0.01929316483438015, 0.04328460618853569, -0.05186709761619568, 0.02684064209461212, -0.0032998407259583473, 0.028026839718222618, -0.0038289781659841537, -0.010483899153769016, 0.010716486722230911, 0.019700193777680397, 0.02052588202059269, 0.04507553204894066, -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": "mock_execute", "annotation": null, "type_comment": null}}, {"_typ...
def test_create_remote_file_rsync(self, mock_execute, mock_mkdtemp): remotefs.RsyncDriver().create_file('host', 'dest_dir', None, None) mkdir_call_args = mock.call('mkdir', '-p', '/tmp/Mars/', on_completion=None, on_execute=None) self.assertEqual(mock_execute....
12,559
[ 0.014898223802447319, 0.011672775261104107, 0.03872845694422722, -0.047545067965984344, 0.0301426500082016, 0.023795614019036293, 0.03512795642018318, -0.01047837920486927, 0.01215168833732605, -0.0033581589814275503, 0.03535876050591469, 0.012244008481502533, 0.022722387686371803, -0.0072...
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": "mock_execute", "annotation": null, "type_comment": null}}], "kwar...
def test_remote_copy_file_rsync(self, mock_execute): remotefs.RsyncDriver().copy_file('1.2.3.4:/home/star_wars', '/home/favourite', None, None, compression=True) mock_execute.assert_called_once_with('rsync', '--sparse', ...
12,560
[ 0.021540367975831032, 0.013669191859662533, 0.02736116573214531, -0.04879901558160782, 0.015229757875204086, 0.02802184410393238, 0.039777349680662155, -0.009801949374377728, 0.0318264365196228, 0.0009547076188027859, 0.03907110542058945, 0.021540367975831032, 0.024672891944646835, -0.0090...
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": "mock_execute", "annotation": null, "type_comment": null}}], "kwar...
def test_remote_copy_file_rsync_without_compression(self, mock_execute): remotefs.RsyncDriver().copy_file('1.2.3.4:/home/star_wars', '/home/favourite', None, None, compression=False) mock_execute.assert_called_once_with('r...
12,561
[ 0.03426831215620041, 0.01155173685401678, -0.020911039784550667, -0.0313020758330822, -0.007751823402941227, -0.013007218949496746, -0.005504117347300053, -0.024945857003331184, 0.02691720612347126, 0.025166941806674004, -0.020045120269060135, -0.0020300750620663166, 0.01755790412425995, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "function_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "args_dict", "annotation": null, "type_comment": null}}],...
def inherit_function_args(function_name, args_dict): #Allow to add args defined for an other function to the args_dict for key, value in document._theme[function_name].items(): if key not in args_dict: args_dict[key] = value return args_dict
12,562
[ 0.04249889403581619, -0.012908647768199444, 0.049305882304906845, -0.03636365011334419, 0.05418721213936806, 0.009762655012309551, 0.030631449073553085, -0.010630321688950062, 0.012751908041536808, -0.0086038988083601, 0.04818631336092949, -0.016256162896752357, 0.03228841349482536, 0.0023...
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": "mock_execute", "annotation": null, "type_comment": null}}], "kwar...
def test_remote_copy_file_ssh(self, mock_execute): remotefs.SshDriver().copy_file('1.2.3.4:/home/SpaceOdyssey', '/home/favourite', None, None, True) mock_execute.assert_called_once_with('scp', '1.2.3.4:/home/SpaceOdyssey...
12,563
[ 0.052054472267627716, -0.013316260650753975, -0.00135659403167665, -0.011076707392930984, 0.014212082140147686, 0.03261273354291916, 0.000057312881835969165, 0.006434175185859203, 0.03709184005856514, 0.029513675719499588, -0.0006555988220497966, -0.04384681582450867, -0.03375066816806793, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_to_ascii(): # check some classical latin accentuated symbols a = '\xe0\xe1\xe2\xe3\xe4\xe5\xe7\xe8\xe9\xea\xeb' expected = 'aaaaaaceeee' assert_equal(strip_accents_ascii(a), expected) a = '\xec\xed\xee\xef\xf1\xf2\xf3\xf4\xf5\xf6\xf9\xfa\xfb\xfc\xfd' expected = 'iiiinooooouuuuy' as...
12,564
[ 0.051350049674510956, -0.012143263593316078, -0.003468198934569955, -0.01784341223537922, -0.0030282035004347563, 0.04126517474651337, 0.004406043794006109, 0.011619532480835915, 0.0372701995074749, 0.026844285428524017, -0.006388306617736816, -0.03488295525312424, -0.03444448485970497, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_strip_accents(): # check some classical latin accentuated symbols a = '\xe0\xe1\xe2\xe3\xe4\xe5\xe7\xe8\xe9\xea\xeb' expected = 'aaaaaaceeee' assert_equal(strip_accents_unicode(a), expected) a = '\xec\xed\xee\xef\xf1\xf2\xf3\xf4\xf5\xf6\xf9\xfa\xfb\xfc\xfd' expected = 'iiiinooooouuuuy'...
12,565
[ -0.002424093661829829, 0.026673084124922752, -0.007768911775201559, -0.010211797431111336, -0.052315324544906616, -0.0024697300978004932, 0.025320101529359818, 0.015086829662322998, 0.03732513636350632, 0.05686821788549423, 0.009674899280071259, -0.05149924010038376, 0.008917872793972492, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_word_analyzer_unigrams_and_bigrams(): wa = CountVectorizer(analyzer="word", strip_accents='unicode', ngram_range=(1, 2)).build_analyzer() text = "J'ai mang\xe9 du kangourou ce midi, c'\xe9tait pas tr\xeas bon." expected = ['ai', 'mange', 'du', 'kangourou', 'ce', 'midi', ...
12,566
[ 0.015864599496126175, 0.0329148955643177, -0.01943354122340679, -0.050178613513708115, -0.026180146262049675, -0.0074698785319924355, 0.011572383344173431, 0.007629947736859322, 0.036543119698762894, 0.06274697929620743, 0.008821571245789528, -0.026962704956531525, 0.010113978758454323, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "For", "_fields": {"body": [{"_type": "Assign", "_fields": {"va...
def test_word_analyzer_unigrams(): for Vectorizer in (CountVectorizer, HashingVectorizer): wa = Vectorizer(strip_accents='ascii').build_analyzer() text = ("J'ai mang\xe9 du kangourou ce midi, " "c'\xe9tait pas tr\xeas bon.") expected = ['ai', 'mange', 'du', 'kangourou', 'ce'...
12,567
[ 0.023683490231633186, 0.018789220601320267, -0.004321281798183918, -0.0608321912586689, -0.047295358031988144, 0.0003407709882594645, 0.00693553825840354, 0.01742837391793728, 0.016210775822401047, 0.06532059609889984, -0.0008908167365007102, -0.02089017443358898, 0.02173771895468235, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_char_ngram_analyzer(): cnga = CountVectorizer(analyzer='char', strip_accents='unicode', ngram_range=(3, 6)).build_analyzer() text = "J'ai mang\xe9 du kangourou ce midi, c'\xe9tait pas tr\xeas bon" expected = ["j'a", "'ai", 'ai ', 'i m', ' ma'] assert_equal(cnga(text...
12,568
[ 0.01275520958006382, 0.030879881232976913, -0.01964784413576126, -0.014771497808396816, -0.029411498457193375, -0.003205239539965987, 0.028469102457165718, -0.014618083834648132, 0.0464184433221817, 0.012097724713385105, 0.035065870732069016, -0.016196047887206078, -0.009725299663841724, 0...
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": "Constant", "_fields":...
def test_unicode_decode_error(): # decode_error default to strict, so this should fail # First, encode (as bytes) a unicode string. text = "J'ai mang\xe9 du kangourou ce midi, c'\xe9tait pas tr\xeas bon." text_bytes = text.encode('utf-8') # Then let the Analyzer try to decode it as ascii. It shoul...
12,569
[ 0.019141854718327522, 0.02316032163798809, 0.008476076647639275, -0.02458001859486103, -0.05953105166554451, -0.004989996552467346, 0.015087295323610306, 0.014569947496056557, 0.012175711803138256, 0.06742360442876816, -0.0008662561886012554, 0.005705860909074545, 0.023172352463006973, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_char_wb_ngram_analyzer(): cnga = CountVectorizer(analyzer='char_wb', strip_accents='unicode', ngram_range=(3, 6)).build_analyzer() text = "This \n\tis a test, really.\n\n I met Harry yesterday" expected = [' th', 'thi', 'his', 'is ', ' thi'] assert_equal(cnga(text)[:...
12,570
[ -0.02485642209649086, 0.015162905678153038, 0.0013406414072960615, -0.0509825237095356, -0.03474527224898338, 0.0084970872849226, -0.013221760280430317, 0.03210824728012085, 0.007727954536676407, 0.04841874539852142, 0.027029527351260185, -0.015797745436429977, -0.015663452446460724, 0.003...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"k...
def test_countvectorizer_custom_vocabulary(): vocab = {"pizza": 0, "beer": 1} terms = set(vocab.keys()) # Try a few of the supported types. for typ in [dict, list, iter, partial(defaultdict, int)]: v = typ(vocab) vect = CountVectorizer(vocabulary=v) vect.fit(JUNK_FOOD_DOCS) ...
12,571
[ 0.026133211329579353, 0.0004416362789925188, 0.039721593260765076, 0.005733985919505358, -0.10568740963935852, 0.00543424254283309, 0.008098631165921688, 0.047026459127664566, 0.007182747591286898, 0.07815539836883545, 0.02833133190870285, -0.018384281545877457, 0.02371305786073208, 0.0110...
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_countvectorizer_stop_words(): cv = CountVectorizer() cv.set_params(stop_words='english') assert_equal(cv.get_stop_words(), ENGLISH_STOP_WORDS) cv.set_params(stop_words='_bad_str_stop_') assert_raises(ValueError, cv.get_stop_words) cv.set_params(stop_words='_bad_unicode_stop_') asser...
12,572
[ -0.012331370264291763, -0.01750447414815426, -0.01637176238000393, -0.02811926230788231, -0.029987651854753494, -0.005692749284207821, 0.00384187581948936, 0.031202103942632675, -0.015215696766972542, 0.051053743809461594, 0.02688145451247692, -0.008069107308983803, -0.021124478429555893, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c...
def test_countvectorizer_custom_vocabulary_pipeline(): what_we_like = ["pizza", "beer"] pipe = Pipeline([ ('count', CountVectorizer(vocabulary=what_we_like)), ('tfidf', TfidfTransformer())]) X = pipe.fit_transform(ALL_FOOD_DOCS) assert_equal(set(pipe.named_steps['count'].vocabulary_), ...
12,573
[ 0.009146241471171379, 0.002966348547488451, -0.007397783920168877, -0.030676385387778282, -0.018087491393089294, 0.02262142114341259, -0.006463263183832169, 0.040708914399147034, -0.01596522517502308, 0.08103195577859879, 0.01891951635479927, -0.03754962980747223, -0.0037380815483629704, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Try", "_fields": {"body": [{"_type": "Assign", "_fields": {"va...
def test_countvectorizer_empty_vocabulary(): try: vect = CountVectorizer(vocabulary=[]) vect.fit(["foo"]) assert False, "we shouldn't get here" except ValueError as e: assert_in("empty vocabulary", str(e).lower()) try: v = CountVectorizer(max_df=1.0, stop_words="engl...
12,574
[ 0.014914672821760178, -0.00711143808439374, -0.008459855802357197, 0.009526864625513554, 0.0030251459684222937, -0.02790638618171215, -0.003848853288218379, 0.0018995102727785707, 0.032713789492845535, 0.09192691743373871, 0.027038708329200745, 0.027132511138916016, -0.03895168751478195, 0...
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": "List", "_fields": {"c...
def test_tf_idf_smoothing(): X = [[1, 1, 1], [1, 1, 0], [1, 0, 0]] tr = TfidfTransformer(smooth_idf=True, norm='l2') tfidf = tr.fit_transform(X).toarray() assert_true((tfidf >= 0).all()) # check normalization assert_array_almost_equal((tfidf ** 2).sum(axis=1), [1., 1., 1.]) ...
12,575
[ 0.016818156465888023, -0.0007335658301599324, -0.030807536095380783, 0.011564712040126324, -0.004516536835581064, -0.029642745852470398, -0.00038702561869286, 0.012681960128247738, 0.01861288584768772, 0.10839688777923584, 0.02169126272201538, 0.016247646883130074, -0.02731316350400448, 0....
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": "List", "_fields": {"c...
def test_tfidf_no_smoothing(): X = [[1, 1, 1], [1, 1, 0], [1, 0, 0]] tr = TfidfTransformer(smooth_idf=False, norm='l2') tfidf = tr.fit_transform(X).toarray() assert_true((tfidf >= 0).all()) # check normalization assert_array_almost_equal((tfidf ** 2).sum(axis=1), [1., 1., 1.])...
12,576
[ -0.022283246740698814, -0.016786474734544754, 0.01746172457933426, -0.027768170461058617, 0.03499452769756317, -0.00646225968375802, 0.016146764159202576, -0.0033110936637967825, 0.00873086228966713, 0.0623125322163105, 0.002090905327349901, 0.031085187569260597, -0.01848052255809307, 0.03...
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": "List", "_fields": {"c...
def test_sublinear_tf(): X = [[1], [2], [3]] tr = TfidfTransformer(sublinear_tf=True, use_idf=False, norm=None) tfidf = tr.fit_transform(X).toarray() assert_equal(tfidf[0], 1) assert_greater(tfidf[1], tfidf[0]) assert_greater(tfidf[2], tfidf[1]) assert_less(tfidf[1], 2) assert_less(tfidf...
12,577
[ 0.002754868706688285, -0.01385047659277916, -0.03300203010439873, -0.013500831089913845, -0.00467509962618351, -0.03469386324286461, 0.02682119980454445, 0.014651277102530003, 0.035911984741687775, 0.06262039393186569, -0.0016467178938910365, 0.025580521672964096, -0.01473022997379303, 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": "Call", "_fields": {"a...
def test_tfidf_vectorizer_setters(): tv = TfidfVectorizer(norm='l2', use_idf=False, smooth_idf=False, sublinear_tf=False) tv.norm = 'l1' assert_equal(tv._tfidf.norm, 'l1') tv.use_idf = True assert_true(tv._tfidf.use_idf) tv.smooth_idf = True assert_true(tv._tfidf.smo...
12,578
[ -0.014002057723701, 0.026689928025007248, -0.017060527577996254, -0.044706229120492935, -0.0006387991015799344, 0.0024357247166335583, 0.009265013039112091, 0.0163675919175148, 0.004420444834977388, 0.05380995571613312, 0.02955724485218525, 0.015507398173213005, 0.0031570338178426027, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_vectorizer(): # raw documents as an iterator train_data = iter(ALL_FOOD_DOCS[:-1]) test_data = [ALL_FOOD_DOCS[-1]] n_train = len(ALL_FOOD_DOCS) - 1 # test without vocabulary v1 = CountVectorizer(max_df=0.5) counts_train = v1.fit_transform(train_data) if hasattr(counts_train, 't...
12,579
[ -0.02306770719587803, 0.04128031060099602, -0.008155612275004387, -0.008430655114352703, 0.015964431688189507, -0.0228046216070652, 0.00868178065866232, 0.04393507167696953, 0.013273796997964382, 0.028652267530560493, 0.026284510269761086, 0.012257334776222706, -0.026451926678419113, 0.013...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_hashing_vectorizer(): v = HashingVectorizer() X = v.transform(ALL_FOOD_DOCS) token_nnz = X.nnz assert_equal(X.shape, (len(ALL_FOOD_DOCS), v.n_features)) assert_equal(X.dtype, v.dtype) # By default the hashed values receive a random sign and l2 normalization # makes the feature valu...
12,580
[ -0.004701066296547651, 0.01813352480530739, 0.025393996387720108, -0.017745202407240868, -0.03205433115363121, -0.030548106878995895, -0.01713329739868641, 0.013108856044709682, 0.021910851821303368, 0.04975246265530586, 0.042974453419446945, -0.024382000789046288, -0.009355063550174236, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_feature_names(): cv = CountVectorizer(max_df=0.5) # test for Value error on unfitted/empty vocabulary assert_raises(ValueError, cv.get_feature_names) X = cv.fit_transform(ALL_FOOD_DOCS) n_samples, n_features = X.shape assert_equal(len(cv.vocabulary_), n_features) feature_names = ...
12,581
[ 0.002065367763862014, 0.03058013506233692, 0.047308556735515594, -0.04344071447849274, -0.039427828043699265, -0.010388785041868687, 0.014987892471253872, -0.025140982121229172, 0.011470573022961617, 0.05690564587712288, 0.034302935004234314, -0.04259462282061577, -0.03084605000913143, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_count_vectorizer_max_features(): # Regression test: max_features didn't work correctly in 0.14. cv_1 = CountVectorizer(max_features=1) cv_3 = CountVectorizer(max_features=3) cv_None = CountVectorizer(max_features=None) counts_1 = cv_1.fit_transform(JUNK_FOOD_DOCS).sum(axis=0) counts_3...
12,582
[ 0.0008423668332397938, 0.017593516036868095, -0.009018280543386936, -0.049527671188116074, -0.04754563048481941, 0.004369231406599283, 0.0012431468348950148, 0.019867032766342163, 0.0046898555010557175, 0.04024706408381462, 0.041692785918712616, -0.024484017863869667, -0.016345996409654617, ...
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": "Tuple", "_fields": {"...
def test_vectorizer_max_features(): vec_factories = ( CountVectorizer, TfidfVectorizer, ) expected_vocabulary = set(['burger', 'beer', 'salad', 'pizza']) expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke', u'sparkling', u'water', u'the'...
12,583
[ 0.021736737340688705, 0.01714584045112133, 0.008305016905069351, -0.023380693048238754, -0.0227474644780159, 0.03835894912481308, 0.002703392645344138, 0.022601336240768433, -0.013407365418970585, 0.056746888905763626, 0.04868542030453682, 0.006350536830723286, -0.008865179494023323, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c...
def test_vectorizer_max_df(): test_data = ['abc', 'dea', 'eat'] vect = CountVectorizer(analyzer='char', max_df=1.0) vect.fit(test_data) assert_true('a' in vect.vocabulary_.keys()) assert_equal(len(vect.vocabulary_.keys()), 6) assert_equal(len(vect.stop_words_), 0) vect.max_df = 0.5 # 0.5 *...
12,584
[ -0.004117670468986034, 0.011277387849986553, -0.0007112753228284419, -0.03034774772822857, -0.01753721758723259, 0.03517138957977295, 0.00778691191226244, 0.039170894771814346, -0.013246839866042137, 0.06728861480951309, 0.045473143458366394, -0.0017285732319578528, -0.004929691087454557, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c...
def test_vectorizer_min_df(): test_data = ['abc', 'dea', 'eat'] vect = CountVectorizer(analyzer='char', min_df=1) vect.fit(test_data) assert_true('a' in vect.vocabulary_.keys()) assert_equal(len(vect.vocabulary_.keys()), 6) assert_equal(len(vect.stop_words_), 0) vect.min_df = 2 vect.fit...
12,585
[ 0.02320619858801365, 0.015106244012713432, 0.024561885744333267, -0.002091918606311083, -0.008635394275188446, 0.03217196837067604, 0.03697953745722771, -0.010657534934580326, 0.019013816490769386, 0.07924512028694153, 0.018763184547424316, -0.011426517739892006, 0.04069343954324722, 0.017...
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": "List", "_fields": {"c...
def test_count_binary_occurrences(): # by default multiple occurrences are counted as longs test_data = ['aaabc', 'abbde'] vect = CountVectorizer(analyzer='char', max_df=1.0) X = vect.fit_transform(test_data).toarray() assert_array_equal(['a', 'b', 'c', 'd', 'e'], vect.get_feature_names()) asser...
12,586
[ 0.008281857706606388, 0.025379696860909462, 0.05667584389448166, -0.021012792363762856, -0.0018973143305629492, 0.009150543250143528, 0.030028337612748146, 0.013124191202223301, 0.019592374563217163, 0.05451587215065956, 0.028314445167779922, 0.005156351253390312, 0.03120223619043827, 0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c...
def test_hashed_binary_occurrences(): # by default multiple occurrences are counted as longs test_data = ['aaabc', 'abbde'] vect = HashingVectorizer(analyzer='char', non_negative=True, norm=None) X = vect.transform(test_data) assert_equal(np.max(X[0:1].data), 3) asse...
12,587
[ -0.0064145768992602825, 0.026705089956521988, 0.02466021478176117, -0.028311775997281075, -0.00974358431994915, -0.01711365394294262, -0.028579557314515114, 0.0047531165182590485, -0.0029395073652267456, 0.03249889984726906, 0.05584455281496048, -0.06567942351102829, -0.018294325098395348, ...
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": "BinOp", "_fields": {"...
def test_count_vectorizer_pipeline_grid_selection(): # raw documents data = JUNK_FOOD_DOCS + NOTJUNK_FOOD_DOCS # label junk food as -1, the others as +1 target = [-1] * len(JUNK_FOOD_DOCS) + [1] * len(NOTJUNK_FOOD_DOCS) # split the dataset for model development and final evaluation train_data,...
12,588
[ 0.006466451566666365, 0.023104211315512657, 0.0005820801015943289, -0.022342784330248833, 0.015808144584298134, -0.029047891497612, -0.004429348744452, 0.006267571356147528, 0.019978949800133705, 0.03813956305384636, 0.0405261255800724, -0.004489012993872166, 0.0023624140303581953, -0.0085...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"i...
def test_vectorizer_inverse_transform(): # raw documents data = ALL_FOOD_DOCS for vectorizer in (TfidfVectorizer(), CountVectorizer()): transformed_data = vectorizer.fit_transform(data) inversed_data = vectorizer.inverse_transform(transformed_data) analyze = vectorizer.build_analyzer...
12,589
[ -0.0032772275153547525, 0.01560351625084877, 0.034337520599365234, -0.029568418860435486, -0.008511008694767952, -0.027562951669096947, -0.02398001216351986, 0.0000950571775319986, -0.006316000130027533, 0.0318429134786129, 0.027856435626745224, -0.05977271869778633, -0.018819602206349373, ...
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": "BinOp", "_fields": {"...
def test_vectorizer_pipeline_grid_selection(): # raw documents data = JUNK_FOOD_DOCS + NOTJUNK_FOOD_DOCS # label junk food as -1, the others as +1 target = [-1] * len(JUNK_FOOD_DOCS) + [1] * len(NOTJUNK_FOOD_DOCS) # split the dataset for model development and final evaluation train_data, test_...
12,590
[ 0.033253252506256104, 0.018153812736272812, 0.06630945205688477, -0.03640615567564964, 0.007094027474522591, -0.005591473076492548, 0.012919505126774311, 0.007346505764871836, 0.007198713719844818, 0.020678596571087837, 0.006355066318064928, -0.044436197727918625, -0.009674233384430408, 0....
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": "BinOp", "_fields": {"...
def test_vectorizer_pipeline_cross_validation(): # raw documents data = JUNK_FOOD_DOCS + NOTJUNK_FOOD_DOCS # label junk food as -1, the others as +1 target = [-1] * len(JUNK_FOOD_DOCS) + [1] * len(NOTJUNK_FOOD_DOCS) pipeline = Pipeline([('vect', TfidfVectorizer()), ('svc',...
12,591
[ -0.009391912259161472, 0.021944621577858925, -0.003405096009373665, -0.026227382943034172, -0.008366462774574757, -0.006852416321635246, 0.02299419976770878, 0.0035408171825110912, 0.010393233969807625, 0.051248352974653244, 0.032404206693172455, -0.009940829128026962, -0.009385880082845688,...
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_vectorizer_unicode(): # tests that the count vectorizer works with cyrillic. document = ( "\xd0\x9c\xd0\xb0\xd1\x88\xd0\xb8\xd0\xbd\xd0\xbd\xd0\xbe\xd0" "\xb5 \xd0\xbe\xd0\xb1\xd1\x83\xd1\x87\xd0\xb5\xd0\xbd\xd0\xb8\xd0" "\xb5 \xe2\x80\x94 \xd0\xbe\xd0\xb1\xd1\x88\xd0\xb8\xd1\x8...
12,592
[ -0.0004315802361816168, 0.020335743203759193, 0.008444718085229397, -0.03299332037568092, -0.042774748057127, 0.005783966742455959, -0.008432048372924328, -0.012575218454003334, -0.012987001799046993, 0.05539431422948837, 0.015419688075780869, -0.011225837282836437, 0.005901166703552008, 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": "List", "_fields": {"c...
def test_tfidf_vectorizer_with_fixed_vocabulary(): # non regression smoke test for inheritance issues vocabulary = ['pizza', 'celeri'] vect = TfidfVectorizer(vocabulary=vocabulary) X_1 = vect.fit_transform(ALL_FOOD_DOCS) X_2 = vect.transform(ALL_FOOD_DOCS) assert_array_almost_equal(X_1.toarray()...
12,593
[ -0.006894356105476618, -0.002159564755856991, -0.027177387848496437, -0.04185367748141289, -0.025702258571982384, 0.03042767383158207, -0.01847662404179573, 0.033202916383743286, -0.026927366852760315, 0.022576984018087387, 0.05320467799901962, -0.004453516565263271, -0.00025470988475717604,...
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": "List", "_fields": {"c...
def test_pickling_vectorizer(): instances = [ HashingVectorizer(), HashingVectorizer(norm='l1'), HashingVectorizer(binary=True), HashingVectorizer(ngram_range=(1, 2)), CountVectorizer(), CountVectorizer(preprocessor=strip_tags), CountVectorizer(analyzer=lazy_a...
12,594
[ 0.03997379541397095, 0.02409093640744686, -0.017691418528556824, -0.028936946764588356, -0.04855285957455635, 0.03387570381164551, -0.005527119152247906, 0.045376285910606384, -0.0065676202066242695, 0.020891176536679268, 0.04004335403442383, -0.006034327205270529, -0.024485109373927116, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"...
def test_stop_words_removal(): # Ensure that deleting the stop_words_ attribute doesn't affect transform fitted_vectorizers = ( TfidfVectorizer().fit(JUNK_FOOD_DOCS), CountVectorizer(preprocessor=strip_tags).fit(JUNK_FOOD_DOCS), CountVectorizer(strip_accents=strip_eacute).fit(JUNK_FOOD_...
12,595
[ 0.005975724197924137, -0.010395601391792297, -0.06137024238705635, -0.02077850140631199, 0.00756967393681407, -0.0024353775661438704, -0.012383275665342808, 0.011995901353657246, -0.02916102670133114, 0.02123573049902916, 0.06182747334241867, -0.012707145884633064, -0.0064329528249800205, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_pickling_transformer(): X = CountVectorizer().fit_transform(JUNK_FOOD_DOCS) orig = TfidfTransformer().fit(X) s = pickle.dumps(orig) copy = pickle.loads(s) assert_equal(type(copy), orig.__class__) assert_array_equal( copy.fit_transform(X).toarray(), orig.fit_transform(X)....
12,596
[ -0.00645502470433712, 0.04232802987098694, 0.005937063135206699, 0.009941518306732178, 0.038095228374004364, -0.05426899343729019, -0.02321358397603035, 0.039810627698898315, 0.025307707488536835, 0.017009185627102852, 0.027134496718645096, -0.009100526571273804, -0.027780555188655853, 0.0...
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": "Constant", "_fields":...
def test_hashingvectorizer_nan_in_docs(): # np.nan can appear when using pandas to load text fields from a csv file # with missing values. message = "np.nan is an invalid document, expected byte or unicode string." exception = ValueError def func(): hv = HashingVectorizer() hv.fit_t...
12,597
[ 0.003580369520932436, 0.0025065720546990633, -0.013518872670829296, -0.020453879609704018, -0.025833839550614357, -0.007223442196846008, -0.006380080245435238, -0.0685223788022995, 0.011349332518875599, -0.013155193068087101, 0.020315932109951973, -0.042186908423900604, 0.04248788580298424, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.move"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n...
class stock_move(orm.Model): _inherit = "stock.move" def _get_direction(self, cr, uid, ids, field_name, arg, context=None): if context is None: context = {} res = {} for move in self.browse(cr, uid, ids, context=context): # import pdb; pdb.set_trace() ...
12,598
[ 0.010006492957472801, 0.004547376185655594, -0.005360014270991087, -0.04143039137125015, -0.0037035916466265917, -0.016807736828923225, 0.0177477914839983, 0.03887072205543518, 0.02681989222764969, 0.09092487394809723, -0.011790333315730095, 0.011258012615144253, 0.026095030829310417, 0.03...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_tfidfvectorizer_binary(): # Non-regression test: TfidfVectorizer used to ignore its "binary" param. v = TfidfVectorizer(binary=True, use_idf=False, norm=None) assert_true(v.binary) X = v.fit_transform(['hello world', 'hello hello']).toarray() assert_array_equal(X.ravel(), [1, 1, 1, 0]) ...
12,599
[ -0.02473745495080948, 0.0010099827777594328, 0.07558000087738037, -0.044892121106386185, 0.0332552008330822, -0.003988944459706545, -0.003335117595270276, -0.01234473381191492, 0.011295011267066002, 0.06962957978248596, 0.006820195354521275, -0.000373776099877432, -0.011408980935811996, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store_true', default=False, help='Produce a context format diff (default)') parser.add_argument('-u', action='store_true', default=False, help='Produce a unified format diff') ...
12,600
[ -0.02752836048603058, -0.002032747259363532, 0.007552551571279764, -0.0031074576545506716, -0.021770279854536057, -0.0036711052525788546, -0.0077103073708713055, -0.03599458187818527, 0.011982856318354607, 0.023492444306612015, 0.008669987320899963, -0.0038190013729035854, 0.0319981053471565...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _get_direction(self, cr, uid, ids, field_name, arg, context=None): if context is None: context = {} res = {} for move in self.browse(cr, uid, ids, context=context): # import pdb; pdb.set_trace() # ('supplier', 'Supplier Location'), ('view', 'View'), ('internal', 'Int...