Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
15,601 | [
-0.025448188185691833,
-0.03536183387041092,
0.05108611285686493,
-0.008739662356674671,
0.013815069571137428,
0.0058995685540139675,
0.022068535909056664,
-0.01590215228497982,
0.015700560063123703,
0.008520280942320824,
0.014657017774879932,
0.011988871730864048,
-0.00010274216765537858,
... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_add_datetime64_nat(self, box_with_array):
# GH#23215
other = np.datetime64('NaT')
tdi = timedelta_range('1 day', periods=3)
expected = pd.DatetimeIndex(["NaT", "NaT", "NaT"])
tdser = tm.box_expected(tdi, box_with_array)
expected = tm.box_expected(expect... | |
15,602 | [
0.009500248357653618,
-0.013575227931141853,
0.024100247770547867,
-0.001957617700099945,
0.021037986502051353,
-0.0012613749131560326,
0.016565153375267982,
-0.016299918293952942,
0.022822296246886253,
0.048007600009441376,
0.0039001652039587498,
-0.0334196537733078,
-0.01691478118300438,
... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_add_sub_numeric_scalar_invalid(self, box_with_array,
scalar):
box = box_with_array
tdser = pd.Series(['59 Days', '59 Days', 'NaT'], dtype='m8[ns]')
tdser = tm.box_expected(tdser, box)
err = TypeError
if box in ... | |
15,603 | [
-0.007694703992456198,
-0.052717480808496475,
0.02533457800745964,
0.0027574936393648386,
0.0024862922728061676,
0.012990708462893963,
0.018785320222377777,
-0.009379183873534203,
0.03773234784603119,
0.02390613779425621,
0.008766033686697483,
-0.002962999977171421,
0.012997446581721306,
-... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_add_intlike(self, box_with_array):
# GH#19123
tdi = TimedeltaIndex(['59 days', '59 days', 'NaT'])
ser = tm.box_expected(tdi, box_with_array)
err = TypeError
if box_with_array in [pd.Index, tm.to_array]:
err = NullFrequencyError
other = Serie... | |
15,604 | [
0.0029644255992025137,
-0.006318134721368551,
0.022862687706947327,
-0.01560841966420412,
0.0026539256796240807,
0.0027203510981053114,
0.030178748071193695,
0.006574567873030901,
0.03173588216304779,
0.038508184254169464,
0.008354149758815765,
-0.0028145823162049055,
-0.007995761930942535,
... | 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": "box", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def test_td64arr_add_sub_numeric_arr_invalid(self, box, vec, dtype):
tdser = pd.Series(['59 Days', '59 Days', 'NaT'], dtype='m8[ns]')
tdser = tm.box_expected(tdser, box)
err = TypeError
if box is pd.Index and not dtype.startswith('float'):
err = NullFrequencyError
ve... | |
15,605 | [
0.007288345601409674,
-0.02938792295753956,
0.03112352266907692,
-0.030912436544895172,
0.018434882164001465,
0.015315493568778038,
0.01716836355626583,
-0.015256858430802822,
0.010349098592996597,
0.03278876096010208,
0.011064447462558746,
-0.006268094293773174,
0.007511158939450979,
-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": "scalar_td", "annotation": null, "type_comment": null}}], "kwarg":... | def test_operators_timedelta64_with_timedelta(self, scalar_td):
# smoke tests
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
td1 + scalar_td
scalar_td + td1
td1 - scalar_td
scalar_td - td1
td1 / scalar_td
scalar_td / td1 | |
15,606 | [
0.0020439024083316326,
-0.023365868255496025,
0.06212974712252617,
-0.025907762348651886,
0.029573954641819,
0.06393840163946152,
0.03451109305024147,
0.01565464399755001,
0.037981756031513214,
0.01460366789251566,
0.01230618730187416,
0.011053571477532387,
0.004106136038899422,
-0.0383728... | 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_timedelta64_operations_with_timedeltas(self):
# td operate with td
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td2 = timedelta(minutes=5, seconds=4)
result = td1 - td2
expected = (Series([timedelta(seconds=0)] * 3) -
Series([timedelta(seconds=... | |
15,607 | [
-0.010655793361365795,
-0.04612046107649803,
0.04284175485372543,
0.0055343336425721645,
0.015130619518458843,
-0.003554966999217868,
0.014547738246619701,
0.0068913535214960575,
0.0029295841231942177,
0.025428183376789093,
0.007352801039814949,
0.01476631872355938,
0.015021328814327717,
-... | 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": "box", "annotation": null, "type_comment": null}}], "kwarg": null,... | def test_td64arr_add_td64_array(self, box):
dti = pd.date_range('2016-01-01', periods=3)
tdi = dti - dti.shift(1)
tdarr = tdi.values
expected = 2 * tdi
tdi = tm.box_expected(tdi, box)
expected = tm.box_expected(expected, box)
result = tdi + tdarr
tm.asse... | |
15,608 | [
-0.012456468306481838,
-0.03883738070726395,
0.03893483802676201,
0.006895218510180712,
0.01974761299788952,
-0.0003517658042255789,
0.022817568853497505,
0.009648432955145836,
0.009532700292766094,
0.028019439429044724,
0.016202544793486595,
0.006858671549707651,
0.012620930559933186,
-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": "box", "annotation": null, "type_comment": null}}], "kwarg": null,... | def test_td64arr_sub_td64_array(self, box):
dti = pd.date_range('2016-01-01', periods=3)
tdi = dti - dti.shift(1)
tdarr = tdi.values
expected = 0 * tdi
tdi = tm.box_expected(tdi, box)
expected = tm.box_expected(expected, box)
result = tdi - tdarr
tm.asse... | |
15,609 | [
-0.006134715396910906,
-0.029298951849341393,
0.0236949659883976,
-0.0038634531665593386,
-0.010205845348536968,
0.028877004981040955,
0.017866821959614754,
-0.016244962811470032,
0.03507435321807861,
-0.009197128005325794,
0.020583106204867363,
0.01484726369380951,
0.02203354984521866,
-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": "box", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def test_td64arr_add_sub_tdi(self, box, names):
# GH#17250 make sure result dtype is correct
# GH#19043 make sure names are propagated correctly
if box is pd.DataFrame and names[1] == 'Venkman':
pytest.skip("Name propagation for DataFrame does not behave like "
... | |
15,610 | [
-0.027380039915442467,
-0.016709500923752785,
0.023260239511728287,
-0.012346606701612473,
0.015250938013195992,
0.01723407208919525,
0.02365686744451523,
0.009423083625733852,
0.041428305208683014,
0.012161088176071644,
0.023835988715291023,
0.017157305032014847,
-0.006940968334674835,
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": "box", "annotation": null, "type_comment": null}}], "kwarg": null,... | def test_td64arr_sub_NaT(self, box):
# GH#18808
ser = Series([NaT, Timedelta('1s')])
expected = Series([NaT, NaT], dtype='timedelta64[ns]')
ser = tm.box_expected(ser, box)
expected = tm.box_expected(expected, box)
res = ser - pd.NaT
tm.assert_equal(res, expected... | |
15,611 | [
0.00045458684326149523,
-0.02421514131128788,
0.04789946973323822,
-0.008461397141218185,
0.003946335054934025,
0.006685704458504915,
0.02176329493522644,
0.01598755456507206,
0.03528636321425438,
0.024328887462615967,
0.029043003916740417,
0.008979571051895618,
-0.02221827767789364,
-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": "box", "annotation": null, "type_comment": null}}], "kwarg": null,... | def test_td64arr_add_sub_td64_nat(self, box):
# GH#23320 special handling for timedelta64("NaT")
tdi = pd.TimedeltaIndex([NaT, Timedelta('1s')])
other = np.timedelta64("NaT")
expected = pd.TimedeltaIndex(["NaT"] * 2)
obj = tm.box_expected(tdi, box)
expected = tm.box_expe... | |
15,612 | [
-0.044205959886312485,
0.005033622495830059,
0.05740213394165039,
-0.03351293131709099,
0.0013738417765125632,
0.02317228354513645,
0.05647864192724228,
0.01760704629123211,
0.03263804689049721,
0.02483699470758438,
0.01923530362546444,
-0.00599052757024765,
-0.0035056129563599825,
-0.0241... | 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": "two_hours", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_sub_timedeltalike(self, two_hours, box):
# only test adding/sub offsets as - is now numeric
rng = timedelta_range('1 days', '10 days')
expected = timedelta_range('0 days 22:00:00', '9 days 22:00:00')
rng = tm.box_expected(rng, box)
expected = tm.box_expected(exp... | |
15,613 | [
-0.04250670596957207,
0.0022808401845395565,
0.05380287766456604,
-0.03829498961567879,
-0.007942618802189827,
0.024978168308734894,
0.039901770651340485,
0.02003609389066696,
0.023821771144866943,
0.0190744586288929,
0.019159667193889618,
0.0034600605722516775,
0.004290840122848749,
-0.02... | 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": "two_hours", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_add_timedeltalike(self, two_hours, box):
# only test adding/sub offsets as + is now numeric
rng = timedelta_range('1 days', '10 days')
expected = timedelta_range('1 days 02:00:00', '10 days 02:00:00',
freq='D')
rng = tm.box_expected(rng... | |
15,614 | [
-0.001333787222392857,
-0.012015029788017273,
0.04760979115962982,
-0.006026278715580702,
-0.0024033186491578817,
0.026594433933496475,
-0.004212453495711088,
0.0039872885681688786,
-0.0015010969946160913,
-0.02164081484079361,
0.008662580512464046,
0.03452523052692413,
0.03782764449715614,
... | 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": "names", "annotation": null, "type_comment": null}}, {"_type": "ar... | def test_td64arr_add_offset_index(self, names, box):
# GH#18849, GH#19744
if box is pd.DataFrame and names[1] == 'bar':
pytest.skip("Name propagation for DataFrame does not behave like "
"it does for Index/Series")
tdi = TimedeltaIndex(['1 days 00:00:00', '3 ... | |
15,615 | [
-0.005396261811256409,
-0.008359662257134914,
0.08150964230298996,
0.00018292258027940989,
0.0151482243090868,
0.03512699902057648,
0.0361822135746479,
0.013881964609026909,
0.025864537805318832,
-0.00792585127055645,
0.011185298673808575,
0.004103621002286673,
-0.03057784028351307,
-0.062... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_timedelta64_operations_with_DateOffset(self):
# GH#10699
td = Series([timedelta(minutes=5, seconds=3)] * 3)
result = td + pd.offsets.Minute(1)
expected = Series([timedelta(minutes=6, seconds=3)] * 3)
tm.assert_series_equal(result, expected)
result = td - pd.offs... | |
15,616 | [
-0.025404775515198708,
-0.028180710971355438,
0.03940838202834129,
0.009591851383447647,
-0.001889867358841002,
0.009703384712338448,
0.018973030149936676,
0.01361943781375885,
0.00742934737354517,
-0.0005448859301395714,
-0.00887308269739151,
0.026024403050541878,
0.018973030149936676,
-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": "box", "annotation": null, "type_comment": null}}], "kwarg": null,... | def test_td64arr_add_offset_array(self, box):
# GH#18849
tdi = TimedeltaIndex(['1 days 00:00:00', '3 days 04:00:00'])
other = np.array([pd.offsets.Hour(n=1), pd.offsets.Minute(n=-2)])
expected = TimedeltaIndex([tdi[n] + other[n] for n in range(len(tdi))],
... | |
15,617 | [
-0.0023928082082420588,
-0.005388924852013588,
0.05530324950814247,
-0.0035821422934532166,
0.0005577458650805056,
0.03489132225513458,
0.010143118910491467,
0.0036544136237353086,
0.008471452631056309,
-0.012908280827105045,
0.019934307783842087,
0.024647653102874756,
0.03549463301897049,
... | 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": "names", "annotation": null, "type_comment": null}}, {"_type": "ar... | def test_td64arr_sub_offset_index(self, names, box):
# GH#18824, GH#19744
if box is pd.DataFrame and names[1] == 'bar':
pytest.skip("Name propagation for DataFrame does not behave like "
"it does for Index/Series")
tdi = TimedeltaIndex(['1 days 00:00:00', '3 ... | |
15,618 | [
-0.019434791058301926,
-0.020654646679759026,
0.0369509756565094,
0.020121701061725616,
0.0086278161033988,
0.016402916982769966,
0.03280583396553993,
0.0003497463185340166,
0.020855983719229698,
0.011985380202531815,
0.002946011256426573,
0.007277683820575476,
0.0166160948574543,
-0.00542... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_sub_offset_array(self, box_with_array):
# GH#18824
tdi = TimedeltaIndex(['1 days 00:00:00', '3 days 04:00:00'])
other = np.array([pd.offsets.Hour(n=1), pd.offsets.Minute(n=-2)])
expected = TimedeltaIndex([tdi[n] - other[n] for n in range(len(tdi))],
... | |
15,619 | [
-0.014637199230492115,
-0.032907746732234955,
0.05719926953315735,
-0.03324512764811516,
-0.017154589295387268,
0.0316360741853714,
0.03337489068508148,
0.007967411540448666,
0.02335723303258419,
-0.0013681823620572686,
0.0012473411625251174,
-0.002961826976388693,
0.0065010967664420605,
-... | 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": "names", "annotation": null, "type_comment": null}}, {"_type": "ar... | def test_td64arr_with_offset_series(self, names, box_df_fail):
# GH#18849
box = box_df_fail
box2 = Series if box in [pd.Index, tm.to_array] else box
tdi = TimedeltaIndex(['1 days 00:00:00', '3 days 04:00:00'],
name=names[0])
other = Series([pd.offset... | |
15,620 | [
0.006798127666115761,
0.00033799215452745557,
0.03730562701821327,
0.024598171934485435,
0.0006966279470361769,
0.03874692693352699,
0.029474567621946335,
-0.0034501098562031984,
0.02215997502207756,
0.00388550222851336,
0.010329310782253742,
0.017295589670538902,
0.024598171934485435,
-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": "obox", "annotation": null, "type_comment": null}}, {"_type": "arg... | def test_td64arr_addsub_anchored_offset_arraylike(self, obox,
box_with_array):
# GH#18824
tdi = TimedeltaIndex(['1 days 00:00:00', '3 days 04:00:00'])
tdi = tm.box_expected(tdi, box_with_array)
anchored = obox([pd.offsets.MonthEnd(),... | |
15,621 | [
0.00004545951014733873,
-0.010485393926501274,
0.01917841285467148,
0.0009225929970853031,
0.04713946208357811,
0.02632230706512928,
-0.0022756760008633137,
0.003837602911517024,
0.012008911930024624,
0.033005304634571075,
0.039509065449237823,
-0.002722169505432248,
0.004468134604394436,
... | 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": "m", "annotation": null... | class TestTimedeltaArraylikeMulDivOps:
# Tests for timedelta64[ns]
# __mul__, __rmul__, __div__, __rdiv__, __floordiv__, __rfloordiv__
# TODO: Moved from tests.series.test_operators; needs cleanup
@pytest.mark.parametrize("m", [1, 3, 10])
@pytest.mark.parametrize("unit", ['D', 'h', 'm', 's', 'ms', ... | |
15,622 | [
-0.0013255304656922817,
-0.014561050571501255,
0.014696712605655193,
0.019897088408470154,
0.01753430813550949,
-0.024848749861121178,
0.02021363191306591,
0.0053190793842077255,
0.032875414937734604,
0.024780917912721634,
0.008563661016523838,
0.007314440794289112,
0.020100580528378487,
-... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_mul_int(self, box_with_array):
idx = TimedeltaIndex(np.arange(5, dtype='int64'))
idx = tm.box_expected(idx, box_with_array)
result = idx * 1
tm.assert_equal(result, idx)
result = 1 * idx
tm.assert_equal(result, idx) | |
15,623 | [
0.00793736893683672,
-0.025622785091400146,
0.04224912449717522,
-0.018471181392669678,
0.015954453498125076,
0.021204277873039246,
0.03197723627090454,
0.00348469871096313,
0.05447973310947418,
-0.0004772243555635214,
0.030314601957798004,
0.006832742597907782,
-0.017935950309038162,
-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": "m", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def test_timedelta64_conversions(self, m, unit):
startdate = Series(pd.date_range('2013-01-01', '2013-01-03'))
enddate = Series(pd.date_range('2013-03-01', '2013-03-03'))
ser = enddate - startdate
ser[2] = np.nan
# op
expected = Series([x / np.timedelta64(m, unit) for x... | |
15,624 | [
0.0047319550067186356,
0.013834094628691673,
0.0073569598607718945,
0.029636219143867493,
0.014192970469594002,
-0.03579499572515488,
0.03084019012749195,
0.031094877049326897,
0.028987927362322807,
0.013579408638179302,
0.0022559992503374815,
0.00189857033547014,
0.006239813286811113,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_tdi_mul_int_array_zerodim(self, box_with_array):
rng5 = np.arange(5, dtype='int64')
idx = TimedeltaIndex(rng5)
expected = TimedeltaIndex(rng5 * 5)
idx = tm.box_expected(idx, box_with_array)
expected = tm.box_expected(expected, box_with_array)
result = idx * np.... | |
15,625 | [
-0.01373306754976511,
0.0009163397480733693,
0.022914862260222435,
0.019993897527456284,
0.0212392695248127,
-0.03077203407883644,
0.028892653062939644,
0.024681027978658676,
0.038176342844963074,
0.025201819837093353,
0.004438056610524654,
0.0027992588002234697,
0.013687781058251858,
-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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_tdi_mul_int_array(self, box_with_array):
rng5 = np.arange(5, dtype='int64')
idx = TimedeltaIndex(rng5)
expected = TimedeltaIndex(rng5 ** 2)
idx = tm.box_expected(idx, box_with_array)
expected = tm.box_expected(expected, box_with_array)
result = idx * rng5
... | |
15,626 | [
-0.006800920702517033,
-0.02767968736588955,
0.016207968816161156,
0.014411048963665962,
0.025823267176747322,
-0.022883936762809753,
0.05021851882338524,
0.029369505122303963,
0.05488336831331253,
0.02741788513958454,
0.01731467992067337,
-0.010513759218156338,
0.014006445184350014,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_tdi_mul_int_series(self, box_with_array):
box = box_with_array
xbox = pd.Series if box in [pd.Index, tm.to_array] else box
idx = TimedeltaIndex(np.arange(5, dtype='int64'))
expected = TimedeltaIndex(np.arange(5, dtype='int64') ** 2)
idx = tm.box_expected(idx, box)
... | |
15,627 | [
-0.009406228549778461,
-0.021365491673350334,
0.007594396825879812,
0.016941798850893974,
0.03207176551222801,
-0.036989595741033554,
0.046942900866270065,
0.028659876435995102,
0.052378397434949875,
0.021036067977547646,
0.02263612672686577,
0.0012132799020037055,
0.0003022169985342771,
-... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_tdi_mul_float_series(self, box_with_array):
box = box_with_array
xbox = pd.Series if box in [pd.Index, tm.to_array] else box
idx = TimedeltaIndex(np.arange(5, dtype='int64'))
idx = tm.box_expected(idx, box)
rng5f = np.arange(5, dtype='float64')
expected = Timed... | |
15,628 | [
-0.011878944002091885,
-0.02060430310666561,
0.003471593139693141,
0.03532544896006584,
0.011368805542588234,
-0.0058500319719314575,
0.048469800502061844,
0.0006513377884402871,
0.0306613240391016,
0.012389082461595535,
0.01030877698212862,
-0.023877140134572983,
0.028859274461865425,
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": "other", "annotation": null, "type_comment": null}}, {"_type": "ar... | def test_tdi_rmul_arraylike(self, other, box_with_array):
box = box_with_array
xbox = get_upcast_box(box, other)
tdi = TimedeltaIndex(['1 Day'] * 10)
expected = timedelta_range('1 days', '10 days')
expected._data.freq = None
tdi = tm.box_expected(tdi, box)
expec... | |
15,629 | [
-0.005827794782817364,
0.002604305511340499,
0.06198060140013695,
0.0036746531259268522,
0.05050547793507576,
-0.01793454773724079,
0.0017470937455073,
0.0009272198658436537,
0.020324161276221275,
0.020585525780916214,
0.01799677684903145,
-0.03285718709230423,
-0.033803075551986694,
0.013... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_div_nat_invalid(self, box_with_array):
# don't allow division by NaT (maybe could in the future)
rng = timedelta_range('1 days', '10 days', name='foo')
rng = tm.box_expected(rng, box_with_array)
with pytest.raises(TypeError,
match="'?true_divi... | |
15,630 | [
-0.0059701004065573215,
-0.0013454356230795383,
0.02641841396689415,
0.014881988987326622,
0.033201832324266434,
-0.017650730907917023,
0.006281583569943905,
0.032232772558927536,
0.035255316644907,
0.019219685345888138,
0.022138400003314018,
0.015308836475014687,
0.027272110804915428,
-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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_div_int(self, box_with_array):
idx = TimedeltaIndex(np.arange(5, dtype='int64'))
idx = tm.box_expected(idx, box_with_array)
result = idx / 1
tm.assert_equal(result, idx)
with pytest.raises(TypeError, match='Cannot divide'):
# GH#23829
1 ... | |
15,631 | [
-0.015502819791436195,
-0.007900475524365902,
0.06240878626704216,
0.012533930130302906,
0.031477682292461395,
-0.017055585980415344,
0.019018283113837242,
-0.012496664188802242,
0.01720465160906315,
0.031999409198760986,
0.011341406032443047,
-0.0007581381942145526,
-0.019279148429632187,
... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_div_td64nat(self, box_with_array):
# GH#23829
rng = timedelta_range('1 days', '10 days',)
rng = tm.box_expected(rng, box_with_array)
other = np.timedelta64('NaT')
expected = np.array([np.nan] * 10)
expected = tm.box_expected(expected, box_with_array)
... | |
15,632 | [
-0.00475431839004159,
-0.004853969439864159,
0.04610949754714966,
-0.008563559502363205,
0.03142543509602547,
-0.0005874588969163597,
0.026822200044989586,
0.0005420533707365394,
0.032968416810035706,
0.03749450296163559,
0.017307134345173836,
-0.008531413972377777,
-0.012883913703262806,
... | 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": "two_hours", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_div_tdlike_scalar_with_nat(self, two_hours,
box_with_array):
rng = TimedeltaIndex(['1 days', pd.NaT, '2 days'], name='foo')
expected = pd.Float64Index([12, np.nan, 24], name='foo')
rng = tm.box_expected(rng, box_with_array)
... | |
15,633 | [
-0.004850718192756176,
-0.015224184840917587,
0.04805491492152214,
0.0014913649065420032,
0.04754531756043434,
-0.0012166607193648815,
0.020090827718377113,
0.0006015623221173882,
0.02440965548157692,
0.026575438678264618,
0.014485269784927368,
-0.01291189156472683,
-0.009472117759287357,
... | 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": "two_hours", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_div_tdlike_scalar(self, two_hours, box_with_array):
# GH#20088, GH#22163 ensure DataFrame returns correct dtype
rng = timedelta_range('1 days', '10 days', name='foo')
expected = pd.Float64Index((np.arange(10) + 1) * 12, name='foo')
rng = tm.box_expected(rng, box_with_ar... | |
15,634 | [
-0.0005799781647510827,
-0.020269542932510376,
0.04114717245101929,
0.02537493407726288,
0.021308356896042824,
-0.008576550520956516,
0.02384204976260662,
-0.010926550254225731,
0.005998517852276564,
0.020332885906100273,
0.005254245828837156,
0.0002597035199869424,
0.002220148453488946,
-... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_div_td64_ndarray(self, box_with_array):
# GH#22631
rng = TimedeltaIndex(['1 days', pd.NaT, '2 days'])
expected = pd.Float64Index([12, np.nan, 24])
rng = tm.box_expected(rng, box_with_array)
expected = tm.box_expected(expected, box_with_array)
other = np... | |
15,635 | [
0.003259372664615512,
0.0011152460938319564,
0.055274151265621185,
0.009024105966091156,
0.000034710628824541345,
0.016798535361886024,
0.02643546462059021,
-0.033717233687639236,
0.011144950985908508,
0.040061745792627335,
0.016990793868899345,
-0.014731762930750847,
-0.0012722066603600979,... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_tdarr_div_length_mismatch(self, box_with_array):
rng = TimedeltaIndex(['1 days', pd.NaT, '2 days'])
mismatched = [1, 2, 3, 4]
rng = tm.box_expected(rng, box_with_array)
for obj in [mismatched, mismatched[:2]]:
# one shorter, one longer
for other in [obj,... | |
15,636 | [
-0.00958721712231636,
-0.018233662471175194,
0.0185678843408823,
0.009296320378780365,
0.0354275219142437,
-0.024781936779618263,
0.01990477181971073,
-0.011747281067073345,
0.008510280400514603,
0.050950273871421814,
0.0020672243554145098,
-0.006740142125636339,
-0.006210957188159227,
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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_floordiv_tdscalar(self, box_with_array, scalar_td):
# GH#18831
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
expected = Series([0, 0, np.nan])
td1 = tm.box_expected(td1, box_with_array, transpose=False)
expected = tm.box_expec... | |
15,637 | [
-0.012561489827930927,
-0.018472040072083473,
0.015899507328867912,
-0.0016815580893307924,
0.03714486584067345,
-0.01323913224041462,
0.014506575651466846,
-0.010039152577519417,
0.0019827326759696007,
0.043394237756729126,
0.0006043099565431476,
-0.004840753972530365,
0.007541913539171219,... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_rfloordiv_tdscalar(self, box_with_array, scalar_td):
# GH#18831
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
expected = Series([1, 1, np.nan])
td1 = tm.box_expected(td1, box_with_array, transpose=False)
expected = tm.box_expe... | |
15,638 | [
-0.012964027002453804,
-0.016910137608647346,
0.011009526439011097,
-0.004023425281047821,
0.029292764142155647,
-0.005381060764193535,
0.013174321502447128,
-0.0059841107577085495,
0.022748898714780807,
0.04732859507203102,
0.013594910502433777,
0.005609910469502211,
0.014361865818500519,
... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_rfloordiv_tdscalar_explicit(self, box_with_array,
scalar_td):
# GH#18831
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
expected = Series([1, 1, np.nan])
td1 = tm.box_expected(td1, box_w... | |
15,639 | [
-0.00926983542740345,
0.0028391440864652395,
0.02445308491587639,
0.018163468688726425,
0.04298099875450134,
-0.009287470020353794,
0.010709980502724648,
0.022231144830584526,
0.0340697318315506,
0.03954816237092018,
0.019198022782802582,
0.006836283020675182,
0.017281746491789818,
-0.0110... | 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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_floordiv_int(self, box_with_array):
idx = TimedeltaIndex(np.arange(5, dtype='int64'))
idx = tm.box_expected(idx, box_with_array)
result = idx // 1
tm.assert_equal(result, idx)
pattern = ('floor_divide cannot use operands|'
'Cannot divide int b... | |
15,640 | [
-0.0188714861869812,
-0.00910793524235487,
0.04666450619697571,
-0.007706714328378439,
0.01935998536646366,
-0.0004031321732327342,
0.03828289359807968,
0.0012935581617057323,
0.03056975267827511,
0.05399199202656746,
0.009872821159660816,
-0.017380280420184135,
-0.013420866802334785,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "two_hours", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_floordiv_tdlike_scalar(self, two_hours, box_with_array):
tdi = timedelta_range('1 days', '10 days', name='foo')
expected = pd.Int64Index((np.arange(10) + 1) * 12, name='foo')
tdi = tm.box_expected(tdi, box_with_array)
expected = tm.box_expected(expected, box_with_array)... | |
15,641 | [
0.0046393838711082935,
-0.009938335046172142,
0.012570200487971306,
-0.0013303408632054925,
0.023424245417118073,
-0.005606322083622217,
0.009509296156466007,
-0.00803007185459137,
-0.005625532940030098,
0.051484670490026474,
-0.008638410829007626,
-0.0064772069454193115,
0.01029693428426981... | 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": "scalar_td", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_rfloordiv_tdlike_scalar(self, scalar_td, box_with_array):
# GH#19125
tdi = TimedeltaIndex(['00:05:03', '00:05:03', pd.NaT], freq=None)
expected = pd.Index([2.0, 2.0, np.nan])
tdi = tm.box_expected(tdi, box_with_array, transpose=False)
expected = tm.box_expected(... | |
15,642 | [
-0.00953718088567257,
-0.012030277401208878,
0.026112230494618416,
0.020118851214647293,
0.025913279503583908,
0.037129104137420654,
0.0006465885671786964,
-0.009953733533620834,
0.04314735159277916,
0.03765134885907173,
0.011358819901943207,
-0.02195914275944233,
0.013926522806286812,
-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": "box_with_array", "annotation": null, "type_comment": null}}], "kw... | def test_td64arr_mod_int(self, box_with_array):
tdi = timedelta_range('1 ns', '10 ns', periods=10)
tdarr = tm.box_expected(tdi, box_with_array)
expected = TimedeltaIndex(['1 ns', '0 ns'] * 5)
expected = tm.box_expected(expected, box_with_array)
result = tdarr % 2
tm.ass... | |
15,643 | [
-0.016813810914754868,
-0.019696887582540512,
0.025997407734394073,
0.017559435218572617,
0.040537066757678986,
0.016093041747808456,
0.019672034308314323,
-0.0226421020925045,
0.03129133582115173,
0.0306202732026577,
0.007201480679214001,
-0.027339529246091843,
0.0071952673606574535,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_mod_tdscalar(self, box_with_array, three_days):
tdi = timedelta_range('1 Day', '9 days')
tdarr = tm.box_expected(tdi, box_with_array)
expected = TimedeltaIndex(['1 Day', '2 Days', '0 Days'] * 3)
expected = tm.box_expected(expected, box_with_array)
result = tdar... | |
15,644 | [
-0.00598034355789423,
-0.0031032024417072535,
0.010616064071655273,
0.0073572611436247826,
0.03983372822403908,
-0.017438998445868492,
0.003153112018480897,
-0.017485972493886948,
0.01484370045363903,
0.025389304384589195,
-0.004245251417160034,
-0.012119223363697529,
0.018719034269452095,
... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_mul_tdscalar_invalid(self, box_with_array, scalar_td):
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
td1 = tm.box_expected(td1, box_with_array)
# check that we are getting a TypeError
# with 'operate' (from core/ops.py) for the ops th... | |
15,645 | [
-0.014195538125932217,
-0.015401288866996765,
0.027197755873203278,
0.017787929624319077,
0.041368432343006134,
0.010770957916975021,
0.018421880900859833,
-0.019316870719194412,
0.03530238941311836,
0.03408420830965042,
0.007433390244841576,
-0.02689942717552185,
0.007396099157631397,
-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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_rmod_tdscalar(self, box_with_array, three_days):
tdi = timedelta_range('1 Day', '9 days')
tdarr = tm.box_expected(tdi, box_with_array)
expected = ['0 Days', '1 Day', '0 Days'] + ['3 Days'] * 6
expected = TimedeltaIndex(expected)
expected = tm.box_expected(expect... | |
15,646 | [
-0.011554267257452011,
-0.03615735471248627,
0.029002711176872253,
0.015809839591383934,
0.034404706209897995,
0.0016431069234386086,
0.014933515340089798,
0.01787460222840309,
0.031139500439167023,
0.04537675902247429,
0.006065240129828453,
-0.029626943171024323,
-0.003574320115149021,
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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_div_numeric_scalar(self, box_with_array, two):
# GH#4521
# divide/multiply by integers
tdser = pd.Series(['59 Days', '59 Days', 'NaT'], dtype='m8[ns]')
expected = Series(['29.5D', '29.5D', 'NaT'], dtype='timedelta64[ns]')
tdser = tm.box_expected(tdser, box_with_... | |
15,647 | [
-0.00893301609903574,
-0.05050261691212654,
0.014234327711164951,
0.039997488260269165,
0.02661624364554882,
-0.021059006452560425,
0.01973063126206398,
-0.008731931447982788,
0.017134815454483032,
0.0397537462413311,
0.00365912402048707,
-0.01895066723227501,
-0.011845691129565239,
0.0052... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_mul_numeric_scalar(self, box_with_array, one):
# GH#4521
# divide/multiply by integers
tdser = pd.Series(['59 Days', '59 Days', 'NaT'], dtype='m8[ns]')
expected = Series(['-59 Days', '-59 Days', 'NaT'],
dtype='timedelta64[ns]')
tdser = ... | |
15,648 | [
-0.00193381542339921,
-0.008515600115060806,
0.007276967633515596,
0.04151897132396698,
0.014950297772884369,
-0.010293038561940193,
0.027571965008974075,
0.019384602084755898,
0.03435967117547989,
0.04587895795702934,
0.01181036327034235,
-0.012906553223729134,
0.008044919930398464,
0.005... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_rmul_numeric_array(self, box_with_array, vector, dtype):
# GH#4521
# divide/multiply by integers
xbox = get_upcast_box(box_with_array, vector)
tdser = pd.Series(['59 Days', '59 Days', 'NaT'], dtype='m8[ns]')
vector = vector.astype(dtype)
expected = Seri... | |
15,649 | [
0.0033643918577581644,
-0.006782950833439827,
0.00328314071521163,
0.028865156695246696,
0.02626512572169304,
0.003361382521688938,
0.02819107472896576,
0.021185437217354774,
0.02355676144361496,
0.05392656475305557,
0.013012191280722618,
-0.013301083818078041,
0.004890104290097952,
0.0092... | 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": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_td64arr_div_numeric_array(self, box_with_array, vector, dtype):
# GH#4521
# divide/multiply by integers
xbox = get_upcast_box(box_with_array, vector)
tdser = pd.Series(['59 Days', '59 Days', 'NaT'], dtype='m8[ns]')
vector = vector.astype(dtype)
expected = Series(... | |
15,650 | [
0.013700425624847412,
-0.030646946281194687,
0.01340207178145647,
0.009726347401738167,
0.02288973517715931,
-0.002879118314012885,
0.008813383989036083,
-0.005134676117449999,
0.03735394775867462,
0.0031685219146311283,
0.03038439340889454,
0.0006671946030110121,
0.02109961025416851,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "box_with_array", "annotation": null, "type_comment": null}}, {"_t... | def test_float_series_rdiv_td64arr(self, box_with_array, names):
# GH#19042 test for correct name attachment
# TODO: the direct operation TimedeltaIndex / Series still
# needs to be fixed.
box = box_with_array
tdi = TimedeltaIndex(['0days', '1day', '2days', '3days', '4days'],
... | |
15,651 | [
-0.013571314513683319,
-0.032022204250097275,
0.029506172984838486,
-0.00892047118395567,
0.0010610531317070127,
-0.0006583930226042867,
0.017866356298327446,
0.009466880932450294,
0.03128518536686897,
0.01700226403772831,
0.02232659049332142,
0.0013247280148789287,
0.015629883855581284,
-... | 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": "box_df_fail", "annotation": null, "type_comment": null}}, {"_type... | def test_td64arr_mul_int_series(self, box_df_fail, names):
# GH#19042 test for correct name attachment
box = box_df_fail # broadcasts along wrong axis, but doesn't raise
tdi = TimedeltaIndex(['0days', '1day', '2days', '3days', '4days'],
name=names[0])
# TODO... | |
15,652 | [
0.004599874839186668,
-0.005880780518054962,
0.018376728519797325,
0.020927153527736664,
0.040806811302900314,
0.023295406252145767,
-0.011004403233528137,
-0.02602800540626049,
0.018843546509742737,
0.011141033843159676,
0.0004490286228246987,
0.007987159304320812,
0.017648033797740936,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "scalar_td", "annotatio... | class TestTimedeltaArraylikeInvalidArithmeticOps:
def test_td64arr_pow_invalid(self, scalar_td, box_with_array):
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
td1 = tm.box_expected(td1, box_with_array)
# check that we are getting a TypeError
# wi... | |
15,653 | [
-0.005195793230086565,
-0.006032805424183607,
0.020151466131210327,
0.007226732559502125,
0.03001873567700386,
-0.00034625461557880044,
-0.009690390899777412,
-0.016917124390602112,
0.019027026370167732,
0.01943131908774376,
0.007346756756305695,
0.0011378629133105278,
0.014478733763098717,
... | 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": "scalar_td", "annotation": null, "type_comment": null}}, {"_type":... | def test_td64arr_pow_invalid(self, scalar_td, box_with_array):
td1 = Series([timedelta(minutes=5, seconds=3)] * 3)
td1.iloc[2] = np.nan
td1 = tm.box_expected(td1, box_with_array)
# check that we are getting a TypeError
# with 'operate' (from core/ops.py) for the ops that are no... | |
15,654 | [
0.04409909248352051,
0.051295287907123566,
-0.012414073571562767,
0.035289518535137177,
-0.04496980831027031,
-0.0008651117677800357,
0.03334321826696396,
-0.027325047180056572,
-0.01054459996521473,
0.0738058015704155,
0.00888640247285366,
-0.0005249892128631473,
0.012650959193706512,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kw", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": nu... | def capture_warnings(*args, **kw):
orig_warn(*args, **kw)
popwarn = warnings.pop(0)
canary.append(popwarn)
if regex:
assert re.match(popwarn, args[0])
else:
eq_(args[0], popwarn) | |
15,655 | [
-0.029155870899558067,
-0.03381771966814995,
0.03147391602396965,
-0.038891665637493134,
0.019690515473484993,
-0.030366405844688416,
-0.05171818658709526,
0.0015936567215248942,
-0.039071954786777496,
0.022124463692307472,
-0.0031164842657744884,
-0.056920912116765976,
-0.024957630783319473... | 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": "host", "annotation": n... | class Fountain(object):
def __init__(self, host='localhost', port=5002):
self.__fountain_url = 'http://{}:{}'.format(host, port)
self.__types = {}
self.__properties = {}
def __send_request(self, path):
try:
response = requests.get(urlparse.urljoin(self.__fountain_url... | |
15,656 | [
0.0017443548422306776,
0.03859180584549904,
-0.0051970649510622025,
0.003393801162019372,
-0.03906307741999626,
0.016939550638198853,
0.007762869819998741,
0.018955541774630547,
-0.027150409296154976,
0.020002808421850204,
-0.019308993592858315,
-0.030239848420023918,
-0.011343215592205524,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "0"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "1"}}, {"_type": "Constant", "_fiel... | class BNPVirtKeyboard(VirtKeyboard):
symbols={'0': '9cc4789a2cb223e8f2d5e676e90264b5',
'1': 'e10b58fc085f9683052d5a63c96fc912',
'2': '04ec647e7b3414bcc069f0c54eb55a4c',
'3': 'fde84fd9bac725db8463554448f1e469',
'4': '2359eea8671bf112b58264bec0294f71',
... | |
15,657 | [
-0.03296507149934769,
-0.021922122687101364,
0.004623649641871452,
-0.02083420567214489,
0.03464958816766739,
-0.03488354757428169,
-0.04183218255639076,
0.030438294634222984,
-0.0008386030676774681,
0.0511438213288784,
-0.01710253208875656,
-0.028168875724077225,
-0.04178539291024208,
-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": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def __send_request(self, path):
try:
response = requests.get(urlparse.urljoin(self.__fountain_url, path))
if response.status_code != 200:
raise IOError(response.json())
return response.json()
except requests.ConnectionError:
message = 'A fo... | |
15,658 | [
0.02072484977543354,
0.017243867740035057,
0.002705193590372801,
-0.009371398016810417,
0.041573576629161835,
-0.017838483676314354,
0.02157961018383503,
0.013676170259714127,
-0.022533472627401352,
0.03359581157565117,
-0.011025173589587212,
-0.028838882222771645,
-0.0023010405711829662,
... | 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 LoginPage(Page):
def on_loaded(self):
for td in self.document.getroot().cssselect('td.LibelleErreur'):
if td.text is None:
continue
msg = td.text.strip()
if 'indisponible' in msg:
raise BrowserUnavailable(msg)
def login(self, log... | |
15,659 | [
0.020775945857167244,
0.028308261185884476,
0.020030992105603218,
0.025635885074734688,
-0.0014980379492044449,
0.023720288649201393,
0.010654028505086899,
-0.029514377936720848,
-0.022088484838604927,
0.029419779777526855,
-0.018813051283359528,
-0.006408971268683672,
-0.003378899535164237,... | 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": "page", "annotation": null, "type_comment": null}}], "kwarg": null... | def __init__(self, page):
coords = {}
size = 136
x, y, width, height = (0, 0, size/5, size/5)
for a in page.document.xpath('//div[@id="secret-nbr-keyboard"]/a'):
code = a.attrib['ondblclick']
coords[code] = (x+1, y+1, x+height-2, y+height-2)
if (x + w... | |
15,660 | [
0.00432272395119071,
0.03309791907668114,
0.005004928447306156,
0.0025731995701789856,
0.01697651669383049,
-0.0026407914701849222,
0.028118140995502472,
0.050652895122766495,
-0.02098800428211689,
0.04715698957443237,
-0.013568637892603874,
0.0062907421961426735,
0.024521633982658386,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "login", "annotation": null, "type_comment": null}}, {"_type": "ar... | def login(self, login, password):
try:
vk=BNPVirtKeyboard(self)
except VirtKeyboardError as err:
self.logger.error("Error: %s"%err)
return False
# Mechanize does not recognize the form..
form = self.document.xpath('//form[@name="logincanalnet"]')[0]
... | |
15,661 | [
0.029637841507792473,
0.012561026029288769,
0.006595429498702288,
0.030327092856168747,
-0.0034670569002628326,
0.015377452597022057,
-0.01017835270613432,
-0.005430831108242273,
0.015531939454376698,
-0.00012190032430225983,
0.005754660815000534,
-0.0264767874032259,
-0.006298338063061237,
... | 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 ConfirmPage(Page):
def get_error(self):
for td in self.document.xpath('//td[@class="hdvon1"]'):
if td.text:
return td.text.strip()
return None
def get_relocate_url(self):
script = self.document.xpath('//script')[0]
m = re.match('document.locatio... | |
15,662 | [
0.009774002246558666,
0.011056647635996342,
0.041365303099155426,
-0.03342277184128761,
-0.02782353200018406,
-0.006246728356927633,
-0.02512257732450962,
-0.04869117960333824,
0.003656771732494235,
0.0654148980975151,
-0.006999048870056868,
0.009619838558137417,
0.013862433843314648,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "rt_input", "annotation": null, "type_comment": null}}, {"_type": ... | def testRowLengths(self,
rt_input,
expected,
axis=1,
ragged_rank=None,
expected_ragged_rank=None):
rt = ragged_factory_ops.constant(rt_input, ragged_rank=ragged_rank)
lengths = rt.row_lengths(axis)
self.... | |
15,663 | [
-0.006439319346100092,
0.0008783731609582901,
0.0347348116338253,
-0.044487569481134415,
-0.02083088457584381,
-0.0007025422528386116,
-0.042111895978450775,
-0.046513140201568604,
0.002918011974543333,
0.04093656688928604,
-0.0036666609812527895,
-0.009471425786614418,
0.025107093155384064,... | 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": "rt_input", "annotation... | class RaggedRowLengthsOp(test_util.TensorFlowTestCase,
parameterized.TestCase):
@parameterized.parameters([
# Docstring Example
dict(
rt_input=[[[3, 1, 4], [1]], [], [[5, 9], [2]], [[6]], []],
expected=[2, 0, 2, 1, 0]),
dict(
rt_input=[[[3, 1, ... | |
15,664 | [
0.014816008508205414,
0.009919513948261738,
0.00031888103694655,
-0.006073171738535166,
-0.026620736345648766,
0.008540397509932518,
0.023179272189736366,
0.010621723718941212,
-0.024393906816840172,
-0.002682317513972521,
-0.003501563100144267,
-0.012734681367874146,
-0.024937961250543594,
... | 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": "msg", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def process(self, msg, kwargs):
# NOTE(mrodden): catch any Message/other object and
# coerce to unicode before they can get
# to the python logging and possibly
# cause string encoding trouble
if not isinstance(msg, six.string_types):
... | |
15,665 | [
0.009349183179438114,
-0.01211476419121027,
0.04041372984647751,
-0.06618683785200119,
-0.008495536632835865,
0.031199024990200996,
-0.006647918373346329,
-0.030590947717428207,
0.0073787798173725605,
0.02190246433019638,
-0.011553461663424969,
0.0033414997160434723,
-0.00207857065834105,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "project", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "version", "annotation": null, "type_comment": null}}], "kwarg"... | def _setup_logging_from_conf(project, version):
log_root = getLogger(None).logger
for handler in log_root.handlers:
log_root.removeHandler(handler)
if CONF.use_syslog:
facility = _find_facility_from_conf()
# TODO(bogdando) use the format provided by RFCSysLogHandler
# afte... | |
15,666 | [
0.000025790381187107414,
0.0005042604170739651,
0.05687415972352028,
-0.06591343879699707,
-0.042142581194639206,
-0.010779949836432934,
-0.019727613776922226,
-0.019666537642478943,
0.0012826002202928066,
0.03532647714018822,
0.0014917862135916948,
-0.006159535143524408,
0.00301869143731892... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def main(argv):
parser = OptionParser(usage=("Usage: %prog [options] modulename\n"
"Utility script to create a basic template for a new ns-3 module"))
(options, args) = parser.parse_args()
if len(args) != 1:
parser.print_help()
return 1
modname = args[0]... | |
15,667 | [
0.04785739630460739,
0.031881947070360184,
0.09056587517261505,
-0.004807001911103725,
0.005614394322037697,
0.01395266130566597,
0.011062138713896275,
0.009108305908739567,
-0.03997310996055603,
-0.008550889790058136,
-0.00012453885574359447,
-0.002585954498499632,
0.001688053598627448,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('socialaccount', '0002_token_max_lengths'),
('oauth', '0004_drop_github_and_bitbucket_models'),
]
operations = [
migrations.AddField(
model_name='remoteorganization',
name='account',
field=... | |
15,668 | [
-0.005522980820387602,
0.002643400337547064,
-0.03224507346749306,
-0.01800159551203251,
-0.01932005025446415,
0.023254655301570892,
-0.0023202747106552124,
-0.047713570296764374,
-0.010288109071552753,
-0.040259622037410736,
-0.019735312089323997,
-0.0609188936650753,
0.009950708597898483,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo... | class Tag(models.Model):
name = models.CharField(max_length=100)
tagged_type = models.ForeignKey(ContentType, models.CASCADE, related_name="fixtures_tag_set")
tagged_id = models.PositiveIntegerField(default=0)
tagged = GenericForeignKey(ct_field='tagged_type', fk_field='tagged_id')
def __str__(self... | |
15,669 | [
0.040095288306474686,
-0.016078924760222435,
-0.023465437814593315,
-0.0366877019405365,
-0.0052542174234986305,
-0.0003640968643594533,
-0.03250472992658615,
-0.04558416083455086,
-0.02775043062865734,
0.0009398927795700729,
-0.016507424414157867,
-0.08406747877597809,
-0.007024327758699655... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo... | class Blog(models.Model):
name = models.CharField(max_length=100)
featured = models.ForeignKey(Article, models.CASCADE, related_name='fixtures_featured_set')
articles = models.ManyToManyField(Article, blank=True,
related_name='fixtures_articles_set')
def __str__(se... | |
15,670 | [
0.0021770428866147995,
-0.010392468422651291,
0.02941426821053028,
0.03489002212882042,
-0.0359221026301384,
-0.01487914752215147,
0.01252113189548254,
0.004289580974727869,
0.01069349143654108,
0.04234393313527107,
0.017746035009622574,
-0.02452622354030609,
-0.011704069562256336,
-0.0422... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def Initialize(self):
self.SetStartDate(2011, 2, 1)
self.SetEndDate(2011, 4, 4)
self.SetCash(100000)
self.filterDateConstituentSymbolCount = {}
self.constituentDataEncountered = {}
self.constituentSymbols = []
self.mappingEventOccurred = False
self.Unive... | |
15,671 | [
0.027913808822631836,
-0.014593720436096191,
-0.0004009127151221037,
0.01419571042060852,
-0.012059720233082771,
0.023336686193943024,
-0.034388113766908646,
0.03452078253030777,
-0.034892261028289795,
0.043621957302093506,
0.044975195080041885,
-0.038713160902261734,
0.0036451134365051985,
... | 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 ETFConstituentUniverseFilterFunctionRegressionAlgorithm(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2011, 2, 1)
self.SetEndDate(2011, 4, 4)
self.SetCash(100000)
self.filterDateConstituentSymbolCount = {}
self.constituentDataEncountered = {}
self.const... | |
15,672 | [
0.02891365997493267,
-0.023816457018256187,
-0.014962756074965,
0.02338642068207264,
-0.014962756074965,
0.0027810109313577414,
-0.041612397879362106,
0.01718882843852043,
-0.01856747642159462,
0.054285839200019836,
0.0321262888610363,
-0.03683139756321907,
0.00934065505862236,
0.002856899... | 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": "constituents", "annotation": null, "type_comment": null}}], "kwar... | def FilterETFs(self, constituents):
constituentSymbols = [i.Symbol for i in constituents]
if self.aapl not in constituentSymbols:
raise Exception("AAPL not found in QQQ constituents")
self.filterDateConstituentSymbolCount[self.UtcTime.date()] = len(constituentSymbols)
for s... | |
15,673 | [
0.04728702828288078,
0.029191533103585243,
0.0002401400270173326,
0.03681497275829315,
-0.0013217239174991846,
0.03198589012026787,
-0.006348344497382641,
-0.029842644929885864,
0.007684480864554644,
0.020211609080433846,
0.030086811631917953,
0.004700216464698315,
0.007514920551329851,
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def OnData(self, data):
if len(data.SymbolChangedEvents) != 0:
for symbolChanged in data.SymbolChangedEvents.Values:
if symbolChanged.Symbol != self.qqq:
raise Exception(f"Mapped symbol is not QQQ. Instead, found: {symbolChanged.Symbol}")
if symbol... | |
15,674 | [
0.004014451522380114,
0.016289249062538147,
-0.04434908181428909,
0.03892667964100838,
0.008910594508051872,
-0.006970873102545738,
0.022527217864990234,
0.004306511953473091,
0.005058704875409603,
0.001020833384245634,
0.0019962044898420572,
0.008905083872377872,
0.03033018670976162,
0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "main_dialog", "annotation": null, "type_comment": null}}, {"_type... | def get_button(self, main_dialog, text):
buttonBox = main_dialog.findChild(QDialogButtonBox, "buttonBox")
self.assertIsNotNone(buttonBox)
button = None
for button in buttonBox.buttons():
if str(button.text()) == text:
return button
self.assertIsNotNone... | |
15,675 | [
0.06454114615917206,
0.0012104776687920094,
0.007471512071788311,
-0.006411723326891661,
-0.020030012354254723,
0.033038921654224396,
-0.01879800669848919,
0.02278546243906021,
-0.03250902518630028,
0.03539695218205452,
0.07614583522081375,
-0.035237982869148254,
0.012187573127448559,
0.00... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def OnEndOfAlgorithm(self):
if len(self.filterDateConstituentSymbolCount) != 2:
raise Exception(f"ETF constituent filtering function was not called 2 times (actual: {len(self.filterDateConstituentSymbolCount)}")
if not self.mappingEventOccurred:
raise Exception("No mapping/Symbo... | |
15,676 | [
0.018437471240758896,
-0.02203410305082798,
-0.03361904248595238,
0.004681931342929602,
0.006947178393602371,
0.032432783395051956,
0.009938061237335205,
-0.010045330040156841,
0.00005274665818433277,
-0.026627695187926292,
-0.009079918265342712,
-0.01805887743830681,
0.019346093758940697,
... | 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": "number", "annotation": null, "type_comment": null}}], "kwarg": nu... | def get_memory(self, number):
_mem = self._memobj.memory[number]
_flg = self._memobj.flags[number]
_name = self._memobj.names[number]
mem = chirp_common.Memory()
mem.number = number
if _flg.empty:
mem.empty = True
return mem
mem.freq = _... | |
15,677 | [
-0.04011689871549606,
0.03754427284002304,
0.05239047110080719,
-0.03411410376429558,
-0.026114841923117638,
-0.010638883337378502,
-0.0016799118602648377,
-0.001996465492993593,
0.00185075041372329,
0.013466093689203262,
0.027923719957470894,
-0.02025943621993065,
-0.0262756310403347,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test(self):
# This test is quite fragile as it depends on windows manager behaviour
# regarding focus, so not surprising it doesn't pass
# on other platforms than Linux.
#if 'TRAVIS_OS_NAME' in os.environ and os.environ['TRAVIS_OS_NAME'] == 'osx':
# return
main_d... | |
15,678 | [
0.0074516599997878075,
0.0865747407078743,
0.021722719073295593,
-0.019227541983127594,
-0.004092767834663391,
-0.02628403715789318,
-0.01903560385107994,
-0.009387962520122528,
0.020627550780773163,
-0.029919544234871864,
-0.01523074135184288,
-0.008315375074744225,
0.0459744855761528,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "__slots__", "ctx": {"_type": "Store", "_fields": {}}}}], "ty... | class AwlInsn_SPPZ(AwlInsn): #+cdef
__slots__ = ()
def __init__(self, cpu, rawInsn):
AwlInsn.__init__(self, cpu, AwlInsn.TYPE_SPPZ, rawInsn)
self.assertOpCount(1)
if self.ops[0].type != AwlOperator.LBL_REF:
raise AwlSimError("Jump instruction expects label operand")
def run(self):
#@cy cdef S7StatusWord... | |
15,679 | [
0.06078531965613365,
0.05365435406565666,
0.032999150454998016,
-0.01910606399178505,
-0.0037744927685707808,
0.003119796747341752,
0.00162137218285352,
-0.009854254312813282,
-0.015257803723216057,
0.011292741633951664,
-0.01989292912185192,
-0.06717859953641891,
0.002766322111710906,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu... | class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Action.deleted'
db.add_column(u'Action', 'deleted',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# De... | |
15,680 | [
-0.016494860872626305,
0.013754568062722683,
0.015857582911849022,
-0.03568752855062485,
-0.0330534502863884,
0.04002101346850395,
0.041083142161369324,
0.013605870306491852,
0.006813556421548128,
-0.02479008585214615,
0.0221560075879097,
-0.0037519701290875673,
0.04414207488298416,
-0.016... | 9 | {"_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 _run_scheduler_job(args):
job = SchedulerJob(
subdir=process_subdir(args.subdir),
num_runs=args.num_runs,
do_pickle=args.do_pickle,
)
enable_health_check = conf.getboolean("scheduler", "ENABLE_HEALTH_CHECK")
with _serve_logs(args.skip_serve_logs), _serve_health_check(enable_h... | |
15,681 | [
-0.0024319980293512344,
0.0027043698355555534,
-0.03498267009854317,
-0.054962556809186935,
0.0005436274805106223,
-0.01238324586302042,
-0.04260312765836716,
-0.023456724360585213,
-0.008525388315320015,
0.04686582088470459,
0.021420633420348167,
-0.009858968667685986,
0.051962003111839294,... | 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 parse_arguments():
parser = argparse.ArgumentParser(description='Flatten and roll up Jstacks suitable for making flamegraphs')
parser.add_argument('file', help='File to process')
parser.add_argument(
'--include_threadname', dest='include_threadname', action='store_true',
... | |
15,682 | [
0.05084138736128807,
0.02472720481455326,
-0.005008830223232508,
-0.035649653524160385,
0.0029717073775827885,
-0.015007528476417065,
0.04210776463150978,
-0.03608308359980583,
-0.02303682640194893,
0.04366811364889145,
0.03339581564068794,
0.013458014465868473,
0.0385969802737236,
0.00566... | 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": "filename", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, filename, include_threadname=False, thread_states=('RUNNABLE',)):
self._include_threadname = include_threadname
self._thread_states = thread_states
self._stacks = []
self._flat_stacks = []
self._rolled_stacks = []
with open(filename) as stack_file:
... | |
15,683 | [
0.019336603581905365,
0.02457333728671074,
0.031014645472168922,
-0.0006419118726626039,
0.01226130872964859,
-0.025080526247620583,
-0.03207974135875702,
-0.0019669446628540754,
0.05355922132730484,
-0.027844710275530815,
0.0031826149206608534,
-0.03966222703456879,
-0.013871636241674423,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dest", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "c", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def pisaErrorDocument(dest, c):
out = pisaTempFile(capacity=c.capacity)
out.write("<p style='background-color:red;'><strong>%d error(s) occured:</strong><p>" % c.err)
for mode, line, msg, _ in c.log:
if mode=="error":
out.write("<pre>%s in line %d: %s</pre>" % (mode, line, cgi.escape(msg... | |
15,684 | [
0.01461783330887556,
0.019387733191251755,
0.0004907019319944084,
-0.03386998921632767,
-0.008787955157458782,
-0.012781360186636448,
0.014112494885921478,
-0.013829013332724571,
0.015184798277914524,
-0.006501608062535524,
-0.0048623401671648026,
-0.02241976372897625,
-0.01190626248717308,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "src", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def pisaStory(src, path=None, link_callback=None, debug=0, default_css=None,
xhtml=False, encoding=None, context=None, xml_output=None,
**kw):
# Prepare Context
if not context:
context = pisaContext(path, debug=debug)
context.pathCallback = link_callback
# Use a... | |
15,685 | [
0.06160978227853775,
0.016847526654601097,
0.046313073486089706,
0.027139320969581604,
0.008940702304244041,
-0.03118084743618965,
-0.024836590513586998,
0.00014850994921289384,
0.006831824779510498,
0.0077775889076292515,
0.013475671410560608,
-0.0003041792078875005,
0.027303801849484444,
... | 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": "address", "annotation": null, "type_comment": null}}, {"_type": "... | def __init__(self, address=None, Body=None):
self.address = address
if not Body:
self.rawBody = '{}'
else:
self.rawBody = Body
self.cmdid = None
self.timestamp = int(time.time())
self.params = dict()
self.way = None
self.ver = None... | |
15,686 | [
-0.0011107083410024643,
0.0224012341350317,
0.023254726082086563,
-0.04802937060594559,
0.015222551301121712,
-0.030749084427952766,
0.001069787540473044,
0.00012057032290613279,
0.006190737709403038,
-0.027966467663645744,
0.017829792574048042,
-0.011148004792630672,
-0.024973401799798012,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "src", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dest", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def pisaDocument(src, dest=None, path=None, link_callback=None, debug=0,
default_css=None, xhtml=False, encoding=None, xml_output=None,
raise_exception=True, capacity=100*1024, **kw):
log.debug("pisaDocument options:\n src = %r\n dest = %r\n path = %r\n link_callback = %r\n x... | |
15,687 | [
0.020204490050673485,
0.023490967229008675,
-0.028663497418165207,
-0.021819494664669037,
0.020283546298742294,
-0.04594291001558304,
-0.0029815458692610264,
0.04043157026171684,
-0.024258941411972046,
0.07896579056978226,
0.0724605992436409,
-0.007990317419171333,
-0.02169526368379593,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node_in_file", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya... | def is_valid_author(node_in_file):
if node_in_file in ['[deleted]']:
return False
if 'bot' in node_in_file.lower():
return False
return True | |
15,688 | [
-0.0022911608684808016,
-0.017952140420675278,
-0.010797145776450634,
-0.019773215055465698,
0.011465232819318771,
0.024783866479992867,
-0.02504248172044754,
0.026831230148673058,
-0.026938986033201218,
-0.004374891519546509,
0.053490050137043,
-0.02106628753244877,
0.010247590020298958,
... | 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": "arg", "annotation": nu... | class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def dumps(self, arg, proto=0, fast=0):
return pickletools.optimize(pickle.dumps(arg, proto))
def loads(self, buf):
return pickle.loads(buf)
module = pickle
error = KeyError | |
15,689 | [
0.0017817715415731072,
-0.015344531275331974,
-0.007172517478466034,
-0.03577740490436554,
-0.002693243557587266,
-0.015026509761810303,
0.024578507989645004,
-0.06519438326358795,
0.02391975000500679,
-0.002434851136058569,
0.001479367259889841,
0.042455852031707764,
-0.03464161232113838,
... | 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": "rate", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__( self, rate, device ):
gr.hier_block2.__init__(self, "output",
gr.io_signature(1,1,gr.sizeof_float),
gr.io_signature(0,0,0))
self.vol = blocks.multiply_const_ff( 0.1 )
self.out = audio.sink( int(rate), device )
... | |
15,690 | [
0.01068097073584795,
-0.016367804259061813,
-0.002639518119394779,
-0.04701414704322815,
0.0033210443798452616,
-0.01846824772655964,
0.014837163500487804,
-0.06582874059677124,
0.030657513067126274,
-0.01916094496846199,
0.01425619050860405,
0.03166304528713226,
-0.04924865812063217,
0.01... | 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": "rate", "annotation": n... | class output( gr.hier_block2 ):
def __init__( self, rate, device ):
gr.hier_block2.__init__(self, "output",
gr.io_signature(1,1,gr.sizeof_float),
gr.io_signature(0,0,0))
self.vol = blocks.multiply_const_ff( 0.1 )
self.out = aud... | |
15,691 | [
0.02764667198061943,
-0.027974961325526237,
0.04094240069389343,
-0.013706089928746223,
0.0071754720993340015,
-0.01814972423017025,
0.01574617438018322,
0.016121363267302513,
-0.01831386797130108,
-0.004522775299847126,
0.012580525130033493,
0.00553109310567379,
-0.0328524075448513,
-0.04... | 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 setUp(self):
super(ScheduleSendEmailTestMixin, self).setUp()
site = SiteFactory.create()
self.site_config = SiteConfigurationFactory.create(site=site)
ScheduleConfigFactory.create(site=self.site_config.site)
DynamicUpgradeDeadlineConfiguration.objects.create(enabled=True)
... | |
15,692 | [
0.012642037123441696,
-0.01337179820984602,
0.07555173337459564,
-0.040694911032915115,
-0.0005597294075414538,
0.017031334340572357,
0.013092771172523499,
0.024811875075101852,
-0.01830841600894928,
0.01709572598338127,
-0.00171574333216995,
0.020540626719594002,
0.0006522909970954061,
-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": "offset", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _get_dates(self, offset=None):
current_day = _get_datetime_beginning_of_day(datetime.datetime.now(pytz.UTC))
offset = offset or self.expected_offsets[0]
target_day = current_day + datetime.timedelta(days=offset)
if self.resolver.schedule_date_field == 'upgrade_deadline':
... | |
15,693 | [
0.02222401648759842,
-0.01650085113942623,
0.00039948831545189023,
-0.014698903076350689,
0.04159211739897728,
0.019515428692102432,
0.004963854793459177,
0.008720745332539082,
0.013894259929656982,
-0.026360562071204185,
0.014472243376076221,
0.019050776958465576,
0.012126311659812927,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_handle(self):
with patch.object(self.command, 'async_send_task') as mock_send:
test_day = datetime.datetime(2017, 8, 1, tzinfo=pytz.UTC)
self.command().handle(date='2017-08-01', site_domain_name=self.site_config.site.domain)
for offset in self.expected_offsets:
... | |
15,694 | [
0.012290007434785366,
0.006951387971639633,
0.04642891511321068,
-0.046193476766347885,
0.0025663040578365326,
0.03748216852545738,
0.005927220918238163,
0.021236754953861237,
-0.005379821173846722,
0.029265284538269043,
0.016327815130352974,
-0.008305172435939312,
-0.006615885067731142,
-... | 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": "offset", "annotation": null, "type_comment": null}}], "kwarg": {"... | def _schedule_factory(self, offset=None, **factory_kwargs):
_, _, target_day, upgrade_deadline = self._get_dates(offset=offset)
factory_kwargs.setdefault('start', target_day)
factory_kwargs.setdefault('upgrade_deadline', upgrade_deadline)
factory_kwargs.setdefault('enrollment__course__se... | |
15,695 | [
-0.005124528892338276,
0.015868661925196648,
0.06929752975702286,
-0.0053999354131519794,
0.02242596074938774,
0.03060946986079216,
-0.0001619857648620382,
-0.029770134016871452,
-0.01627521403133869,
-0.013980160467326641,
-0.013383446261286736,
-0.025468546897172928,
0.0028130810242146254,... | 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_ace", "annotation": null, "type_comment": null}}], "kwarg": ... | def test_resolver_send(self, mock_ace):
current_day, offset, target_day, _ = self._get_dates()
with patch.object(self.task, 'apply_async') as mock_apply_async:
self.task.enqueue(self.site_config.site, current_day, offset)
mock_apply_async.assert_any_call(
(self.site_confi... | |
15,696 | [
-0.007078475318849087,
-0.011375418864190578,
0.029179850593209267,
-0.051799483597278595,
0.008659488521516323,
0.028392624109983444,
0.024745143949985504,
-0.04227404668927193,
0.0005936997476965189,
0.0016498948680236936,
0.04652506858110428,
-0.021976731717586517,
0.0037196436896920204,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "schedule_count", "annotation": null, "type_comment": null}}, {"_t... | def test_schedule_bin(self, schedule_count, mock_metric, mock_ace):
with patch.object(self.task, 'async_send_task') as mock_schedule_send:
current_day, offset, target_day, upgrade_deadline = self._get_dates()
schedules = [
self._schedule_factory() for _ in range(schedule_... | |
15,697 | [
0.0396079495549202,
-0.01017109677195549,
0.04579745605587959,
-0.01033623144030571,
0.0022706070449203253,
0.004593200981616974,
0.016574667766690254,
0.029920026659965515,
0.026910899206995964,
-0.030849674716591835,
0.01700279489159584,
0.00047208750038407743,
0.003376094624400139,
-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": "is_enabled", "annotation": null, "type_comment": null}}, {"_type"... | def test_deliver_config(self, is_enabled, mock_message, mock_ace):
user = UserFactory.create()
schedule_config_kwargs = {
'site': self.site_config.site,
self.deliver_config: is_enabled,
}
self._update_schedule_config(schedule_config_kwargs)
mock_message.f... | |
15,698 | [
0.007912305183708668,
0.010080328211188316,
0.04398927092552185,
-0.044329866766929626,
0.004611144308000803,
0.0092681385576725,
0.0303916335105896,
0.004162475001066923,
-0.007493109907954931,
0.03322120010852814,
0.041736096143722534,
-0.035474371165037155,
-0.025190996006131172,
0.0141... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_no_course_overview(self):
current_day, offset, target_day, upgrade_deadline = self._get_dates()
# Don't use CourseEnrollmentFactory since it creates a course overview
enrollment = CourseEnrollment.objects.create(
course_id=CourseKey.from_string('edX/toy/Not_2012_Fall'),
... | |
15,699 | [
0.03099777176976204,
-0.009260817430913448,
0.04369565472006798,
-0.058400921523571014,
0.011950948275625706,
0.037230003625154495,
0.024672172963619232,
0.016234150156378746,
-0.0322115384042263,
-0.00026569413603283465,
-0.00214743590913713,
0.0054123555310070515,
-0.001750627183355391,
... | 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": "is_enabled", "annotation": null, "type_comment": null}}], "kwarg"... | def test_enqueue_config(self, is_enabled):
schedule_config_kwargs = {
'site': self.site_config.site,
self.enqueue_config: is_enabled,
}
self._update_schedule_config(schedule_config_kwargs)
current_datetime = datetime.datetime(2017, 8, 1, tzinfo=pytz.UTC)
... | |
15,700 | [
-0.002921801060438156,
-0.01655743457376957,
0.03551293537020683,
-0.02893846109509468,
0.002623726846650243,
0.027618177235126495,
0.000034812164813047275,
-0.02121884375810623,
-0.0023441771045327187,
0.0158703476190567,
0.033977095037698746,
-0.04103656858205795,
0.004378491546958685,
-... | 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": "this_org_list", "annotation": null, "type_comment": null}}, {"_ty... | def test_site_config(self, this_org_list, other_org_list, expected_message_count, mock_ace):
filtered_org = 'filtered_org'
unfiltered_org = 'unfiltered_org'
this_config = SiteConfigurationFactory.create(values={'course_org_filter': this_org_list})
other_config = SiteConfigurationFactory.... |