Search is not available for this dataset
id
int64
0
10.8M
vector
listlengths
1.54k
1.54k
ast_depth
int64
3
164
ast_data
stringlengths
297
510k
full_path
stringlengths
0
319
code
stringlengths
60
56.5k
10,101
[ -0.005120881367474794, 0.0009229090064764023, 0.025377819314599037, 0.008819488808512688, 0.016063323244452477, 0.021417763084173203, 0.025810077786445618, -0.009300552308559418, -0.01929829642176628, 0.04054873436689377, 0.028389692306518555, -0.04788320139050484, -0.005465991795063019, 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_20_auto_join(self): registry, cr, uid = self.registry, self.cr, self.uid unaccent = get_unaccent_wrapper(cr) # Get models partner_obj = registry('res.partner') state_obj = registry('res.country.state') bank_obj = registry('res.partner.bank') # Get test ...
10,102
[ 0.010779209434986115, 0.015970133244991302, 0.055353038012981415, -0.006420851219445467, -0.024913912639021873, -0.008773481473326683, -0.015780914574861526, 0.05414203181862831, -0.013913947157561779, 0.06902730464935303, -0.02423272281885147, -0.04271316900849342, 0.028887523338198662, -...
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_translate_search(self): Country = self.registry('res.country') be = self.ref('base.be') domains = [ [('name', '=', 'Belgium')], [('name', 'ilike', 'Belgi')], [('name', 'in', ['Belgium', 'Care Bears'])], ] for domain in domains: ...
10,103
[ 0.014046340249478817, -0.02273492142558098, 0.027665957808494568, -0.007764011155813932, -0.021241385489702225, 0.029064664617180824, -0.013643323443830013, 0.026788800954818726, -0.008890088647603989, 0.06538364291191101, 0.030487079173326492, -0.0273340605199337, -0.013394400477409363, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class EUCTWDistributionAnalysis(CharDistributionAnalysis): def __init__(self): CharDistributionAnalysis.__init__(self) self._mCharToFreqOrder = EUCTWCharToFreqOrder self._mTableSize = EUCTW_TABLE_SIZE self._mTypicalDistributionRatio = EUCTW_TYPICAL_DISTRIBUTION_RATIO def get_ord...
10,104
[ 0.015811296179890633, -0.009103121235966682, 0.016950638964772224, -0.007440609857439995, -0.017183158546686172, 0.03129706531763077, -0.02441450208425522, 0.022217197343707085, -0.018392257392406464, 0.06394274532794952, 0.026646684855222702, -0.04266724735498428, -0.011974731460213661, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class EUCKRDistributionAnalysis(CharDistributionAnalysis): def __init__(self): CharDistributionAnalysis.__init__(self) self._mCharToFreqOrder = EUCKRCharToFreqOrder self._mTableSize = EUCKR_TABLE_SIZE self._mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO def get_ord...
10,105
[ 0.0004201833507977426, -0.015357837080955505, -0.005946971941739321, 0.0193680077791214, 0.00674776453524828, 0.007356118410825729, -0.012322274036705494, 0.02461971715092659, 0.00716988742351532, 0.03136127442121506, 0.030094904825091362, -0.013805913738906384, -0.007449233904480934, 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}}, {"_type": "arg", "_fields": {"arg": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_order(self, aBuf): # for euc-TW encoding, we are interested # first byte range: 0xc4 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xC4: return 94...
10,106
[ 0.022120151668787003, -0.011262141168117523, 0.030048223212361336, -0.002822963986545801, -0.02565034292638302, 0.010453881695866585, -0.016141410917043686, 0.00862935557961464, -0.010632174089550972, 0.044715750962495804, 0.018922774121165276, -0.005075392313301563, -0.017246823757886887, ...
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 GB2312DistributionAnalysis(CharDistributionAnalysis): def __init__(self): CharDistributionAnalysis.__init__(self) self._mCharToFreqOrder = GB2312CharToFreqOrder self._mTableSize = GB2312_TABLE_SIZE self._mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO def get...
10,107
[ -0.009550033137202263, -0.00042578528518788517, -0.006327285896986723, 0.019348926842212677, 0.0083243940025568, 0.004423500970005989, -0.022310370579361916, 0.026727650314569473, 0.00113776046782732, 0.03722957521677017, 0.02476165071129799, -0.01693497784435749, -0.006401944439858198, 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": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: return 94...
10,108
[ 0.033087294548749924, -0.021010782569646835, 0.011038868688046932, -0.003115857020020485, -0.014773206785321236, 0.006788640283048153, -0.017962343990802765, 0.0034675998613238335, -0.006882438436150551, 0.0445072166621685, 0.017012637108564377, -0.040895987302064896, -0.02332056127488613, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class Big5DistributionAnalysis(CharDistributionAnalysis): def __init__(self): CharDistributionAnalysis.__init__(self) self._mCharToFreqOrder = Big5CharToFreqOrder self._mTableSize = BIG5_TABLE_SIZE self._mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO def get_order(s...
10,109
[ -0.00373471574857831, -0.006090271752327681, -0.0010114855831488967, 0.014633739367127419, -0.0037164082750678062, -0.01236972026526928, -0.017587337642908096, 0.011796087957918644, 0.000651439419016242, 0.018392864614725113, 0.03297778591513634, -0.007676915731281042, -0.01993068866431713, ...
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": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_order(self, aBuf): # for GB2312 encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1]) if (first_char...
10,110
[ -0.0024998807348310947, -0.010212145745754242, -0.012657308019697666, 0.0013914282899349928, -0.004533867817372084, -0.0008676884463056922, -0.008692518807947636, 0.010224653407931328, 0.01358284242451191, 0.024226486682891846, 0.03329422324895859, -0.025939976796507835, -0.02881663665175438...
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": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_order(self, aBuf): # for big5 encoding, we are interested # first byte range: 0xa4 -- 0xfe # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(aBuf[1]) ...
10,111
[ 0.00881789531558752, -0.02378212660551071, 0.019405189901590347, -0.013934020884335041, 0.007490845862776041, -0.004013161174952984, -0.02663411945104599, 0.002409642795100808, -0.014783798716962337, 0.04917068034410477, 0.03631925210356712, -0.010750265792012215, -0.013491670601069927, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class SJISDistributionAnalysis(CharDistributionAnalysis): def __init__(self): CharDistributionAnalysis.__init__(self) self._mCharToFreqOrder = JISCharToFreqOrder self._mTableSize = JIS_TABLE_SIZE self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO def get_order(self...
10,112
[ -0.0009968404192477465, -0.017787441611289978, -0.014764422550797462, 0.004108282271772623, 0.002152389148250222, -0.006469259969890118, -0.03083479031920433, 0.004827760625630617, 0.00312277814373374, 0.024220425635576248, 0.04846503213047981, -0.02411159686744213, -0.021028118208050728, ...
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": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_order(self, aBuf): # for sjis encoding, we are interested # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe # no validation needed here. State machine has done that first_char, second_char = wrap_ord(aBuf[0]), wrap_ord(a...
10,113
[ 0.005876078736037016, -0.016525929793715477, 0.02248590998351574, 0.0031101845670491457, -0.00036436173832044005, 0.006700639612972736, -0.01741703413426876, 0.03282040357589722, 0.009026767686009407, 0.053188495337963104, 0.0406436026096344, -0.016086162999272346, -0.0063013783656060696, ...
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 EUCJPDistributionAnalysis(CharDistributionAnalysis): def __init__(self): CharDistributionAnalysis.__init__(self) self._mCharToFreqOrder = JISCharToFreqOrder self._mTableSize = JIS_TABLE_SIZE self._mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO def get_order(sel...
10,114
[ -0.019940517842769623, -0.026243342086672783, -0.036416325718164444, -0.03265674412250519, -0.015763206407427788, 0.030690951272845268, -0.03341848775744438, 0.029192032292485237, -0.016463520005345345, -0.03710435330867767, 0.02698051556944847, -0.007298008073121309, -0.022250324487686157, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": n...
class nn_rf_switch(Instrument): def __init__(self, name, address): logging.info(__name__ + ' : Initializing instrument nn_rf_switch') Instrument.__init__(self, name, tags=['physical']) self._address = address self.num_channels = 2 self.add_parameter('switch', type=int, flags=Instrument.FLAG_GETSET, ...
10,115
[ -0.006248158402740955, -0.010157533921301365, -0.007936934009194374, 0.02450745925307274, 0.013734130188822746, 0.0023325628135353327, -0.026622317731380463, 0.02853812836110592, 0.010082891210913658, 0.021322734653949738, 0.040679894387722015, -0.014480549842119217, -0.019257638603448868, ...
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": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_order(self, aBuf): # for euc-JP encoding, we are interested # first byte range: 0xa0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that char = wrap_ord(aBuf[0]) if char >= 0xA0: return 94 * (char - 0...
10,116
[ -0.009162536822259426, -0.010776291601359844, -0.015671346336603165, -0.03700876235961914, -0.024146543815732002, 0.026561196893453598, -0.01954435557126999, 0.012599235400557518, -0.026035232469439507, -0.019508494064211845, 0.02238934487104416, 0.014320573769509792, -0.015587669797241688, ...
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, name, address): logging.info(__name__ + ' : Initializing instrument nn_rf_switch') Instrument.__init__(self, name, tags=['physical']) self._address = address self.num_channels = 2 self.add_parameter('switch', type=int, flags=Instrument.FLAG_GETSET, minval=1, maxval=6, channels...
10,117
[ 0.00653686560690403, -0.049348071217536926, -0.06759048998355865, -0.01911945454776287, 0.00560428062453866, 0.0368824228644371, -0.00019093873561359942, 0.03325732797384262, 0.03812197223305702, -0.041115596890449524, 0.009425248019397259, 0.007712097838521004, -0.019213005900382996, 0.00...
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": "switch", "annotation": null, "type_comment": null}}, {"_type": "a...
def do_set_switch(self, switch, channel): if switch != self.do_get_switch(channel=channel): act = 1 else : act = 0 url = 'http://{0}/?pos={1}&ch={2}&act={3}'.format(self._address, switch, channel, act) #print (url) r = requests.get(url) time.sleep(1)
10,118
[ -0.026101117953658104, -0.013366494327783585, 0.029965249821543694, -0.016829630360007286, 0.011987314559519291, 0.013074860908091068, 0.001089065452106297, -0.03290587663650513, 0.0233913641422987, 0.07159580290317535, -0.05293131619691849, -0.02522621862590313, -0.004599289037287235, -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 TestCrossCorrelation(TestCase): def testRegression(self): testdir = join(filedir(), 'crosscorrelation') input1 = readVector(join(testdir, 'input1.txt')) input2 = readVector(join(testdir, 'input2.txt')) expected = readVector(join(testdir, 'output.txt')) xcor = CrossCorr...
10,119
[ 0.012432541698217392, -0.037490375339984894, -0.04042985290288925, -0.02326282672584057, 0.004556791391223669, 0.015323829837143421, -0.031370483338832855, 0.05893409997224808, 0.024865083396434784, -0.02432296611368656, 0.025660187005996704, -0.010137581266462803, -0.05546455457806587, 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": "channel", "annotation": null, "type_comment": null}}], "kwarg": n...
def do_get_switch(self, channel): r = requests.get('http://{0}/'.format(self._address)) time.sleep(1) answer = r.text matches = re.finditer('\\?pos=([0-9]+)&ch=([0-9]+)&act=([0-9]+)', answer) for match in matches: #print (match.groups()) #print (match.group(1), match.group(2), match.group(3)) if int(...
10,120
[ 0.0320696085691452, 0.026755480095744133, 0.013701208867132664, 0.01683192327618599, -0.014937321655452251, 0.016554664820432663, 0.030567791312932968, -0.021857241168618202, 0.004314841236919165, 0.024722250178456306, 0.009143766947090626, -0.03904728963971138, 0.001010839594528079, -0.00...
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": "adjustment_type", "annotation": null, "type_comment": null}}, {"_...
def _make_adjustment(self, adjustment_type, front_close, back_close, end_loc): adj_base = back_close - front_close if adjustment_type == 'mul': adj_value = 1.0 + adj_base / front_close ...
10,121
[ 0.0011242922628298402, -0.024120256304740906, 0.006855729501694441, -0.015200363472104073, -0.012675993144512177, 0.012730135582387447, -0.0012012753868475556, -0.04217660799622536, 0.027910195291042328, 0.08262067288160324, -0.054006632417440414, -0.03762868419289589, 0.012838419526815414, ...
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 testZeroSignals(self): x = [0]*50 y = [0]*50 self.assertAlmostEqualVector(CrossCorrelation(minLag=-49, maxLag=49)(x, y), [0]*(50*2 - 1)) x = [10]*50 y = [0] self.assertAlmostEqualVector(CrossCorrelation(maxLag=49)(x, y), [0]*50)
10,122
[ 0.008233181200921535, 0.04263262450695038, 0.060024652630090714, 0.006955506280064583, -0.050064001232385635, 0.0058733937330543995, 0.03113355115056038, -0.019399801269173622, -0.0072423312813043594, 0.030977100133895874, 0.023858625441789627, -0.013976200483739376, 0.04456217586994171, 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": "cf", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _get_adjustments_in_range(self, cf, dts, field): if field == 'volume' or field == 'sid': return {} if cf.adjustment is None: return {} rf = self._roll_finders[cf.roll_style] partitions = [] rolls = rf.get_rolls(cf.root_symbol, dts[0], dts[-1], ...
10,123
[ 0.033805206418037415, 0.006418710108846426, 0.051587410271167755, 0.016688646748661995, -0.0038482544478029013, 0.016189413145184517, 0.012706668116152287, -0.052300598472356796, 0.004692195914685726, 0.022536803036928177, 0.036444008350372314, -0.01661732606589794, 0.03363879397511482, -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": "trading_calendar", "annotation": null, "type_comment": null}}, {"...
def __init__(self, trading_calendar, reader, equity_adjustment_reader, asset_finder, roll_finders=None, sid_cache_size=1000, prefetch_length=0): self.trading_calendar = trading_calendar self._asset_finder = asset_finder self._re...
10,124
[ 0.017523253336548805, 0.0065003675408661366, 0.0525335818529129, 0.002648688619956374, 0.032827459275722504, 0.036373112350702286, -0.008761626668274403, -0.03437114506959915, 0.02817227877676487, 0.023492978885769844, 0.00010778670548461378, -0.010148532688617706, -0.02027294598519802, -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 MinuteHistoryLoader(HistoryLoader): @property def _frequency(self): return 'minute' @lazyval def _calendar(self): mm = self.trading_calendar.all_minutes start = mm.searchsorted(self._reader.first_trading_day) end = mm.searchsorted(self._reader.last_available_dt, s...
10,125
[ -0.023048676550388336, -0.030375409871339798, 0.022547144442796707, 0.020704559981822968, -0.013835747726261616, 0.0013308321358636022, 0.00025826183264143765, -0.02245992235839367, 0.030680689960718155, -0.002663027262315154, -0.00566949462518096, -0.02710454724729061, 0.010183284990489483,...
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": "asset", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _decimal_places_for_asset(self, asset, reference_date): if isinstance(asset, Future) and asset.tick_size: return number_of_decimal_places(asset.tick_size) elif isinstance(asset, ContinuousFuture): # Tick size should be the same for all contracts of a continuous # ...
10,126
[ 0.01952318102121353, -0.016494616866111755, 0.0398002527654171, -0.03852643445134163, 0.036472730338573456, -0.008058835752308369, 0.02859587036073208, 0.011750303208827972, 0.012959128245711327, 0.008403286337852478, 0.03514692187309265, -0.05719174072146416, -0.025346338748931885, -0.044...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setUp(self): super(RolesTestCase, self).setUp() self.course_key = SlashSeparatedCourseKey('edX', 'toy', '2012_Fall') self.course_loc = self.course_key.make_usage_key('course', '2012_Fall') self.anonymous_user = AnonymousUserFactory() self.student = UserFactory() self....
10,127
[ 0.04538344591856003, -0.023328183218836784, 0.037486154586076736, 0.00802068691700697, 0.046760279685258865, 0.05185195431113243, 0.014209928922355175, 0.005669683683663607, 0.051566194742918015, 0.018626177683472633, 0.007462161127477884, -0.04114904627203941, -0.029900599271059036, 0.048...
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_group_name_case_sensitive(self): uppercase_course_id = "ORG/COURSE/NAME" lowercase_course_id = uppercase_course_id.lower() uppercase_course_key = SlashSeparatedCourseKey.from_deprecated_string(uppercase_course_id) lowercase_course_key = SlashSeparatedCourseKey.from_deprecated_st...
10,128
[ 0.005856901872903109, -0.004851076751947403, 0.024789532646536827, -0.03453541547060013, 0.04135753586888313, 0.05442701652646065, 0.006369185633957386, 0.00845268089324236, 0.015031152404844761, -0.0022740396670997143, 0.021703334525227547, -0.05467691272497177, 0.0016524272505193949, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "edX"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "toy"}}, {"_type": "Constant", "_...
class RoleCacheTestCase(TestCase): IN_KEY = SlashSeparatedCourseKey('edX', 'toy', '2012_Fall') NOT_IN_KEY = SlashSeparatedCourseKey('edX', 'toy', '2013_Fall') ROLES = ( (CourseStaffRole(IN_KEY), ('staff', IN_KEY, 'edX')), (CourseInstructorRole(IN_KEY), ('instructor', IN_KEY, 'edX')), ...
10,129
[ 0.017314119264483452, 0.018441278487443924, 0.019963527098298073, 0.026587048545479774, 0.025308825075626373, 0.035348691046237946, 0.007239392958581448, 0.03892771527171135, -0.0018142058979719877, -0.000873694836627692, 0.02702861651778221, -0.009197399020195007, 0.025355305522680283, 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": "role", "annotation": null, "type_comment": null}}, {"_type": "arg...
def test_only_in_role(self, role, target): role.add_users(self.user) cache = RoleCache(self.user) self.assertTrue(cache.has_role(*target)) for other_role, other_target in self.ROLES: if other_role == role: continue self.assertFalse(cache.has_role...
10,130
[ 0.029163183644413948, -0.00711097801104188, 0.011410258710384369, 0.013371908105909824, -0.01142115704715252, 0.01755675859749317, 0.056844230741262436, 0.009105321019887924, 0.029054202139377594, -0.0006300435634329915, -0.003070525825023651, -0.07750693708658218, -0.037576477974653244, 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": "display", "annotation": null, "type_comment": null}}], "kwarg": n...
def __init__(self, display=None): super(CallbackModule, self).__init__(display=display) if not HAS_XMPP: self._display.warning("The required python xmpp library (xmpppy) is not installed. " "pip install git+https://github.com/ArchipelProject/xmpppy") ...
10,131
[ -0.022441720589995384, -0.0027140455786138773, 0.02428194135427475, -0.016730302944779396, -0.042325083166360855, -0.013352823443710804, -0.04708272963762283, -0.007781666703522205, 0.0034952980931848288, 0.06265728175640106, 0.0008626036578789353, -0.05430896207690239, 0.025381585583090782,...
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": "user_agent", "annotation": null, "type_comment": null}}], "kwarg"...
def __call__(self, user_agent): for platform, regex in self.platforms: match = regex.search(user_agent) if match is not None: break else: platform = None for browser, regex in self.browsers: match = regex.search(user_agent) ...
10,132
[ 0.013835319317877293, 0.016178801655769348, 0.04188191890716553, -0.039901863783597946, -0.025652987882494926, 0.00013227126328274608, -0.02305886521935463, -0.06541699916124344, 0.02972588501870632, 0.02636731043457985, 0.04809778556227684, -0.011748742312192917, 0.0060466863214969635, -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": "stats", "annotation": null, "type_comment": null}}], "kwarg": nul...
def playbook_on_stats(self, stats): name = self.play hosts = sorted(stats.processed.keys()) failures = False unreachable = False for h in hosts: s = stats.summarize(h) if s['failures'] > 0: failures = True if s['unreachable'] > ...
10,133
[ 0.011735000647604465, 0.004899078048765659, 0.059004805982112885, -0.02049577422440052, -0.025808606296777725, -0.024969106540083885, 0.026935933157801628, -0.005600659176707268, -0.005831521470099688, 0.04063176363706589, -0.02339804358780384, -0.006626047659665346, 0.013839744962751865, ...
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": "pargs", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _options(self, pargs): pwd = self.app.config.get('general', 'pwd') if pargs.url_file != None: url_file = pargs.url_file if not url_file.startswith('/'): url_file = pwd + "/" + url_file else: url = pargs.url threads = pargs.threads ...
10,134
[ -0.022509481757879257, 0.020605022087693214, 0.008213749155402184, -0.047304317355155945, -0.03219150751829147, -0.0029089082963764668, -0.03199492022395134, 0.0058178165927529335, -0.02703103795647621, 0.05052346736192703, -0.01324520818889141, -0.05121152848005295, -0.013282069005072117, ...
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": "opts", "annotation": null, "type_comment": null}}], "kwarg": null...
def _functionality(self, opts): kwargs_base = self._base_kwargs(opts) plugins_base_url = opts['plugins_base_url'] themes_base_url = opts['themes_base_url'] if not plugins_base_url: plugins_base_url = self.plugins_base_url if not themes_base_url: themes_ba...
10,135
[ 0.04160377010703087, 0.01317537110298872, -0.019256312400102615, -0.019497016444802284, 0.006885398644953966, 0.01002721767872572, -0.011287746019661427, -0.015557073056697845, 0.006993081886321306, 0.04662054404616356, 0.033825233578681946, -0.06258301436901093, -0.0012684462126344442, -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": "functionality", "annotation": null, "type_comment": null}}, {"_ty...
def _enabled_functionality(self, functionality, opts): enabled_functionality = {} if opts['enumerate'] == 'p': enabled_functionality['plugins'] = functionality['plugins'] elif opts['enumerate'] == 't': enabled_functionality['themes'] = functionality['themes'] elif...
10,136
[ 0.012805669568479061, 0.013732656836509705, 0.04319761320948601, -0.005095120053738356, -0.03689409792423248, 0.004949450958520174, 0.017361151054501534, 0.0028024816419929266, -0.009879037737846375, 0.03260347247123718, 0.012838776223361492, -0.03848322108387947, -0.06488911807537079, -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": "results", "annotation": null, "type_comment": null}}, {"_type": "...
def _process_results_multisite(self, results, functionality, timeout_host): for result in results: try: if shutdown: result['future'].cancel() continue output = result['future'].result(timeout=timeout_host) out...
10,137
[ -0.0010947480332106352, 0.033269625157117844, 0.017682675272226334, -0.018206605687737465, -0.03391263261437416, -0.0026509128510951996, 0.03638939559459686, 0.01909966953098774, -0.033793557435274124, 0.02277909591794014, -0.008609140291810036, -0.012056369334459305, -0.034508008509874344, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def plugin_init(self): time_start = datetime.now() opts = self._options(self.app.pargs) hide_progressbar, functionality, enabled_functionality = self._general_init(opts) if 'url_file' in opts: self.process_url_file(opts, functionality, enabled_functionality) else: ...
10,138
[ -0.0171491838991642, -0.031000910326838493, 0.014525659382343292, -0.035525888204574585, -0.025922344997525215, -0.008869437500834465, 0.014369210228323936, 0.013514759950339794, -0.03157856687903404, 0.04907675087451935, 0.019856948405504227, -0.03665713220834732, -0.024069029837846756, -...
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": "iterable", "annotation": null, "type_comment": null}}, {"_type": ...
def process_url_iterable(self, iterable, opts, functionality, enabled_functionality): timeout_host = opts['timeout_host'] i = 0 with ThreadPoolExecutor(max_workers=opts['threads']) as executor: results = [] for url in iterable: args = [url, opts, functiona...
10,139
[ -0.018172666430473328, 0.022619934752583504, 0.009799574501812458, -0.026323994621634483, -0.0076538571156561375, 0.015271752141416073, -0.03092709556221962, -0.007132411934435368, -0.025412963703274727, 0.05590851977467537, 0.025388987734913826, -0.04476037994027138, 0.011190094985067844, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def url_scan(self, url, opts, functionality, enabled_functionality, hide_progressbar): url = common.repair_url(url, self.out) if opts['follow_redirects']: url = self.determine_redirect(url, opts['verb'], opts['timeout']) need_sm = opts['enumerate'] in ['a', 'p', 't'] if need...
10,140
[ 0.004481613170355558, -0.014615274034440517, -0.015076170675456524, -0.004123811610043049, 0.0434940867125988, 0.01486998051404953, 0.013851155526936054, 0.004909155424684286, 0.015658356249332428, 0.06433146446943283, 0.008714584633708, -0.06995925307273865, -0.009654571302235126, 0.03721...
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": "requests_verb", "annotation": null, "type_comment": null}}, {"_ty...
def _determine_ok_200(self, requests_verb, url, timeout): if common.is_string(self.regular_file_url): reg_url = url + self.regular_file_url ok_resp = requests_verb(reg_url, timeout=timeout) ok_200 = ok_resp.status_code == 200 else: ok_200 = False ...
10,141
[ -0.04617971554398537, 0.027146020904183388, 0.01278599351644516, -0.04644608870148659, 0.00005259389945422299, 0.018888399004936218, -0.024409623816609383, 0.01985703594982624, -0.004189350176602602, 0.06504389643669128, 0.0013833331177011132, -0.04005309194326401, -0.011678116396069527, -...
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": "url", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def determine_scanning_method(self, url, verb, timeout=15): requests_verb = getattr(self.session, verb) folder_resp = requests_verb(url + self.forbidden_url, timeout=timeout) ok_200, reg_url_len = self._determine_ok_200(requests_verb, url, timeout) fake_200, fake_200_len = self._determin...
10,142
[ 0.02355027385056019, 0.011511033400893211, 0.03153778240084648, -0.03344447910785675, -0.020548515021800995, -0.030017580837011337, 0.0008245172211900353, 0.017018551006913185, -0.004077495541423559, 0.03599533066153526, 0.03254266455769539, -0.031434718519449234, -0.08698656409978867, -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": "amount", "annotation": null, "type_comment": null}}], "kwarg": nu...
def themes_get(self, amount=100000): amount = int(amount) with open(self.themes_file) as f: i = 0 for theme in f: if i>= amount: break yield theme.strip() i +=1
10,143
[ 0.010474667884409428, 0.015045542269945145, -0.0034235911443829536, -0.03547144681215286, -0.04474709928035736, -0.033158622682094574, -0.04024317488074303, 0.0231647789478302, -0.03267171233892441, 0.043408092111349106, 0.03664003312587738, -0.052099451422691345, -0.03890416771173477, -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": "amount", "annotation": null, "type_comment": null}}], "kwarg": nu...
def plugins_get(self, amount=100000): amount = int(amount) with open(self.plugins_file) as f: i = 0 for plugin in f: if i >= amount: break yield plugin.strip() i += 1
10,144
[ -0.004913402255624533, -0.0014969032490625978, 0.02888292260468006, -0.07022415101528168, 0.0013403799384832382, 0.014492311514914036, 0.006114738527685404, 0.0017559215193614364, -0.012687128968536854, 0.07337686419487, 0.019221382215619087, -0.01896713115274906, -0.028501546010375023, -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": "url", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def enumerate_version(self, url, versions_file, threads=10, verb='head', timeout=15, hide_progressbar=False): vf = VersionsFile(versions_file) files = vf.files_get() changelogs = vf.changelogs_get() if not hide_progressbar: p = ProgressBar(sys.stderr, len(files) ...
10,145
[ -0.04529034346342087, -0.021947383880615234, -0.009637363255023956, -0.0011462472612038255, 0.014706195332109928, 0.02098628133535385, 0.003393484279513359, 0.03162424638867378, 0.054295748472213745, 0.07604564726352692, 0.028490785509347916, -0.03183489665389061, -0.02783249504864216, -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": "url", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def enumerate_interesting(self, url, interesting_urls, threads=10, verb='head', timeout=15, hide_progressbar=False): requests_verb = getattr(self.session, verb) if not hide_progressbar: p = ProgressBar(sys.stderr, len(interesting_urls), "interesting") ...
10,146
[ 0.004899832885712385, 0.0021445604506880045, 0.02587609365582466, -0.06450928002595901, -0.021691584959626198, 0.042365316301584244, -0.02132968232035637, -0.01762017235159874, -0.022223131731152534, 0.05971406400203705, 0.00612408434972167, 0.009765737690031528, -0.02347848378121853, -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": "url", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def enumerate_version_changelog(self, url, versions_estimated, vf, timeout=15): changelogs = vf.changelogs_get() ch_hash = None for ch_url in changelogs: try: ch_hash = self.enumerate_file_hash(url, file_url=ch_url, timeout=timeout) ...
10,147
[ -0.01881461776793003, 0.004493847023695707, 0.02776261977851391, -0.03962524235248566, 0.038786012679338455, -0.04048715531826019, 0.01178323570638895, 0.020050780847668648, 0.0026438564527779818, 0.013257558457553387, -0.0006138283642940223, -0.002699143486097455, -0.04030570015311241, 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": "execute", "annotation": null, "type_comment": null}}], "kwarg": {...
def __init__(self, execute=utils.execute, *args, **kwargs): self._context = None super(IBMNAS_NFSDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(nas_opts) self.configuration.san_ip = self.configuration.nas_ip self.configuration.san_login = self.con...
10,148
[ 0.04308054596185684, 0.06620386242866516, -0.018690800294280052, -0.04707635939121246, -0.041006218641996384, 0.02204247936606407, -0.0020797881297767162, -0.009258059784770012, 0.01830868609249592, 0.02602737583220005, 0.028691250830888748, -0.007593137212097645, -0.00895782746374607, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fchild", "annotation": null, "type_comment": null}}, {"_type": "a...
def _delete_snapfiles(self, fchild, mount_point): LOG.debug(_('Enter _delete_snapfiles: fchild %(fchild)s, ' 'mount_point %(mount_point)s') % {'fchild': fchild, 'mount_point': mount_point}) ssh_cmd = ['lsclone', fchild] try: ...
10,149
[ -0.009658755734562874, 0.004782732576131821, 0.030226372182369232, 0.012899072840809822, -0.008750720880925655, -0.02995271608233452, 0.014553437940776348, 0.007401107344776392, -0.021917229518294334, 0.04470517486333847, 0.03186829760670662, -0.036172136664390564, -0.04766561836004257, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_browse_with_bing(): max_page = 1 bing = BrowseBing(kw="Ravi RT Merugu", max_page=max_page) bing.search() result = bing.data assert bing.data['result_count'] != 0 assert bing.data[ 'result_count'] <= DEFAULT_MAX_RESULTS_PER_PAGE * max_page assert "selenium-htmlunit" == bing.shift_met...
10,150
[ -0.0021251339931041002, 0.002708743792027235, 0.030017709359526634, -0.01385996863245964, -0.00240166112780571, -0.042802125215530396, 0.025471054017543793, 0.007333316840231419, -0.03532214090228081, 0.04219101369380951, 0.04898655414581299, -0.05539098381996155, -0.03605547547340393, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":...
def test_browse_with_bing_source_enin(): max_page = 2 bing = BrowseBing(kw="Ravi RT Merugu", max_page=max_page, source="en-in") bing.search() result = bing.data assert bing.data['result_count'] != 0 assert bing.data['result_count'] <= DEFAULT_MAX_RESULTS_PER_PAGE * max_page assert "selenium-...
10,151
[ -0.010016233660280704, 0.0031228160951286554, 0.023625845089554787, -0.00032351090339943767, -0.007620648946613073, -0.038720473647117615, 0.02327139675617218, 0.00859843846410513, -0.031655944883823395, 0.032120391726493835, 0.03884269669651985, -0.04810725525021553, -0.04610278829932213, ...
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_browse_with_bing_source_enus(): max_page = 1 bing = BrowseBing(kw="Ravi RT Merugu", max_page=max_page, source="en-us") bing.search() result = bing.data assert bing.data['result_count'] != 0 assert bing.data['result_count'] <= DEFAULT_MAX_RESULTS_PER_PAGE * max_page assert "selenium-...
10,152
[ -0.020136097446084023, -0.00682009756565094, -0.07242751866579056, -0.05009409785270691, 0.028937386348843575, -0.021396854892373085, -0.0003502729523461312, 0.011797088198363781, 0.01589755155146122, 0.0019481704803183675, 0.06714434176683426, -0.043201956897974014, 0.01671404205262661, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https?://(?:www\\.)?sunporno\\.com/videos/(?P<id>\\d+)"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID_URL", "ctx": {"_type":...
class SunPornoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?sunporno\.com/videos/(?P<id>\d+)' _TEST = { 'url': 'http://www.sunporno.com/videos/807778/', 'md5': '6457d3c165fd6de062b99ef6c2ff4c86', 'info_dict': { 'id': '807778', 'ext': 'flv', 'tit...
10,153
[ 0.007913867011666298, 0.0072486791759729385, 0.0005738796899095178, 0.014758460223674774, -0.014136789366602898, -0.049037378281354904, -0.03051159344613552, 0.019632358103990555, -0.008883672766387463, 0.022927211597561836, 0.027079971507191658, -0.020676763728260994, -0.026259366422891617,...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_browser_with_stackoverflow(): stack = BrowseStackOverFlow(kw="Python Exception errors", max_page=1) stack.search() result = stack.data assert type(result) is dict assert "result" in result assert "related_keywords" in result stack.close()
10,154
[ -0.013627956621348858, -0.0012450342765077949, -0.053361181169748306, -0.05820348113775253, 0.010631483979523182, -0.01410739216953516, 0.012429367750883102, -0.0013132040621712804, 0.010727371089160442, 0.04473134130239487, 0.0560460202395916, -0.0560460202395916, 0.01691208966076374, -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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) title = self._html_search_regex( r'<title>([^<]+)</title>', webpage, 'title') description = self._html_search_meta( 'description', webpage, 'description'...
10,155
[ 0.05801040306687355, -0.0007928795530460775, 0.02357536368072033, 0.014058341272175312, 0.03607385978102684, -0.04391257092356682, 0.07329292595386505, 0.029459333047270775, -0.007280917372554541, 0.038087837398052216, 0.03204590827226639, 0.008248415775597095, 0.03050580993294716, 0.01531...
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": "sql", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def __init__( self, sql, hive_table, create=True, recreate=False, partition=None, delimiter=chr(1), mssql_conn_id='mssql_default', hive_cli_conn_id='hive_cli_default', *args, **kwargs): super(...
10,156
[ 0.03768884390592575, 0.006071591749787331, 0.05653326213359833, -0.03748645633459091, 0.04117438569664955, -0.05163101479411125, 0.05217071250081062, 0.04704359173774719, -0.027007339522242546, 0.00360360206104815, 0.009365991689264774, -0.0011032868642359972, -0.017944926396012306, 0.0206...
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": "context", "annotation": null, "type_comment": null}}], "kwarg": n...
def execute(self, context): hive = HiveCliHook(hive_cli_conn_id=self.hive_cli_conn_id) mssql = MsSqlHook(mssql_conn_id=self.mssql_conn_id) logging.info("Dumping Microsoft SQL Server query results to local file") conn = mssql.get_conn() cursor = conn.cursor() cursor.execu...
10,157
[ 0.01110595092177391, -0.006203411612659693, -0.015260974876582623, -0.05867514759302139, -0.014892070554196835, -0.021842997521162033, -0.0018372389022260904, -0.018056878820061684, -0.03162866085767746, -0.03558952361345291, 0.012484487146139145, 0.056850042194128036, -0.052034877240657806,...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "imgName", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def image_to_txt(imgName): #获取当前时间,转换成字符串 timenow = datetime.datetime.now() timestr = timenow.strftime("%Y-%m-%d-%H-%M-%S") #生成的Txt文件用<原图片文件名+ 当前时间字符串+ ".txt"后缀>作为文件名 namestr = "{0}-{1}.txt".format(imgName, timestr) #打开或创建一个TxT文件文件 txt = open(namestr, "w+") #打开图片文件文件 print(...
10,158
[ 0.0468657985329628, 0.012845976278185844, 0.04257742315530777, -0.022341661155223846, 0.04001205787062645, -0.02532820776104927, 0.006915959995239973, -0.0021286318078637123, -0.021327001973986626, 0.02758726105093956, 0.014540267176926136, 0.036719199270009995, 0.03541737049818039, -0.085...
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": "host", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, host, task, return_data, task_fields=None): self._host = host self._task = task if isinstance(return_data, dict): self._result = return_data.copy() else: self._result = DataLoader().load(return_data) if task_fields is None: ...
10,159
[ 0.02291056513786316, 0.050950177013874054, 0.019227858632802963, -0.02404090017080307, 0.04988061264157295, 0.06611855328083038, -0.0029473803006112576, 0.008039967156946659, -0.012008296325802803, 0.029631806537508965, -0.014293275773525238, -0.028926866129040718, -0.013393868692219257, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def is_skipped(self): # loop results if 'results' in self._result: results = self._result['results'] # Loop tasks are only considered skipped if all items were skipped. # some squashed results (eg, yum) are not dicts and can't be skipped individually if re...
10,160
[ 0.04033870995044708, -0.005228215828537941, 0.08224555104970932, -0.02911849319934845, -0.030875876545906067, -0.01557312160730362, -0.026063349097967148, -0.03074069321155548, -0.05547924339771271, 0.0074756392277777195, -0.02729351818561554, 0.0006125495419837534, -0.03276844322681427, 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 __str__(self): maxprint = self.getmaxprint() A = self.tocoo() nnz = self.getnnz() # helper function, outputs "(i,j) v" def tostr(row,col,data): triples = zip(list(zip(row,col)),data) return '\n'.join([(' %s\t%s' % t) for t in triples]) if ...
10,161
[ -0.0007964390679262578, -0.07162772864103317, 0.022110816091299057, 0.0267997644841671, 0.04818298667669296, 0.035773441195487976, 0.02291925624012947, 0.012601548805832863, -0.00854419358074665, 0.030902594327926636, -0.046566106379032135, -0.017543133348226547, 0.06798975169658661, 0.025...
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": "shape", "annotation": null, "type_comment": null}}], "kwarg": nul...
def set_shape(self,shape): shape = tuple(shape) if len(shape) != 2: raise ValueError("Only two-dimensional sparse arrays " "are supported.") try: shape = int(shape[0]),int(shape[1]) # floats, other weirdness except: ...
10,162
[ -0.0038296361453831196, -0.03872280195355415, 0.000441668089479208, 0.017190441489219666, 0.03677336871623993, -0.01269345823675394, 0.012959289364516735, -0.009713929146528244, -0.018342379480600357, 0.042023543268442154, -0.03214346989989281, -0.026538852602243423, 0.04851426184177399, 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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __rmul__(self, other): # other * self if isscalarlike(other): return self.__mul__(other) else: # Don't use asarray unless we have to try: tr = other.transpose() except AttributeError: tr = np.asarray(other).transpose() ...
10,163
[ -0.007466049399226904, -0.01117867510765791, 0.025947580114006996, -0.004505273886024952, 0.037231165915727615, -0.0141161372885108, 0.02187942899763584, 0.01247255690395832, -0.007588443346321583, 0.04147416725754738, -0.0016785496845841408, -0.03734773024916649, -0.009727428667247295, 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": "other", "annotation": null, "type_comment": null}}, {"_type": "ar...
def _divide(self, other, true_divide=False, rdivide=False): if isscalarlike(other): if rdivide: if true_divide: return np.true_divide(other, self.todense()) else: return np.divide(other, self.todense()) if true_divi...
10,164
[ 0.031145663931965828, -0.03863171115517616, -0.03320201486349106, -0.0019812616519629955, 0.03856239840388298, -0.0334099605679512, -0.05152435228228569, -0.014417576603591442, -0.03280923143029213, -0.009756124578416348, -0.02283938229084015, -0.01612735353410244, 0.06950011849403381, 0.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": "attr", "annotation": null, "type_comment": null}}], "kwarg": null...
def __getattr__(self, attr): if attr == 'A': return self.toarray() elif attr == 'T': return self.transpose() elif attr == 'H': return self.getH() elif attr == 'real': return self._real() elif attr == 'imag': return self....
10,165
[ 0.052407827228307724, -0.02850293554365635, 0.023793648928403854, -0.01736627332866192, -0.015240294858813286, 0.013608730398118496, -0.013139037415385246, -0.012558101676404476, -0.000716513255611062, 0.047043442726135254, 0.017378633841872215, -0.0042859469540417194, -0.012026607990264893,...
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": "values", "annotation": null, "type_comment": null}}, {"_type": "a...
def _setdiag(self, values, k): M, N = self.shape if k < 0: if values.ndim == 0: # broadcast max_index = min(M+k, N) for i in xrange(max_index): self[i - k, i] = values else: max_index = min(M+k, N...
10,166
[ -0.03747280314564705, 0.019012905657291412, 0.04455655813217163, -0.019052404910326004, -0.0356031134724617, -0.014944354072213173, -0.027545012533664703, -0.0345497652888298, 0.04123851656913757, 0.012942995876073837, 0.01687987893819809, -0.03860514983534813, -0.0103886304423213, -0.0323...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bond_pairs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "g_bond_pattern", "annotation": null, "type_comment": null}}...
def GenInteractions_str(bond_pairs, g_bond_pattern, typepattern_to_coefftypes, canonical_order, #function to sort atoms and bonds atomids_str, atomtypes_str, bondids_str, ...
10,167
[ 0.0335187166929245, 0.006984128151088953, 0.05740239471197128, -0.027554169297218323, -0.022813118994235992, 0.02151315286755562, 0.0013190825702622533, 0.0012529691448435187, -0.0007152996258810163, 0.03385008126497269, 0.05090256780385971, -0.03086780570447445, -0.037265677005052567, 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": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "...
def handle(self, *args, **options): # Scrub the username from the log message cleaned_options = copy.copy(options) if 'username' in cleaned_options: cleaned_options['username'] = '<USERNAME>' LOGGER.info( ( u"Starting to create tasks to regenerate...
10,168
[ -0.009383582510054111, 0.028295427560806274, 0.012576893903315067, 0.003040879964828491, 0.015108807943761349, 0.0033044058363884687, 0.015036467462778091, -0.03916715458035469, 0.011140420101583004, 0.06465164572000504, -0.018167773261666298, -0.02688995748758316, 0.004764131736010313, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "news/news_webview.css"}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_f...
class NewsWidget(FormClass, BaseClass): CSS = util.THEME.readstylesheet('news/news_webview.css') HTML = str(util.THEME.readfile('news/news_webview_frame.html')) def __init__(self, *args, **kwargs): BaseClass.__init__(self, *args, **kwargs) self.setupUi(self) self.newsManager = Ne...
10,169
[ -0.005266585387289524, 0.00968944188207388, 0.010586910881102085, 0.01856202632188797, 0.007126012351363897, -0.00889408029615879, 0.01113506592810154, -0.03858579695224762, -0.027257265523076057, 0.05137607455253601, -0.020518185570836067, -0.01879848539829254, -0.004691560287028551, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def __init__(self, *args, **kwargs): BaseClass.__init__(self, *args, **kwargs) self.setupUi(self) self.newsManager = NewsManager(self) # open all links in external browser self.newsWebView.setPage(ExternalLinkPage(self)) # hide webview until loaded to avoid FOUC ...
10,170
[ -0.03672436624765396, 0.013434479013085365, 0.02099720947444439, -0.059090957045555115, -0.011380404233932495, -0.011961354874074459, -0.00036730850115418434, -0.015996884554624557, -0.030230170115828514, 0.088221475481987, 0.003752836026251316, -0.021972374990582466, 0.036620624363422394, ...
11
{"_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": "base_path", "annotation": null, "type_comment": null}}], "kwarg": ...
def _find_packages_iter(cls, base_path): dirs = cls._all_dirs(base_path) suitable = filterfalse(lambda n: '.' in n, dirs) return ( path.replace(os.path.sep, '.') for path in suitable if cls._looks_like_package(os.path.join(base_path, path)) )
10,171
[ 0.0337432436645031, 0.024652019143104553, -0.0013610409805551171, 0.0017217829590663314, 0.03630147501826286, 0.03773915395140648, -0.011712880805134773, 0.04342645779252052, 0.023848609998822212, 0.04778178781270981, -0.0016266421880573034, -0.00575072830542922, 0.016047069802880287, 0.05...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "__doc__", "value": {"_type": "Name", "_fields": {"id": "_Command", "ctx": {"_type": "Load", "_fields": {}}}}}}...
class Command(_Command): __doc__ = _Command.__doc__ command_consumes_arguments = False def __init__(self, dist, **kw): # Add support for keyword arguments _Command.__init__(self,dist) for k,v in kw.items(): setattr(self,k,v) def reinitialize_command(self, command, ...
10,172
[ 0.005146809387952089, -0.0068285586312413216, 0.020372165367007256, -0.043635863810777664, -0.05090054124593735, -0.03804397210478783, 0.00033941163565032184, -0.048630330711603165, 0.04502188786864281, 0.0031305027659982443, 0.031400617212057114, 0.00392208993434906, -0.016178246587514877, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "outf", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "msgs", "annotation": null, "type_comment": null}}], "kwarg": null...
def generate_methods_python(outf, msgs): outf.write(""" ''' MAVLink protocol test implementation (auto-generated by mavtestgen.py) Generated from: %s Note: this file has been auto-generated. DO NOT EDIT ''' import mavlink def generate_outputs(mav): '''generate all message types as outputs''' """) for m ...
10,173
[ 0.013066915795207024, -0.011760223656892776, 0.015395427122712135, -0.03864338994026184, -0.05088046193122864, -0.006793557666242123, -0.004622963257133961, -0.06351388245820999, 0.028932999819517136, 0.014416957274079323, 0.042210470885038376, 0.02395394816994667, -0.015890855342149734, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "outf", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "msgs", "annotation": null, "type_comment": null}}], "kwarg": null...
def generate_methods_C(outf, msgs): outf.write(""" /* MAVLink protocol test implementation (auto-generated by mavtestgen.py) Generated from: %s Note: this file has been auto-generated. DO NOT EDIT */ static void mavtest_generate_outputs(mavlink_channel_t chan) { """) for m in msgs: if m.name == "HEAR...
10,174
[ 0.06686569005250931, -0.04385373741388321, -0.0038592107594013214, -0.002493899781256914, 0.03869447484612465, -0.015211637131869793, 0.009427939541637897, -0.01087130419909954, -0.005312812514603138, 0.01608175039291382, -0.03660620003938675, 0.023114318028092384, 0.014003714546561241, -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": "bash_command", "annotation": null, "type_comment": null}}, {"_typ...
def __init__( self, bash_command, env=None, output_encoding='utf-8', *args, **kwargs): super().__init__(*args, **kwargs) self.bash_command = bash_command self.env = env self.output_encoding = output_encoding if kwargs.g...
10,175
[ -0.029617488384246826, -0.0023958678357303143, 0.038196977227926254, -0.024734482169151306, -0.05019913241267204, -0.012036383152008057, 0.041094835847616196, -0.008722099475562572, 0.010148211382329464, -0.02881886623799801, -0.009075775742530823, -0.0022104731760919094, 0.04451750591397285...
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 BaseSuite(object): def setup(self): os.environ['MODE'] = 'TESTING' app = create_app() self.app = app self.client = app.test_client() with app.app_context(): db.drop_all() db.create_all() def teardown(self): with self.app.app_contex...
10,176
[ -0.022508220747113228, 0.01761818118393421, 0.0643894225358963, -0.0312822125852108, 0.011897535994648933, 0.013242881745100021, 0.008153965696692467, -0.001158167258836329, 0.012470770627260208, 0.04595233127474785, -0.009043063037097454, -0.016155848279595375, 0.016226040199398994, 0.021...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestGetClosest(object): def test_when_can_match(self): assert 'branch' == get_closest('brnch', ['branch', 'status']) def test_when_cant_match(self): assert 'status' == get_closest('st', ['status', 'reset']) def test_without_fallback(self): assert get_closest('st', ['status', ...
10,177
[ 0.03374464809894562, 0.019977454096078873, 0.0635271891951561, -0.014902401715517044, -0.01474658865481615, 0.007851863279938698, 0.08342673629522324, 0.020144397392868996, 0.004774556029587984, 0.007679355796426535, 0.002666906686499715, -0.006788995582610369, 0.020511670038104057, -0.030...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setup(self): os.environ['MODE'] = 'TESTING' app = create_app() self.app = app self.client = app.test_client() with app.app_context(): db.drop_all() db.create_all()
10,178
[ 0.004983382765203714, -0.014257174916565418, -0.040710680186748505, -0.04999050125479698, 0.05924621596932411, 0.02598349004983902, 0.022584907710552216, 0.008092724718153477, -0.0056160977110266685, -0.04852019250392914, 0.05027974024415016, -0.011744393035769463, -0.0022160084918141365, ...
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": "mocker", "annotation":...
class TestCache(object): @pytest.fixture def shelve(self, mocker): value = {} class _Shelve(object): def __init__(self, path): pass def __setitem__(self, k, v): value[k] = v def __getitem__(self, k): return va...
10,179
[ 0.025710709393024445, -0.0046331328339874744, 0.010458593256771564, -0.02373761683702469, -0.01214722078293562, -0.002504191594198346, -0.043529052287340164, 0.006258209235966206, -0.0007312088273465633, 0.04251224547624588, 0.010047027841210365, -0.02856745384633541, -0.027332758530974388, ...
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 TestGetValidHistoryWithoutCurrent(object): @pytest.yield_fixture(autouse=True) def fail_on_warning(self): warnings.simplefilter('error') yield warnings.resetwarnings() @pytest.fixture(autouse=True) def history(self, mocker): return mocker.patch('thefuck.shells.shel...
10,180
[ -0.015620894730091095, 0.0028642727993428707, -0.005367196165025234, -0.0264812633395195, -0.002040462801232934, -0.054315097630023956, 0.0072866566479206085, -0.03163960576057434, 0.025566287338733673, 0.005715284962207079, 0.029226191341876984, -0.0677347481250763, 0.015010911040008068, ...
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": "mocker", "annotation": null, "type_comment": null}}], "kwarg": nu...
def bins(self, mocker): callables = list() for name in ['diff', 'ls', 'café']: bin_mock = mocker.Mock(name=name) bin_mock.configure_mock(name=name, is_dir=lambda: False) callables.append(bin_mock) path_mock = mocker.Mock(iterdir=mocker.Mock(return_value=callab...
10,181
[ 0.003929270431399345, 0.013515466824173927, 0.0498298779129982, -0.07221295684576035, -0.00302110449410975, 0.022260770201683044, 0.01532568410038948, 0.013344230130314827, 0.028254054486751556, 0.042735785245895386, -0.013026219792664051, -0.03904196619987488, -0.04613605514168739, 0.0231...
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 TruncatewordsTests(SimpleTestCase): @setup({'truncatewords01': '{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:"2"}}{% endautoescape %}'}) def test_truncatewords01(self): output = self.engine.render_to_string('truncatewords01', {'a': 'alpha & bravo', 'b': mark_safe('alph...
10,182
[ 0.0075448728166520596, -0.012630137614905834, 0.04338042438030243, -0.04317286238074303, 0.01842111349105835, -0.0014542300486937165, -0.03038705326616764, 0.030428564175963402, 0.007949618622660637, 0.005305799189954996, 0.0028539751656353474, 0.015805833041667938, 0.0207873173058033, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Export dataframe"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":...
class ExportDataframe(ui.ExportDataApp): name = "Export dataframe" export_filename_filter = "Comma separated values (*.csv);;Hierarchical Data Format (*.hdf);;Pickle (*.pickle);;JavaScript Object Notation (*.json)" export_description = "Export data frame" export_type = "data" icon = 'export.png' ...
10,183
[ 0.01263442076742649, 0.0011126270983368158, 0.059198737144470215, -0.04433208331465721, 0.0206034816801548, 0.01776854880154133, 0.0046932632103562355, 0.014007242396473885, 0.031117284670472145, 0.027612682431936264, -0.007092910353094339, -0.05415389686822891, -0.07129742205142975, 0.017...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class FunctionTests(SimpleTestCase): def test_truncate(self): self.assertEqual(truncatewords('A sentence with a few words in it', 1), 'A ...') def test_truncate2(self): self.assertEqual( truncatewords('A sentence with a few words in it', 5), 'A sentence with a few ...',...
10,184
[ 0.019831737503409386, -0.01885397732257843, 0.07324311137199402, -0.031031534075737, 0.016019461676478386, 0.007402334362268448, 0.004207330755889416, 0.026468653231859207, -0.017026850953698158, 0.024335360154509544, 0.018656451255083084, 0.009545505046844482, 0.004656705539673567, -0.036...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def __init__(self, *args, **kwargs): super(ExportDataframe, self).__init__(*args, **kwargs) self.config.set_defaults({ 'filename': None, }) self.data.add_input('input_data') # Add output slot self.data.consumer_defs.append( DataDefinition('input_data',...
10,185
[ 0.011744160205125809, -0.04494098573923111, -0.006366313435137272, 0.01952466554939747, 0.0114701297134161, -0.00928277987986803, -0.01428872812539339, 0.020219529047608376, -0.03908848017454147, -0.019142979755997658, -0.012546677142381668, -0.0007645937148481607, 0.01897660456597805, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Copy to clipboard"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment"...
class PasteToClipboard(ui.ExportDataApp): name = "Copy to clipboard" icon = 'clipboard.png' notebook = 'export_clipboard.ipynb' shortname = 'export_clipboard' def __init__(self, *args, **kwargs): super(PasteToClipboard, self).__init__(*args, **kwargs) self.data.add_input('input_da...
10,186
[ 0.022962158545851707, 0.04845040664076805, -0.004019640851765871, -0.03021203726530075, 0.0011177948908880353, -0.0005798165802843869, 0.006214181426912546, 0.043145619332790375, 0.03382434695959091, 0.009914902970194817, 0.004316456150263548, -0.023644203320145607, -0.011228470131754875, ...
16
{"_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": "text", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_tokens_unprocessed(self, text): pylexer = PythonLexer(**self.options) tblexer = PythonTracebackLexer(**self.options) curcode = '' insertions = [] for match in line_re.finditer(text): line = match.group() input_prompt = self.input_prompt.match(line...
10,187
[ 0.029694965109229088, -0.03210493177175522, 0.042897384613752365, 0.023617660626769066, 0.017100276425480843, -0.008241034112870693, 0.010268548503518105, -0.002865763148292899, -0.016178201884031296, 0.00044368248200044036, 0.018200477585196495, 0.003989540506154299, 0.017372706905007362, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def __init__(self, *args, **kwargs): super(PasteToClipboard, self).__init__(*args, **kwargs) self.data.add_input('input_data') # Add output slot self.data.consumer_defs.append( DataDefinition('input_data', { 'labels_n': ('>0', None), 'entities_t': (None, Non...
10,188
[ 0.029187090694904327, 0.00437699630856514, -0.02290983870625496, -0.009736147709190845, 0.011486945673823357, -0.040311068296432495, -0.017860278487205505, 0.02732953615486622, 0.028930876404047012, 0.058416884392499924, -0.01043539959937334, -0.036446500569581985, 0.0324111245572567, 0.03...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment":...
def _wrapcall(*args, **kargs): try: if py.std.sys.version_info > (2,7): return py.std.subprocess.check_output(*args,**kargs).decode().splitlines() if 'stdout' in kargs: raise ValueError('stdout argument not allowed, it will be overridden.') process = py.std.subprocess...
10,189
[ 0.02018563635647297, -0.04543526470661163, 0.03211883828043938, -0.008961625397205353, 0.03725316375494003, 0.02031457982957363, 0.03441639244556427, 0.02635151520371437, 0.0029378775507211685, 0.04187171533703804, 0.03891771659255028, -0.0221784096211195, -0.015977364033460617, 0.00628896...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "prefix", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ffc", "annotation": null, "type_comment": null}}, {"_type": "ar...
def equal_with_bash(prefix, ffc, fc, out=None): res = ffc(prefix) res_bash = set(fc(prefix)) retval = set(res) == res_bash if out: out.write('equal_with_bash %s %s\n' % (retval, res)) if not retval: out.write(' python - bash: %s\n' % (set(res) - res_bash)) out.wri...
10,190
[ 0.0033940684515982866, -0.06813791394233704, 0.017270497977733612, 0.008096507750451565, 0.07142166793346405, -0.020030904561281204, 0.007008763961493969, 0.01826588623225689, -0.02555171586573124, 0.008696818724274635, 0.008768651634454727, 0.01814274489879608, 0.014992392621934414, -0.04...
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": "host", "annotation": null, "type_comment": null}}], "kwarg": null...
def make_connection(self, host): # create a HTTPS connection object from a host descriptor host, extra_headers, x509 = self.get_host_info(host) http = HTTPTLSConnection(host, None, self.username, self.password, self.sharedKey, ...
10,191
[ 0.058123424649238586, 0.0005070079932920635, 0.03628356009721756, 0.0003624543023761362, -0.025948846712708473, -0.035934921354055405, -0.0071471394039690495, 0.011723051778972149, 0.026148071512579918, 0.05667905509471893, -0.010926158167421818, 0.0056778667494654655, 0.05682847276329994, ...
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": "prefix", "annotation": null, "type_comment": null}}], "kwarg": {"...
def __call__(self, prefix, **kwargs): completion = [] if self.allowednames: if self.directories: files = _wrapcall(['bash','-c', "compgen -A directory -- '{p}'".format(p=prefix)]) completion += [ f + '/' for f in files] for x in...
10,192
[ 0.021468063816428185, 0.023038897663354874, 0.03609086573123932, -0.043089378625154495, 0.005995987914502621, 0.03450726345181465, 0.011902579106390476, 0.011334269307553768, 0.035784363746643066, -0.018594587221741676, 0.03478822484612465, -0.01418858952820301, 0.000932283524889499, -0.01...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "event", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def event_handler(event): if isinstance(event, paddle.event.EndIteration): if not event.batch_id % conf.log_period: logger.info("Pass %d, Batch %d, Cost %f, %s" % ( event.pass_id, event.batch_id, event.cost, event.metrics)) if (not event.batch_id % ...
10,193
[ 0.012586886994540691, 0.01927681267261505, 0.06468789279460907, -0.056155163794755936, -0.031517475843429565, 0.010911613702774048, 0.0502135269343853, 0.04266363009810448, -0.031785521656274796, 0.004422721918672323, -0.008259098045527935, 0.01236351765692234, 0.0195783618837595, 0.001544...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value...
def main(): # prepare vocab if not (os.path.exists(conf.vocab_file) and os.path.getsize(conf.vocab_file)): logger.info(("word dictionary does not exist, " "build it from the training data")) build_dict(conf.train_file, conf.vocab_file, conf.max_word_num, ...
10,194
[ 0.003485653782263398, 0.0061552682891488075, 0.017381638288497925, -0.018430830910801888, -0.020913921296596527, -0.05880146101117134, -0.00995567999780178, -0.00468639750033617, -0.014805285260081291, 0.01944505050778389, -0.014607103541493416, 0.055210888385772705, 0.01907200552523136, -...
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": "cfg", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def __init__(self, cfg, parent): super(GTranslateLister, self).__init__(parent) self.item_flags = ( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsEnabled ) self.set_data(cfg) # Contrary to other implementations hotkey data is THE data her...
10,195
[ 0.0034237876534461975, 0.024665245786309242, 0.00798883754760027, -0.04383379966020584, -0.036776602268218994, -0.037615083158016205, -0.019599437713623047, 0.013206037692725658, -0.0006808999460190535, 0.01481312233954668, -0.024921447038650513, 0.005339478142559528, 0.021159939467906952, ...
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": "cfg", "annotation": nu...
class GTranslateLister(a2item_editor.A2ItemEditor): def __init__(self, cfg, parent): super(GTranslateLister, self).__init__(parent) self.item_flags = ( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsEnabled ) self.set_data(cfg) # Contr...
10,196
[ 0.0021777614019811153, 0.01669529266655445, -0.012682102620601654, -0.010006642900407314, -0.018570221960544586, -0.04765268415212631, 0.012629436329007149, 0.006541184149682522, 0.008279180154204369, -0.03265325352549553, -0.019539285451173782, 0.024500474333763123, -0.030504459515213966, ...
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": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def _update_hotkey(self, name): try: from_lang, to_lang = name.split(gtranslate_langs.SEPARATOR) except ValueError: return text = 'Translate "%s" to "%s"' % ( gtranslate_langs.key_to_name(from_lang), gtranslate_langs.key_to_name(to_lang), ...
10,197
[ 0.004872238263487816, 0.013552725315093994, 0.0064889476634562016, 0.0028382237069308758, 0.01767602562904358, -0.04136566072702408, 0.023965993896126747, 0.03515307232737541, -0.04740137606859207, 0.022274667397141457, -0.023435382172465324, 0.009528914466500282, -0.0021169225219637156, 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": "parent", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, parent, present_keys): super(NewDialog, self).__init__( parent, 'New gtranslate Hotkey', 'Select languages to translate between:' ) self._present_keys = present_keys self.ui.combo_from = QtWidgets.QComboBox(self) self.ui.combo_from.addItem(gtransla...
10,198
[ 0.059767525643110275, 0.020858965814113617, -0.012940514832735062, 0.012064139358699322, 0.012741620652377605, 0.003533469047397375, 0.028292614966630936, 0.023295411840081215, -0.016595184803009033, 0.012903221882879734, 0.024314742535352707, -0.014892158098518848, -0.00544471200555563, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,...
def check(self, key=None): key = self.get_key(key) if key not in self.parent().data: self.ui.a2ok_button.setEnabled(True) self.ui.a2ok_button.setText('OK') return True else: self.ui.a2ok_button.setEnabled(False) self.ui.a2ok_button.setT...
10,199
[ 0.0017348828259855509, 0.02178923599421978, 0.01126279216259718, 0.012551402673125267, -0.04712633416056633, -0.0050707668997347355, -0.010671481490135193, 0.004959198646247387, -0.03891492635011673, 0.06506647169589996, -0.039271946996450424, 0.005835007876157761, 0.02246979996562004, 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": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen...
def __init__(self, *args): super(Draw, self).__init__(*args) self.main_layout = QtWidgets.QVBoxLayout(self) self.main_layout.setContentsMargins(0, 0, 0, 0) self.editor = GTranslateLister(self.user_cfg, self) self.editor.data_changed.connect(self.delayed_check) self.main_...
10,200
[ 0.027480917051434517, 0.053750429302453995, -0.02725658379495144, -0.03780028223991394, -0.016129616647958755, 0.004495093133300543, -0.020234929397702217, -0.051731426268815994, 0.009646362625062466, 0.02855772152543068, 0.024295374751091003, -0.02927558869123459, 0.002317650942131877, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "has_content", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}...
class BokehModelDirective(Directive): has_content = True required_arguments = 1 def run(self): model_path = self.arguments[0] module_name, model_name = model_path.rsplit(".", 1) try: module = importlib.import_module(module_name) except ImportError: ...