Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
15,201 | [
0.0070463973097503185,
0.02382405661046505,
-0.03167043253779411,
-0.005375206936150789,
-0.02428431808948517,
0.035462118685245514,
-0.002610892988741398,
0.0057697175070643425,
0.003942366223782301,
-0.026936305686831474,
-0.007545014843344688,
0.008936760947108269,
0.020711805671453476,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "cart_discount_title"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Load",... | class CartDiscountView(DiscountView):
title = _('cart_discount_title', default=u'Discount for Cart')
default_form = 'cart_discount_form'
related_forms = [
('cart_discount_form',
_('cart_discount_form',
default=u'General Rules for Cart')),
('user_cart_discount_form',
... | |
15,202 | [
0.014229416847229004,
0.036026958376169205,
-0.02203264646232128,
0.00009769779717316851,
-0.03304896876215935,
0.02108103223145008,
-0.005256264004856348,
0.0022236963268369436,
0.004595732316374779,
-0.01773359254002571,
-0.019972683861851692,
0.005552943330258131,
0.028526006266474724,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "cart_item_discount_title"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "L... | class ItemDiscountView(DiscountView):
title = _('cart_item_discount_title', default=u'Discount for Cart Items')
default_form = 'cart_item_discount_form'
related_forms = [
('cart_item_discount_form',
_('cart_item_discount_form',
default=u'General Rules for Cart Items')),
(... | |
15,203 | [
-0.02888181433081627,
-0.06253185123205185,
0.02042389288544655,
-0.006789042614400387,
-0.025180764496326447,
0.0001210681875818409,
0.011386972852051258,
-0.007129630073904991,
0.04087049141526222,
0.06657349318265915,
0.010660386644303799,
-0.01897072046995163,
-0.0126584991812706,
0.05... | 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_fully_connected():
cm = np.array([
[0, 0, 1],
[1, 0, 1],
[1, 1, 0]
])
assert not utils.fully_connected(cm, (0,), (0, 1, 2))
assert not utils.fully_connected(cm, (2,), (2,))
assert not utils.fully_connected(cm, (0, 1), (1, 2))
assert utils.fully_connected(cm, (0, ... | |
15,204 | [
0.011308456771075726,
-0.0267766322940588,
0.04814812168478966,
-0.00965204183012247,
-0.03688948228955269,
-0.010025669820606709,
0.015343633480370045,
0.021570757031440735,
0.0453832782804966,
0.036789849400520325,
0.03322793170809746,
0.021446214988827705,
-0.024522414430975914,
0.06411... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def test_marginalize_out(s):
marginalized_distribution = utils.marginalize_out([0], s.tpm)
assert np.array_equal(marginalized_distribution,
np.array([[[[0., 0., 0.5],
[1., 1., 0.5]],
[[1., 0., 0.5],
... | |
15,205 | [
-0.0024111790116876364,
-0.06175214797258377,
0.040569473057985306,
-0.03570113703608513,
0.024752788245677948,
0.009861086495220661,
-0.00483858585357666,
-0.011207993142306805,
0.006350474897772074,
0.018240034580230713,
0.010537244379520416,
-0.0011656961869448423,
0.03989872336387634,
... | 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_comb_indices():
n, k = 3, 2
data = np.arange(6).reshape(2, 3)
assert np.array_equal(data[:, utils.comb_indices(n, k)],
np.asarray([[[0, 1],
[0, 2],
[1, 2]],
... | |
15,206 | [
-0.04138200357556343,
-0.03858756273984909,
0.03943804278969765,
0.0056982263922691345,
-0.003104257630184293,
-0.030763132497668266,
-0.00016962170775514096,
-0.018163856118917465,
0.023837782442569733,
0.04337455704808235,
0.03355757147073746,
-0.018261054530739784,
0.006251039449125528,
... | 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_hamming_matrix():
H = utils._hamming_matrix(3)
answer = np.array([[0., 1., 1., 2., 1., 2., 2., 3.],
[1., 0., 2., 1., 2., 1., 3., 2.],
[1., 2., 0., 1., 2., 3., 1., 2.],
[2., 1., 1., 0., 3., 2., 2., 1.],
... | |
15,207 | [
0.007909616455435753,
-0.03219802677631378,
0.023011913523077965,
0.019911017268896103,
-0.01278828177601099,
-0.01535293273627758,
0.015387904830276966,
-0.018640348687767982,
0.0465833842754364,
0.03749053180217743,
0.017870953306555748,
0.0006950786919333041,
-0.00746080232784152,
0.053... | 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_block_reducible():
cm1 = np.array([
[1, 0, 0, 1, 1, 0],
[1, 0, 1, 0, 0, 1],
[0, 0, 0, 1, 0, 0],
[0, 1, 0, 0, 0, 0],
[1, 1, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 0],
])
cm2 = np.array([
[1, 0, 0],
[0, 1, 1],
[0, 1, 1]
])
cm3 = np... | |
15,208 | [
0.01783175952732563,
-0.03421398252248764,
0.021855462342500687,
0.02193043939769268,
-0.02046841010451317,
-0.02299259789288044,
0.014745252206921577,
-0.04406081512570381,
0.06322964280843735,
0.044135790318250656,
0.018431564792990685,
-0.007453850004822016,
-0.013958006165921688,
0.052... | 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_block_cm():
cm1 = np.array([
[1, 0, 0, 1, 1, 0],
[1, 0, 1, 0, 0, 1],
[0, 0, 0, 1, 0, 0],
[0, 1, 0, 0, 0, 0],
[1, 1, 0, 0, 0, 1]
])
cm2 = np.array([
[1, 0, 0],
[0, 1, 1],
[0, 1, 1]
])
cm3 = np.array([
[1, 1, 0, 0, 0],
... | |
15,209 | [
0.01510973833501339,
-0.03552230820059776,
0.04319920763373375,
-0.0177722480148077,
-0.01163738314062357,
0.0043016159906983376,
0.0157088041305542,
-0.020601164549589157,
0.06256896257400513,
0.021910231560468674,
0.02052350714802742,
0.01023956574499607,
0.011482070200145245,
0.05910770... | 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_get_outputs_from_cm():
cm = np.array([
[0, 1, 0],
[1, 1, 1],
[0, 0, 0],
])
assert utils.get_outputs_from_cm(0, cm) == (1,)
assert utils.get_outputs_from_cm(1, cm) == (0, 1, 2)
assert utils.get_outputs_from_cm(2, cm) == tuple() | |
15,210 | [
0.010805267840623856,
-0.02534346841275692,
0.029863465577363968,
-0.012165764346718788,
-0.015347752720117569,
-0.013267654925584793,
0.018113721162080765,
-0.014549444429576397,
0.055319372564554214,
0.04387320950627327,
0.035755205899477005,
0.004081490449607372,
0.01435830071568489,
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_get_inputs_from_cm():
cm = np.array([
[0, 1, 0],
[1, 1, 1],
[0, 0, 0],
])
assert utils.get_inputs_from_cm(0, cm) == (1,)
assert utils.get_inputs_from_cm(1, cm) == (0, 1)
assert utils.get_inputs_from_cm(2, cm) == (1,) | |
15,211 | [
-0.017953883856534958,
-0.05680658668279648,
0.020387152209877968,
-0.007430565543472767,
0.01516813226044178,
0.013962868601083755,
-0.012985012494027615,
-0.014986204914748669,
0.013201050460338593,
0.052440349012613297,
-0.012393751181662083,
0.012689381837844849,
0.013837793841958046,
... | 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_strongly_connected():
# Strongly connected
cm = np.array([[0, 1, 0],
[0, 0, 1],
[1, 0, 0]])
assert utils.strongly_connected(cm)
# Disconnected
cm = np.array([[0, 0, 1],
[0, 1, 0],
[1, 0, 0]])
assert not utils.s... | |
15,212 | [
-0.018440362066030502,
-0.06419239938259125,
0.08657002449035645,
-0.029853451997041702,
-0.00209634518250823,
0.029529498890042305,
0.018440362066030502,
-0.00443253992125392,
-0.002211597515270114,
0.04418211057782173,
0.0015932846581563354,
-0.008902458474040031,
-0.006859067361801863,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_relevant_connections():
cm = utils.relevant_connections(2, (0, 1), (1,))
assert np.array_equal(cm, [
[0, 1],
[0, 1],
])
cm = utils.relevant_connections(3, (0, 1), (0, 2))
assert np.array_equal(cm, [
[1, 0, 1],
[1, 0, 1],
[0, 0, 0],
]) | |
15,213 | [
-0.024672774598002434,
-0.037537604570388794,
0.00818173959851265,
0.02993289940059185,
-0.015926148742437363,
-0.011959796771407127,
-0.041716549545526505,
0.003559391014277935,
0.07099345326423645,
0.07837948948144913,
0.044850755482912064,
-0.027478983625769615,
0.029155420139431953,
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": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_all_states():
assert list(utils.all_states(0)) == []
assert list(utils.all_states(1)) == [(0,), (1,)]
assert list(utils.all_states(3)) == [
(0, 0, 0),
(1, 0, 0),
(0, 1, 0),
(1, 1, 0),
(0, 0, 1),
(1, 0, 1),
(0, 1, 1),
(1, 1, 1),
] | |
15,214 | [
-0.02796293795108795,
-0.009726507589221,
0.04248785600066185,
-0.009146004915237427,
-0.005310982000082731,
-0.026629015803337097,
-0.016118211671710014,
-0.0048941317945718765,
0.03327392041683197,
0.0727233961224556,
0.010967794805765152,
-0.0016179968370124698,
0.020329944789409637,
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_state_by_state():
# State-by-state
tpm = np.ones((8, 8))
assert utils.state_by_state(tpm)
# State-by-node, N-dimensional
tpm = np.ones((2, 2, 2, 3))
assert not utils.state_by_state(tpm)
# State-by-node, 2-dimensional
tpm = np.ones((8, 3))
assert not utils.state_by_state(tp... | |
15,215 | [
0.016241705045104027,
-0.03258103132247925,
0.008511336520314217,
0.005536945071071386,
-0.009737701155245304,
0.020122142508625984,
0.00020992342615500093,
-0.04712656885385513,
0.0030003224965184927,
0.06189175695180893,
0.013154438696801662,
0.0020927516743540764,
-0.007651051040738821,
... | 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_causally_significant_nodes():
cm = np.array([
[0, 0],
[1, 0]
])
assert utils.causally_significant_nodes(cm) == ()
cm = np.array([
[0, 1],
[1, 0]
])
assert utils.causally_significant_nodes(cm) == (0, 1)
cm = np.array([
[0, 1, 0],
[0, ... | |
15,216 | [
-0.032223038375377655,
-0.02634274959564209,
0.06591615080833435,
-0.01905166357755661,
-0.031061207875609398,
-0.018304772675037384,
-0.005394217558205128,
0.007409639190882444,
0.03314776346087456,
0.03793735429644585,
0.023698989301919937,
0.025465447455644608,
0.023331472650170326,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_expand_tpm():
tpm = np.ones((2, 1, 2))
tpm[(0, 0)] = (0, 1)
assert np.array_equal(utils.expand_tpm(tpm), np.array([
[[0, 1],
[0, 1]],
[[1, 1],
[1, 1]],
])) | |
15,217 | [
-0.002055889228358865,
-0.01628802716732025,
0.03135230764746666,
-0.04055486246943474,
-0.01229862216860056,
0.004815430846065283,
0.022272132337093353,
0.021978434175252914,
0.04701622575521469,
0.016116702929139137,
0.023471400141716003,
-0.03025094047188759,
0.002849792828783393,
0.063... | 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_marginal_zero():
repertoire = np.array([
[[0., 0.],
[0., 0.5]],
[[0., 0.],
[0., 0.5]]])
assert utils.marginal_zero(repertoire, 0) == 0.5
assert utils.marginal_zero(repertoire, 1) == 0
assert utils.marginal_zero(repertoire, 2) == 0 | |
15,218 | [
0.004793975036591291,
-0.012760620564222336,
0.055696580559015274,
-0.046922460198402405,
-0.012061234563589096,
0.025839144363999367,
0.014623531140387058,
-0.0016880641924217343,
0.01962096430361271,
0.01749737374484539,
0.02286357432603836,
-0.030162623152136803,
0.015322918072342873,
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_marginal():
repertoire = np.array([
[[0., 0.],
[0., 0.5]],
[[0., 0.],
[0., 0.5]]])
assert np.array_equal(utils.marginal(repertoire, 0), np.array([[[0.5]], [[0.5]]]))
assert np.array_equal(utils.marginal(repertoire, 1), np.array([[[0], [1]]]))
assert np.array_eq... | |
15,219 | [
0.005429635290056467,
-0.042891521006822586,
0.024810055270791054,
-0.025849219411611557,
0.01176204439252615,
0.013678004033863544,
-0.0005195823032408953,
-0.027485905215144157,
0.008319811895489693,
0.04011175408959389,
0.0100993812084198,
-0.0470481775701046,
0.03411057963967323,
0.039... | 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_independent():
repertoire = np.array([
[[ 0.25],
[ 0.25]],
[[ 0.25],
[ 0.25]]])
assert utils.independent(repertoire)
repertoire = np.array([
[[ 0.5],
[ 0. ]],
[[ 0. ],
[ 0.5]]])
assert not utils.independent(repertoire) | |
15,220 | [
0.016201697289943695,
0.00791720300912857,
0.018024560064077377,
0.01279403641819954,
-0.003293733112514019,
0.0059753116220235825,
-0.03286591172218323,
0.015167837031185627,
0.015616750344634056,
0.010440641082823277,
0.07688664644956589,
-0.05536600574851036,
0.004880234599113464,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def test_purview(s):
mechanisms = utils.powerset(s.node_indices)
purviews = utils.powerset(s.node_indices)
for mechanism, purview in zip(mechanisms, purviews):
repertoire = s.cause_repertoire(mechanism, purview)
assert utils.purview(repertoire) == purview
assert utils.purview(None) == ... | |
15,221 | [
-0.004042856395244598,
0.005470268428325653,
0.047781359404325485,
-0.0037414152175188065,
-0.036905840039253235,
-0.04983825236558914,
0.04104326665401459,
-0.05475587770342827,
-0.03948286548256874,
0.015781324356794357,
-0.0109523581340909,
-0.01658516749739647,
0.002863690024241805,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "row", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "selection", "annotation": null, "type_comment": null}}, {"_type": ... | def initial_thumbs_load(row, selection, width, height):
items = (row.split(","))
thumb_loc = items[1]
file_loc = items[2]
dir_parser.thumbs_generator(file_loc, thumb_loc)
pixbuf = Pixbuf.new_from_file(thumb_loc)
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR) #BILINEAR, HYPER, TIL... | |
15,222 | [
0.013149112462997437,
-0.011835488490760326,
0.031320903450250626,
-0.029801219701766968,
-0.024623999372124672,
-0.048578307032585144,
0.011423371732234955,
-0.06949324905872345,
-0.04798588901758194,
0.007637045346200466,
-0.005064533092081547,
-0.024830056354403496,
0.0069931126199662685,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "row", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "selection", "annotation": null, "type_comment": null}}, {"_type": ... | def thumbs_scale(row, selection, width, height):
items = (row.split(","))
thumb_loc = items[1]
file_loc = items[2]
category = items[3]
if category == "0": # Only relevant to the 'Not done' category, will be required to be modified when other cats are viewable
pixbuf = Pixbuf.new_from_file(thumb_loc)
pix... | |
15,223 | [
-0.02394992485642433,
0.0069848704151809216,
0.04364600032567978,
-0.0036906544119119644,
0.002271655946969986,
-0.014234032481908798,
0.010496183298528194,
-0.006286383140832186,
-0.03241986781358719,
0.03415664657950401,
0.010659793391823769,
0.0005305512459017336,
0.012541303411126137,
... | 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 __init__(self):
self.gladefile = "gui.glade"
self.builder = gtk.Builder()
self.builder.add_from_file(self.gladefile)
self.builder.connect_signals(self)
self.window = self.builder.get_object("window1")
self.thumb_view = self.builder.get_object('iconview2')
self.model = self.builder.get_object('l... | |
15,224 | [
0.008355274796485901,
0.011865557171404362,
0.005519018974155188,
-0.03905356675386429,
-0.02034095488488674,
-0.0039874413050711155,
0.01672389544546604,
-0.031072011217474937,
-0.029790690168738365,
0.02781532146036625,
0.025920037180185318,
-0.0038306131027638912,
0.011785474605858326,
... | 14 | {"_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 image:
def __init__(self):
self.gladefile = "gui.glade"
self.builder = gtk.Builder()
self.builder.add_from_file(self.gladefile)
self.builder.connect_signals(self)
self.window = self.builder.get_object("window1")
self.thumb_view = self.builder.get_object('iconview2')
self.model = self.builde... | |
15,225 | [
0.026264887303113937,
0.026029039174318314,
-0.019875552505254745,
-0.004593675024807453,
0.028473282232880592,
-0.01664872281253338,
0.03231117129325867,
0.01797804795205593,
0.02199818380177021,
0.0015102310571819544,
0.005928360391408205,
-0.003669044002890587,
-0.0182782169431448,
0.01... | 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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a... | def filechooserdialog_open_button_clicked(self, widget, data=None):
self.import_xml_button.set_sensitive(False)
self.filechooserdialog.hide()
#self.selection = self.filechooserdialog.get_current_folder()
self.selection = self.filechooserdialog.get_filename() # GUI updated too, this fixes folder selection
... | |
15,226 | [
0.03535015136003494,
0.023620327934622765,
0.010747186839580536,
-0.034509655088186264,
-0.0481305867433548,
-0.011148893274366856,
0.0029015550389885902,
-0.00637785904109478,
-0.0271182619035244,
0.0039429012686014175,
0.03292755037546158,
-0.02238430827856064,
0.005342693068087101,
-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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a... | def import_prep_apply_clicked(self, widget, data=None):
dir_parser.create_case(self.selection)
index_file = dir_parser.create_index_and_thumbs(self.selection)
self.temp_index = list(index_file)
self.filechooserdialog.hide()
self.thumb_view.set_model(self.model)
self.thumb_view.set_pixbuf_column(0)
... | |
15,227 | [
0.05839840695261955,
0.03819255903363228,
0.019855458289384842,
-0.04734942689538002,
-0.0028615219052881002,
-0.0014935393119230866,
0.002719905925914645,
0.012240306474268436,
0.00778450770303607,
-0.02275201864540577,
0.0081816166639328,
0.0047857495956122875,
-0.007077887188643217,
-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": "menuitem", "annotation": null, "type_comment": null}}, {"_type": ... | def show_result_activate(self, menuitem, data=None): # This is a temporary feature to monitor the index results
# for each in self.thumb_view.get_selected_items():
# path = gtk.TreePath(each)
# treeiter = self.model.get_iter(path)
#Get value at 2nd column
# value = self.model.get_value(treeiter, 1)
... | |
15,228 | [
0.01872427389025688,
0.03857764974236488,
0.034813977777957916,
-0.0049935877323150635,
-0.05806810036301613,
-0.009657854214310646,
0.04287899285554886,
0.013018276542425156,
-0.0127494428306818,
0.04798683524131775,
0.017810240387916565,
-0.02830819971859455,
-0.010296334512531757,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "widget", "annotation": null, "type_comment": null}}], "kwarg": nu... | def on_adjustment1_changed(self, widget,*argvs):
self.model.clear()
self.desired_width = self.adjustment.get_value()
self.desired_height = self.adjustment.get_value()
partial_harvester = partial(thumbs_scale,selection=self.selection,width=self.desired_width,height=self.desired_height)
pool = ThreadPo... | |
15,229 | [
0.019112713634967804,
-0.005471351090818644,
-0.016784192994236946,
-0.04008286073803902,
-0.026757799088954926,
0.0074566504918038845,
0.008419016376137733,
-0.034106772392988205,
-0.018439730629324913,
0.001636189641430974,
0.024308141320943832,
-0.019610721617937088,
0.011945446021854877,... | 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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a... | def on_iconview_key_press_event(self, widget, event):
to_remove = []
cats = {48: 0, 49: 1, 50: 2, 51: 3, 52: 4, 53: 5, 54: 6, 55: 7, 56: 8, 57: 9} # the larger number is the keyval equvilent to the smaller number
#What do cats use to make coffee? A purrcolator! XD
if event.keyval in cats:
print("Ke... | |
15,230 | [
-0.012515246868133545,
-0.007503403816372156,
0.05801675096154213,
-0.026653239503502846,
0.012709114700555801,
0.011883381754159927,
-0.027629759162664413,
-0.031564559787511826,
0.024441709741950035,
-0.0073741585947573185,
0.04586769640445709,
-0.02538950741291046,
-0.01978888176381588,
... | 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 TestNameserver(unittest.TestCase):
def testInit(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
self.assertEquals(ns.ip, mocks.GOOD_IP)
self.assertEquals(ns.name, None)
ns = mocks.MockNameServer(mocks.NO_RESPONSE_IP, name='Broked')
self.assertEquals(ns.ip, mocks.NO_RESPONSE_IP)
self.ass... | |
15,231 | [
-0.02993789315223694,
0.020760776475071907,
0.04785456880927086,
0.017248831689357758,
0.013460537418723106,
-0.00007214600191218778,
-0.012735119089484215,
-0.0230291485786438,
0.05347368121147156,
-0.010386145673692226,
0.013587197288870811,
-0.022591594606637955,
-0.046012237668037415,
... | 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 testInit(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
self.assertEquals(ns.ip, mocks.GOOD_IP)
self.assertEquals(ns.name, None)
ns = mocks.MockNameServer(mocks.NO_RESPONSE_IP, name='Broked')
self.assertEquals(ns.ip, mocks.NO_RESPONSE_IP)
self.assertEquals(ns.name, 'Broked') | |
15,232 | [
-0.036204446107149124,
-0.031153863295912743,
0.01776723563671112,
-0.007788465823978186,
0.030406583100557327,
-0.018475864082574844,
-0.03870397061109543,
0.0004364504129625857,
0.02600020542740822,
-0.0015364342834800482,
0.014288516715168953,
-0.03968316689133644,
-0.0200863815844059,
... | 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 testTimedRequest(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
(response, duration, exception) = ns.TimedRequest('A', 'www.paypal.com')
self.assertEquals(response.id, 999)
expected = ('www.paypal.com. 159 IN A 66.211.169.65\n'
'www.paypal.com. 159 IN A 66.211.169.2')
self.asser... | |
15,233 | [
-0.030000906437635422,
0.0349096916615963,
0.029951071366667747,
0.014352592639625072,
0.019435802474617958,
-0.00208374229259789,
-0.03493461012840271,
-0.015187336131930351,
0.015610937029123306,
0.039843395352363586,
0.04265909641981125,
-0.03398773819208145,
-0.04567413777112961,
-0.03... | 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 testCheckHealthPerfect(self):
ns = mocks.MockNameServer(mocks.PERFECT_IP)
ns.CheckHealth()
self.assertEquals(ns.CheckHealth(), True)
expected = ['www.google.com. is hijacked (66.211.169.65 + 66.211.169.2)',
'google.com. is hijacked (66.211.169.65 + 66.211.169.2)',
'NX... | |
15,234 | [
-0.029689684510231018,
0.03260093182325363,
0.035135723650455475,
0.007020870223641396,
0.009530564770102501,
0.004021785221993923,
-0.024293841794133186,
-0.016551434993743896,
0.04163582995533943,
0.013439414091408253,
0.03521101176738739,
-0.04263971000909805,
-0.03260093182325363,
0.01... | 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 testCheckHealthGood(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
ns.CheckHealth()
self.assertEquals(ns.CheckHealth(), False)
self.assertEquals(ns.warnings, ['No answer'])
self.assertEquals(len(ns.checks), 1)
self.assertEquals(ns.failure[0], 'TestWwwGoogleComResponse')
self.assertEqual... | |
15,235 | [
-0.0032056088093668222,
0.00032412083237431943,
0.06088007614016533,
-0.010100317187607288,
0.002900943625718355,
0.034387439489364624,
0.007464299909770489,
0.0159883052110672,
-0.0054972218349576,
-0.02980421483516693,
0.04652106761932373,
-0.01270321849733591,
-0.025181248784065247,
-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 testQUeryWildcardCacheSaving(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
other_ns = mocks.MockNameServer(mocks.PERFECT_IP)
ns.QueryWildcardCache(save=True)
other_ns.QueryWildcardCache(save=True)
# Test our cache-sharing mechanisms
(hostname, ttl) = ns.cache_check
self.assertTrue(hos... | |
15,236 | [
-0.005749199073761702,
-0.0040974244475364685,
0.030961165204644203,
-0.016018370166420937,
0.029117323458194733,
0.026377171277999878,
-0.0026121081318706274,
-0.03692803904414177,
0.0015549407107755542,
-0.029347803443670273,
0.02151148021221161,
-0.016850659623742104,
-0.00581002002581954... | 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 testSharedCacheNoMatch(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
other_ns = mocks.MockNameServer(mocks.PERFECT_IP)
ns.QueryWildcardCache(save=True)
other_ns.QueryWildcardCache(save=True)
(shared, slower, faster) = ns.TestSharedCache(other_ns)
self.assertEquals(shared, False)
self.a... | |
15,237 | [
-0.016837380826473236,
0.031712647527456284,
0.04439280182123184,
-0.06288571655750275,
0.001162705128081143,
-0.011226964183151722,
-0.018836284056305885,
-0.05905959755182266,
0.0031945649534463882,
0.013060313649475574,
0.015562007203698158,
-0.045300278812646866,
0.024759411811828613,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "hr.evaluation.report"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comm... | class hr_evaluation_report(osv.Model):
_name = "hr.evaluation.report"
_description = "Evaluations Statistics"
_auto = False
_columns = {
'create_date': fields.date('Create Date', readonly=True),
'delay_date': fields.float('Delay to Start', digits=(16, 2), readonly=True),
'overpas... | |
15,238 | [
-0.014973752200603485,
-0.020401902496814728,
0.039506345987319946,
-0.022321613505482674,
0.024254566058516502,
0.029338492080569267,
0.007195609156042337,
-0.03233059495687485,
0.010796723887324333,
-0.024373719468712807,
0.03227763622999191,
-0.028914831578731537,
-0.0047132233157753944,
... | 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 testSharedCacheMatch(self):
ns = mocks.MockNameServer(mocks.GOOD_IP)
other_ns = mocks.MockNameServer(mocks.PERFECT_IP)
ns.QueryWildcardCache(save=True)
other_ns.QueryWildcardCache(save=True)
# Increase the TTL of 'other'
other_ns.cache_check = (other_ns.cache_check[0], other_ns.cache_check[1... | |
15,239 | [
-0.024392152205109596,
0.02462681196630001,
0.023391764611005783,
-0.032555803656578064,
-0.0025488254614174366,
0.020415306091308594,
0.03752068802714348,
0.014017768204212189,
0.03253110498189926,
0.04083061218261719,
0.011220389977097511,
-0.031197253614664078,
-0.04300428926944733,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class moduleClass(Module):
def __init__(self):
Module.__init__(self)
self.priority = 109
self.sidebarTitle = _("Finish Updates Setup")
self.title = _("Finish Updates Setup")
def needsNetwork(self):
return False
def apply(self, interface, testing=False):
if t... | |
15,240 | [
-0.013638009317219257,
0.012734362855553627,
0.05321899801492691,
-0.04483623802661896,
-0.02089281566441059,
0.04245214909315109,
0.006504971534013748,
-0.0039478447288274765,
0.005505192559212446,
0.061524856835603714,
-0.006511380430310965,
-0.019534140825271606,
-0.04568220674991608,
-... | 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": "interface", "annotation": null, "type_comment": null}}, {"_type":... | def apply(self, interface, testing=False):
if testing:
return RESULT_SUCCESS
up2DateConfig = config.initUp2dateConfig()
up2DateConfig.save()
interface.moveToPage(pageNum = len(interface.moduleList))
return RESULT_JUMP | |
15,241 | [
-0.007187666371464729,
0.005053629167377949,
0.0015814456855878234,
-0.045644860714673996,
0.019463947042822838,
-0.02076154202222824,
-0.003320320276543498,
0.0013564334949478507,
0.043762076646089554,
0.02348395064473152,
0.035009659826755524,
-0.03582383692264557,
-0.014197231270372868,
... | 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_summaryforbranch(self):
fake_request = """{
"id": 10,
"user": "testuser",
"repo": "testuser",
"state": "requested",
"branch": "testuser_fixes",
"revision": "00000",
"description": "long desc",
"title": "funn... | |
15,242 | [
-0.011207387782633305,
-0.00011430364975240082,
0.05910005420446396,
-0.05054736137390137,
0.026474902406334877,
0.011453638784587383,
-0.020973311737179756,
-0.02024056762456894,
0.06073371320962906,
0.02191026322543621,
0.022042397409677505,
-0.046991750597953796,
0.015435684472322464,
-... | 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 SummaryForBranchServletTest(T.TestCase, ServletTestMixin):
def get_handlers(self):
return [
get_servlet_urlspec(SummaryForBranchServlet),
]
def test_summaryforbranch(self):
fake_request = """{
"id": 10,
"user": "testuser",
"repo": "... | |
15,243 | [
0.008596351370215416,
0.028492655605077744,
0.006869356147944927,
-0.008850159123539925,
0.016177471727132797,
0.00009457434498472139,
0.026947740465402603,
-0.00850807037204504,
-0.008055631071329117,
-0.005677564535290003,
0.044206652790308,
0.015316733159124851,
0.014930504374206066,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def read_color_directives(data):
unpack_dir = data.split("?replace;")
directives = []
for directive in unpack_dir[1:]:
unpack_gr = directive.split(";")
groups = []
for group in unpack_gr:
groups.append(group.split("="))
directives.append(groups)
return directi... | |
15,244 | [
0.004936262499541044,
-0.0039377412758767605,
0.012270228005945683,
-0.054539911448955536,
0.023839300498366356,
-0.005950434599071741,
-0.009490645490586758,
0.008539076894521713,
0.0395902656018734,
0.009409261867403984,
0.02176087349653244,
-0.020195793360471725,
-0.03267887234687805,
-... | 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_branch_name_with_slash(self):
fake_request = """{
"id": 10,
"user": "testuser",
"repo": "testuser",
"state": "requested",
"branch": "testuser/testbranch",
"revision": "00000",
"description": "description for 'testuser/t... | |
15,245 | [
0.019697554409503937,
-0.017643531784415245,
0.005198258440941572,
0.011070657521486282,
-0.025659488514065742,
-0.008426761254668236,
0.009469573386013508,
-0.017211660742759705,
0.012229337356984615,
0.029135527089238167,
0.04204953834414482,
0.0020777233876287937,
-0.009395838715136051,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "colors", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def make_color_directives(colors):
string = ""
for directive in colors:
if len(directive) == 0:
continue
string += "?replace"
for group in directive:
string += ";%s=%s" % (group[0], group[1])
return string | |
15,246 | [
0.026466352865099907,
-0.049125589430332184,
-0.01647840067744255,
0.03449340909719467,
0.02552604116499424,
-0.039699528366327286,
0.01660454086959362,
-0.012166724540293217,
0.040525171905756,
0.003901723073795438,
0.013221709057688713,
0.008296536281704903,
-0.010532645508646965,
-0.033... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def hex_to_rgb(value):
value = value.lstrip('#')
lv = len(value)
if lv == 1: # might not be supported in starbound
v = int(value, 16)*17
return v, v, v
if lv == 3: # might not be supported in starbound
return tuple(int(value[i:i+1], 16)*17 for i in range(0, 3))
if lv == 6:
... | |
15,247 | [
0.03871598467230797,
-0.030893370509147644,
-0.05785558000206947,
-0.012736566364765167,
-0.008105538785457611,
-0.01130705326795578,
0.07385818660259247,
0.021442700177431107,
-0.042766273021698,
0.05166102200746536,
0.03688938543200493,
0.004774971399456263,
-0.005757761653512716,
-0.015... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "image", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dict_colors", "annotation": null, "type_comment": null}}], "kwar... | def replace_colors(image, dict_colors):
pixel_data = image.load()
result_img = image.copy()
result_pixel_data = result_img.load()
for (key, value) in dict_colors.items():
for y in range(result_img.size[1]):
for x in range(result_img.size[0]):
pixel = pixel_data[x, y]... | |
15,248 | [
-0.0000034479619444027776,
-0.0053781792521476746,
-0.004343598149716854,
-0.008758357726037502,
0.009004686959087849,
-0.007406286429613829,
0.04510554298758507,
-0.04346335306763649,
0.005293332505971193,
-0.0009162063943222165,
0.059425462037324905,
0.0250707995146513,
0.01973914913833141... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def unpack_color_directives(data):
if data is None:
return {}
# won't grab fade directives
replace_matches = replace_directive_re.findall(data)
groups = []
for directive in replace_matches:
unpack_gr = directive.split(";")
for group in unpack_gr[1:]:
hexkey, hexva... | |
15,249 | [
0.030411910265684128,
0.020288078114390373,
0.05617615208029747,
0.006931086536496878,
-0.05241760239005089,
-0.0017605565953999758,
-0.04251605272293091,
-0.022793777287006378,
-0.0263704601675272,
0.02948237583041191,
-0.04405180364847183,
-0.031482893973588943,
0.007052329834550619,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "<app app ...>"}}, "targets": [{"_type": "Name", "_fields": {"id": "args", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nu... | class Command(BaseCommand):
args = '<app app ...>'
help = 'reloads permissions for specified apps, or all apps if no args are specified'
def handle(self, *args, **options):
if not args:
apps = []
for model in get_models():
apps.append(get_app(model._meta.app_... | |
15,250 | [
0.016066275537014008,
0.026858046650886536,
0.05980715528130531,
-0.021395953372120857,
-0.0734899714589119,
-0.037760164588689804,
-0.02802770771086216,
-0.018240079283714294,
-0.012204190716147423,
0.053936783224344254,
-0.01897939294576645,
-0.04903745278716087,
0.0014689718373119831,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "... | def handle(self, *args, **options):
if not args:
apps = []
for model in get_models():
apps.append(get_app(model._meta.app_label))
else:
apps = []
for arg in args:
apps.append(get_app(arg))
for app in apps:
... | |
15,251 | [
0.032854776829481125,
-0.0030151952523738146,
-0.02091236785054207,
-0.029408838599920273,
-0.015651395544409752,
0.014599200338125229,
-0.013902121223509312,
-0.04758550226688385,
0.03067147359251976,
0.025397347286343575,
0.02088606357574463,
-0.054451070725917816,
-0.0026091139297932386,
... | 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": "session", "annotation": null, "type_comment": null}}, {"_type": "... | def __init__(self, session, args = None):
Screen.__init__(self, session)
templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
tempcount = len(templist)
fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
fancount = len(fanlist)
self["red"] = StaticText(_("Cancel"))
self["green"] = StaticTe... | |
15,252 | [
0.03393132612109184,
0.011426996439695358,
-0.015287279151380062,
-0.0514424666762352,
-0.018797898665070534,
0.018616074696183205,
-0.018699992448091507,
-0.04008540138602257,
0.02984725870192051,
0.003807833418250084,
0.03132983297109604,
-0.04053296893835068,
0.0016766355838626623,
0.01... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\n\t\t<screen position=\"center,center\" size=\"570,420\" title=\"Fan Control\" >\n\t\t\t<ePixmap pixmap=\"skin_default/buttons/red.png\"... | class TempFanControl(Screen, ConfigListScreen):
skin = """
<screen position="center,center" size="570,420" title="Fan Control" >
<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphates... | |
15,253 | [
0.04962034523487091,
0.01634049229323864,
-0.025451814755797386,
0.014041273854672909,
0.013292691670358181,
0.0011569614289328456,
0.01484332699328661,
0.03161158040165901,
0.02301357313990593,
-0.01981605589389801,
-0.011153883300721645,
-0.06279540061950684,
0.0017712003318592906,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ParticipateActionMixin(object):
@property
def action(self):
msg = "{0} is missing action.".format(self.__class__)
raise NotImplementedError(msg)
def form_valid(self, form):
msg = 'Participate {0}.'.format(self.action)
messages.info(self.request, msg)
re... | |
15,254 | [
0.04649626836180687,
-0.004410425666719675,
0.023348426446318626,
0.002528660697862506,
-0.007311427500098944,
-0.03783087059855461,
-0.004631072282791138,
-0.0055211810395121574,
0.016929615288972855,
0.00006519105227198452,
0.017039939761161804,
0.000009485807822784409,
0.02814247645437717... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "contact/contact_form.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}}... | class ContactView(FormView):
template_name = 'contact/contact_form.html'
form_class = ContactForm
success_url = '/contact/thankyou/'
def form_valid(self, form):
try:
form.send_email()
except BadHeaderError:
return super(ContactView, self).form_invalid(form)
... | |
15,255 | [
0.019162675365805626,
0.019990617409348488,
0.020422589033842087,
-0.024190327152609825,
-0.030189912766218185,
-0.018274737522006035,
-0.02925397828221321,
0.004004723392426968,
-0.025678224861621857,
0.011669193394482136,
-0.0038427342660725117,
-0.009857318364083767,
0.007619473151862621,... | 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": "num_classes", "annotat... | class ProposalTargetOperator(mx.operator.CustomOp):
def __init__(self, num_classes, batch_images, batch_rois, fg_fraction):
super(ProposalTargetOperator, self).__init__()
self._num_classes = num_classes
self._batch_images = batch_images
self._batch_rois = batch_rois
self._fg_... | |
15,256 | [
0.018476577475667,
0.009828084148466587,
0.012942424044013023,
-0.017451327294111252,
-0.0328962467610836,
-0.01672372780740261,
-0.011487227864563465,
-0.0009232776938006282,
-0.043170809745788574,
0.021078292280435562,
0.006184582598507404,
-0.016624510288238525,
-0.01987665332853794,
-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": "num_classes", "annotation": null, "type_comment": null}}, {"_type... | def __init__(self, num_classes, batch_images, batch_rois, fg_fraction):
super(ProposalTargetOperator, self).__init__()
self._num_classes = num_classes
self._batch_images = batch_images
self._batch_rois = batch_rois
self._fg_fraction = fg_fraction
if logger.level == loggi... | |
15,257 | [
0.020121023058891296,
0.005229664500802755,
0.02953827753663063,
-0.018088335171341896,
0.0021613375283777714,
-0.07374277710914612,
0.0013154568150639534,
-0.02259112149477005,
-0.05130603536963463,
0.029280975461006165,
0.010472194291651249,
-0.007223755586892366,
-0.0054805343970656395,
... | 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": "is_train", "annotation": null, "type_comment": null}}, {"_type": ... | def forward(self, is_train, req, in_data, out_data, aux):
assert self._batch_rois % self._batch_images == 0, \
'BATCHIMAGES {} must devide BATCH_ROIS {}'.format(self._batch_images, self._batch_rois)
rois_per_image = self._batch_rois / self._batch_images
fg_rois_per_image = np.round(s... | |
15,258 | [
0.023220408707857132,
0.02701929584145546,
0.016072209924459457,
-0.02002844586968422,
-0.03182971850037575,
-0.004537870176136494,
-0.03704475611448288,
0.014880843460559845,
-0.039427489042282104,
0.006670529022812843,
-0.009075740352272987,
-0.02105122245848179,
0.017398448660969734,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "num_classes", "annotat... | class ProposalTargetProp(mx.operator.CustomOpProp):
def __init__(self, num_classes, batch_images, batch_rois, fg_fraction='0.25'):
super(ProposalTargetProp, self).__init__(need_top_grad=False)
self._num_classes = int(num_classes)
self._batch_images = int(batch_images)
self._batch_roi... | |
15,259 | [
0.01948171854019165,
-0.024043235927820206,
0.023061644285917282,
0.002793207298964262,
0.021052267402410507,
-0.013326558284461498,
-0.004957040771842003,
0.020290089771151543,
0.002693604677915573,
0.06443864107131958,
0.022749844938516617,
-0.0585721880197525,
0.029309190809726715,
0.03... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "epitope_column_name", "annotation": null, "type_comment": null}},... | def _load_dataframe(
path,
epitope_column_name,
mhc_class = None,
hla_type = None,
exclude_hla_type = None, # regex pattern i.e. '(HLA-A2)|(HLA-A\*02)'
peptide_length = None,
reduced_alphabet = None,
nrows = None):
df = pd.read_csv(path, skipinitialspa... | |
15,260 | [
0.00204004580155015,
-0.01916959322988987,
0.012741738930344582,
0.0006275420309975743,
0.006279694382101297,
-0.028127560392022133,
-0.015078104101121426,
0.015237661078572273,
0.0266459621489048,
0.024548931047320366,
0.025848178192973137,
-0.052334584295749664,
-0.05292722210288048,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "question", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def scrape(question):
if not question:
raise Exception("Please provide a question")
url = "http://api.duckduckgo.com/?q={}&format=xml&pretty=1".format(quote(question))
response = requests.get(url).content
answer = Answer(response)
heading = answer.related_topics
print(heading) | |
15,261 | [
0.033312804996967316,
-0.005563581828027964,
0.008997892029583454,
-0.010875314474105835,
0.04057064652442932,
-0.028916887938976288,
0.03812083974480629,
0.017354711890220642,
0.0023439163342118263,
0.041234612464904785,
0.018957389518618584,
-0.013382360339164734,
0.006416435353457928,
-... | 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": "session_id", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__ (self, session_id):
core._WinSysObject.__init__ (self)
self._session_id = session_id
self._session_info = dict (session_id = self._session_id)
for k, v in wrapped (win32security.LsaGetLogonSessionData, session_id).iteritems ():
mapper = self._MAP.get (k)
if mapper: v = map... | |
15,262 | [
0.02599215880036354,
0.02355685643851757,
-0.00386955332942307,
-0.058306735008955,
0.04395250603556633,
-0.03493720665574074,
-0.0068844095803797245,
-0.004812061786651611,
0.024001767858862877,
0.034656211733818054,
0.012738498859107494,
-0.04435058310627937,
0.010631026700139046,
0.0022... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": "u", "value": "UserName"}}, {"_type": "Constant", "_fields": {"kind": "u", "value": "Sid"}}, {"_type": "Constant",... | class LogonSession (core._WinSysObject):
_MAP = {
u"UserName" : principal,
u"Sid" : principal,
u"LogonTime" : utils.from_pytime
}
def __init__ (self, session_id):
core._WinSysObject.__init__ (self)
self._session_id = session_id
self._session_info = dict (session_id = self._ses... | |
15,263 | [
0.025063635781407356,
-0.0006939670420251787,
-0.02715619094669819,
-0.0423213355243206,
-0.04335585609078407,
0.017387015745043755,
0.04333234578371048,
0.02558089606463909,
0.021771976724267006,
0.035291291773319244,
-0.019291475415229797,
-0.03091808781027794,
0.016035083681344986,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "string", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "encoding", "annotation": null, "type_comment": null}}], "kwarg"... | def confuse(string, encoding='utf-8'):
output = []
pos = 0
while pos < len(string):
for regex in regexes:
pattern = re.compile(regex)
match = pattern.match(string, pos)
if match:
pos = match.end(0)
output.extend(match.group(0))
... | |
15,264 | [
0.030283251777291298,
0.010377967730164528,
0.016757866367697716,
-0.024097787216305733,
0.021679501980543137,
-0.01977160945534706,
-0.018228281289339066,
-0.012182568199932575,
0.00527404947206378,
0.019479956477880478,
-0.013306645676493645,
-0.04063691571354866,
0.007552584633231163,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "system_name", "annotat... | class LSA (core._WinSysObject):
def __init__ (self, system_name=None):
core._WinSysObject.__init__ (self)
self._lsa = wrapped (win32security.LsaOpenPolicy, system_name, 0)
@staticmethod
def logon_sessions ():
for session_id in wrapped (win32security.LsaEnumerateLogonSessions):
yield L... | |
15,265 | [
0.051047585904598236,
0.02165953442454338,
-0.002149031963199377,
0.008731500245630741,
-0.005531795788556337,
-0.006224039476364851,
0.028600431978702545,
0.006602466106414795,
0.01110666524618864,
-0.023837795481085777,
0.015961600467562675,
0.022287169471383095,
0.03234162554144859,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "object", "annotation": null, "type_comment": null}}, {"_type": "a... | def on_IOST_WMain_Config_Email_C_toggled(self, object, data=None):
Res = self.IOST_Objs[self.IOST_WMainAutoMail_WindowName]["_Config_Email_CB"].get_active()
self.IOST_Objs[self.IOST_WMainAutoMail_WindowName]["_Config_Email_B"].set_sensitive(Res)
if (Res):
self.IOST_Data["AutoMail"] ... | |
15,266 | [
-0.02096809633076191,
-0.04448744282126427,
-0.032255105674266815,
-0.04118448495864868,
0.02230066992342472,
-0.036218658089637756,
0.02405465394258499,
0.004849086049944162,
-0.031890641897916794,
-0.03136672452092171,
0.013257394544780254,
-0.004923117812722921,
0.0341913215816021,
-0.1... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "image", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def upload_image(image):
alias = '{}/{}/{}/{}'.format(image['os'],
image['release'],
image['arch'],
image['variant'])
lxd = api.API()
imgs = api.API(host='images.linuxcontainers.org')
d = imgs.alias_show(a... | |
15,267 | [
0.05748024582862854,
0.0026231722440570593,
0.027810880914330482,
-0.015553738921880722,
-0.019403453916311264,
-0.018374651670455933,
0.01831933856010437,
0.028364000841975212,
-0.007655182853341103,
-0.02057606913149357,
0.004043308086693287,
0.0011553297517821193,
0.004228603560477495,
... | 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 TomoeRecognizerTest(unittest.TestCase):
def setUp(self):
dict = tomoe.Dict("XML", filename = os.path.join(test_common.data_dir, 'handwriting-ja.xml'))
self.recognizer = tomoe.Recognizer('Simple', dictionary = dict)
self.writings = []
self.results = []
for file in glob.... | |
15,268 | [
0.054502468556165695,
0.05340956896543503,
0.04485643655061722,
-0.006153504829853773,
-0.030102279037237167,
-0.013292995281517506,
-0.011445756070315838,
-0.058969106525182724,
-0.006670256610959768,
0.04079369828104973,
0.03806144744157791,
-0.014397775754332542,
0.018032856285572052,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "allstr", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def process_str(allstr):
newstr = allstr
writestr = '' #_head # using _head will break free-format files
struct = parse_structure(newstr)
oldend = 0
names = {}
names.update(_special_names)
for sub in struct:
writestr += newstr[oldend:sub[0]]
names.update(find_repl_patterns(... | |
15,269 | [
0.0657806545495987,
0.010113594122231007,
0.04697927460074425,
-0.03221366927027702,
-0.017290983349084854,
-0.029507044702768326,
0.02883038856089115,
-0.0003245457774028182,
-0.007316345348954201,
-0.02858872525393963,
0.025422940030694008,
0.011883774772286415,
-0.0033983851317316294,
-... | 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 setUp(self):
dict = tomoe.Dict("XML", filename = os.path.join(test_common.data_dir, 'handwriting-ja.xml'))
self.recognizer = tomoe.Recognizer('Simple', dictionary = dict)
self.writings = []
self.results = []
for file in glob.glob(os.path.join(test_common.test_data_dir, '*.dat... | |
15,270 | [
0.011053933762013912,
0.012484864331781864,
0.012329846620559692,
-0.02942945994436741,
0.014786276035010815,
0.021821681410074234,
0.008633277378976345,
0.01492936909198761,
0.012043660506606102,
0.015120159834623337,
0.07068794220685959,
-0.099115751683712,
0.011202989146113396,
-0.03021... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ad_group_id", "annotation": null, "type_comment": null}}, {"_ty... | def main(client, ad_group_id, criterion_id):
# Initialize appropriate service.
ad_group_criterion_service = client.GetService(
'AdGroupCriterionService', version='v201809')
# Construct operations and delete ad group criteria.
operations = [
{
'operator': 'REMOVE',
'operand': {
... | |
15,271 | [
-0.009222298860549927,
-0.010439763776957989,
0.006706204265356064,
-0.07337257266044617,
-0.0005687845405191183,
-0.04119090735912323,
0.024531923234462738,
-0.01992584764957428,
-0.0009796790545806289,
0.05202634632587433,
0.02063603512942791,
0.007781631778925657,
0.010439763776957989,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "file_paths", "annotation": null, "type_comment": null}}, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def find_version(*file_paths):
# Open in Latin-1 so that we avoid encoding errors.
# Use codecs.open for Python 2 compatibility
with codecs.open(os.path.join(here, *file_paths), 'r', 'latin1') as file:
version_file = file.read()
# The version line must have the form
# __version__ = 'ver'
... | |
15,272 | [
0.00980188325047493,
0.003767759306356311,
0.03578229621052742,
0.00111462885979563,
-0.008717224933207035,
-0.03932170569896698,
0.018382098525762558,
0.009864679537713528,
0.00811780896037817,
0.035736627876758575,
0.016338374465703964,
-0.03797444701194763,
-0.009322349913418293,
-0.015... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "uri", "annotation": nu... | class SplitIntoBucketAndBlobTest(parameterized.TestCase):
@parameterized.named_parameters(
('just_bucket', 'gs://bucket-name', 'bucket-name', ''),
('bucket_obj', 'gs://bucket/test_obj.txt', 'bucket', 'test_obj.txt'),
('bucket_path', 'gs://b/this/that/those.csv', 'b', 'this_that_those.txt'),
)
d... | |
15,273 | [
0.002007360104471445,
0.05945609509944916,
-0.02862877957522869,
0.0034591115545481443,
-0.005102040246129036,
-0.03063613921403885,
-0.0033336516935378313,
-0.01219351775944233,
-0.006392485927790403,
0.027457818388938904,
0.03357548639178276,
-0.024661853909492493,
0.025665532797574997,
... | 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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _get_value(self, cr, uid, ids, field_name, arg, context=None):
res = {}
for rule in self.browse(cr, uid, ids, context):
if not rule.groups:
res[rule.id] = True
else:
res[rule.id] = False
return res | |
15,274 | [
0.005477231927216053,
0.06820585578680038,
-0.013364320620894432,
-0.000636677083093673,
0.020172322168946266,
-0.0004467357648536563,
-0.026476958766579628,
-0.0006681373924948275,
-0.000666564330458641,
0.06040370836853981,
0.04223226010799408,
-0.023192506283521652,
0.034027423709630966,
... | 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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _domain_force_get(self, cr, uid, ids, field_name, arg, context=None):
res = {}
eval_context = self._eval_context(cr, uid)
for rule in self.browse(cr, uid, ids, context):
if rule.domain_force:
res[rule.id] = expression.normalize_domain(eval(rule.domain_force, eval_... | |
15,275 | [
-0.018389306962490082,
0.061501163989305496,
0.05397248640656471,
0.0008663703338243067,
0.02093277871608734,
0.028308849781751633,
0.009957694448530674,
0.00709628826007247,
-0.03418426960706711,
0.06755463033914566,
0.0070644947700202465,
-0.06480768322944641,
0.025193095207214355,
0.015... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _compute_domain(self, cr, uid, model_name, mode="read"):
if mode not in self._MODES:
raise ValueError('Invalid mode: %r' % (mode,))
if uid == SUPERUSER_ID:
return None
cr.execute("""SELECT r.id
FROM ir_rule r
JOIN ir_model m ON (r.mode... | |
15,276 | [
0.009610594250261784,
0.04934021458029747,
0.06983614712953568,
0.026644716039299965,
0.04394128546118736,
0.02195814438164234,
-0.01078536082059145,
0.017121603712439537,
-0.036567747592926025,
0.030568936839699745,
0.003980460576713085,
-0.023295380175113678,
-0.005377058405429125,
0.013... | 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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def domain_get(self, cr, uid, model_name, mode='read', context=None):
dom = self._compute_domain(cr, uid, model_name, mode)
if dom:
# _where_calc is called as superuser. This means that rules can
# involve objects on which the real uid has no acces rights.
# This mean... | |
15,277 | [
-0.014659861102700233,
0.007102225907146931,
0.019159745424985886,
-0.030664267018437386,
-0.015342975966632366,
-0.030967872589826584,
0.006435375660657883,
0.010116606019437313,
0.015874287113547325,
-0.0013960482319816947,
-0.020612718537449837,
0.02017899602651596,
-0.040509793907403946,... | 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": "usrp_addr", "annotation": null, "type_comment": null}}, {"_type":... | def __init__(self, usrp_addr="addr=192.168.30.2",
ctrl_socket_host="localhost",
ctrl_socket_port=8080,
src_mac="12:34:56:78:90:ab",
dst_mac="30:14:4a:e6:46:e4",
bss_mac="66:66:66:66:66:66",
src_ipv4_address="192.168.12... | |
15,278 | [
0.01810324750840664,
0.00010523240780457854,
0.028057124465703964,
-0.0333891436457634,
-0.016636360436677933,
-0.018999679014086723,
0.03543812781572342,
0.042469870299100876,
0.02966371551156044,
-0.028266679495573044,
0.02015223354101181,
0.04118925705552101,
-0.02828996255993843,
0.026... | 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 _activate_rp(self):
self.log.info('Activate GR80211 radio program')
self.activate_radio_program(self.grc_radio_program_name, self.grc_xml)
tapIface = "tap0"
while True:
try:
time.sleep(1)
sh.ifconfig(tapIface)
break
... | |
15,279 | [
-0.00034923513885587454,
-0.017471900209784508,
-0.020165709778666496,
-0.04275476559996605,
-0.001667403383180499,
0.02663518115878105,
-0.03074621595442295,
0.014594174921512604,
0.034316323697566986,
0.02228613756597042,
0.016141222789883614,
0.03860045596957207,
-0.026375535875558853,
... | 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": "channel", "annotation": null, "type_comment": null}}, {"_type": "... | def set_channel(self, channel, ifaceName):
# convert channel to freq
freq = channels.ch2rf(channel)
self.log.info('Setting channel for {}:{} to {}/{}'
.format(ifaceName, self.device, channel, freq))
inval = {}
inval['freq'] = freq * 1e6
# delegate ... | |
15,280 | [
-0.007371161133050919,
-0.009868107736110687,
-0.002910384675487876,
-0.04032106697559357,
0.02646001987159252,
0.010776583105325699,
-0.052702441811561584,
0.012457534670829773,
0.015623597428202629,
0.006473565939813852,
0.003125263610854745,
0.05561826750636101,
-0.021727245301008224,
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": "ifaceName", "annotation": null, "type_comment": null}}], "kwarg":... | def get_channel(self, ifaceName):
self.log.info('Getting channel for {}:{}'
.format(ifaceName, self.device))
gvals = ['freq']
# delegate to generic function
freq = self.get_parameters(gvals)
if freq == None:
return None
freq = freq['fr... | |
15,281 | [
-0.010494519956409931,
-0.027843518182635307,
-0.0036876420490443707,
0.01932021975517273,
-0.0075096855871379375,
-0.00531446048989892,
-0.024864284321665764,
0.037363626062870026,
0.05635904148221016,
-0.047354139387607574,
-0.04065646231174469,
0.0185026116669178,
-0.0185026116669178,
-... | 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": "power_dBm", "annotation": null, "type_comment": null}}, {"_type":... | def set_tx_power(self, power_dBm, ifaceName):
# TODO convert power_dBm to tx power of USRP
power_usrp = power_dBm
self.log.info('Setting power on iface {}:{} to {}'
.format(ifaceName, self.device, str(power_usrp)))
inval = {}
inval['tx_gain'] = power_usrp
... | |
15,282 | [
-0.021092964336276054,
-0.02011960744857788,
-0.0004235038359183818,
0.0021058202255517244,
0.018964413553476334,
0.00017515075160190463,
-0.06456243991851807,
0.02654804103076458,
0.04612214118242264,
-0.023873982951045036,
-0.027574878185987473,
0.017306499183177948,
-0.032709069550037384,... | 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": "ifaceName", "annotation": null, "type_comment": null}}], "kwarg":... | def get_tx_power(self, ifaceName):
self.log.debug("getting power of interface: {}".format(ifaceName))
gvals = ['tx_gain']
# delegate to generic function
tx_gain = self.get_parameters(gvals)
# TODO convert to dBm
tx_gain_dBm = tx_gain
return tx_gain_dBm | |
15,283 | [
0.009820887818932533,
0.0082101970911026,
0.023976586759090424,
-0.006372496485710144,
-0.042591411620378494,
-0.020701155066490173,
-0.037553951144218445,
-0.00832910742610693,
-0.00854530744254589,
-0.01956610567867756,
-0.005515804048627615,
0.018031084910035133,
-0.020084984600543976,
... | 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": "bw", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def set_bandwidth(self, bw, ifaceName):
self.log.info('Setting bandwidth on iface {}:{} to {}'
.format(ifaceName, self.device, str(bw)))
inval = {}
inval['samp_rate'] = bw
# delegate to generic function
self.set_parameters(inval) | |
15,284 | [
-0.02594347856938839,
-0.0013215088983997703,
0.021279482170939445,
-0.01942637749016285,
-0.026110049337148666,
-0.013356935232877731,
-0.06504608690738678,
-0.011795329861342907,
0.046598318964242935,
-0.015105933882296085,
0.00019406205683480948,
-0.009114572778344154,
-0.0413305014371871... | 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": "ifaceName", "annotation": null, "type_comment": null}}], "kwarg":... | def get_bandwidth(self, ifaceName):
self.log.debug("getting bandwidth of interface: {}".format(ifaceName))
gvals = ['samp_rate']
# delegate to generic function
samp_rate = self.get_parameters(gvals)
return samp_rate | |
15,285 | [
-0.030772782862186432,
-0.009485389105975628,
0.011089199222624302,
-0.011017918586730957,
0.0070262146182358265,
-0.010936455801129341,
-0.0529104508459568,
0.0063846902921795845,
0.04120009019970894,
-0.006496702786535025,
-0.042442407459020615,
0.009816334582865238,
-0.01717858575284481,
... | 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": "ifaceName", "annotation": null, "type_comment": null}}], "kwarg":... | def get_rx_gain(self, ifaceName):
self.log.debug("getting rx gain of interface: {}".format(ifaceName))
gvals = ['rx_gain']
# delegate to generic function
rx_gain = self.get_parameters(gvals)
# TODO convert to dBm
rx_gain_dBm = rx_gain
return rx_gain_dBm | |
15,286 | [
-0.011961816810071468,
-0.008768340572714806,
0.004902698565274477,
0.019171830266714096,
-0.005273076239973307,
-0.0012922054156661034,
-0.022211667150259018,
0.02284816838800907,
0.04323812574148178,
-0.03399789705872536,
-0.05930427461862564,
0.021026460453867912,
-0.008093430660665035,
... | 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": "rx_gain_dBm", "annotation": null, "type_comment": null}}, {"_type... | def set_rx_gain(self, rx_gain_dBm, ifaceName):
# TODO convert power_dBm to tx power of USRP
rx_gain = rx_gain_dBm
self.log.info('Setting rx gain on iface {}:{} to {}'
.format(ifaceName, self.device, str(rx_gain)))
inval = {}
inval['rx_gain'] = rx_gain
... | |
15,287 | [
0.009857446886599064,
-0.036931220442056656,
0.06848456710577011,
-0.043475087732076645,
-0.03136298060417175,
-0.025223642587661743,
0.04002468287944794,
0.007025735918432474,
0.007412419188767672,
-0.011130526661872864,
0.022213462740182877,
-0.02962588146328926,
-0.04590227082371712,
-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 setUp(self):
super(InstancesTest, self).setUp()
self.orig__init = instances.Instances.__init__
instances.Instances.__init__ = Mock(return_value=None)
self.instances = instances.Instances()
self.instances.api = Mock()
self.instances.api.client = Mock()
self.ins... | |
15,288 | [
0.00486503541469574,
0.006682842969894409,
0.03520414978265762,
-0.03832570090889931,
-0.0039700670167803764,
0.00967432837933302,
0.012040265835821629,
0.014666331931948662,
0.035402342677116394,
0.0023458078503608704,
0.032999247312545776,
-0.02583950012922287,
-0.028812404721975327,
-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 InstancesTest(TestCase):
def setUp(self):
super(InstancesTest, self).setUp()
self.orig__init = instances.Instances.__init__
instances.Instances.__init__ = Mock(return_value=None)
self.instances = instances.Instances()
self.instances.api = Mock()
self.instances.... | |
15,289 | [
-0.029592156410217285,
-0.023708049207925797,
0.006331544369459152,
-0.018731074407696724,
0.004547924734652042,
-0.03486333414912224,
-0.020765995606780052,
0.01875559240579605,
0.04900971055030823,
0.0060771796852350235,
0.016598084941506386,
-0.039227381348609924,
0.0036898255348205566,
... | 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__list(self):
self.instances.api.client.get = Mock(return_value=('resp', None))
self.assertRaises(Exception, self.instances._list, "url", None)
body = Mock()
body.get = Mock(return_value=[{'href': 'http://test.net/test_file',
'rel': 'next'}... | |
15,290 | [
0.03837868571281433,
0.025487948209047318,
0.01937279850244522,
-0.035981547087430954,
-0.00004321214146330021,
-0.016278531402349472,
0.03718011826276779,
0.004886005539447069,
0.0020913814660161734,
-0.01840660348534584,
0.05552556738257408,
-0.013636786490678787,
0.003913696389645338,
-... | 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(self):
def side_effect_func(path, body, inst):
return path, body, inst
self.instances._create = Mock(side_effect=side_effect_func)
p, b, i = self.instances.create("test-name", 103, "test-volume",
['db1', 'db2'], ['u1', 'u2'])
... | |
15,291 | [
-0.003044706303626299,
0.01305491104722023,
0.006385554559528828,
-0.04530967399477959,
-0.024937596172094345,
0.017669785767793655,
-0.008501733653247356,
-0.008341323584318161,
0.009902236983180046,
0.026307251304388046,
0.05449006333947182,
-0.016139719635248184,
0.00010343750182073563,
... | 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_list(self):
def side_effect_func(path, inst, limit, marker):
return path, inst, limit, marker
self.instances._list = Mock(side_effect=side_effect_func)
limit_ = "test-limit"
marker_ = "test-marker"
expected = ("/instances", "instances", limit_, marker_)
... | |
15,292 | [
0.031154608353972435,
-0.002196953631937504,
0.0016432009870186448,
-0.04482989385724068,
-0.012459436431527138,
0.0289155226200819,
-0.01545692328363657,
0.08051083236932755,
0.033923372626304626,
-0.0053419079631567,
0.05600125342607498,
-0.04909138008952141,
-0.020801840350031853,
-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 test_delete(self):
resp = Mock()
resp.status = 200
body = None
self.instances.api.client.delete = Mock(return_value=(resp, body))
self.instances.delete('instance1')
resp.status = 500
self.assertRaises(Exception, self.instances.delete, 'instance1') | |
15,293 | [
0.010631326586008072,
0.005292142275720835,
-0.0019322199514135718,
-0.03618414327502251,
-0.03895016759634018,
-0.0326090045273304,
0.004506553057581186,
0.0027636743616312742,
-0.03891253471374512,
0.07157798856496811,
0.002829532139003277,
-0.031498830765485764,
0.008928432129323483,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "directory", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "recursive", "annotation": null, "type_comment": null}}], "kw... | def walk(directory, recursive):
if recursive:
for dirpath, dirnames, filenames in os.walk(directory):
for filename in filenames:
yield os.path.join(dirpath, filename)
else:
dirpath, dirnames, filenames = os.walk(directory).next()
for filename in filenames:
... | |
15,294 | [
-0.005300194025039673,
-0.025988832116127014,
-0.008873052895069122,
-0.013491403311491013,
0.008376064710319042,
-0.014497500844299793,
-0.00047425981028936803,
0.008133631199598312,
0.04998971149325371,
-0.016982439905405045,
0.03539523482322693,
-0.053189828991889954,
-0.03837716579437256... | 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__action(self):
body = Mock()
resp = Mock()
resp.status = 200
self.instances.api.client.post = Mock(return_value=(resp, body))
self.assertEqual('instance-1', self.instances._action(1, body))
self.instances.api.client.post = Mock(return_value=(resp, None))
... | |
15,295 | [
0.0050690253265202045,
0.06864262372255325,
0.035390641540288925,
-0.09311378002166748,
-0.03047584556043148,
-0.02068738266825676,
0.016420353204011917,
-0.03321085870265961,
-0.019196491688489914,
0.04487064480781555,
0.02788478136062622,
-0.0018559008603915572,
0.03868088126182556,
-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 main():
parser = argparse.ArgumentParser(description="sort #include clauses in c++ source code.")
parser.add_argument("-r", "--recursive", action='store_true', dest='recursive',
help="process all files in the specified directory and all its subdirectories")
parser.add_argument("p... | |
15,296 | [
0.03363560512661934,
0.023944756016135216,
0.04565316066145897,
-0.051052026450634,
0.026406999677419662,
0.007714277599006891,
0.043868597596883774,
-0.021911710500717163,
0.004563057329505682,
0.011102685704827309,
0.060810644179582596,
-0.0009346361039206386,
0.0021911710500717163,
-0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filepath", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def process_file(filepath):
print("processing {0}...".format(filepath))
with open(filepath) as f:
lines = f.readlines()
section_begin = -1
for index in range(len(lines)):
line = lines[index]
if section_begin == -1 and line.startswith("#include"):
section_begin = i... | |
15,297 | [
0.03065650910139084,
0.02850886806845665,
-0.008543185889720917,
-0.022613385692238808,
-0.014917676337063313,
0.02415042370557785,
-0.02221333608031273,
-0.05933381989598274,
-0.03377269208431244,
0.03290942683815956,
0.02785615436732769,
0.004758496768772602,
-0.009243274107575417,
-0.02... | 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": "plotly_name", "annotat... | class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yanchor", parent_name="layout.updatemenu", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_typ... | |
15,298 | [
0.02803700603544712,
0.05174717679619789,
-0.0037176895420998335,
-0.014794273301959038,
-0.008948678150773048,
0.020235594362020493,
-0.01025437656790018,
-0.03474578261375427,
-0.02239901013672352,
0.024212785065174103,
0.037105873227119446,
0.014258882962167263,
-0.011494516395032406,
-... | 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": "plotly_name", "annotation": null, "type_comment": null}}, {"_type... | def __init__(
self, plotly_name="yanchor", parent_name="layout.updatemenu", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "arraydraw"),
role=kwargs.pop("role", "i... | |
15,299 | [
0.01336831133812666,
-0.020346395671367645,
0.01288931630551815,
-0.01733090542256832,
0.020858049392700195,
-0.04136773943901062,
-0.007380875293165445,
0.02817360684275627,
0.04195559397339821,
0.02275225520133972,
0.022795800119638443,
-0.06205160543322563,
0.03231038153171539,
-0.01757... | 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 MainHandler(webapp2.RequestHandler):
def get(self):
user = users.get_current_user()
# print os.listdir(os.path.join(os.path.dirname(__file__), 'app'))
# os.chdir("/mydir")
# x = glob.glob("app/*/*.js"):
# print files
if user:
# self.response.head... | |
15,300 | [
0.003663158044219017,
-0.01767100766301155,
0.0052033173851668835,
0.003680052002891898,
0.045748647302389145,
-0.052618831396102905,
0.002521412679925561,
0.05194307491183281,
-0.0023426192346960306,
0.014900409616529942,
-0.0009566164226271212,
-0.016567273065447807,
0.03419322893023491,
... | 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(self):
user = users.get_current_user()
# print os.listdir(os.path.join(os.path.dirname(__file__), 'app'))
# os.chdir("/mydir")
# x = glob.glob("app/*/*.js"):
# print files
if user:
# self.response.headers['Content-Type'] = 'text/plain'
... |