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 |
|---|---|---|---|---|---|
301 | [
0.00978177785873413,
-0.06154230609536171,
0.03284024819731712,
-0.014775458723306656,
0.00836259126663208,
0.0029245859477669,
-0.00821006204932928,
-0.013435852713882923,
0.0026676070410758257,
0.03071809932589531,
0.004360352177172899,
-0.014735668897628784,
-0.0032777246087789536,
0.08... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def test_friedmanchisquare():
# see ticket:113
# verified with matlab and R
#From Demsar "Statistical Comparisons of Classifiers over Multiple Data Sets"
#2006, Xf=9.28 (no tie handling, tie corrected Xf >=9.28)
x1 = [array([0.763, 0.599, 0.954, 0.628, 0.882, 0.936, 0.661, 0.583,
0.... | |
302 | [
-0.006291422992944717,
-0.01818002201616764,
0.036483462899923325,
-0.029794005677103996,
0.011478221043944359,
-0.002753847511485219,
-0.018599655479192734,
-0.013588733039796352,
0.038606319576501846,
0.0716339722275734,
0.006880761589854956,
0.002031830372288823,
-0.011725064367055893,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_kstest():
#from numpy.testing import assert_almost_equal
# comparing with values from R
x = np.linspace(-1,1,9)
D,p = stats.kstest(x,'norm')
assert_almost_equal( D, 0.15865525393145705, 12)
assert_almost_equal( p, 0.95164069201518386, 1)
x = np.linspace(-15,15,9)
D,p = stats.k... | |
303 | [
-0.002942481078207493,
-0.0537400022149086,
0.029335837811231613,
-0.058061569929122925,
-0.020222408697009087,
-0.02162056230008602,
-0.015532232820987701,
-0.0411820262670517,
0.044334229081869125,
0.0830249935388565,
0.040216028690338135,
-0.02961546927690506,
-0.036453720182180405,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_ks_2samp():
#exact small sample solution
data1 = np.array([1.0,2.0])
data2 = np.array([1.0,2.0,3.0])
assert_almost_equal(np.array(stats.ks_2samp(data1+0.01,data2)),
np.array((0.33333333333333337, 0.99062316386915694)))
assert_almost_equal(np.array(stats.ks_2samp(data1-0.01,d... | |
304 | [
-0.006289173848927021,
-0.02032231166958809,
0.033073317259550095,
-0.00566888926550746,
-0.0135311558842659,
-0.016881970688700676,
-0.004859961569309235,
-0.021703563630580902,
0.01321142166852951,
0.057194072753190994,
0.008460169658064842,
-0.015334457159042358,
0.012405690737068653,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"... | def test_ttest_rel():
#regression test
tr,pr = 0.81248591389165692, 0.41846234511362157
tpr = ([tr,-tr],[pr,pr])
rvs1 = np.linspace(1,100,100)
rvs2 = np.linspace(1.01,99.989,100)
rvs1_2D = np.array([np.linspace(1,100,100), np.linspace(1.01,99.989,100)])
rvs2_2D = np.array([np.linspace(1.01,... | |
305 | [
-0.0008147485787048936,
-0.030894363299012184,
0.03035280853509903,
-0.005289821419864893,
-0.0089936638250947,
-0.022306865081191063,
0.003942383918911219,
-0.03785720095038414,
0.02270658314228058,
0.06142769008874893,
0.014931416139006615,
-0.005870057735592127,
0.0028753934893757105,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"... | def test_ttest_1samp_new():
n1, n2, n3 = (10,15,20)
rvn1 = stats.norm.rvs(loc=5,scale=10,size=(n1,n2,n3))
#check multidimensional array and correct axis handling
#deterministic rvn1 and rvn2 would be better as in test_ttest_rel
t1,p1 = stats.ttest_1samp(rvn1[:,:,:], np.ones((n2,n3)),axis=0)
t2,... | |
306 | [
-0.013759832829236984,
-0.025351759046316147,
0.04200638458132744,
-0.008346442133188248,
-0.0044729020446538925,
-0.023553671315312386,
-0.013173223473131657,
-0.014448462054133415,
0.03137088939547539,
0.07406590133905411,
0.018873542547225952,
0.0032056330237537622,
0.013026570901274681,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_ttest_ind():
#regression test
tr = 1.0912746897927283
pr = 0.27647818616351882
tpr = ([tr,-tr],[pr,pr])
rvs2 = np.linspace(1,100,100)
rvs1 = np.linspace(5,105,100)
rvs1_2D = np.array([rvs1, rvs2])
rvs2_2D = np.array([rvs2, rvs1])
t,p = stats.ttest_ind(rvs1, rvs2, axis=0)
... | |
307 | [
-0.012707496993243694,
-0.025651631876826286,
0.01268383301794529,
-0.0004274286038707942,
0.015026555396616459,
-0.013417412526905537,
-0.019664673134684563,
-0.018351329490542412,
0.06346648931503296,
0.049268171191215515,
-0.0023131431080400944,
-0.02381768263876438,
-0.013216270133852959... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"... | def test_normalitytests():
# numbers verified with R: dagoTest in package fBasics
st_normal, st_skew, st_kurt = (3.92371918, 1.98078826, -0.01403734)
pv_normal, pv_skew, pv_kurt = (0.14059673, 0.04761502, 0.98880019)
x = np.array((-2,-1,0,1,2,3)*4)**2
yield assert_array_almost_equal, stats.normalte... | |
308 | [
-0.010056247934699059,
-0.001918136142194271,
-0.00534301670268178,
-0.025150777772068977,
0.0011461414396762848,
-0.017376653850078583,
-0.019557202234864235,
-0.011701815761625767,
0.04380054771900177,
0.06067608296871185,
0.03892479091882706,
-0.02093866653740406,
-0.011620553210377693,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_describe():
x = np.vstack((np.ones((3,4)),2*np.ones((2,4))))
nc, mmc = (5, ([ 1., 1., 1., 1.], [ 2., 2., 2., 2.]))
mc = np.array([ 1.4, 1.4, 1.4, 1.4])
vc = np.array([ 0.3, 0.3, 0.3, 0.3])
skc = [0.40824829046386357]*4
kurtc = [-1.833333333333333]*4
n, mm, m, v, sk, kurt... | |
309 | [
0.011432848870754242,
0.0008964179432950914,
-0.0050499774515628815,
-0.014768212102353573,
-0.025881918147206306,
0.005919800139963627,
-0.005728940013796091,
-0.025906948372721672,
0.02439258061349392,
0.05091278627514839,
0.03902312368154526,
0.010713211260735989,
-0.01170818880200386,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_obrientransform():
#this is a regression test to check np.var replacement
#I didn't separately verigy the numbers
x1 = np.arange(5)
result = np.array(
[[ 5.41666667, 1.04166667, -0.41666667, 1.04166667, 5.41666667],
[ 21.66666667, 4.16666667, -1.66666667, 4.16666667, 21... | |
310 | [
-0.01986878365278244,
-0.0018528428627178073,
-0.005374558735638857,
0.002320981351658702,
-0.009632155299186707,
-0.023981831967830658,
0.012096041813492775,
-0.025177638977766037,
-0.0004558190703392029,
0.054034680128097534,
0.0015621043276041746,
-0.006820038892328739,
-0.040420886129140... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def mannwhitneyu():
x = np.array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 2., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1... | |
311 | [
0.01374857872724533,
-0.035554464906454086,
0.026128694415092468,
-0.034147635102272034,
-0.03596372529864311,
-0.03744729235768318,
0.012092354707419872,
0.011241861619055271,
0.010218711569905281,
0.02898072637617588,
0.01392763014882803,
0.00850493460893631,
-0.02373708225786686,
0.0120... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_binomtest():
# precision tests compared to R for ticket:986
pp = np.concatenate(( np.linspace(0.1,0.2,5), np.linspace(0.45,0.65,5),
np.linspace(0.85,0.95,5)))
n = 501
x = 450
results = [0.0, 0.0, 1.0159969301994141e-304,
2.9752418572150531e-275, 7.7668382922535... | |
312 | [
0.02428775653243065,
0.004155606962740421,
0.017085516825318336,
-0.05245083197951317,
0.01951063610613346,
0.035511553287506104,
-0.026006057858467102,
-0.004953824914991856,
0.027322202920913696,
0.06931699067354202,
0.017195194959640503,
-0.018767258152365685,
0.00495687173679471,
0.036... | 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 Test_Trim(object):
# test trim functions
def test_trim1(self):
a = np.arange(11)
assert_equal(stats.trim1(a, 0.1), np.arange(10))
assert_equal(stats.trim1(a, 0.2), np.arange(9))
assert_equal(stats.trim1(a, 0.2, tail='left'), np.arange(2,11))
assert_equal(stats.trim1... | |
313 | [
0.026427173987030983,
0.0026981818955391645,
0.008658978156745434,
-0.031086187809705734,
-0.024547908455133438,
0.05037476122379303,
-0.016495777294039726,
-0.054394301027059555,
0.016534928232431412,
0.03557554632425308,
0.04995714873075485,
-0.03768971934914589,
-0.022224927321076393,
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 TestSigamClip(object):
def test_sigmaclip1(self):
a = np.concatenate((np.linspace(9.5,10.5,31),np.linspace(0,20,5)))
fact = 4 #default
c, low, upp = stats.sigmaclip(a)
assert_(c.min()>low)
assert_(c.max()<upp)
assert_equal(low, c.mean() - fact*c.std())
... | |
314 | [
0.020935289561748505,
-0.02847844734787941,
0.04757164791226387,
-0.028155745938420296,
-0.01253831572830677,
0.019214212894439697,
-0.03684180602431297,
0.010252510197460651,
0.03493248671293259,
0.08153602480888367,
0.0330231674015522,
-0.021661369130015373,
-0.013284564018249512,
0.0554... | 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_trimboth(self):
a = np.arange(11)
assert_equal(stats.trimboth(a, 3/11.), np.arange(3,8))
assert_equal(stats.trimboth(a, 0.2), np.array([2, 3, 4, 5, 6, 7, 8]))
assert_equal(stats.trimboth(np.arange(24).reshape(6,4), 0.2),
np.arange(4,20).reshape(4,4))
... | |
315 | [
0.020800521597266197,
-0.01738216169178486,
0.03352368623018265,
-0.0235457681119442,
-0.026027049869298935,
0.02502397820353508,
-0.027109310030937195,
-0.02681894786655903,
0.01974465884268284,
0.04988957941532135,
0.04521737992763519,
-0.034737929701805115,
-0.040914732962846756,
0.0324... | 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_sigmaclip1(self):
a = np.concatenate((np.linspace(9.5,10.5,31),np.linspace(0,20,5)))
fact = 4 #default
c, low, upp = stats.sigmaclip(a)
assert_(c.min()>low)
assert_(c.max()<upp)
assert_equal(low, c.mean() - fact*c.std())
assert_equal(upp, c.mean() + fact... | |
316 | [
0.025167414918541908,
-0.02273792028427124,
0.02770429104566574,
-0.040536317974328995,
-0.030308280140161514,
0.041395366191864014,
-0.02920762449502945,
-0.02757006511092186,
0.02799958921968937,
0.05905953422188759,
0.05057643726468086,
-0.04099268838763237,
-0.044938936829566956,
0.035... | 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_sigmaclip2(self):
a = np.concatenate((np.linspace(9.5,10.5,31),np.linspace(0,20,5)))
fact = 1.5
c, low, upp = stats.sigmaclip(a, fact, fact)
assert_(c.min()>low)
assert_(c.max()<upp)
assert_equal(low, c.mean() - fact*c.std())
assert_equal(upp, c.mean() + ... | |
317 | [
0.03432192653417587,
0.031192267313599586,
0.04089421033859253,
0.030122967436909676,
0.02588488720357418,
0.02270306833088398,
0.005907231476157904,
-0.010829923674464226,
-0.0052258786745369434,
0.027749642729759216,
0.06603580713272095,
-0.007452500518411398,
0.008782605640590191,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, name, raise_if=ErrorDefect, lazy=False):
super(CfbIO, self).__init__(name, mode='rb')
MaybeDefected.__init__(self, raise_if=raise_if)
self.size = fstat(self.fileno()).st_size
self.header = Header(self)
self.directory = Directory(self)
if not lazy:
... | |
318 | [
0.02036798559129238,
-0.018757184967398643,
0.028967803344130516,
-0.034958384931087494,
-0.02695762924849987,
0.0305652916431427,
-0.031204286962747574,
-0.028382057324051857,
0.037913743406534195,
0.04558169096708298,
0.04033660143613815,
-0.03298814967274666,
-0.048483796417713165,
0.03... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sigmaclip3(self):
a = np.concatenate((np.linspace(9.5,10.5,11),np.linspace(-100,-50,3)))
fact = 1.8
c, low, upp = stats.sigmaclip(a, fact, fact)
assert_(c.min()>low)
assert_(c.max()<upp)
assert_equal(low, c.mean() - fact*c.std())
assert_equal(upp, c.mean(... | |
319 | [
0.004665055312216282,
-0.03351174294948578,
0.021606571972370148,
0.002217248547822237,
0.03032585233449936,
-0.046902067959308624,
-0.0475727841258049,
0.010162514634430408,
-0.04774046316742897,
0.006856852676719427,
-0.0037398291751742363,
-0.025367360562086105,
0.04417130723595619,
-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": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def Layout(self, request, response):
client_id = request.REQ.get("client_id")
container = request.REQ.get("aff4_path", "")
if container:
self.container = rdfvalue.RDFURN(container)
self.hash_dict = dict(
container=self.container, main="TimelineMain", c=client_id,
reason=requ... | |
320 | [
0.006520027760416269,
0.002492704428732395,
0.07092353701591492,
-0.03306024521589279,
-0.04430476948618889,
-0.005414653103798628,
0.013230831362307072,
0.03229714557528496,
-0.019907968118786812,
0.03788574039936066,
0.019133644178509712,
-0.020267074927687645,
-0.003748174523934722,
-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": "targets", "annotation"... | class BuildExamples():
def __init__(self, targets=[], clean=False):
print("init")
self.targets = targets
self.clean = clean
def run(self):
for target in self.targets:
util.build_examples(target, clean=self.clean) | |
321 | [
0.03427577391266823,
-0.007215628866106272,
-0.027090903371572495,
0.023965975269675255,
0.0209517739713192,
-0.014049869030714035,
-0.06825628131628036,
0.013643873855471611,
-0.015661543235182762,
-0.014382045716047287,
0.04771050065755844,
-0.012001441791653633,
0.02070571668446064,
-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": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def GetEvent(self, request):
event_id = request.REQ.get("event")
if event_id:
event_id = int(event_id)
container = request.REQ.get("container")
fd = aff4.FACTORY.Open(container, token=request.token)
child = None
for child in fd:
# Found the right event.
if child.id... | |
322 | [
0.008310385048389435,
-0.0146552212536335,
-0.004333388060331345,
-0.005459258798509836,
0.005583455786108971,
0.01941789872944355,
0.0021909934002906084,
-0.011609700508415699,
-0.009973542764782906,
-0.04131973162293434,
-0.004522383213043213,
-0.028122473508119583,
0.032895948737859726,
... | 8 | {"_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, **kwargs):
if EventTable.content_cache is None:
EventTable.content_cache = utils.TimeBasedCache()
super(EventTable, self).__init__(**kwargs)
self.AddColumn(semantic.AttributeColumn("event.id"))
self.AddColumn(semantic.AttributeColumn("timestamp"))
self.AddColumn(semantic.Att... | |
323 | [
0.022370632737874985,
-0.022933144122362137,
0.04482780396938324,
0.01431157998740673,
0.022889873012900352,
-0.020650647580623627,
-0.0017186335753649473,
0.03037559799849987,
0.007258556317538023,
0.004029526375234127,
0.008086096495389938,
-0.05525589361786842,
-0.036390140652656555,
-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": "pool_connections", "annotation": null, "type_comment": null}}, {"... | def __init__(self, pool_connections=DEFAULT_POOLSIZE,
pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES,
pool_block=DEFAULT_POOLBLOCK):
if max_retries == DEFAULT_RETRIES:
self.max_retries = Retry(0, read=False)
else:
self.max_retries = R... | |
324 | [
0.015914378687739372,
-0.005893792025744915,
0.018171576783061028,
-0.02624276466667652,
0.030916759744286537,
-0.004577093757688999,
0.0009682862437330186,
0.020747972652316093,
-0.01264258287847042,
-0.026197165250778198,
0.004642643965780735,
-0.09092628210783005,
-0.0018866974860429764,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "ExperimentData", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model"... | class ExperimentDataFactory(factory.DjangoModelFactory):
class Meta(object):
model = ExperimentData
user = factory.SubFactory(UserFactory)
experiment_id = factory.fuzzy.FuzzyInteger(0)
key = factory.Sequence(lambda n: n)
value = factory.Faker('word') | |
325 | [
0.008870616555213928,
0.008664077147841454,
0.08998776972293854,
-0.06516063958406448,
0.008155670948326588,
0.027792833745479584,
-0.011004860512912273,
-0.012953747995197773,
-0.01215936429798603,
-0.010395833291113377,
-0.0026532411575317383,
0.002189850667491555,
0.01458488218486309,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dates", "annotation": null, "type_comment": null}}, {"_type": "ar... | def process_traces(data, dates, output_file_name):
result = []
for i in range(len(dates)):
subs = data[data.FECHA == dates.Fecha[i]] # Creates a subset for each day
subs = subs.reset_index(drop=True) # Resets pandas dataframe indexe
if len(subs) > 1:
result.append(int(dates... | |
326 | [
0.0367310531437397,
-0.05567266419529915,
-0.01626858487725258,
0.015945978462696075,
0.0026528623420745134,
0.007944184355437756,
-0.013169257901608944,
-0.023895923048257828,
0.027052858844399452,
0.04292970523238182,
0.018526829779148102,
-0.03350498899817467,
0.014206207357347012,
-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": "state", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __setstate__(self, state):
# Can't handle by adding 'proxy_manager' to self.__attrs__ because
# self.poolmanager uses a lambda function, which isn't pickleable.
self.proxy_manager = {}
self.config = {}
for attr, value in state.items():
setattr(self, attr, value)
... | |
327 | [
0.03321243077516556,
0.038532551378011703,
0.022878702729940414,
-0.015938464552164078,
-0.004671524278819561,
0.011472191661596298,
0.008801184594631195,
-0.014351185411214828,
0.0006174649461172521,
0.035336099565029144,
0.008281214162707329,
-0.002264608396217227,
-0.025199413299560547,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def check_consistency_of_users_to_projects():
nodes = models.Node.find(
Q('is_deleted', 'eq', False)
)
no_creator, creator_ref, contrib_ref = [], [], []
for node in nodes:
if not node.creator:
logger.info('Node {} has no creator'.format(node._id))
no_creator.appe... | |
328 | [
0.009154686704277992,
0.008390866219997406,
0.05401376634836197,
-0.06369253247976303,
-0.02890249341726303,
0.012990511022508144,
0.011808541603386402,
-0.031890869140625,
-0.00015201476344373077,
0.007069514133036137,
0.011853144504129887,
0.010593120940029621,
0.03093191236257553,
-0.02... | 11 | {"_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):
output = "output.xlsx"
input_file_name = "input.csv"
dates_file_name = "dates.csv"
existing_file_name = "existing.csv"
non_existing_file_name = "non_existing.csv"
try:
opts, args = getopt.getopt(argv, "i:d:o:e:n:",
["input=", "dates=", ... | |
329 | [
0.0031001835595816374,
0.06363421678543091,
-0.007106821984052658,
-0.04378874972462654,
-0.006034093908965588,
-0.00014096313680056483,
-0.019126737490296364,
-0.04190075024962425,
0.022205466404557228,
0.04074220359325409,
0.00955264177173376,
-0.01954510062932968,
0.03447747230529785,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "o_strs", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _parse_options(o_strs):
opts = {}
if not o_strs:
return opts
for o_str in o_strs:
if not o_str.strip():
continue
o_args = o_str.split(',')
for o_arg in o_args:
o_arg = o_arg.strip()
try:
o_key, o_val = o_arg.split('=', 1... | |
330 | [
-0.0018144900677725673,
0.04784706234931946,
-0.008823969401419163,
-0.005047633778303862,
0.019115710631012917,
0.005579268094152212,
-0.06277904659509659,
0.03173623979091644,
-0.04479594528675079,
0.02258288860321045,
0.010488214902579784,
0.007668243255466223,
-0.016053035855293274,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "what", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null... | def _print_help(what, name):
try:
if what == 'lexer':
cls = get_lexer_by_name(name)
print("Help on the %s lexer:" % cls.name)
print(dedent(cls.__doc__))
elif what == 'formatter':
cls = find_formatter_class(name)
print("Help on the %s format... | |
331 | [
-0.00756500381976366,
-0.03370095416903496,
-0.025624869391322136,
0.018955521285533905,
0.06343471258878708,
-0.015514583326876163,
0.025867760181427002,
0.006542842835187912,
-0.015302054584026337,
0.05404297262430191,
-0.050278179347515106,
0.029956404119729996,
-0.03325565531849861,
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": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def _fully_connected_with_bn(self,
x,
out_dim,
kernel_initializer=None,
kernel_regularizer=None):
x = self._fully_connected(
x,
out_dim,
kernel_... | |
332 | [
-0.012954720295965672,
0.015106170438230038,
0.007714156061410904,
-0.012321940623223782,
0.05775550380349159,
-0.00365573912858963,
-0.00895095244050026,
-0.007829206995666027,
0.023182736709713936,
-0.0012864117743447423,
0.00476597947999835,
-0.04790715500712395,
0.017706317827105522,
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 SimpleTestLogin(TestLogin):
def test_login(self):
self.pulp.send(login.request())
self.assertPulpOK()
def test_wrong_login(self):
with self.assertRaises(AssertionError):
with self.wrong_pulp.asserting(True):
self.wrong_pulp.send(login.request()) | |
333 | [
0.02326326258480549,
0.050821978598833084,
-0.03388885408639908,
0.0003513015399221331,
0.04828992113471031,
0.007364439312368631,
-0.038455598056316376,
-0.01344024296849966,
0.013734142296016216,
0.03549399599432945,
0.015158423222601414,
-0.02428060583770275,
0.010755585506558418,
0.013... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "modified"}}, {"_type": "Constant", "_fields": {"kind": n... | class RealFileEvent(application.ChangeEvent):
_attrs = ("modified", "added", "removed", "renamed", "deleted")
def __init__(self, **kwargs):
super().__init__()
for attr, iterable in kwargs.items():
if not attr in self._attrs:
raise ValueError("Invalid keyword attr... | |
334 | [
0.01834007166326046,
0.025975821539759636,
-0.04248426482081413,
-0.0051886229775846004,
0.0397249273955822,
0.04709901660680771,
0.0038595027290284634,
-0.01872066967189312,
-0.01721017062664032,
0.012238608673214912,
0.008831066079437733,
-0.02814047411084175,
-0.01982678286731243,
0.027... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def merge(self, other):
if not type(other) is type(self):
return False
for attr in self._attrs:
attrInOther = getattr(other, attr)
if len(attrInOther) > 0:
if len(getattr(self, attr)) > 0:
getattr(self, attr).update(getattr(other, a... | |
335 | [
0.011615637689828873,
0.023039599880576134,
0.0002773329324554652,
-0.020202776417136192,
0.01063169538974762,
-0.007577638607472181,
-0.01029945444315672,
0.012529299594461918,
-0.03677646443247795,
0.07687533646821976,
0.03156284615397453,
-0.02617032639682293,
0.04702480509877205,
0.001... | 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _ensureLoaded(self, params):
# note that __contains__ (p not in self) ensures that p is either int or url
ids = [p for p in params if isinstance(p, int) and p not in self]
urls = []
for p in params:
if isinstance(p, URL) and p not in self:
id = db.idFromU... | |
336 | [
0.04812968522310257,
0.015296848490834236,
0.021637145429849625,
-0.04261433333158493,
-0.03174862265586853,
0.013540892861783504,
-0.017606696113944054,
0.007895908318459988,
-0.02557331509888172,
0.04987385496497154,
0.014860806055366993,
-0.08164604753255844,
0.03632117807865143,
0.0175... | 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu... | def collect(self, params):
# We need to iterate params twice
if not isinstance(params, collections.abc.Iterable):
self._ensureLoaded([params])
return self[params]
if not isinstance(params, collections.abc.Sized): # exclude one-time generators
params = list(pa... | |
337 | [
0.08392828702926636,
0.007359212264418602,
0.02622472122311592,
0.01750609092414379,
0.005004608538001776,
0.03166239336133003,
-0.0026872882153838873,
0.02420567162334919,
-0.008013109676539898,
0.0653897300362587,
0.08094559609889984,
-0.032740749418735504,
0.04659878462553024,
-0.021532... | 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": "elements", "annotation": null, "type_comment": null}}, {"_type": ... | def deleteElements(self, elements, fromDisk=False):
elements = tuple(elements)
stack.beginMacro("delete elements")
# 1st step: isolate the elements (remove contents & parents)
for element in elements:
if element.isContainer() and len(element.contents) > 0:
sel... | |
338 | [
0.05485851317644119,
0.0252991933375597,
0.023492997512221336,
0.02633308432996273,
-0.00635593943297863,
0.0493527315557003,
0.010743748396635056,
-0.03607408329844475,
-0.013764454983174801,
0.03826643154025078,
0.040184732526540756,
0.010612955316901207,
0.04790777713060379,
0.021923474... | 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": "changes", "annotation": null, "type_comment": null}}], "kwarg": n... | def _changeFlags(self, changes):
if not all(element.isInDb() for element in changes.keys()):
raise levels.ConsistencyError("Elements on real must be added to the DB before adding tags.")
with db.transaction():
dbRemovals = [(el.id, flag.id) for el, diff in changes.items() for fla... | |
339 | [
0.05708218365907669,
0.0014400450745597482,
0.03662689030170441,
-0.019061191007494926,
-0.02176068164408207,
0.033914726227521896,
0.03137999027967453,
0.00674872612580657,
-0.052114106714725494,
0.01506898645311594,
0.05698079243302345,
-0.010157941840589046,
0.020341230556368828,
-0.025... | 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": "changes", "annotation": null, "type_comment": null}}], "kwarg": n... | def _changeStickers(self, changes):
if not all(element.isInDb() for element in changes.keys()):
raise levels.ConsistencyError("Elements on real must be added to the DB before adding stickers.")
with db.transaction():
for element, diff in changes.items():
for type,... | |
340 | [
0.04830315709114075,
-0.016615604981780052,
0.02358030341565609,
-0.022316204383969307,
-0.0360025055706501,
0.036488696932792664,
0.03306104242801666,
0.016785772517323494,
-0.04823022708296776,
0.019982483237981796,
0.042225759476423264,
-0.024455448612570763,
0.03605112433433533,
-0.065... | 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": "type", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _setStickers(self, type, elementToStickers):
if not all(element.isInDb() for element in elementToStickers.keys()):
raise levels.ConsistencyError("Elements on real must be added to the DB before adding stickers.")
values = []
for element, stickers in elementToStickers.items():
... | |
341 | [
0.0822826623916626,
0.005290248431265354,
0.07356397062540054,
0.02365853637456894,
-0.004770873114466667,
0.012317423708736897,
0.053356580436229706,
0.008849245496094227,
-0.024135340005159378,
0.02093394473195076,
0.062256913632154465,
0.009581480175256729,
0.057488881051540375,
-0.0290... | 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": "parent", "annotation": null, "type_comment": null}}, {"_type": "a... | def _setContents(self, parent, contents):
with db.transaction():
db.query("DELETE FROM {p}contents WHERE container_id = ?", parent.id)
#Note: This checks skips elements which are not loaded on real. This should rarely happen and
# due to foreign key constraints...
... | |
342 | [
0.07993070781230927,
0.026463251560926437,
0.08430157601833344,
0.025835750624537468,
0.006172234192490578,
-0.0028508040122687817,
0.04115544259548187,
0.0024085778277367353,
-0.05379202216863632,
0.01166287250816822,
0.03518335893750191,
0.016693701967597008,
0.056215476244688034,
-0.032... | 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 _insertContents(self, parent, insertions):
if not all(element.isInDb() for _, element in insertions):
raise levels.ConsistencyError("Elements must be in the DB before being added to a container.")
with db.transaction():
db.multiQuery("INSERT INTO {p}contents (container_id, po... | |
343 | [
0.01958749070763588,
0.017566664144396782,
0.03154074773192406,
-0.026112250983715057,
-0.019759194925427437,
-0.009278632700443268,
-0.006003044079989195,
0.008968244306743145,
0.007614422589540482,
0.04234490543603897,
0.011173983104526997,
-0.03933347761631012,
-0.027763254940509796,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "funs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "guess", "annotation": null, "type_comment": null}}, {"_type": "ar... | def constraint_satisfaction(funs, guess, order=3, max_iter=50, linesearch=True, verbose=False):
# Heuristic
if np.all(guess == 0):
if verbose:
print("Initial guess is all zeros, this is often difficult for numerical algorithms.\nA small random perturbation is added.")
guess = np.ran... | |
344 | [
0.03307124227285385,
0.0029928863514214754,
0.10026322305202484,
0.019464440643787384,
-0.024699702858924866,
-0.009634592570364475,
0.03028886578977108,
-0.0031942427158355713,
-0.04744686186313629,
0.0073708598501980305,
0.034657686948776245,
0.023552581667900085,
0.0183661337941885,
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": "parent", "annotation": null, "type_comment": null}}, {"_type": "a... | def _changePositions(self, parent, changes):
super()._changePositions(parent, changes)
changes = list(changes.items())
changesOne = [ (newPos, parent.id, oldPos)
for (oldPos, newPos) in sorted(changes, key=lambda cng: cng[1], reverse=True)
if newPo... | |
345 | [
0.010572603903710842,
-0.016558045521378517,
-0.0487687774002552,
0.015260362066328526,
-0.011900466866791248,
-0.022734619677066803,
-0.008706554770469666,
0.016095304861664772,
0.03118465468287468,
-0.013610593043267727,
0.019133294001221657,
-0.017634419724345207,
0.008792060427367687,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}, {"_type": "ar... | def web_request(url, method=None, body=None):
req = webob.Request.blank("%s%s" % (base_url, url))
if method:
req.content_type = "application/json"
req.method = method
if body:
req.body = json.dumps(body)
return req | |
346 | [
-0.0019215074134990573,
0.005025024060159922,
-0.027702968567609787,
-0.021977055817842484,
-0.008024594746530056,
0.027013959363102913,
0.004843861795961857,
0.0050814514979720116,
0.025540901347994804,
0.0403902642428875,
0.03704024851322174,
-0.06177334487438202,
-0.023592665791511536,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
module = AnsibleModule(
argument_spec={
"idrac_ip": {"required": True, "type": 'str'},
"idrac_user": {"required": True, "type": 'str'},
"idrac_pwd": {"required": True, "type": 'str', "no_log": True},
"idrac_port": {"required": False, "default": 443... | |
347 | [
0.03963684290647507,
0.03227512165904045,
0.030299518257379532,
0.01747889071702957,
-0.001982102170586586,
0.009987195022404194,
0.017374912276864052,
0.015108167193830013,
-0.008770639076828957,
0.03310695290565491,
0.036995772272348404,
-0.027533672749996185,
-0.07661182433366776,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def verify(self):
data_to_verify = self._hash_ctx.finalize()
data_to_verify = _truncate_digest_for_dsa(
self._public_key._dsa_cdata, data_to_verify, self._backend
)
# The first parameter passed to DSA_verify is unused by OpenSSL but
# must be an integer.
res... | |
348 | [
0.015753576532006264,
0.001949674217030406,
0.031173963099718094,
0.004779174458235502,
0.004672450013458729,
0.011578305624425411,
0.02040780521929264,
0.00017651839880272746,
-0.019585244357585907,
0.022865071892738342,
0.029299777001142502,
-0.0800902247428894,
-0.05905768647789955,
-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": "backend", "annotation"... | class _DSAVerificationContext(object):
def __init__(self, backend, public_key, signature, algorithm):
self._backend = backend
self._public_key = public_key
self._signature = signature
self._algorithm = algorithm
self._hash_ctx = hashes.Hash(self._algorithm, self._backend)
... | |
349 | [
0.0336802676320076,
-0.005874344613403082,
0.04819762334227562,
-0.011396124958992004,
0.04116707667708397,
0.010711735114455223,
0.001993544166907668,
0.011717580258846283,
-0.0361274778842926,
-0.008985206484794617,
0.012049405835568905,
-0.07130096107721329,
-0.05388013273477554,
-0.015... | 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": "backend", "annotation"... | class _DSASignatureContext(object):
def __init__(self, backend, private_key, algorithm):
self._backend = backend
self._private_key = private_key
self._algorithm = algorithm
self._hash_ctx = hashes.Hash(self._algorithm, self._backend)
def update(self, data):
self._hash_ct... | |
350 | [
0.07362338155508041,
0.022617170587182045,
0.0450633242726326,
-0.004505263641476631,
0.017540065571665764,
0.023301243782043457,
0.01962435059249401,
0.02056495100259781,
-0.014386915601789951,
0.014344160445034504,
0.04076648876070976,
-0.02740568481385708,
-0.07071606814861298,
-0.02392... | 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 finalize(self):
data_to_sign = self._hash_ctx.finalize()
data_to_sign = _truncate_digest_for_dsa(
self._private_key._dsa_cdata, data_to_sign, self._backend
)
sig_buf_len = self._backend._lib.DSA_size(self._private_key._dsa_cdata)
sig_buf = self._backend._ffi.new("... | |
351 | [
0.04856600612401962,
-0.02956191822886467,
0.04865219444036484,
-0.022052932530641556,
0.03313865140080452,
0.010805613361299038,
-0.008036877028644085,
0.021945198997855186,
0.0014328480465337634,
-0.007288133259862661,
0.026545396074652672,
-0.07032805681228638,
-0.010094576515257359,
-0... | 15 | {"_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": "backend", "annotation"... | class _DSAPrivateKey(object):
def __init__(self, backend, dsa_cdata):
self._backend = backend
self._dsa_cdata = dsa_cdata
self._key_size = self._backend._lib.BN_num_bits(self._dsa_cdata.p)
key_size = utils.read_only_property("_key_size")
def signer(self, signature_algorithm):
... | |
352 | [
0.0263622235506773,
-0.010695291683077812,
0.04896438494324684,
-0.014998476020991802,
0.033339228481054306,
0.014998476020991802,
-0.01290955115109682,
0.013055776245892048,
-0.002085007494315505,
-0.000633857911452651,
0.005540871527045965,
-0.08155160397291183,
-0.006010879296809435,
-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}}, {"_type": "arg", "_fields": {"arg": "backend", "annotation"... | class _DSAParameters(object):
def __init__(self, backend, dsa_cdata):
self._backend = backend
self._dsa_cdata = dsa_cdata
def parameter_numbers(self):
return dsa.DSAParameterNumbers(
p=self._backend._bn_to_int(self._dsa_cdata.p),
q=self._backend._bn_to_int(self._... | |
353 | [
0.09130723774433136,
-0.03316200152039528,
0.05251395329833031,
0.009977650828659534,
0.041273731738328934,
-0.0005272345151752234,
-0.007368713151663542,
0.04938546195626259,
-0.002615921199321747,
-0.011094968765974045,
0.02204468660056591,
-0.04920669272542,
-0.05162009969353676,
-0.039... | 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 public_key(self):
dsa_cdata = self._backend._lib.DSA_new()
assert dsa_cdata != self._backend._ffi.NULL
dsa_cdata = self._backend._ffi.gc(
dsa_cdata, self._backend._lib.DSA_free
)
dsa_cdata.p = self._backend._lib.BN_dup(self._dsa_cdata.p)
dsa_cdata.q = self... | |
354 | [
0.05310554802417755,
-0.03665737062692642,
0.0726628303527832,
0.018140634521842003,
0.03252025321125984,
-0.005350045394152403,
-0.042449332773685455,
0.06308477371931076,
0.010812921449542046,
0.014078736305236816,
0.003547891741618514,
-0.07782796025276184,
-0.00861272681504488,
-0.0351... | 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 private_numbers(self):
return dsa.DSAPrivateNumbers(
public_numbers=dsa.DSAPublicNumbers(
parameter_numbers=dsa.DSAParameterNumbers(
p=self._backend._bn_to_int(self._dsa_cdata.p),
q=self._backend._bn_to_int(self._dsa_cdata.q),
... | |
355 | [
0.034200724214315414,
-0.01156647875905037,
0.05244271457195282,
-0.00526950741186738,
0.02016472816467285,
0.01545401755720377,
-0.01716044917702675,
0.030547520145773888,
0.00925318244844675,
0.0090729258954525,
0.0314127542078495,
-0.06753621995449066,
-0.028360404074192047,
-0.01792954... | 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 parameters(self):
dsa_cdata = self._backend._lib.DSA_new()
assert dsa_cdata != self._backend._ffi.NULL
dsa_cdata = self._backend._ffi.gc(
dsa_cdata, self._backend._lib.DSA_free
)
dsa_cdata.p = self._backend._lib.BN_dup(self._dsa_cdata.p)
dsa_cdata.q = self... | |
356 | [
0.08056449145078659,
-0.0542261004447937,
0.05673850700259209,
-0.009866428561508656,
0.007469174452126026,
0.019575832411646843,
0.02564748004078865,
0.055775418877601624,
0.0198794137686491,
-0.05179744213819504,
0.06096772477030754,
-0.010065327398478985,
-0.013127322308719158,
-0.02416... | 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": "encoding", "annotation": null, "type_comment": null}}, {"_type": ... | def private_bytes(self, encoding, format, encryption_algorithm):
evp_pkey = self._backend._lib.EVP_PKEY_new()
assert evp_pkey != self._backend._ffi.NULL
evp_pkey = self._backend._ffi.gc(
evp_pkey, self._backend._lib.EVP_PKEY_free
)
res = self._backend._lib.EVP_PKEY_se... | |
357 | [
0.03929227590560913,
-0.022786643356084824,
0.06918701529502869,
0.020461231470108032,
0.040203262120485306,
0.0027419489342719316,
-0.06281010806560516,
0.061371710151433945,
-0.006532730534672737,
0.02601105533540249,
0.00046485773054882884,
-0.07513239979743958,
-0.0352647602558136,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def public_numbers(self):
return dsa.DSAPublicNumbers(
parameter_numbers=dsa.DSAParameterNumbers(
p=self._backend._bn_to_int(self._dsa_cdata.p),
q=self._backend._bn_to_int(self._dsa_cdata.q),
g=self._backend._bn_to_int(self._dsa_cdata.g)
),... | |
358 | [
0.052872493863105774,
-0.02864457666873932,
0.038518354296684265,
-0.017316272482275963,
0.023951876908540726,
0.023675836622714996,
-0.027073265984654427,
0.013218123465776443,
-0.0025228566955775023,
0.004976703319698572,
0.029791209846735,
-0.06425388157367706,
-0.020713701844215393,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "backend", "annotation"... | class _DSAPublicKey(object):
def __init__(self, backend, dsa_cdata):
self._backend = backend
self._dsa_cdata = dsa_cdata
self._key_size = self._backend._lib.BN_num_bits(self._dsa_cdata.p)
key_size = utils.read_only_property("_key_size")
def verifier(self, signature, signature_algor... | |
359 | [
0.09562655538320541,
-0.02513313479721546,
0.036674272269010544,
0.002160192932933569,
0.03211009502410889,
0.026399845257401466,
-0.00951037835329771,
0.026962827891111374,
0.01823660358786583,
-0.0026691388338804245,
0.019372619688510895,
-0.04459623619914055,
-0.007147863507270813,
-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": "encoding", "annotation": null, "type_comment": null}}, {"_type": ... | def public_bytes(self, encoding, format):
if format is serialization.PublicFormat.PKCS1:
raise ValueError(
"DSA public keys do not support PKCS1 serialization"
)
evp_pkey = self._backend._lib.EVP_PKEY_new()
assert evp_pkey != self._backend._ffi.NULL
... | |
360 | [
0.034200724214315414,
-0.01156647875905037,
0.05244271457195282,
-0.00526950741186738,
0.02016472816467285,
0.01545401755720377,
-0.01716044917702675,
0.030547520145773888,
0.00925318244844675,
0.0090729258954525,
0.0314127542078495,
-0.06753621995449066,
-0.028360404074192047,
-0.01792954... | 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 parameters(self):
dsa_cdata = self._backend._lib.DSA_new()
assert dsa_cdata != self._backend._ffi.NULL
dsa_cdata = self._backend._ffi.gc(
dsa_cdata, self._backend._lib.DSA_free
)
dsa_cdata.p = self._backend._lib.BN_dup(self._dsa_cdata.p)
dsa_cdata.q = self... | |
361 | [
0.0028068379033356905,
-0.06630104035139084,
-0.012366358190774918,
-0.06204874441027641,
-0.007832027040421963,
-0.024927975609898567,
-0.039138440042734146,
0.034235287457704544,
0.002107162494212389,
0.01247483491897583,
-0.0005986564792692661,
-0.030156558379530907,
0.003596006892621517,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Douban Photos Downloader v{0}'.format(__version__),
epilog='''https://github.com/mcxiaoke/python-labs
''')
parser.add_argument('-a', '--album',
... | |
362 | [
0.06771551072597504,
0.0030240435153245926,
-0.01365263108164072,
-0.0059568132273852825,
-0.0042298175394535065,
0.021636681631207466,
0.01787043921649456,
0.015651045367121696,
0.017639853060245514,
-0.016736723482608795,
0.01886964589357376,
-0.020541397854685783,
0.010482069104909897,
... | 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, dtype, save_callback, restore_callback):
self._restore_callback = restore_callback
spec = saver_lib.BaseSaverBuilder.SaveSpec(
tensor=save_callback,
slice_spec="",
name=name,
dtype=dtype)
super(_CallbackSaveable, self).__init__(
save_callback,... | |
363 | [
0.0858016088604927,
0.026714786887168884,
-0.04478655382990837,
-0.032666683197021484,
0.01637262850999832,
-0.04584728926420212,
0.023355795070528984,
-0.01914232224225998,
-0.020095018669962883,
-0.010312693193554878,
0.004407448694109917,
0.0015604087384417653,
0.014535986818373203,
-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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _save(self, name, content):
name = name.replace('\\', '/')
if hasattr(content, 'file') and \
hasattr(content.file, 'blobstore_info'):
data = content.file.blobstore_info
elif hasattr(content, 'blobstore_info'):
data = content.blobstore_info
elif isin... | |
364 | [
0.02292751893401146,
0.0011366568505764008,
-0.03496968001127243,
-0.04498269036412239,
0.021732782945036888,
-0.06553970277309418,
-0.011226709000766277,
-0.0441482737660408,
-0.021315574645996094,
0.013265342451632023,
0.00801230501383543,
-0.03366116061806679,
0.05070982873439789,
-0.05... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "file", "annotation": null, "type_comment": null}}, {"_type": "... | def serve_file(request, file, save_as, content_type, **kwargs):
if hasattr(file, 'file') and hasattr(file.file, 'blobstore_info'):
blobkey = file.file.blobstore_info.key()
elif hasattr(file, 'blobstore_info'):
blobkey = file.blobstore_info.key()
else:
raise ValueError("The provided f... | |
365 | [
0.04603715240955353,
0.04928683489561081,
-0.0308332871645689,
-0.004976074676960707,
0.03775820508599281,
-0.040079403668642044,
0.03170373663306236,
-0.049325522035360336,
-0.02537846378982067,
-0.017370320856571198,
0.027119364589452744,
0.00225349934771657,
0.05102773755788803,
-0.0656... | 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": "name", "annotation": n... | class BlobstoreFile(File):
def __init__(self, name, mode, storage):
self.name = name
self._storage = storage
self._mode = mode
self.blobstore_info = storage._get_blobinfo(name)
@property
def size(self):
return self.blobstore_info.size
def write(self, content):
... | |
366 | [
0.01701079122722149,
-0.031908951699733734,
0.006632836535573006,
0.003117501735687256,
0.01776530221104622,
-0.00920503307133913,
-0.025557341054081917,
-0.002037179423496127,
0.007428502663969994,
0.021071430295705795,
0.037121936678886414,
-0.030262745916843414,
0.03594215586781502,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "m.okcupid.com"}}, "targets": [{"_type": "Name", "_fields": {"id": "DOMAIN", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class OkCBrowser(Browser):
DOMAIN = 'm.okcupid.com'
PROTOCOL = 'https'
ENCODING = 'UTF-8'
PAGES = OrderedDict((
('https://%s/login.*' % DOMAIN, LoginPage),
('http://%s/home' % DOMAIN, Page),
('http://%s/messages' % DOMAIN, ThreadPage),
('http://%s/messages... | |
367 | [
0.036707863211631775,
-0.02773376926779747,
-0.0016005989164113998,
0.04296109080314636,
0.014594837091863155,
-0.026301734149456024,
-0.012315512634813786,
0.03334257751703262,
0.029738619923591614,
0.053128547966480255,
0.006450130138546228,
0.00760769285261631,
0.024845829233527184,
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": "thread_id", "annotation": null, "type_comment": null}}, {"_type":... | def post_reply(self, thread_id, content):
self.location(self.absurl('/messages?readmsg=true&threadid=%s&folder=1' % thread_id))
username, key = self.page.get_post_params()
data = urllib.urlencode({
'ajax' : 1,
'sendmsg' : 1,
'r1' : username,
'subje... | |
368 | [
0.003424903843551874,
-0.03731442242860794,
-0.02215149626135826,
0.021054012700915337,
-0.0019789384678006172,
-0.012595824897289276,
-0.020435890182852745,
0.034690555185079575,
0.026137756183743477,
0.045917682349681854,
0.02835795283317566,
-0.001213381066918373,
0.06004619598388672,
-... | 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": "id", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def visit_profile(self, id):
self.location(self.absurl('/profile/%s' % id))
stalk, u, tuid = self.page.get_visit_button_params()
if stalk and u and tuid:
# Premium users, need to click on "visit button" to let the other person know his profile was visited
data = urllib.u... | |
369 | [
0.0015155867440626025,
-0.001541232573799789,
0.0015875606331974268,
0.01978866569697857,
0.027505584061145782,
0.01491760928183794,
-0.04262174293398857,
0.03150302544236183,
0.003438198007643223,
0.025123002007603645,
0.02790268138051033,
-0.03528868407011032,
0.03221780061721802,
0.0623... | 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": "id", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def do_rate(self, id):
# Need to be in quickmatch page
abs_url, rating,params = self.page.get_rating_params()
# print abs_url, rating, params
data = urllib.urlencode(params)
self.addheaders = [('Referer', self.page.url), ('Content-Type', 'application/x-www-form-urlencoded;charset... | |
370 | [
0.007927514612674713,
-0.010216881521046162,
0.013291765004396439,
-0.046882931143045425,
0.0061187599785625935,
-0.001931492006406188,
-0.05577166751027107,
0.00006633447628701106,
-0.01365351676940918,
0.0276997908949852,
0.006387488916516304,
-0.04597338289022446,
0.011017901822924614,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "p_todos", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "p_functions", "annotation": null, "type_comment": null}}], "kw... | def _apply_sort_functions(p_todos, p_functions):
sorted_todos = p_todos
for function, order in reversed(p_functions):
sorted_todos = sorted(sorted_todos, key=function,
reverse=(order == 'desc'))
return sorted_todos | |
371 | [
0.02074786275625229,
-0.01264145690947771,
-0.018820464611053467,
-0.010770748369395733,
-0.028593501076102257,
-0.020793212577700615,
-0.021416781470179558,
-0.05895567312836647,
-0.03868399187922478,
0.05301475524902344,
-0.0009438576526008546,
-0.03149593621492386,
-0.006643850822001696,
... | 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": "fit_intercept", "annotation": null, "type_comment": null}}, {"_ty... | def __init__(self, fit_intercept=True, verbose=False, max_iter=500,
normalize=True, precompute='auto', cv=None,
max_n_alphas=1000, n_jobs=1, eps=np.finfo(np.float).eps,
copy_X=True, positive=False):
self.max_iter = max_iter
self.cv = cv
self.max... | |
372 | [
0.007125867530703545,
-0.048185426741838455,
-0.025008153170347214,
-0.007391137070953846,
0.01624905876815319,
-0.05783915892243385,
0.017830273136496544,
0.017237316817045212,
-0.036492764949798584,
0.008098522201180458,
-0.03549410030245781,
-0.026256481185555458,
0.00007086856930982322,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _get_gram(self):
# precompute if n_samples > n_features
precompute = self.precompute
if hasattr(precompute, '__array__'):
Gram = precompute
elif precompute == 'auto':
Gram = 'auto'
else:
Gram = None
return Gram | |
373 | [
-0.017763400450348854,
0.029800867661833763,
0.02279527857899666,
-0.0588209293782711,
-0.014998035505414009,
0.014835366979241371,
0.017926068976521492,
-0.006539273541420698,
0.020593831315636635,
0.03311930596828461,
-0.021201128140091896,
-0.05786660686135292,
0.006539273541420698,
-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}}, {"_type": "arg", "_fields": {"arg": "modname", "annotation"... | class BrythonModuleTestCase(unittest.TestCase):
def __init__(self, modname, caption, base_path=''):
unittest.TestCase.__init__(self)
self.modname = modname
self.caption = caption
self.base_path = base_path
def shortDescription(self):
return "Brython test module '%s'" % s... | |
374 | [
0.00898229144513607,
0.011551951989531517,
-0.03625181317329407,
-0.010336260311305523,
-0.01806829124689102,
0.023587876930832863,
-0.04293523728847504,
-0.01767650432884693,
0.01113135740160942,
-0.011044934391975403,
0.018125906586647034,
0.05793837085366249,
-0.00348287052474916,
-0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "testName", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}, {"_type": ... | def qunit_test(testName, test, result):
def wrapped_test(qunit):
test(result)
if result.details:
msg = '[' + result.lastOutcome + '] - ' + result.details
else:
msg = ''
qunit.ok(result.wasSuccessful(), msg)
if result.lastOutcome == 'SKIP':
... | |
375 | [
-0.021198436617851257,
0.008140498772263527,
0.04994407296180725,
-0.07128147780895233,
-0.029098408296704292,
-0.011662881821393967,
-0.011951514519751072,
-0.013448125682771206,
-0.02939773164689541,
0.04147752746939659,
-0.029675673693418503,
-0.0032123702112585306,
0.007237187121063471,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "base_path", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "val... | def load_brython_test_cases(base_path=''):
ret = []
for label, options in utils.discover_brython_test_modules():
tcs = []
for filenm, caption in options:
tcs.append(BrythonModuleTestCase(filenm, caption, base_path))
ret.append(NamedTestSuite('Brython :' + label, tcs))
ret... | |
376 | [
0.0032990099862217903,
0.007963968440890312,
-0.03097776509821415,
-0.019159868359565735,
-0.016013309359550476,
0.021086832508444786,
-0.032002225518226624,
-0.003933200612664223,
0.01647675596177578,
0.00046573361032642424,
0.004899730905890465,
0.04807651415467262,
-0.006186405662447214,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "qunit", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def wrapped_test(qunit):
test(result)
if result.details:
msg = '[' + result.lastOutcome + '] - ' + result.details
else:
msg = ''
qunit.ok(result.wasSuccessful(), msg)
if result.lastOutcome == 'SKIP':
# QUnit can't skip tests based on runtime be... | |
377 | [
0.060608647763729095,
0.026880517601966858,
0.06235697492957115,
-0.05570362135767937,
-0.03979870676994324,
0.0008969278424046934,
0.020275728777050972,
0.0583261102437973,
-0.04601497948169708,
0.01399875245988369,
0.046184953302145004,
-0.0024950073566287756,
0.017665380612015724,
-0.06... | 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 run(self):
self.run_command('egg_info')
if os.path.isdir(self.target) and not os.path.islink(self.target):
dir_util.remove_tree(self.target, dry_run=self.dry_run)
elif os.path.exists(self.target):
self.execute(os.unlink, (self.target,), "Removing " + self.target)
... | |
378 | [
0.029983336105942726,
-0.020137891173362732,
0.05079745873808861,
-0.025857189670205116,
-0.044241469353437424,
-0.034315790981054306,
0.02060781419277191,
0.007530218921601772,
-0.020447352901101112,
0.04463116079568863,
0.0460294634103775,
-0.011215097270905972,
-0.01597735844552517,
-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 finalize_options(self):
self.set_undefined_options('install_lib',
('install_dir', 'install_dir'))
self.set_undefined_options('install',('install_layout','install_layout'))
if sys.hexversion > 0x2060000:
self.set_undefined_options('install',('pre... | |
379 | [
-0.006404681131243706,
0.0052440655417740345,
0.0635889545083046,
-0.0684443786740303,
-0.023978956043720245,
0.0006644923705607653,
-0.013948682695627213,
-0.017079150304198265,
-0.006484540179371834,
0.026939058676362038,
0.006463244557380676,
0.03202873095870018,
-0.0033540725708007812,
... | 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 install_namespaces(self):
nsp = self._get_all_ns_packages()
if not nsp:
return
filename, ext = os.path.splitext(self.target)
filename += '-nspkg.pth'
self.outputs.append(filename)
log.info("Installing %s", filename)
lines = map(self._gen_nspkg_line... | |
380 | [
0.0387110635638237,
-0.011491074226796627,
0.009300842881202698,
-0.05822959169745445,
-0.0021240150090306997,
-0.0011657888535410166,
0.02599753625690937,
0.019223099574446678,
-0.06992440670728683,
0.01042142603546381,
0.06462710350751877,
-0.006117366719990969,
-0.027912715449929237,
-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 copytree(self):
# Copy the .egg-info tree to site-packages
def skimmer(src, dst):
# filter out source-control directories; note that 'src' is always
# a '/'-separated path, regardless of platform. 'dst' is a
# platform-specific path.
for skip in '.svn... | |
381 | [
0.02643224410712719,
0.0066541638225317,
-0.014875821769237518,
-0.06929755955934525,
-0.008129452355206013,
0.018512817099690437,
0.0052429074421525,
0.003672852646559477,
-0.013216122053563595,
0.020131535828113556,
0.02684204652905464,
0.009148835204541683,
-0.0062494841404259205,
0.009... | 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": "dst", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def skimmer(src, dst):
# filter out source-control directories; note that 'src' is always
# a '/'-separated path, regardless of platform. 'dst' is a
# platform-specific path.
for skip in '.svn/', 'CVS/':
if src.startswith(skip) or '/' + skip in src:
... | |
382 | [
-0.005894097965210676,
0.013133775442838669,
0.05230508744716644,
-0.053869180381298065,
-0.020080184563994408,
-0.026681574061512947,
0.024220429360866547,
-0.02629055082798004,
0.012834757566452026,
0.055755291134119034,
0.023737400770187378,
-0.013156776316463947,
0.017803050577640533,
... | 8 | {"_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": "pkg", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _gen_nspkg_line(cls, pkg):
# ensure pkg is not a unicode string under Python 2.7
pkg = str(pkg)
pth = tuple(pkg.split('.'))
tmpl_lines = cls._nspkg_tmpl
parent, sep, child = pkg.rpartition('.')
if parent:
tmpl_lines += cls._nspkg_tmpl_multi
return ... | |
383 | [
0.008457555435597897,
0.02541826106607914,
-0.02872377447783947,
-0.03264479711651802,
0.024027666077017784,
-0.024004869163036346,
0.030000386759638786,
-0.06041111424565315,
0.03911904618144035,
-0.022044356912374496,
0.05712839588522911,
-0.06109501048922539,
-0.022397704422473907,
-0.0... | 15 | {"_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": "video", "annotation": ... | class BaseVideoPage(BasePage):
def get_video(self, video):
date, duration = self.get_date_and_duration()
if not video:
video = InaVideo(self.get_id())
video.title = self.get_title()
video.url = self.get_url()
video.date = date
video.duration = duration
... | |
384 | [
-0.03362124413251877,
0.029284490272402763,
0.027116114273667336,
-0.03204631805419922,
0.03318756818771362,
0.0056976936757564545,
-0.00850802380591631,
-0.016673671081662178,
0.051812779158353806,
0.029147541150450706,
-0.012451044283807278,
-0.027481315657496452,
0.03978399559855461,
0.... | 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}}, {"_type": "arg", "_fields": {"arg": "mock_gateway", "annota... | class TestSimulationRunnerWrapper(unittest.TestCase):
def test_init_with_arguments(self, mock_gateway):
SimulationRunnerWrapper(py4j_jar_path="py4j_jar_path",
classpath="classpath")
mock_gateway.assert_called_with(jarpath='py4j_jar_path',
classp... | |
385 | [
-0.014169118367135525,
0.049331627786159515,
0.02052013948559761,
-0.04626496508717537,
-0.024817252531647682,
0.00729752192273736,
0.012342371977865696,
-0.03933657705783844,
0.02833823673427105,
0.023454291746020317,
0.004299480468034744,
-0.0023579702246934175,
0.007993199862539768,
-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": "text", "annotation": null, "type_comment": null}}], "kwarg": null... | def parse_date_and_duration(self, text):
duration_regexp = re.compile('(.* - )?(.+) - ((.+)h)?((.+)min)?(.+)s')
m = duration_regexp.match(text)
if m:
day, month, year = [int(s) for s in m.group(2).split('/')]
date = datetime.datetime(year, month, day)
duration... | |
386 | [
-0.020021172240376472,
0.011641590856015682,
-0.04935561865568161,
-0.035456620156764984,
0.012267990969121456,
-0.05242852494120598,
0.05933074653148651,
-0.03678033500909805,
0.03382561728358269,
-0.006837218534201384,
0.04973382130265236,
-0.05124663561582565,
-0.01587274856865406,
-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": "video", "annotation": null, "type_comment": null}}], "kwarg": nul... | def get_video(self, video):
date, duration = self.get_date_and_duration()
if not video:
video = InaVideo(self.get_id())
video.title = self.get_title()
video.url = self.get_url()
video.date = date
video.duration = duration
video.description = self.get_... | |
387 | [
0.03445622697472572,
0.01841668039560318,
-0.021480001509189606,
-0.04224931076169014,
-0.005005465354770422,
-0.009024540893733501,
-0.02178633213043213,
-0.03320639207959175,
0.00003819577250396833,
-0.004824729170650244,
0.04673401266336441,
-0.08371441066265106,
-0.0014688620576635003,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "http://boutique.ina.fr/(audio|video)/(.+).html"}}], "func": {"_type": "Attribute", "_fields": {"ct... | class BoutiqueVideoPage(BaseVideoPage):
URL_REGEXP = re.compile('http://boutique.ina.fr/(audio|video)/(.+).html')
def create_id(self, id):
return u'boutique.%s' % id
def get_description(self):
el = self.document.getroot().cssselect('div.bloc-produit-haut div.contenu p')[0]
if el is... | |
388 | [
0.02888752520084381,
0.043008722364902496,
-0.013165447860956192,
-0.034191932529211044,
0.016653932631015778,
-0.004208283964544535,
0.012627838179469109,
-0.051753826439380646,
0.00264175096526742,
0.0015127720544114709,
0.047644104808568954,
-0.06828828901052475,
0.0031121589709073305,
... | 19 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "http://www.ina.fr/(.+)\\.html"}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Lo... | class VideoPage(BaseVideoPage):
URL_REGEXP = re.compile('http://www.ina.fr/(.+)\.html')
def create_id(self, id):
return u'www.%s' % id
def get_date_and_duration(self):
qr = self.parser.select(self.document.getroot(), 'div.container-global-qr')[0].find('div').findall('div')[1]
retur... | |
389 | [
0.021207759156823158,
0.03967084735631943,
0.027446690946817398,
-0.008366628549993038,
-0.02592443861067295,
0.009514084085822105,
0.0030646882951259613,
0.0015510841039940715,
0.02178437076508999,
-0.01155528798699379,
0.0023410413414239883,
-0.048158563673496246,
0.04670550674200058,
-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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,... | def forwards(self, orm):
# Adding model 'CredAudit'
db.create_table('cred_credaudit', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('audittype', self.gf('django.db.models.fields.CharField')(max_length=1)),
('cred', self.gf('django.db.model... | |
390 | [
0.03906266763806343,
0.04512719064950943,
0.04242618381977081,
-0.036285217851400375,
-0.01353051234036684,
0.006147337611764669,
-0.00359603320248425,
-0.020716208964586258,
-0.008491607382893562,
0.003315740032121539,
-0.002130864653736353,
-0.06915595382452011,
0.011434684507548809,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu... | class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CredAudit'
db.create_table('cred_credaudit', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('audittype', self.gf('django.db.models.fields.CharField')(max_length=1)),
... | |
391 | [
0.06056696176528931,
0.013360358774662018,
0.019155949354171753,
-0.009163131937384605,
-0.05163565278053284,
-0.014007024466991425,
0.006454456597566605,
-0.005737633444368839,
0.0016563184326514602,
0.04665754735469818,
0.042289502918720245,
-0.029185369610786438,
0.0056369733065366745,
... | 12 | {"_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": "Return", "_fields": {"val... | def validate_plural_config():
if plural_validation['done']:
return
if catalog.num_plurals != len(catalog.language.plural_keywords):
warnfunc(('Catalog defines %d plurals, we expect %d for '
'this language. See the README for an '
'expla... | |
392 | [
0.047408830374479294,
0.0023674836847931147,
0.09989410638809204,
-0.041471969336271286,
-0.03667515888810158,
-0.020305778831243515,
-0.023231185972690582,
0.009077371098101139,
-0.026092063635587692,
-0.03529849648475647,
-0.0013833849225193262,
-0.03970812261104584,
-0.007388807833194733,... | 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": "configFilePath", "anno... | class FgdcWriter(DatasetGranuleWriter):
def __init__(self, configFilePath):
super(FgdcWriter, self).__init__(configFilePath)
templatePath = os.path.dirname(configFilePath) + os.sep
templatePath += self._configuration.get('service', 'template')
self.template = self._readTempl... | |
393 | [
-0.010891050100326538,
0.006501088850200176,
-0.03847381845116615,
-0.00938662514090538,
0.0019101265352219343,
-0.04372204467654228,
0.042814455926418304,
-0.014156392775475979,
-0.020341798663139343,
0.017688091844320297,
0.009105470962822437,
0.02933875285089016,
0.04186740890145302,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "link", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "location", "annotation": null, "type_comment": null}}], "kwarg": ... | def unpack_file_url(link, location):
source = url_to_path(link.url)
content_type = mimetypes.guess_type(source)[0]
if os.path.isdir(source):
# delete the location since shutil will create it again :(
if os.path.isdir(location):
rmtree(location)
copytree(source, location)
... | |
394 | [
-0.028415456414222717,
0.003655530046671629,
-0.006284946575760841,
-0.008667700923979282,
-0.0079721137881279,
-0.028316792100667953,
0.03628890588879585,
0.05533120781183243,
-0.05130568519234657,
-0.0005318648181855679,
0.03382228687405586,
0.01872657611966133,
0.002570217475295067,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "target_file", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "link", "annotation": null, "type_comment": null}}], "kwarg... | def _get_md5_from_file(target_file, link):
download_hash = md5()
fp = open(target_file, 'rb')
while True:
chunk = fp.read(4096)
if not chunk:
break
download_hash.update(chunk)
fp.close()
return download_hash | |
395 | [
0.002414884977042675,
0.02894205041229725,
-0.014826270751655102,
-0.04563858360052109,
0.010918571613729,
-0.002168041653931141,
0.045137058943510056,
-0.0451788529753685,
0.004605129361152649,
0.01803392730653286,
0.02419847995042801,
0.026037396863102913,
0.03836650028824806,
0.02344619... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "location", "annotation": null, "type_comment": null}}, {"_typ... | def _copy_file(filename, location, content_type, link):
copy = True
download_location = os.path.join(location, link.filename)
if os.path.exists(download_location):
response = ask_path_exists(
'The file %s exists. (i)gnore, (w)ipe, (b)ackup ' %
display_path(download_location),... | |
396 | [
-0.022889824584126472,
0.00024464615853503346,
-0.021931437775492668,
0.0012697222409769893,
-0.009600576013326645,
0.004672131966799498,
0.023491602391004562,
0.004187366925179958,
-0.003967272583395243,
0.05032641068100929,
0.024762021377682686,
-0.0007024217629805207,
-0.02734743431210518... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "link", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _download_url(resp, link, temp_location):
fp = open(temp_location, 'wb')
download_hash = None
if link.md5_hash:
download_hash = md5()
try:
total_length = int(resp.info()['content-length'])
except (ValueError, KeyError, TypeError):
total_length = 0
downloaded = 0
s... | |
397 | [
-0.04388229548931122,
-0.02471127361059189,
-0.029635939747095108,
-0.03227415308356285,
-0.028316833078861237,
-0.03181246668100357,
0.0312628373503685,
0.02710765227675438,
-0.007980598136782646,
-0.0030339465010911226,
0.02178725227713585,
0.011075004003942013,
0.018995143473148346,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "link", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "location", "annotation": null, "type_comment": null}}, {"_type": ... | def unpack_http_url(link, location, download_cache, download_dir=None):
temp_dir = tempfile.mkdtemp('-unpack', 'pip-')
target_url = link.url.split('#', 1)[0]
target_file = None
download_hash = None
if download_cache:
target_file = os.path.join(download_cache,
... | |
398 | [
-0.04436465725302696,
-0.0047210282646119595,
-0.02055923268198967,
-0.00043276092037558556,
0.004601376596838236,
-0.0004470670537557453,
-0.017604362219572067,
0.05489398166537285,
0.02927817776799202,
0.03196253255009651,
0.013213676400482655,
0.004232018254697323,
-0.0032383911311626434,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "target_url", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "link", "annotation": null, "type_comment": null}}], "kwarg"... | def _get_response_from_url(target_url, link):
try:
resp = urlopen(target_url)
except urllib2.HTTPError:
e = sys.exc_info()[1]
logger.fatal("HTTP error %s while getting %s" % (e.code, link))
raise
except IOError:
e = sys.exc_info()[1]
# Typically an FTP error
... | |
399 | [
0.019690008834004402,
-0.05572785437107086,
0.015859657898545265,
-0.014382593333721161,
-0.04636477306485176,
-0.025210220366716385,
0.06418967992067337,
0.01182902604341507,
0.016798468306660652,
-0.0076294089667499065,
0.03730211406946182,
-0.0015451273648068309,
0.014582873322069645,
-... | 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(SavePhotosTestCase, self).setUp()
self._CreateSimpleTestAssets()
self._existing_vp_id, existing_ep_ids = self._tester.ShareNew(self._cookie,
[(self._episode_id, self._photo_ids)],
... | |
400 | [
0.0333305187523365,
0.01329993735998869,
0.04045301303267479,
-0.03192446008324623,
-0.008240428753197193,
0.03330746665596962,
0.0023352683056145906,
-0.010090203955769539,
-0.04510914534330368,
-0.01902789995074272,
-0.013138585723936558,
-0.06712204217910767,
0.027475779876112938,
-0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "IConfigurer", "value": {"_type": "Name", "_fields": {"id": "plugins", "ct... | class OpendatajePlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'opendataj... |