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 |
|---|---|---|---|---|---|
9,201 | [
0.029576823115348816,
-0.04842973127961159,
0.021474309265613556,
-0.0012494685361161828,
0.006513785570859909,
0.029470907524228096,
0.000859733612742275,
0.011061519384384155,
0.04885338991880417,
0.017833473160862923,
0.011630813591182232,
-0.07038065791130066,
-0.051792535930871964,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_solveset():
x = Symbol('x')
raises(ValueError, lambda: solveset(x + y))
raises(ValueError, lambda: solveset(x, 1))
assert solveset(0, domain=S.Reals) == S.Reals
assert solveset(1) == S.EmptySet
assert solveset(True, domain=S.Reals) == S.Reals # issue 10197
assert solveset(False, d... | |
9,202 | [
0.03612565994262695,
-0.01124569308012724,
-0.011865432374179363,
0.01919901929795742,
-0.0010046560782939196,
0.01887623779475689,
-0.03331100940704346,
-0.013763384893536568,
0.07973983883857727,
0.024428071454167366,
0.011716953478753567,
-0.05944336578249931,
-0.022917456924915314,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_solvify():
x = Symbol('x')
assert solvify(x**2 + 10, x, S.Reals) == []
assert solvify(x**3 + 1, x, S.Complexes) == [-1, 1/2 - sqrt(3)*I/2,
1/2 + sqrt(3)*I/2]
assert solvify(log(x), x, S.Reals) == [1]
assert solvify(cos(x), x, S.Reals) == [pi... | |
9,203 | [
0.0032310595270246267,
-0.03072112239897251,
0.001981955487281084,
0.0076281665824353695,
0.011080710217356682,
-0.0007291869260370731,
-0.004618591163307428,
-0.008019020780920982,
0.028011200949549675,
0.03327470272779465,
0.008390331640839577,
-0.06264086067676544,
-0.020467719063162804,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_linsolve():
x, y, z, u, v, w = symbols("x, y, z, u, v, w")
x1, x2, x3, x4 = symbols('x1, x2, x3, x4')
# Test for different input forms
M = Matrix([[1, 2, 1, 1, 7], [1, 2, 2, -1, 12], [2, 4, 0, 6, 4]])
system1 = A, b = M[:, :-1], M[:, -1]
Eqns = [x1 + 2*x2 + x3 + x4 - 7, x1 + 2*x2 + 2*... | |
9,204 | [
-0.02508268691599369,
-0.030867211520671844,
0.017402805387973785,
-0.0062306723557412624,
0.0014784384984523058,
-0.01804279536008835,
-0.02235042117536068,
-0.006879892665892839,
0.008978322148323059,
0.03473176807165146,
-0.004141474142670631,
-0.08408484607934952,
-0.04159935191273689,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_nonlinsolve_basic():
assert nonlinsolve([],[]) == S.EmptySet
assert nonlinsolve([],[x, y]) == S.EmptySet
system = [x, y - x - 5]
assert nonlinsolve([x],[x, y]) == FiniteSet((0, y))
assert nonlinsolve(system, [y]) == FiniteSet((x + 5,))
soln = (ImageSet(Lambda(n, 2*n*pi + pi/2), S.Integ... | |
9,205 | [
0.03289533779025078,
-0.032103948295116425,
-0.012747932225465775,
-0.03484742343425751,
0.0036140023730695248,
0.017924925312399864,
-0.0024203264620155096,
0.016434477642178535,
0.05650506168603897,
0.014825323596596718,
0.023398688063025475,
-0.03912091627717018,
-0.04347354918718338,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_solve_decomposition():
x = Symbol('x')
n = Dummy('n')
f1 = exp(3*x) - 6*exp(2*x) + 11*exp(x) - 6
f2 = sin(x)**2 - 2*sin(x) + 1
f3 = sin(x)**2 - sin(x)
f4 = sin(x + 1)
f5 = exp(x + 2) - 1
f6 = 1/log(x)
s1 = ImageSet(Lambda(n, 2*n*pi), S.Integers)
s2 = ImageSet(Lambda(n,... | |
9,206 | [
-0.03576452285051346,
-0.023027291521430016,
-0.0009318651864305139,
-0.06174035742878914,
-0.01818069815635681,
0.015041154809296131,
-0.00017663657490629703,
-0.010946618393063545,
0.03889212757349014,
0.028721442446112633,
-0.01961318776011467,
-0.038534004241228104,
-0.05448240414261818,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def test_trig_system_fail():
# fails because solveset trig solver is not much smart.
sys = [x + y - pi/2, sin(x) + sin(y) - 1]
# solveset returns conditonset for sin(x) + sin(y) - 1
soln_1 = (ImageSet(Lambda(n, n*pi + pi/2), S.Integers),
ImageSet(Lambda(n, n*pi)), S.Integers)
soln_1 = Finite... | |
9,207 | [
0.027568083256483078,
-0.029309747740626335,
0.028339391574263573,
0.01945689506828785,
0.014990766532719135,
0.0007024978403933346,
-0.035330936312675476,
-0.00255340663716197,
-0.006599669344723225,
0.029956651851534843,
0.013385945931077003,
-0.07613568007946014,
-0.040033433586359024,
... | 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_nonlinsolve_positive_dimensional():
x, y, z, a, b, c, d = symbols('x, y, z, a, b, c, d', real = True)
assert nonlinsolve([x*y, x*y - x], [x, y]) == FiniteSet((0, y))
system = [a**2 + a*c, a - b]
assert nonlinsolve(system, [a, b]) == FiniteSet((0, 0), (-c, -c))
# here (a= 0, b = 0) is indep... | |
9,208 | [
0.0048411935567855835,
0.007408967241644859,
0.008843163028359413,
-0.004415318835526705,
0.0073964414186775684,
0.007834842428565025,
-0.016295969486236572,
0.017999468371272087,
-0.006601057946681976,
0.021343838423490524,
0.004722198937088251,
-0.0478232242166996,
-0.03366915509104729,
... | 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_nonlinsolve_using_substitution():
x, y, z, n = symbols('x, y, z, n', real = True)
system = [(x + y)*n - y**2 + 2]
s_x = (n*y - y**2 + 2)/n
soln = (-s_x, y)
assert nonlinsolve(system, [x, y]) == FiniteSet(soln)
system = [z**2*x**2 - z**2*y**2/exp(x)]
soln_real_1 = (y, x, 0)
soln... | |
9,209 | [
0.02834346704185009,
-0.005944154225289822,
0.009327005594968796,
0.02102200873196125,
-0.0025310982018709183,
0.0034462804906070232,
-0.024114901199936867,
-0.015404057689011097,
0.006149541586637497,
0.04209234192967415,
0.028971709311008453,
-0.07616249471902847,
-0.022459721192717552,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_nonlinsolve_polysys():
x, y, z = symbols('x, y, z', real = True)
assert nonlinsolve([x**2 + y - 2, x**2 + y], [x, y]) == S.EmptySet
s = (-y + 2, y)
assert nonlinsolve([(x + y)**2 - 4, x + y - 2], [x, y]) == FiniteSet(s)
system = [x**2 - y**2]
soln_real = FiniteSet((-y, y), (y, y))
... | |
9,210 | [
0.012924456037580967,
0.0010424404172226787,
-0.008844949305057526,
-0.024128058925271034,
-0.010240886360406876,
0.01636616513133049,
-0.031143847852945328,
0.02500653639435768,
0.011215636506676674,
0.0260655228048563,
0.01882108859717846,
-0.014621241949498653,
-0.04170965030789375,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_solve_nonlinear_trans():
# After the transcendental equation solver these will work
x, y, z = symbols('x, y, z', real=True)
soln1 = FiniteSet((2*LambertW(y/2), y))
soln2 = FiniteSet((-x*sqrt(exp(x)), y), (x*sqrt(exp(x)), y))
soln3 = FiniteSet((x*exp(x/2), x))
soln4 = FiniteSet(2*Lambert... | |
9,211 | [
0.017864786088466644,
0.0011474740458652377,
-0.008522232063114643,
-0.017396030947566032,
-0.007018309086561203,
0.008177176117897034,
-0.01884135976433754,
0.008919372223317623,
0.015625178813934326,
0.0069076307117938995,
-0.003759808372706175,
-0.039271280169487,
-0.02320338971912861,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_nonlinsolve_complex():
x, y, z = symbols('x, y, z')
n = Dummy('n')
real_soln = (log(sin(S(1)/3)), S(1)/3)
img_lamda = Lambda(n, 2*n*I*pi + Mod(log(sin(S(1)/3)), 2*I*pi))
complex_soln = (ImageSet(img_lamda, S.Integers), S(1)/3)
soln = FiniteSet(real_soln, complex_soln)
assert nonlins... | |
9,212 | [
0.03181736171245575,
0.017861926928162575,
-0.015009159222245216,
-0.002322693122550845,
-0.009573479183018208,
0.018324539065361023,
-0.010260970331728458,
0.016936706379055977,
0.008975939825177193,
0.010999863035976887,
0.0066628847271203995,
-0.05294326692819595,
-0.03960464894771576,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_issue_5132_2():
x, y = symbols('x, y', real=True)
eqs = [exp(x)**2 - sin(y) + z**2, 1/exp(y) - 3]
n = Dummy('n')
soln_real = (log(-z**2 + sin(y))/2, z)
lam = Lambda( n, I*(2*n*pi + arg(-z**2 + sin(y)))/2 + log(Abs(z**2 - sin(y)))/2)
img = ImageSet(lam, S.Integers)
# not sure about t... | |
9,213 | [
-0.00245302333496511,
0.008290085941553116,
0.012519325129687786,
-0.009553028270602226,
-0.0008889174205251038,
0.0018280287040397525,
-0.01056985929608345,
0.005935830995440483,
-0.004319911822676659,
0.02290136180818081,
0.010887213982641697,
-0.061605699360370636,
-0.049118757247924805,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def test_issue_5132_1():
system = [sqrt(x**2 + y**2) - sqrt(10), x + y - 4]
assert nonlinsolve(system, [x, y]) == FiniteSet((1, 3), (3, 1))
n = Dummy('n')
eqs = [exp(x)**2 - sin(y) + z**2, 1/exp(y) - 3]
s_real_y = -log(3)
s_real_z = sqrt(-exp(2*x) - sin(log(3)))
soln_real = FiniteSet((s_rea... | |
9,214 | [
0.029749423265457153,
-0.013163215480744839,
0.03470302373170853,
-0.019118666648864746,
-0.002972507383674383,
0.022138135507702827,
-0.013302361592650414,
-0.004932727199047804,
0.006105032749474049,
0.02368265576660633,
0.04833933711051941,
-0.06679010391235352,
-0.0779217854142189,
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_issue_5114():
# slow testcase
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r = symbols('a:r')
# there is no 'a' in the equation set but this is how the
# problem was originally posed
syms = [a, b, c, f, h, k, n]
eqs = [b + r/d - c/d,
c*(1/d + 1/e + 1/g) - f/g - r/d,
f... | |
9,215 | [
-0.015334143303334713,
-0.011774196289479733,
-0.005000407341867685,
0.0011948896571993828,
-0.010600731708109379,
0.005264107137918472,
-0.0034412823151797056,
-0.04037243872880936,
0.04274573549628258,
0.055640656501054764,
0.020331254228949547,
-0.06555576622486115,
-0.04675397276878357,
... | 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_issue_5335():
# Not able to check zero dimensional system.
# is_zero_dimensional Hangs
lam, a0, conc = symbols('lam a0 conc')
eqs = [lam + 2*y - a0*(1 - x/2)*x - 0.005*x/2*x,
a0*(1 - x/2)*x - 1*y - 0.743436700916726*y,
x + y - conc]
sym = [x, y, a0]
# there are 4 ... | |
9,216 | [
0.013108947314321995,
-0.02932722680270672,
0.03957558795809746,
-0.020384786650538445,
0.03251118212938309,
0.034252408891916275,
-0.004449455067515373,
0.005752265453338623,
0.02062109485268593,
0.054376013576984406,
0.01817094162106514,
-0.06870381534099579,
-0.06736058741807938,
-0.006... | 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_issue_2777():
# the equations represent two circles
x, y = symbols('x y', real=True)
e1, e2 = sqrt(x**2 + y**2) - 10, sqrt(y**2 + (-x + 10)**2) - 3
a, b = 191/S(20), 3*sqrt(391)/20
ans = {(a, -b), (a, b)}
assert nonlinsolve((e1, e2), (x, y)) == ans
assert nonlinsolve((e1, e2/(x - a)... | |
9,217 | [
-0.002090891357511282,
0.011209501884877682,
0.05229809880256653,
-0.015346110798418522,
-0.03298962116241455,
-0.019321385771036148,
0.012216227129101753,
-0.02934992127120495,
0.002192531945183873,
0.023477355018258095,
-0.014958908781409264,
-0.02097344771027565,
-0.05591198801994324,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_issue_8828():
x1 = 0
y1 = -620
r1 = 920
x2 = 126
y2 = 276
x3 = 51
y3 = 205
r3 = 104
v = [x, y, z]
f1 = (x - x1)**2 + (y - y1)**2 - (r1 - z)**2
f2 = (x2 - x)**2 + (y2 - y)**2 - z**2
f3 = (x - x3)**2 + (y - y3)**2 - (r3 - z)**2
F = [f1, f2, f3]
g1 = sqrt(... | |
9,218 | [
0.007966235280036926,
-0.020475713536143303,
0.02994806505739689,
-0.010685957968235016,
-0.0017861793749034405,
-0.006127155385911465,
0.0056915017776191235,
0.007331425789743662,
0.0127957658842206,
0.020176980644464493,
0.0010121164377778769,
-0.09639144688844681,
-0.034752700477838516,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_substitution_basic():
assert substitution([], [x, y]) == S.EmptySet
assert substitution([], []) == S.EmptySet
system = [2*x**2 + 3*y**2 - 30, 3*x**2 - 2*y**2 - 19]
soln = FiniteSet((-3, -2), (-3, 2), (3, -2), (3, 2))
assert substitution(system, [x, y]) == soln
soln = FiniteSet((-1, 1))... | |
9,219 | [
-0.0012287943391129375,
-0.038452304899692535,
0.006107269320636988,
-0.027858544141054153,
0.0038141070399433374,
-0.000916090386454016,
-0.013741355389356613,
0.0018718192586675286,
0.03645569831132889,
0.04028448835015297,
0.004154704976826906,
-0.08188438415527344,
-0.06854235380887985,
... | 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_nonlinsolve_conditionset():
# when solveset failed to solve all the eq
# return conditionset
f = Function('f')
f1 = f(x) - pi/2
f2 = f(x) - 3*pi/2
intermediate_system = FiniteSet(2*f(x) - 3*pi, 2*f(x) - pi)
symbols = FiniteSet(x, y)
soln = ConditionSet(
symbols,
... | |
9,220 | [
0.023887142539024353,
0.004020804073661566,
0.0001930142898345366,
-0.008913112804293633,
-0.010530677624046803,
0.014089320786297321,
0.006457054987549782,
0.03240411728620529,
0.012782064266502857,
0.004826285410672426,
0.0018668019911274314,
-0.04069661349058151,
-0.023174094036221504,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_issue_5132_substitution():
x, y, z, r, t = symbols('x, y, z, r, t', real=True)
system = [r - x**2 - y**2, tan(t) - y/x]
s_x_1 = Complement(FiniteSet(-sqrt(r/(tan(t)**2 + 1))), FiniteSet(0))
s_x_2 = Complement(FiniteSet(sqrt(r/(tan(t)**2 + 1))), FiniteSet(0))
s_y = sqrt(r/(tan(t)**2 + 1))*ta... | |
9,221 | [
0.022711502388119698,
-0.0015908380737528205,
0.01862994208931923,
0.01985691487789154,
-0.005342962220311165,
0.029672691598534584,
-0.003975138999521732,
0.02804507501423359,
0.0036652658600360155,
0.025102846324443817,
-0.006998748518526554,
-0.03638347610831261,
-0.031074944883584976,
... | 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_issue_11174():
r, t = symbols('r t')
eq = z**2 + exp(2*x) - sin(y)
soln = Intersection(S.Reals, FiniteSet(log(-z**2 + sin(y))/2))
assert solveset(eq, x, S.Reals) == soln
eq = sqrt(r)*Abs(tan(t))/sqrt(tan(t)**2 + 1) + x*tan(t)
s = -sqrt(r)*Abs(tan(t))/(sqrt(tan(t)**2 + 1)*tan(t))
so... | |
9,222 | [
-0.036199312657117844,
0.07194894552230835,
0.024156296625733376,
-0.015766937285661697,
-0.009548692964017391,
0.017382977530360222,
-0.008150466717779636,
-0.005202948581427336,
0.033754173666238785,
0.02769753336906433,
0.036480363458395004,
-0.025097815319895744,
0.03330449387431145,
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": "tab", "annotation": null, "type_comment": null}}], "kwarg": null,... | def RunAction(self, tab):
tab.ExecuteJavaScript(
'window.__rafCount = 0;'
'window.__rafFunction = function() {'
'window.__rafCount += 1;'
'window.webkitRequestAnimationFrame(window.__rafFunction);'
'};'
'window.webkitRequestAnimationFrame(window.__rafFunction);')
... | |
9,223 | [
-0.007261984050273895,
-0.017239166423678398,
-0.02037568762898445,
0.006120898760855198,
-0.006214526016265154,
-0.022950444370508194,
0.019743701443076134,
0.003288666484877467,
0.02371116727590561,
-0.015436836518347263,
0.011797066777944565,
-0.02724560722708702,
0.013470658101141453,
... | 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_userbar_tag(self):
template = Template("{% load wagtailuserbar %}{% wagtailuserbar %}")
content = template.render(Context({
PAGE_TEMPLATE_VAR: self.homepage,
'request': self.dummy_request(self.user),
}))
self.assertIn("<!-- Wagtail user bar embed code --... | |
9,224 | [
-0.021439366042613983,
-0.04075925052165985,
0.002644984284415841,
-0.009275640361011028,
0.01133689470589161,
-0.004597061313688755,
-0.021648984402418137,
0.0352625735104084,
0.0548270158469677,
-0.004506808705627918,
0.029789188876748085,
-0.025573518127202988,
-0.010213103145360947,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestUserbarFrontend(TestCase, WagtailTestUtils):
def setUp(self):
self.login()
self.homepage = Page.objects.get(id=2)
def test_userbar_frontend(self):
response = self.client.get(reverse('wagtailadmin_userbar_frontend', args=(self.homepage.id, )))
self.assertEqual(response... | |
9,225 | [
0.015696033835411072,
-0.019666867330670357,
-0.034788504242897034,
0.008815751411020756,
0.0006906816270202398,
-0.032066360116004944,
0.005575400777161121,
0.01889267936348915,
0.04730037599802017,
-0.008047807030379772,
0.012680446729063988,
-0.02548576146364212,
0.023425424471497536,
-... | 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_userbar_tag_anonymous_user(self):
template = Template("{% load wagtailuserbar %}{% wagtailuserbar %}")
content = template.render(Context({
PAGE_TEMPLATE_VAR: self.homepage,
'request': self.dummy_request(),
}))
# Make sure nothing was rendered
sel... | |
9,226 | [
-0.025304971262812614,
-0.013734380714595318,
0.00781811960041523,
-0.008512810803949833,
-0.017446991056203842,
-0.000991500448435545,
-0.012140008620917797,
-0.000035299515730002895,
0.028402607887983322,
0.008672247640788555,
0.016683969646692276,
-0.027992626652121544,
-0.011058112606406... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "test.json"}}]}}, "targets": [{"_type": "Name", "_fields":... | class TestUserbarAddLink(TestCase, WagtailTestUtils):
fixtures = ['test.json']
def setUp(self):
self.login()
self.homepage = Page.objects.get(url_path='/home/')
self.event_index = Page.objects.get(url_path='/home/events/')
self.business_index = BusinessIndex(title='Business', l... | |
9,227 | [
-0.0028484014328569174,
-0.0370691642165184,
-0.00877565797418356,
-0.000984035199508071,
0.030333787202835083,
0.016273068264126778,
-0.03175952285528183,
0.04412410780787468,
0.07792390882968903,
0.0013035968877375126,
0.03618422523140907,
-0.03461099788546562,
-0.013937809504568577,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_userbar_frontend_anonymous_user_cannot_see(self):
# Logout
self.client.logout()
response = self.client.get(reverse('wagtailadmin_userbar_frontend', args=(self.homepage.id, )))
# Check that the user received a forbidden message
self.assertEqual(response.status_code, 403... | |
9,228 | [
0.012165014632046223,
0.015645528212189674,
-0.0013800353044643998,
0.018723154440522194,
0.010413565672934055,
-0.016026034951210022,
-0.004059667699038982,
0.02305421233177185,
0.04044559597969055,
0.017559252679347992,
0.028784191235899925,
-0.032052069902420044,
-0.015611954964697361,
... | 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_page_allowing_subpages(self):
response = self.client.get(reverse('wagtailadmin_userbar_frontend', args=(self.event_index.id, )))
# page allows subpages, so the 'add page' button should show
expected_url = reverse('wagtailadmin_pages:add_subpage', args=(self.event_index.id, ))
e... | |
9,229 | [
0.03475293144583702,
-0.007542992942035198,
0.024631649255752563,
0.009743532165884972,
0.008340463973581791,
-0.013491044752299786,
0.006277832668274641,
0.028469102457165718,
0.013718893751502037,
0.00048118061386048794,
0.025567028671503067,
-0.04240385442972183,
-0.018779534846544266,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.login()
self.homepage = Page.objects.get(url_path='/home/')
self.event_index = Page.objects.get(url_path='/home/events/')
self.business_index = BusinessIndex(title='Business', live=True)
self.homepage.add_child(instance=self.business_index)
self.bu... | |
9,230 | [
0.015885233879089355,
0.009625043720006943,
-0.003160837572067976,
0.03259770944714546,
0.013481768779456615,
-0.004275933839380741,
-0.015024458058178425,
0.026494022458791733,
0.038611963391304016,
0.002316829515621066,
0.0021295829210430384,
-0.045833539217710495,
-0.020591557025909424,
... | 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_page_disallowing_subpages(self):
response = self.client.get(reverse('wagtailadmin_userbar_frontend', args=(self.business_child.id, )))
# page disallows subpages, so the 'add page' button shouldn't show
expected_url = reverse('wagtailadmin_pages:add_subpage', args=(self.business_index.i... | |
9,231 | [
0.005654108710587025,
-0.014432935975492,
0.01353843230754137,
0.00520685687661171,
-0.00037491333205252886,
0.03457135334610939,
-0.025553790852427483,
0.027052687481045723,
0.0260373055934906,
0.010383494198322296,
0.030147187411785126,
-0.041558150202035904,
-0.023571377620100975,
0.012... | 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 TestUserbarModeration(TestCase, WagtailTestUtils):
def setUp(self):
self.login()
self.homepage = Page.objects.get(id=2)
self.homepage.save_revision()
self.revision = self.homepage.get_latest_revision()
def test_userbar_moderation(self):
response = self.client.get(r... | |
9,232 | [
0.008581281639635563,
-0.02887992560863495,
-0.0031806083861738443,
0.00587776442989707,
0.014987027272582054,
0.03432512655854225,
-0.02605554461479187,
0.04188225045800209,
0.05984633043408394,
-0.007849741727113724,
0.04450307413935661,
-0.03445235267281532,
-0.01810402423143387,
0.0290... | 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_userbar_moderation_anonymous_user_cannot_see(self):
# Logout
self.client.logout()
response = self.client.get(reverse('wagtailadmin_userbar_moderation', args=(self.revision.id, )))
# Check that the user received a forbidden message
self.assertEqual(response.status_code,... | |
9,233 | [
0.017209568992257118,
0.036324694752693176,
0.02199331298470497,
-0.012147931382060051,
0.006520580500364304,
0.00726493913680315,
-0.015234537422657013,
-0.017288967967033386,
-0.021199330687522888,
0.04803593456745148,
0.012038758024573326,
0.015343709848821163,
-0.01055996585637331,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _find_module(module, path=None):
mod_base = module
parent_path = None
while '.' in mod_base:
first, _, mod_base = mod_base.partition('.')
parent_path = path
_, path, _ = imp.find_module(first, path)
path = [path]
try:
_, path, _ = imp.find_modu... | |
9,234 | [
-0.03005947545170784,
0.021336954087018967,
0.011907771229743958,
-0.07543346285820007,
0.02468041144311428,
0.032548610121011734,
-0.005099563859403133,
-0.012920301407575607,
-0.009703409858047962,
0.0035359435714781284,
-0.03170483559370041,
-0.014027755707502365,
0.015303964726626873,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _get_import_type(module):
if module in module_cache:
return module_cache[module]
def cache_type(module_type):
module_cache[module] = module_type
return module_type
# Check static stdlib list
if module in py2_stdlib:
return cache_type('stdlib')
# Check if the mo... | |
9,235 | [
0.010384474880993366,
0.04682533070445061,
0.007000952493399382,
0.007338216993957758,
-0.03775183483958244,
-0.059271469712257385,
0.042625848203897476,
-0.003329124301671982,
0.03622870519757271,
0.0034705577418208122,
0.005189517512917519,
-0.020061781629920006,
0.01923494040966034,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mumesh", "annotation": null, "type_comment": null}}, {"_type": "arg... | def create_mesh(mu, mumesh, name):
mesh = bpy.data.meshes.new(name)
faces = []
for sm in mumesh.submeshes:
faces.extend(sm)
mesh.from_pydata(mumesh.verts, [], faces)
if mumesh.uvs:
create_uvs(mu, mumesh.uvs, mesh, name + ".UV")
if mumesh.uv2s:
create_uvs(mu, mumesh.uv2s, ... | |
9,236 | [
-0.017079051584005356,
0.005539758130908012,
-0.03278998285531998,
0.0005428317817859352,
0.0008964259177446365,
-0.07746689766645432,
0.02507469430565834,
-0.019714361056685448,
0.014511026442050934,
-0.00712094409391284,
-0.039428722113370895,
0.02545597217977047,
0.005029517225921154,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mulight", "annotation": null, "type_comment": null}}, {"_type": "ar... | def create_light(mu, mulight, transform):
ltype = ('SPOT', 'SUN', 'POINT', 'AREA')[mulight.type]
light = bpy.data.lamps.new(transform.name, ltype)
light.color = mulight.color[:3]
light.distance = mulight.range
light.energy = mulight.intensity
if ltype == 'SPOT' and hasattr(mulight, "spotAngle"):... | |
9,237 | [
0.010951399803161621,
0.06171402707695961,
-0.004394284915179014,
0.0008725861553102732,
-0.01567460596561432,
-0.04550936073064804,
0.011623439379036427,
-0.013582765124738216,
-0.010241499170660973,
-0.01902533695101738,
-0.000022110445570433512,
0.0015854446683079004,
0.048311103135347366... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mesh", "annotation": null, "type_comment": null}}, {"_type": "arg... | def create_mesh_object(name, mesh, transform):
obj = bpy.data.objects.new(name, mesh)
obj.rotation_mode = 'QUATERNION'
if transform:
obj.location = Vector(transform.localPosition)
obj.rotation_quaternion = Quaternion(transform.localRotation)
obj.scale = Vector(transform.localScale)
... | |
9,238 | [
-0.0008398348581977189,
0.028829239308834076,
-0.018195081502199173,
-0.01858084462583065,
-0.01582907885313034,
0.03669877350330353,
-0.03703309968113899,
-0.026771845296025276,
0.051126252859830856,
0.0219884030520916,
0.03605583682656288,
-0.04323100298643112,
-0.004719148389995098,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "action", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "curve", "annotation": null, "type_comment": null}}], "kwarg": n... | def create_fcurve(action, curve):
try:
dp, ind, mult = property_map[curve.property]
except KeyError:
print("%s: Unknown property: %s" % (curve.path, curve.property))
return False
fps = bpy.context.scene.render.fps
fc = action.fcurves.new(data_path = dp, index = ind)
fc.keyfra... | |
9,239 | [
-0.007005683612078428,
0.03420690447092056,
-0.03162826597690582,
-0.012881786562502384,
-0.05531523376703262,
0.0027697551995515823,
0.032769255340099335,
-0.0015617312164977193,
0.04992975667119026,
0.005630789790302515,
0.018609559163451195,
-0.0314457081258297,
0.00720535684376955,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def create_action(mu, path, clip):
#print(clip.name)
actions = {}
for curve in clip.curves:
if not curve.path:
#FIXME need to look into this more as I'm not sure if the animation
# is broken or if the property is somewhere weird
continue
name = ".".join([c... | |
9,240 | [
0.0019673272036015987,
0.04289154335856438,
-0.01453156117349863,
-0.012750272639095783,
-0.023461438715457916,
-0.012187760323286057,
0.005358512979000807,
-0.03698516637086868,
0.05507930368185043,
0.0006862939917482436,
-0.0037823074962943792,
-0.01421514805406332,
0.0154690807685256,
0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "muobj", "annotation": null, "type_comment": null}}], "kwarg": null,... | def create_collider(mu, muobj):
col = muobj.collider
name = muobj.transform.name
if type(col) == MuColliderMesh:
name = name + ".collider"
mesh = create_mesh(mu, col.mesh, name)
elif type(col) == MuColliderSphere:
mesh = collider.sphere(name, col.center, col.radius)
elif type... | |
9,241 | [
0.015593948774039745,
0.047750961035490036,
-0.03259751945734024,
0.0010062832152470946,
-0.027311434969305992,
-0.04486564174294472,
0.011018182151019573,
-0.004782254341989756,
0.034381572157144547,
0.01929420791566372,
0.005990895442664623,
-0.016805343329906464,
0.046869948506355286,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "muobj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def create_object(mu, muobj, parent, create_colliders, parents):
obj = None
mesh = None
if hasattr(muobj, "shared_mesh"):
mesh = create_mesh(mu, muobj.shared_mesh, muobj.transform.name)
for poly in mesh.polygons:
poly.use_smooth = True
obj = create_mesh_object(muobj.trans... | |
9,242 | [
-0.015995493158698082,
0.00863671489059925,
0.0018743055406957865,
0.006852929480373859,
0.009185162372887135,
-0.03252346068620682,
-0.0012965721543878317,
-0.020159434527158737,
-0.0069274757988750935,
0.02606988698244095,
0.03916872665286064,
0.00641630170866847,
-0.045324116945266724,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pixels", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "width", "annotation": null, "type_comment": null}}, {"_type": "... | def convert_bump(pixels, width, height):
outp = list(pixels)
for y in range(1, height - 1):
for x in range(1, width - 1):
index = (y * width + x) * 4
p = pixels[index:index + 4]
nx = (p[3]-128) / 127.
nz = (p[2]-128) / 127.
#n = [p[3],p[2],int(... | |
9,243 | [
0.02813936211168766,
0.027978038415312767,
0.03970853611826897,
-0.00012369306932669133,
-0.02267742156982422,
-0.028738562017679214,
0.03399308770895004,
-0.014853250235319138,
-0.014369281008839607,
0.021986037492752075,
0.03756524249911308,
0.017503559589385986,
0.019727513194084167,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mbmpath", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def load_mbm(mbmpath):
mbmfile = open(mbmpath, "rb")
header = mbmfile.read(20)
magic, width, height, bump, bpp = unpack("<5i", header)
if magic != 0x50534b03: # "\x03KSP" as little endian
raise
if bpp == 32:
pixels = mbmfile.read(width * height * 4)
elif bpp == 24:
pixels... | |
9,244 | [
0.022380713373422623,
0.023318452760577202,
-0.015264313668012619,
0.01822340302169323,
-0.004727769643068314,
-0.0020213492680341005,
0.026965217664837837,
0.0017204913310706615,
-0.03819725289940834,
-0.011596710421144962,
0.019900914281606674,
0.026527605950832367,
0.01484754029661417,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def load_image(name, path):
if name[-4:].lower() in [".dds", ".png", ".tga"]:
bpy.data.images.load(os.path.join(path, name))
elif name[-4:].lower() == ".mbm":
w,h, pixels = load_mbm(os.path.join(path, name))
img = bpy.data.images.new(name, w, h)
img.pixels[:] = map(lambda x: x / ... | |
9,245 | [
-0.035502754151821136,
0.02254876121878624,
0.03892495855689049,
-0.002020780462771654,
-0.06164168193936348,
-0.04379582777619362,
0.06067590415477753,
-0.0003628219710662961,
0.013751805759966373,
0.009327082894742489,
-0.0047265272587537766,
0.026600820943713188,
-0.00006507668149424717,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def create_textures(mu, path):
extensions = [".dds", ".mbm", ".tga", ".png"]
#texture info is in the top level object
for tex in mu.textures:
base, ext = os.path.splitext(tex.name)
ind = 0
if ext in extensions:
ind = extensions.index(ext)
lst = extensions[ind:] + ... | |
9,246 | [
0.000897967373020947,
0.05532245710492134,
0.0038123668637126684,
-0.010251527652144432,
-0.030115460976958275,
-0.02238207682967186,
0.009810533374547958,
0.023621974512934685,
0.014444172382354736,
-0.0007054316811263561,
-0.012149722315371037,
-0.005445325281471014,
0.0018997921142727137,... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def import_mu(self, context, filepath, create_colliders):
operator = self
undo = bpy.context.user_preferences.edit.use_global_undo
bpy.context.user_preferences.edit.use_global_undo = False
for obj in bpy.context.scene.objects:
obj.select = False
mu = Mu()
if not mu.read(filepath):
... | |
9,247 | [
-0.01710401475429535,
0.00011092761269537732,
0.022226480767130852,
-0.007399725262075663,
-0.04178796708583832,
-0.04692135751247406,
0.04397238790988922,
-0.0400841198861599,
0.03088770993053913,
-0.028047962114214897,
0.017224157229065895,
-0.002423341851681471,
0.028637755662202835,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mu", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mat", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def add_texture(mu, mat, mattex):
i, s, o = mattex.index, mattex.scale, mattex.offset
mat.texture_slots.add()
ts = mat.texture_slots[0]
ts.texture = bpy.data.textures[mu.textures[i].name]
ts.use_map_alpha = True
ts.texture_coords = 'UV'
ts.scale = s + (1,)
ts.offset = o + (0,) | |
9,248 | [
0.03574656695127487,
0.049551043659448624,
-0.005105842836201191,
-0.011832408607006073,
0.0009874507086351514,
0.028447648510336876,
-0.020389370620250702,
0.00459582544863224,
-0.03549722582101822,
-0.03295847028493881,
0.007236583158373833,
-0.043181490153074265,
0.01346446480602026,
0.... | 12 | {"_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": "orm", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _accept_with(cls, orm, target):
if isinstance(target, instrumentation.ClassManager):
return target
elif isinstance(target, mapperlib.Mapper):
return target.class_manager
elif target is orm.mapper:
return instrumentation.ClassManager
elif isinstance... | |
9,249 | [
0.019787536934018135,
0.07044940441846848,
0.013239782303571701,
0.0065089124254882336,
0.0013199553359299898,
0.07670861482620239,
-0.04834241047501564,
0.002376335673034191,
-0.053758177906274796,
0.009915964677929878,
0.004228296224027872,
0.00612603547051549,
0.01766784116625786,
0.029... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "event_key", "annotation": null, "type_comment": null}}, {"_type": ... | def _listen(cls, event_key, propagate=True, **kw):
target, identifier, fn = \
event_key.dispatch_target, event_key.identifier, \
event_key._listen_fn
def listen(target_cls, *arg):
listen_cls = target()
if propagate and issubclass(target_cls, listen_cls):
... | |
9,250 | [
0.034602995961904526,
0.06788778305053711,
0.008409077301621437,
0.01214949693530798,
0.01853182725608349,
0.051410164684057236,
-0.047543417662382126,
-0.0012159108882769942,
-0.02471642568707466,
0.003935404121875763,
0.006942569278180599,
0.0071952263824641705,
0.04064479097723961,
0.02... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "event_key", "annotation": null, "type_comment": null}}, {"_type": ... | def _listen(cls, event_key, raw=False, propagate=False, **kw):
target, identifier, fn = \
event_key.dispatch_target, event_key.identifier, \
event_key._listen_fn
if not raw:
def wrap(state, *arg, **kw):
return fn(state.obj(), *arg, **kw)
e... | |
9,251 | [
0.022902436554431915,
0.03294307738542557,
0.008985485881567001,
0.002968320157378912,
-0.01123463362455368,
0.05988842993974686,
-0.035097818821668625,
0.015927301719784737,
-0.028122682124376297,
-0.03489789366722107,
0.00887441635131836,
-0.010895873419940472,
0.03871867060661316,
0.013... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "_dispatch_target", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class HoldEvents(object):
_dispatch_target = None
@classmethod
def _listen(cls, event_key, raw=False, propagate=False, **kw):
target, identifier, fn = \
event_key.dispatch_target, event_key.identifier, event_key.fn
if target.class_ in target.all_holds:
... | |
9,252 | [
0.028494736179709435,
0.0612025260925293,
0.012854342348873615,
0.01348856557160616,
0.008216586895287037,
0.03157524764537811,
0.03395358473062515,
-0.03248128294944763,
-0.038234591484069824,
-0.01496086921542883,
0.02091803587973118,
-0.02083875797688961,
0.06840548664331436,
0.03073716... | 13 | {"_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": "class_", "annotation": null, "type_comment": null}}, {"_type": "ar... | def populate(cls, class_, subject):
for subclass in class_.__mro__:
if subclass in cls.all_holds:
collection = cls.all_holds[subclass]
for event_key, raw, propagate in collection.values():
if propagate or subclass is class_:
... | |
9,253 | [
0.032968778163194656,
0.046717457473278046,
0.015397120267152786,
0.014461835846304893,
-0.0015125302597880363,
0.06649872660636902,
-0.0300460122525692,
-0.011679364368319511,
-0.04989742487668991,
-0.010223828256130219,
0.009183323942124844,
-0.010153681971132755,
0.04335043206810951,
0.... | 12 | {"_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": "event_key", "annotation": null, "type_comment": null}}, {"_type": ... | def _listen(cls, event_key, raw=False, propagate=False, **kw):
target, identifier, fn = \
event_key.dispatch_target, event_key.identifier, event_key.fn
if target.class_ in target.all_holds:
collection = target.all_holds[target.class_]
else:
... | |
9,254 | [
0.03620595484972,
0.03976936265826225,
-0.02131444215774536,
-0.006158972159028053,
-0.0008612937526777387,
-0.02160039357841015,
-0.01722312532365322,
0.017025157809257507,
-0.022139305248856544,
-0.03328044340014458,
-0.014253620989620686,
-0.04786400869488716,
0.017399094998836517,
0.03... | 10 | {"_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": "orm", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _accept_with(cls, orm, target):
if target is orm.mapper:
return mapperlib.Mapper
elif isinstance(target, type):
if issubclass(target, mapperlib.Mapper):
return target
else:
mapper = _mapper_or_none(target)
if mapper ... | |
9,255 | [
-0.007057687267661095,
0.027829810976982117,
-0.007971590384840965,
-0.025164753198623657,
-0.007900835946202278,
0.027829810976982117,
-0.028183581307530403,
-0.016072895377874374,
-0.018926629796624184,
-0.05481057986617088,
0.040589071810245514,
-0.03997587412595749,
0.0015241538640111685... | 8 | {"_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": "WeakKeyDictionary", "value": {"_type": "Name", "_fields": {"... | class _InstanceEventsHold(_EventsHold):
all_holds = weakref.WeakKeyDictionary()
def resolve(self, class_):
return instrumentation.manager_of_class(class_)
class HoldInstanceEvents(_EventsHold.HoldEvents, InstanceEvents):
pass
dispatch = event.dispatcher(HoldInstanceEvents) | |
9,256 | [
0.04955580085515976,
0.065336674451828,
0.008341492153704166,
-0.0341598242521286,
-0.02648589201271534,
0.03319757431745529,
-0.02326235920190811,
0.00817911233752966,
0.00534047931432724,
0.0004600750980898738,
0.009520246647298336,
-0.025042518973350525,
0.03076789714396,
0.031345248222... | 13 | {"_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": "event_key", "annotation": null, "type_comment": null}}, {"_type": ... | def _listen(
cls, event_key, raw=False, retval=False, propagate=False, **kw):
target, identifier, fn = \
event_key.dispatch_target, event_key.identifier, \
event_key._listen_fn
if identifier in ("before_configured", "after_configured") and \
target is... | |
9,257 | [
0.011844107881188393,
0.04524515941739082,
0.0009907091734930873,
-0.01756080612540245,
-0.033922769129276276,
0.0031913600396364927,
-0.02761775255203247,
0.03609844297170639,
0.01386437751352787,
0.04127122461795807,
-0.0027001681737601757,
-0.004839766770601273,
0.041138019412755966,
0.... | 9 | {"_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": "arg", "annotation": null, "type_comment": nul... | def wrap(*arg, **kw):
if not raw and target_index is not None:
arg = list(arg)
arg[target_index] = arg[target_index].obj()
if not retval:
fn(*arg, **kw)
return interfaces.EXT_CONTINUE
else:
... | |
9,258 | [
0.01313806138932705,
0.029652120545506477,
-0.004878080915659666,
-0.015711374580860138,
-0.021849552169442177,
-0.005905045196413994,
-0.00739532383158803,
-0.02090521715581417,
0.011408748105168343,
-0.04669736698269844,
0.026346947997808456,
-0.047995828092098236,
0.012429810129106045,
... | 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": "WeakKeyDictionary", "value": {"_type": "Name", "_fields": {"... | class _MapperEventsHold(_EventsHold):
all_holds = weakref.WeakKeyDictionary()
def resolve(self, class_):
return _mapper_or_none(class_)
class HoldMapperEvents(_EventsHold.HoldEvents, MapperEvents):
pass
dispatch = event.dispatcher(HoldMapperEvents) | |
9,259 | [
0.052263230085372925,
0.044888924807310104,
0.020397236570715904,
-0.0024397901725023985,
0.020536575466394424,
0.03682864084839821,
-0.025509944185614586,
0.015488180331885815,
0.00028068976826034486,
-0.020075682550668716,
0.02001137100160122,
-0.0002845417184289545,
0.023087570443749428,
... | 10 | {"_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": "target", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _accept_with(cls, target):
if isinstance(target, scoped_session):
target = target.session_factory
if not isinstance(target, sessionmaker) and \
(
not isinstance(target, type) or
not issubclass(target, Session)
):
... | |
9,260 | [
0.050501685589551926,
0.05968381091952324,
0.01849050261080265,
-0.0003583180659916252,
0.018306860700249672,
0.07754304260015488,
-0.047884780913591385,
-0.007374393753707409,
-0.03238994628190994,
-0.0013880790211260319,
-0.0037818877026438713,
0.004180735908448696,
0.02541152946650982,
... | 12 | {"_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": "event_key", "annotation": null, "type_comment": null}}, {"_type": ... | def _listen(cls, event_key, active_history=False,
raw=False, retval=False,
propagate=False):
target, identifier, fn = \
event_key.dispatch_target, event_key.identifier, \
event_key._listen_fn
if active_history:
target.dispatch._active... | |
9,261 | [
0.03747578337788582,
0.04834677278995514,
-0.007012894377112389,
-0.02813195437192917,
0.0069274939596652985,
-0.007495156489312649,
-0.012217305600643158,
0.0017770854756236076,
0.01970241591334343,
0.004290123004466295,
0.007429850287735462,
0.013151688501238823,
0.02990024909377098,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "target", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": n... | def wrap(target, value, *arg):
if not raw:
target = target.obj()
if not retval:
fn(target, value, *arg)
return value
else:
return fn(target, value, *arg) | |
9,262 | [
-0.006308624520897865,
0.06169438734650612,
0.014043054543435574,
-0.008916943334043026,
-0.004843213129788637,
0.011700659990310669,
-0.019825488328933716,
-0.009188525378704071,
-0.01915784925222397,
0.015050171874463558,
-0.0055108522064983845,
-0.018365735188126564,
0.03514724224805832,
... | 10 | {"_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": "event_key", "annotation": null, "type_comment": null}}, {"_type": ... | def _listen(
cls, event_key, retval=False, **kw):
fn = event_key._listen_fn
if not retval:
def wrap(*arg, **kw):
if not retval:
query = arg[0]
fn(*arg, **kw)
return query
else:
... | |
9,263 | [
0.017532842233777046,
-0.018133513629436493,
0.04941382631659508,
-0.034771014004945755,
0.01187745202332735,
0.005709223449230194,
-0.0007572158938273787,
-0.026860268786549568,
-0.018677519634366035,
0.032594989985227585,
-0.018133513629436493,
-0.010959442704916,
-0.03055497072637081,
-... | 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": "testname", "annotation... | class BuilderTest(unittest.TestCase):
def _mock_test_result(self, testname):
return test_results.TestResult(testname, [test_failures.FailureTextMismatch()])
def _install_fetch_build(self, failure):
def _mock_fetch_build(build_number):
build = Build(
builder=self.buil... | |
9,264 | [
0.04702981188893318,
-0.0010137505596503615,
0.04883594438433647,
-0.050055671483278275,
-0.018753284588456154,
0.011786773800849915,
0.05019640922546387,
-0.008708138950169086,
-0.007136568892747164,
0.014871273189783096,
0.013862653635442257,
0.009669845923781395,
-0.0021022679284214973,
... | 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_build_and_revision_for_filename(self):
expectations = {
"r47483 (1)/" : (47483, 1),
"r47483 (1).zip" : (47483, 1),
"random junk": None,
}
for filename, revision_and_build in expectations.items():
self.assertEqual(self.builder._revision_and... | |
9,265 | [
0.000160023060743697,
-0.03155386447906494,
0.01732991822063923,
-0.041130613535642624,
0.0034589245915412903,
-0.013200385496020317,
-0.017365213483572006,
0.006670783273875713,
-0.03595399111509323,
0.01729462295770645,
-0.010870905593037605,
-0.03487160801887512,
-0.006823728792369366,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_fetch_build(self):
buildbot = BuildBot()
builder = Builder(u"Test Builder \u2661", buildbot)
def mock_fetch_build_dictionary(self, build_number):
build_dictionary = {
"sourceStamp": {
"revision": None, # revision=None means a trunk build... | |
9,266 | [
0.004924312233924866,
-0.024938680231571198,
0.01702866703271866,
-0.01596362702548504,
0.0062406533397734165,
-0.01839287392795086,
-0.00030047728796489537,
-0.004328967072069645,
0.005510682240128517,
0.029821109026670456,
0.029127037152647972,
-0.04781908169388771,
-0.05590859428048134,
... | 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_status_parsing(self):
buildbot = BuildBot()
soup = BeautifulSoup(self._example_one_box_status)
status_table = soup.find("table")
input_rows = status_table.findAll('tr')
for x in range(len(input_rows)):
status_row = input_rows[x]
expected_parsing... | |
9,267 | [
0.020103707909584045,
-0.0036111301742494106,
0.04811545088887215,
-0.04008385166525841,
-0.004207321908324957,
0.020783305168151855,
0.0039107706397771835,
-0.030841337516903877,
-0.002621081192046404,
0.019572386518120766,
0.03286777064204216,
-0.027134444564580917,
-0.05589992180466652,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\n <table>\n <tr>\n <td class=\"box\"><a href=\"builders/Windows%20Debug%20%28Tests%29\">Windows Debug (Tests)</a></td>\n <... | class BuildBotTest(unittest.TestCase):
_example_one_box_status = '''
<table>
<tr>
<td class="box"><a href="builders/Windows%20Debug%20%28Tests%29">Windows Debug (Tests)</a></td>
<td align="center" class="LastBuild box success"><a href="builders/Windows%20Debug%20%28Tests%29/builds/3693">47380</a>... | |
9,268 | [
0.038604918867349625,
0.007058457005769014,
0.06564110517501831,
-0.027010703459382057,
-0.03455331549048424,
0.02876894734799862,
0.008740255609154701,
-0.012670822441577911,
-0.023749032989144325,
0.045230187475681305,
-0.0010957171907648444,
-0.042529117316007614,
-0.03671926632523537,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_revisions_for_builder(self):
buildbot = BuildBot()
buildbot._fetch_builder_page = lambda builder: builder.page
builder_with_success = Builder('Some builder', None)
builder_with_success.page = self._fake_builder_page
self.assertEqual(buildbot._revisions_for_builder(builde... | |
9,269 | [
0.020548472180962563,
-0.01953059248626232,
0.029722126200795174,
-0.02459454908967018,
-0.0029343601781874895,
0.0018703563837334514,
-0.003874309593811631,
-0.011737440712749958,
-0.04496489465236664,
0.026541247963905334,
0.0033749116118997335,
-0.017978323623538017,
-0.027788151055574417... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_builder_with_name(self):
buildbot = BuildBot()
builder = buildbot.builder_with_name("Test Builder")
self.assertEqual(builder.name(), "Test Builder")
self.assertEqual(builder.url(), "http://build.chromium.org/p/chromium.webkit/builders/Test%20Builder")
self.assertEqual(b... | |
9,270 | [
0.015493785962462425,
-0.020803391933441162,
0.02127188630402088,
-0.04310150444507599,
-0.0412498340010643,
-0.004726775921881199,
-0.001009494299069047,
-0.0167654138058424,
-0.033865466713905334,
-0.014188693836331367,
0.009358737617731094,
-0.03100988082587719,
-0.004461853299289942,
-... | 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": "build_number", "annotation": null, "type_comment": null}}], "kwar... | def mock_fetch_build_dictionary(self, build_number):
build_dictionary = {
"sourceStamp": {
"revision" : 2 * build_number,
},
"number" : int(build_number),
"results" : build_number % 2, # 0 means pass
}
... | |
9,271 | [
0.010209420695900917,
0.0046888478100299835,
0.08367150276899338,
-0.04879451543092728,
-0.022331807762384415,
0.010119317099452019,
-0.01960097812116146,
-0.027128085494041443,
-0.0025159670040011406,
0.0059295035898685455,
0.024203186854720116,
-0.019711874425411224,
-0.027044912800192833,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_find_green_revision(self):
buildbot = BuildBot()
self.assertEqual(buildbot._find_green_revision({
'Builder 1': [(1, True), (3, True)],
'Builder 2': [(1, True), (3, False)],
'Builder 3': [(1, True), (3, True)],
}), 1)
self.assertEqual(buildbot.... | |
9,272 | [
0.005175807047635317,
0.001468926900997758,
-0.0008856765343807638,
-0.01266157440841198,
0.02134840562939644,
-0.07419521361589432,
0.03382564336061478,
0.034954700618982315,
0.003657916095107794,
0.04472450539469719,
-0.0034246158320456743,
-0.013226103037595749,
0.0017555117374286056,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_create_subnet_merge_plurar(self):
resource = 'subnet'
cmd = CreateSubnet(MyApp(sys.stdout), None)
name = 'myname'
myid = 'myid'
netid = 'netid'
cidr = 'prefixvalue'
args = ['--tenant_id', 'tenantid',
netid, cidr,
'--allocat... | |
9,273 | [
0.013856437057256699,
-0.0034351693466305733,
0.013219758868217468,
-0.013891165144741535,
0.01954023912549019,
-0.07473446428775787,
0.029078839346766472,
0.032482173293828964,
0.0005227274377830327,
0.050795361399650574,
-0.007669080514460802,
-0.01747971586883068,
0.007854295894503593,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_create_subnet_merge_single_plurar(self):
resource = 'subnet'
cmd = CreateSubnet(MyApp(sys.stdout), None)
name = 'myname'
myid = 'myid'
netid = 'netid'
cidr = 'prefixvalue'
args = ['--tenant_id', 'tenantid',
'--allocation-pool', 'start=1.1.... | |
9,274 | [
0.0199228934943676,
0.028713088482618332,
-0.05060739815235138,
-0.0500507615506649,
0.0024700677022337914,
-0.015307461842894554,
-0.025094959884881973,
0.013243273831903934,
0.03029021993279457,
0.034279435873031616,
0.0008929352625273168,
-0.023065561428666115,
0.02060709148645401,
0.00... | 16 | {"_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 Filter(_base.Filter):
def __iter__(self):
open_elements = []
contentModelFlag = "PCDATA"
for token in _base.Filter.__iter__(self):
type = token["type"]
if type in ("StartTag", "EmptyTag"):
name = token["name"]
if contentModelFlag ... | |
9,275 | [
0.017990153282880783,
-0.01017457153648138,
0.018471112474799156,
-0.015127303078770638,
0.012550737708806992,
-0.07278511673212051,
0.032453276216983795,
0.028811728581786156,
0.00226880912669003,
0.05304289609193802,
-0.005161719862371683,
-0.024116653949022293,
0.009682160802185535,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_create_subnet_merge_single_single(self):
resource = 'subnet'
cmd = CreateSubnet(MyApp(sys.stdout), None)
name = 'myname'
myid = 'myid'
netid = 'netid'
cidr = 'prefixvalue'
args = ['--tenant_id', 'tenantid',
'--allocation-pool', 'start=1.1.... | |
9,276 | [
-0.012331027537584305,
0.02435704693198204,
0.0084639647975564,
-0.005816933698952198,
0.0008619192522019148,
-0.026448529213666916,
-0.03986886888742447,
-0.011328859254717827,
-0.022570572793483734,
-0.005620857235044241,
0.0052232579328119755,
0.005838719662278891,
-0.03751595318317413,
... | 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class NumaHostInfo(fakelibvirt.HostInfo):
def __init__(self, **kwargs):
super(NumaHostInfo, self).__init__(**kwargs)
self.numa_mempages_list = []
def get_numa_topology(self):
if self.numa_topology:
return self.numa_topology
topology = self._gen_numa_topology(self.cp... | |
9,277 | [
0.03578405827283859,
0.028288263827562332,
-0.02895667776465416,
-0.039412591606378555,
0.014430595561861992,
-0.02640237845480442,
-0.020864086225628853,
-0.01673423871397972,
0.031057409942150116,
0.03547372296452522,
-0.002979518147185445,
-0.02465972676873207,
0.01716393418610096,
-0.0... | 15 | {"_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 __iter__(self):
open_elements = []
contentModelFlag = "PCDATA"
for token in _base.Filter.__iter__(self):
type = token["type"]
if type in ("StartTag", "EmptyTag"):
name = token["name"]
if contentModelFlag != "PCDATA":
... | |
9,278 | [
-0.039890531450510025,
0.038019873201847076,
0.031270336359739304,
-0.06360239535570145,
-0.0012228799751028419,
0.018883541226387024,
-0.03359602019190788,
0.0033084116876125336,
0.01678537018597126,
-0.0012568488018587232,
0.0358964242041111,
-0.030006377026438713,
-0.027124552056193352,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class NUMAServersTest(ServersTestBase):
def setUp(self):
super(NUMAServersTest, self).setUp()
# Replace libvirt with fakelibvirt
self.useFixture(fixtures.MonkeyPatch(
'nova.virt.libvirt.driver.libvirt_utils',
fake_libvirt_utils))
self.useFixture(fixtures.Monke... | |
9,279 | [
0.0037823787424713373,
0.029342735186219215,
0.030749140307307243,
-0.0002427248255116865,
0.01574748009443283,
-0.015662243589758873,
-0.02112804725766182,
0.003998134285211563,
0.005010319873690605,
-0.02563493885099888,
-0.029704991728067398,
0.015097551047801971,
-0.027552764862775803,
... | 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 get_numa_topology(self):
if self.numa_topology:
return self.numa_topology
topology = self._gen_numa_topology(self.cpu_nodes, self.cpu_sockets,
self.cpu_cores, self.cpu_threads,
self.kB_mem)
sel... | |
9,280 | [
-0.018627963960170746,
-0.0063529605977237225,
0.037797652184963226,
-0.03944745287299156,
-0.00733791571110487,
0.0002910619368776679,
-0.03375933691859245,
0.002714782487601042,
0.01883726567029953,
-0.0007868098327890038,
0.032528143376111984,
-0.031789425760507584,
-0.023269563913345337,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
super(NUMAServersTest, self).setUp()
# Replace libvirt with fakelibvirt
self.useFixture(fixtures.MonkeyPatch(
'nova.virt.libvirt.driver.libvirt_utils',
fake_libvirt_utils))
self.useFixture(fixtures.MonkeyPatch(
'nova.virt.libvirt.driver.... | |
9,281 | [
0.011829792521893978,
0.02514064311981201,
0.008649874478578568,
-0.03021855466067791,
0.013740232214331627,
-0.022639025002717972,
0.013080601580440998,
0.05005726218223572,
0.006300718057900667,
0.018034055829048157,
0.050032369792461395,
-0.03432568907737732,
0.001413383288308978,
-0.06... | 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": "flavor_id", "annotation": null, "type_comment": null}}, {"_type":... | def _run_build_test(self, flavor_id, filter_mock, end_status='ACTIVE'):
self.compute = self.start_service('compute', host='test_compute0')
fake_network.set_stub_network_methods(self)
# Create server
good_server = self._build_server(flavor_id)
post = {'server': good_server}
... | |
9,282 | [
-0.00259799906052649,
0.04231593757867813,
0.02165660262107849,
-0.03209393098950386,
-0.009474055841565132,
-0.002398262033239007,
-0.014981700107455254,
0.007422854658216238,
-0.02166793681681156,
-0.029147453606128693,
0.03855351358652115,
0.01616029068827629,
-0.035335052758455276,
-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": "img_mock", "annotation": null, "type_comment": null}}], "kwarg": ... | def test_create_server_with_numa_topology(self, img_mock):
host_info = NumaHostInfo(cpu_nodes=2, cpu_sockets=1, cpu_cores=2,
cpu_threads=2, kB_mem=15740000)
fake_connection = fakelibvirt.Connection('qemu:///system',
versi... | |
9,283 | [
-0.00564369885250926,
0.05415315553545952,
0.028723571449518204,
-0.05068349093198776,
-0.02169639803469181,
-0.009794123470783234,
-0.019533347338438034,
0.005410374607890844,
-0.012945371679961681,
-0.02411198988556862,
0.04110896587371826,
0.005443314556032419,
-0.04130660369992256,
-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": "img_mock", "annotation": null, "type_comment": null}}], "kwarg": ... | def test_create_server_with_numa_fails(self, img_mock):
host_info = NumaHostInfo(cpu_nodes=1, cpu_sockets=1, cpu_cores=2,
kB_mem=15740000)
fake_connection = fakelibvirt.Connection('qemu:///system',
version=1002007,
... | |
9,284 | [
-0.01639767363667488,
0.04116914048790932,
0.0021899763960391283,
-0.027968954294919968,
0.02276851423084736,
-0.004066236782819033,
-0.055648323148489,
0.04032452404499054,
-0.0025956949684768915,
0.015528922900557518,
0.02830680087208748,
-0.051642417907714844,
0.009411468170583248,
0.02... | 19 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def make_request(module):
# Create client and authenticate.
api_client = ingate_create_client(**module.params)
if module.params.get('add'):
# Add a row to a table.
table = module.params['table']
columns = module.params['columns']
response = api_client.add_row(table, **column... | |
9,285 | [
0.018938956782221794,
0.03225323557853699,
-0.017089400440454483,
-0.03344404324889183,
0.02311946265399456,
0.02933954820036888,
0.010489268228411674,
0.011996784247457981,
0.0038669677451252937,
0.025209715589880943,
0.04973534867167473,
-0.07489439100027084,
0.023550180718302727,
0.0001... | 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():
argument_spec = ingate_argument_spec(
add=dict(type='bool'),
delete=dict(type='bool'),
get=dict(type='bool'),
modify=dict(type='bool'),
revert=dict(type='bool'),
factory=dict(type='bool'),
store=dict(type='bool'),
no_response=dict(type='boo... | |
9,286 | [
0.020084425806999207,
0.04269066080451012,
-0.008550516329705715,
-0.03902052715420723,
-0.06309030950069427,
-0.0032085543498396873,
0.005077396519482136,
-0.03289612755179405,
0.03082463890314102,
0.0501209981739521,
0.005769769195467234,
-0.06660283356904984,
0.03138754144310951,
0.0079... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "required_together", "annotation": null, "type_comment": null}}]... | def map_params_to_obj(module, required_together=None):
obj = []
aggregate = module.params.get('aggregate')
if aggregate:
for item in aggregate:
for key in item:
if item.get(key) is None:
item[key] = module.params[key]
module._check_requir... | |
9,287 | [
-0.013800648972392082,
0.03516726940870285,
0.01979806460440159,
-0.057100676000118256,
-0.04589671269059181,
0.026863154023885727,
-0.016608230769634247,
0.0030234227888286114,
0.04550127685070038,
0.027179500088095665,
0.03319009765982628,
-0.03917433321475983,
0.010380144231021404,
0.00... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "updates", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg":... | def map_obj_to_commands(updates, module):
commands = list()
want, have = updates
purge = module.params['purge']
for w in want:
group = w['group']
mode = w['mode']
min_links = w['min_links']
members = w.get('members') or []
state = w['state']
del w['state'... | |
9,288 | [
0.00494247255846858,
0.014734270051121712,
-0.009043793193995953,
-0.05532407760620117,
-0.01237452868372202,
0.055369239300489426,
0.03522675856947899,
-0.020515071228146553,
0.0449141189455986,
-0.026645882055163383,
-0.012453562580049038,
0.010895456187427044,
0.023755481466650963,
0.03... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "member", "annotation": null, "type_comment": null}}, {"_type": "... | def parse_mode(group, member, config):
mode = None
for line in config.strip().split('!'):
match_int = re.findall(r'interface {}\\b'.format(member), line, re.M)
if match_int:
match = re.search(r'channel-group {} mode (\S+)'.format(group), line, re.M)
if match:
... | |
9,289 | [
0.02904299646615982,
0.012499377131462097,
0.021065616980195045,
-0.05124188959598541,
-0.022732200101017952,
0.043464500457048416,
-0.006588560529053211,
0.004524774383753538,
0.03044292703270912,
0.00040518815512768924,
0.017865777015686035,
0.0007249639020301402,
0.031242888420820236,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": n... | def parse_members(group, config):
members = []
for line in config.strip().split('!'):
match_group = re.findall(r'channel-group {} mode'.format(group), line, re.M)
if match_group:
match = re.search(r'interface (\S+)', line, re.M)
if match:
members.append(m... | |
9,290 | [
0.015433943830430508,
0.0011004937114194036,
-0.023492373526096344,
-0.0402238629758358,
-0.02080623060464859,
0.0471668615937233,
0.01626482792198658,
0.0030987397767603397,
0.020726557821035385,
-0.009025897830724716,
0.010909613221883774,
-0.0005178793799132109,
0.03216543048620224,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_channel(group, module):
channel = {}
config = get_config(module, flags=['| section channel-group'])
for line in config.split('\n'):
l = line.strip()
match = re.search(r'interface (\S+)', l, re.M)
if match:
member = match.group(1)
channel['mode'] = pa... | |
9,291 | [
-0.029606739059090614,
-0.002437208779156208,
0.03771200776100159,
-0.06322108209133148,
-0.03107019141316414,
-0.007108994759619236,
-0.011431803926825523,
-0.012067842297255993,
0.023347672075033188,
0.032263465225696564,
0.013970328494906425,
-0.014848398976027966,
0.0037486860528588295,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": n... | def parse_min_links(group, config):
min_links = ''
for line in config.strip().split('!'):
match_pc = re.findall(r'interface Port-Channel{}\\b'.format(group), line, re.M)
if match_pc:
match = re.search(r'port-channel min-links (\S+)', line, re.M)
if match:
... | |
9,292 | [
0.031513649970293045,
0.02813718654215336,
0.016937483102083206,
-0.06514586508274078,
-0.021958040073513985,
0.007337736897170544,
-0.014918225817382336,
-0.042834728956222534,
0.04164303466677666,
0.004063340835273266,
0.023149732500314713,
-0.01907811500132084,
0.032837752252817154,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def map_config_to_obj(module):
objs = list()
config = get_config(module, flags=['| section port-channel'])
for line in config.split('\n'):
l = line.strip()
match = re.search(r'interface Port-Channel(\S+)', l, re.M)
if match:
obj = {}
group = match.group(1)
... | |
9,293 | [
0.047692157328128815,
0.06381993740797043,
-0.00015677788178436458,
-0.03419090062379837,
-0.0077701350674033165,
0.03732429817318916,
0.03103446215391159,
0.0013795014237985015,
0.012625749222934246,
0.049950044602155685,
0.02886873111128807,
-0.004432260058820248,
-0.007459099404513836,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "modify_times", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya... | def _reload_on_update(modify_times):
if _reload_attempted:
# We already tried to reload and it didn't work, so don't try again.
return
if process.task_id() is not None:
# We're in a child process created by fork_processes. If child
# processes restarted themselves, they'd all re... | |
9,294 | [
0.010481596924364567,
0.029570916667580605,
-0.008232949301600456,
-0.04110430181026459,
-0.022329306229948997,
0.042264893651008606,
0.021265430375933647,
0.011037713848054409,
0.009194064885377884,
0.07069939374923706,
0.009381451644003391,
0.015123964287340641,
-0.020044391974806786,
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": "Global", "_fields": {"names": ["_reload_attempted"]}}, {"_type... | def _reload():
global _reload_attempted
_reload_attempted = True
for fn in _reload_hooks:
fn()
if hasattr(signal, "setitimer"):
# Clear the alarm signal set by
# ioloop.set_blocking_log_threshold so it doesn't fire
# after the exec.
signal.setitimer(signal.ITIMER_... | |
9,295 | [
0.02190614491701126,
0.07009048014879227,
0.0018059086287394166,
-0.037018973380327225,
0.0019278324907645583,
0.03343871235847473,
0.034471482038497925,
-0.028504380956292152,
0.03940581530332565,
0.026438845321536064,
0.0520973801612854,
-0.006707250606268644,
0.017258690670132637,
0.007... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "modify_times", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwar... | def _check_file(modify_times, path):
try:
modified = os.stat(path).st_mtime
except Exception:
return
if path not in modify_times:
modify_times[path] = modified
return
if modify_times[path] != modified:
gen_log.info("%s modified; restarting server", path)
_... | |
9,296 | [
-0.03304101526737213,
0.007347582373768091,
0.03366486728191376,
-0.020148087292909622,
-0.017282992601394653,
-0.037407971918582916,
0.005172767210751772,
0.0003460425359662622,
0.003624691627919674,
0.04406238719820976,
0.03068424202501774,
0.002960405545309186,
0.017571812495589256,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_all_good():
src = Rectilinear([0, 1, 2], [0, 2])
dst = Rectilinear([0.5, 1.5, 2.5], [0.25, 1.25])
src_vals = np.arange(src.get_point_count())
mapper = NearestVal()
mapper.initialize(dst, src)
dst_vals = mapper.run(src_vals)
assert_array_almost_equal(dst_vals, np.array([0.0, 1.0, ... | |
9,297 | [
-0.04195520654320717,
0.0004118660290259868,
0.018689369782805443,
-0.011620134115219116,
-0.022882333025336266,
-0.04302901402115822,
0.01069333590567112,
-0.015813099220395088,
-0.010392925702035427,
0.03226536884903908,
0.022383779287338257,
-0.004560487344861031,
0.01968647725880146,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_some_bad():
src = Rectilinear([0, 1, 2], [0, 2])
dst = Rectilinear([0.5, 1.5, 2.5], [0.25, 1.25])
mapper = NearestVal()
mapper.initialize(dst, src)
src_vals = np.arange(src.get_point_count())
src_vals[2] = -999
dst_vals = np.zeros(dst.get_point_count()) - 1
rv = mapper.run(src... | |
9,298 | [
-0.03585568442940712,
-0.010664410889148712,
0.03714527562260628,
-0.00048675734433345497,
-0.04230363667011261,
-0.0463494136929512,
0.012624083086848259,
-0.00460206950083375,
0.014122284948825836,
0.04667813330888748,
-0.008666809648275375,
0.01710604317486286,
-0.0074214693158864975,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_destination_init_zero():
src = Rectilinear([0, 1, 2], [0, 2])
dst = Rectilinear([0.5, 1.5, 2.5], [0.25, 1.25])
mapper = NearestVal()
mapper.initialize(dst, src)
src_vals = np.arange(src.get_point_count())
src_vals[2] = -999
dst_vals = mapper.run(src_vals)
assert_array_almost_e... | |
9,299 | [
-0.03632208704948425,
-0.00302634434774518,
0.029867473989725113,
-0.01875648833811283,
-0.014171568676829338,
-0.037632063031196594,
-0.001702970010228455,
-0.016124624758958817,
-0.01337367296218872,
0.03801314905285835,
0.000060846938140457496,
0.019340023398399353,
0.008884024806320667,
... | 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_no_destination():
src = Rectilinear([0, 1, 2], [0, 2])
dst = Rectilinear([0.5, 1.5, 2.5], [0.25, 1.25])
mapper = NearestVal()
mapper.initialize(dst, src)
src_vals = np.arange(src.get_point_count())
dst_vals = mapper.run(src_vals)
assert_array_almost_equal(dst_vals, np.array([0.0, ... | |
9,300 | [
-0.014990169554948807,
0.03511533886194229,
0.03883765637874603,
-0.04188726469874382,
-0.02502472512423992,
-0.05157425254583359,
-0.015292887575924397,
-0.02280478924512863,
-0.010410151444375515,
-0.004599638748914003,
0.008902165107429028,
0.01470987405627966,
0.023746579885482788,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_find_mapper():
src = Rectilinear([0, 1, 2], [0, 2])
dst = Rectilinear([0.5, 1.5, 2.5], [0.25, 1.25])
mappers = find_mapper(dst, src)
assert len(mappers) == 3
assert mappers[0].name == "PointToPoint"
assert isinstance(mappers[0], NearestVal) |