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
17,501
[ 0.024751899763941765, -0.020305592566728592, 0.0281995702534914, -0.06415045261383057, -0.04605612903833389, 0.05283258482813835, -0.04879048839211464, -0.020864352583885193, 0.0038964624982327223, 0.024442797526717186, 0.05078775808215141, -0.02558409608900547, 0.022397972643375397, -0.00...
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_legend_remove(): fig = plt.figure() ax = fig.add_subplot(1, 1, 1) lines = ax.plot(range(10)) leg = fig.legend(lines, "test") leg.remove() assert_equal(fig.legends, []) leg = ax.legend("test") leg.remove() assert ax.get_legend() is None
17,502
[ 0.011776776053011417, -0.0035153613425791264, 0.03296992555260658, -0.02935989387333393, -0.040947332978248596, 0.042184337973594666, -0.05162595212459564, -0.031228020787239075, -0.05170168727636337, 0.021925251930952072, -0.013379831798374653, 0.00981398019939661, 0.011953490786254406, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_legend_label_loc_args(self): # Check the deprecated warning is created and that the appropriate # call to Legend is made. This wouldn't actually create a valid # legend as there is no artist to legendify, but that doesn't matter. with mock.patch('matplotlib.cbook.warn_deprecated...
17,503
[ 0.021204236894845963, -0.008875505067408085, 0.021665455773472786, -0.0660843700170517, -0.009928029961884022, 0.04690239951014519, -0.04446621984243393, -0.030795222148299217, -0.008207328617572784, 0.006155496463179588, 0.010401074774563313, -0.02887939102947712, 0.041580647230148315, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "The \"loc\" positional argument to legend is deprecated. Please use the \"loc\" keyword instead."}}, "targets": [{"_type": "Name", "_fiel...
class TestLegendFunction(object): # Tests the legend function on the Axes and pyplot. deprecation_message = ('The "loc" positional argument ' 'to legend is deprecated. Please use ' 'the "loc" keyword instead.') @cleanup def test_legend_label_loc_ar...
17,504
[ 0.028469109907746315, 0.0016334486426785588, 0.0012664925307035446, -0.04274013265967369, -0.031848449259996414, 0.04368829354643822, -0.02382555790245533, -0.010861293412744999, 0.006229897029697895, 0.02251272089779377, 0.009621392004191875, -0.024238858371973038, -0.006242053117603064, ...
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_old_legend_handler_interface(self): # Check the deprecated warning is created and that the appropriate # call to the legend handler is made. class AnyObject(object): pass class AnyObjectHandler(object): def __call__(self, legend, orig_handle, fontsize, h...
17,505
[ 0.019308224320411682, 0.003294117981567979, 0.05249868705868721, -0.035689786076545715, -0.03299621492624283, 0.04980511963367462, -0.039833735674619675, -0.02599034644663334, -0.04682665318250656, 0.01992981880903244, -0.006517011672258377, 0.004266975447535515, 0.011641914024949074, 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 test_legend_handle_label_loc_args(self): # Check the deprecated warning is created and that the appropriate # call to Legend is made. lines = plt.plot(range(10)) with mock.patch('matplotlib.cbook.warn_deprecated') as deprecation: with mock.patch('matplotlib.legend.Legend'...
17,506
[ 0.0106577193364501, -0.01421029306948185, 0.03597274422645569, 0.0059493836015462875, -0.030702702701091766, -0.013751517049968243, 0.013975023292005062, -0.004326022695749998, -0.024915065616369247, -0.0029791032429784536, 0.00768743921071291, -0.005893507041037083, 0.006681660655885935, ...
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": "legend", "annotation": null, "type_comment": null}}, {"_type": "a...
def __call__(self, legend, orig_handle, fontsize, handlebox): x0, y0 = handlebox.xdescent, handlebox.ydescent width, height = handlebox.width, handlebox.height patch = mpatches.Rectangle([x0, y0], width, height, facecolor='red', ...
17,507
[ 0.01668262854218483, 0.002330831252038479, 0.022875072434544563, -0.00805248785763979, -0.03729330003261566, -0.0026629818603396416, 0.0052046566270291805, -0.011154485866427422, -0.021765979006886482, 0.0009755120845511556, -0.006024924572557211, -0.01023024134337902, 0.0050284722819924355,...
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": "legend", "annotation":...
class AnyObjectHandler(object): def __call__(self, legend, orig_handle, fontsize, handlebox): x0, y0 = handlebox.xdescent, handlebox.ydescent width, height = handlebox.width, handlebox.height patch = mpatches.Rectangle([x0, y0], width, height, facecolor='red',...
17,508
[ 0.060004062950611115, -0.012079446576535702, 0.07229521870613098, -0.02956651709973812, 0.0022335180547088385, -0.046285390853881836, 0.004588012117892504, -0.02939715050160885, -0.005997381638735533, 0.012472618371248245, 0.013851744122803211, 0.00864373054355383, 0.031719889491796494, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_stack_create(self): files = {'remote_stack.yaml': self.remote_template} stack_id = self.stack_create(files=files) expected_resources = {'my_stack': 'OS::Heat::Stack'} self.assertEqual(expected_resources, self.list_resources(stack_id)) stack = self.client.stacks.get(sta...
17,509
[ 0.008581701666116714, -0.025050953030586243, 0.056810006499290466, -0.05980776622891426, -0.011296886019408703, -0.005424225237220526, -0.000327879999531433, -0.03806172311306, 0.03671027347445488, -0.00742682721465826, 0.020333167165517807, -0.00629038130864501, 0.014743081294000149, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\nheat_template_version: 2013-05-23\nresources:\n my_stack:\n type: OS::Heat::Stack\n properties:\n context:\n region_...
class RemoteStackTest(functional_base.FunctionalTestsBase): template = ''' heat_template_version: 2013-05-23 resources: my_stack: type: OS::Heat::Stack properties: context: region_name: RegionOne template: get_file: remote_stack.yaml outputs: key: value: {get_attr: [my_st...
17,510
[ 0.004644719883799553, 0.023065729066729546, 0.06647184491157532, -0.028028961271047592, 0.0027488877531141043, -0.03190648555755615, -0.010657652281224728, -0.007932307198643684, 0.034454572945833206, -0.0046862647868692875, 0.01944301463663578, -0.024816155433654785, 0.02170305699110031, ...
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_stack_resource_validation_fail(self): tmpl_bad_format = self.remote_template.replace('resources', 'resource') files = {'remote_stack.yaml': tmpl_bad_format} kwargs = {'files': files} ex = self.assertRaises(exc.HTTPBadRequest, self.stack_create, **kwargs) error_msg = ('E...
17,511
[ 0.006148514337837696, -0.015182124450802803, 0.05752967298030853, 0.0009088974329642951, -0.023855866864323616, -0.01672002300620079, -0.03506406396627426, -0.006336137652397156, -0.010390035808086395, -0.006025482434779406, 0.0028404968325048685, -0.006606807932257652, 0.029822908341884613,...
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_stack_create_bad_region(self): tmpl_bad_region = self.template.replace(self.conf.region, 'DARKHOLE') files = {'remote_stack.yaml': self.remote_template} kwargs = { 'template': tmpl_bad_region, 'files': files } ex = self.assertRaises(exc.HTTPBadReq...
17,512
[ 0.03700999915599823, -0.010528086684644222, 0.04929875582456589, -0.029057040810585022, -0.007455897517502308, -0.007551716174930334, 0.02148735709488392, -0.033249109983444214, -0.01745099201798439, 0.02114001475274563, 0.015498685650527477, 0.008641654625535011, 0.00012903718743473291, -...
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_stack_update(self): files = {'remote_stack.yaml': self.remote_template} stack_id = self.stack_create(files=files) expected_resources = {'my_stack': 'OS::Heat::Stack'} self.assertEqual(expected_resources, self.list_resources(stack_id)) rsrc = self.client.resources.get(s...
17,513
[ 0.016200417652726173, -0.045006152242422104, 0.03810805454850197, 0.02164923958480358, 0.05212894082069397, 0.03190650790929794, 0.02487359382212162, 0.04028758406639099, -0.008364223875105381, -0.030445998534560204, -0.014200642704963684, -0.03096279501914978, 0.007937305606901646, 0.0426...
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": "conn", "annotation": null, "type_comment": null}}], "kwarg": null...
def _connect(self, conn): self._conn = conn ptype, result = self._send_message(cSSH2_AGENTC_REQUEST_IDENTITIES) if ptype != SSH2_AGENT_IDENTITIES_ANSWER: raise SSHException('could not get keys from ssh-agent') keys = [] for i in range(result.get_int()): ke...
17,514
[ -0.001407429575920105, 0.00042245237273164093, 0.04944853484630585, 0.0038952045142650604, 0.008916948921978474, -0.027990635484457016, 0.019824713468551636, 0.03297363594174385, -0.011372686363756657, -0.010097132995724678, 0.004217073321342468, 0.0068486458621919155, 0.020611504092812538, ...
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 run(self): try: (r, addr) = self.get_connection() self.__inr = r self.__addr = addr self._agent.connect() self._communicate() except: #XXX Not sure what to do here ... raise or pass ? raise
17,515
[ -0.0016563009703531861, -0.015789970755577087, -0.01560185570269823, 0.024266941472887993, 0.06569945067167282, 0.0001415461301803589, -0.021104242652654648, 0.05093235895037651, -0.043196093291044235, 0.0030039744451642036, 0.025325091555714607, -0.03444870933890343, -0.03183860331773758, ...
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": "wanted", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _read_all(self, wanted): result = self._conn.recv(wanted) while len(result) < wanted: if len(result) == 0: raise SSHException('lost ssh-agent') extra = self._conn.recv(wanted - len(result)) if len(extra) == 0: raise SSHException('lo...
17,516
[ -0.0051943277940154076, -0.03256544470787048, 0.02270522154867649, 0.0019961432553827763, 0.037164557725191116, 0.019337184727191925, 0.06406240910291672, 0.012322373688220978, -0.021671583876013756, -0.010574478656053543, 0.00750259542837739, 0.020568260923027992, 0.001911942264996469, -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": "t", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def __init__(self, t): AgentSSH.__init__(self) self.__t = t self._dir = tempfile.mkdtemp('sshproxy') os.chmod(self._dir, stat.S_IRWXU) self._file = self._dir + '/sshproxy.ssh' self.thread = AgentLocalProxy(self) self.thread.start()
17,517
[ 0.011449869722127914, -0.0017893812619149685, 0.024419153109192848, 0.00918702781200409, 0.024484271183609962, 0.019090350717306137, -0.002895026234909892, 0.027523098513484, 0.03279763460159302, -0.0050303456373512745, 0.008004055358469486, -0.03368757665157318, -0.010413412004709244, 0.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": "chanClient", "annotati...
class AgentRequestHandler(object): def __init__(self, chanClient): self._conn = None self.__chanC = chanClient chanClient.request_forward_agent(self._forward_agent_handler) self.__clientProxys = [] def _forward_agent_handler(self, chanRemote): self.__clientProxys.append(...
17,518
[ -0.03301340341567993, -0.041497766971588135, 0.039621684700250626, -0.0375215969979763, 0.002357350429520011, 0.010290438309311867, -0.049842122942209244, -0.0003804224543273449, 0.040713731199502945, 0.005610738880932331, 0.0254810843616724, -0.030493298545479774, 0.002933124778792262, -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 TaxInputTests(TestCase): def test_convert(self): values = {"II_brk2_0": [36000., 38000., 40000.], "II_brk2_1": [72250., 74000.], "II_brk2_2": [36500.] } ans = package_up_vars(values) exp = [[36000, 72250, 36500, 50200, 749...
17,519
[ 0.04917741194367409, 0.002961041871458292, 0.015702899545431137, 0.02741844393312931, 0.025188952684402466, 0.04109551012516022, 0.0032048923894762993, 0.007085063029080629, -0.01682836376130581, -0.019529476761817932, -0.01019348669797182, -0.02140524983406067, -0.0318559855222702, 0.0175...
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def sign_ssh_data(self, data): msg = Message() msg.add_byte(cSSH2_AGENTC_SIGN_REQUEST) msg.add_string(self.blob) msg.add_string(data) msg.add_int(0) ptype, result = self.agent._send_message(msg) if ptype != SSH2_AGENT_SIGN_RESPONSE: raise SSHException(...
17,520
[ -0.0030296985059976578, -0.04319078102707863, 0.03560427203774452, -0.047951970249414444, -0.003525110660120845, 0.014362046495079994, -0.03285743296146393, -0.00126060307957232, 0.06105831637978554, 0.027049828320741653, 0.04371398687362671, -0.01251774001866579, 0.0037343937437981367, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_convert_multiple_items(self): values = {"II_brk2_0": [36000., 38000., 40000., 41000], "II_brk2_1": [72250., 74000.], "II_brk2_2": [36500.] } values['II_em'] = [4000] ans = package_up_vars(values) defaults = taxcalc.p...
17,521
[ -0.00813769269734621, -0.017835460603237152, 0.0376385860145092, -0.03173559531569481, 0.011342172510921955, -0.0004550220910459757, -0.026830492541193962, -0.007737132720649242, 0.030245793983340263, 0.004469406325370073, 0.02552340179681778, -0.05391396954655647, 0.006194625049829483, 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_format_csv(self): c = cycler(40) tab_types = [u'mY_bin', u'mX_bin', u'mY_dec', u'mX_dec', u'df_dec', u'df_bin', u'fiscal_tots'] bin_keys = [u'thirty_forty_2', u'thirty_forty_0', u'thirty_forty_1', u'seventyfive_hundred_2', u'f...
17,522
[ 0.0026477985084056854, -0.0010138542857021093, 0.02856103517115116, -0.026358792558312416, 0.005326814483851194, 0.011340410448610783, -0.03900465741753578, -0.013905908912420273, -0.022873802110552788, 0.040571197867393494, 0.039890091866254807, -0.04558867961168289, -0.009206279180943966, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Return", "_fields": {"val...
def draw(): if(len(data) == 0): return # Clear axis so it will replace the current graph # instead of adding a new one plt.cla() for axises in data: plt.plot(axises) plt.pause(.01)
17,523
[ 0.030410345643758774, 0.021725019440054893, 0.02490885928273201, 0.0069236792623996735, -0.02399584650993347, 0.01766328327357769, -0.009411053732037544, -0.002864870009943843, -0.0005962382419966161, 0.013449379242956638, 0.0053054229356348515, -0.05857327580451965, -0.03125312551856041, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "never"}}, "targets": [{"_type": "Name", "_fields": {"id": "changefreq", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null...
class TopicSitemap(Sitemap): changefreq = "never" priority = 0.5 def items(self): return Topic.objects.all().order_by('-created', '-id') def lastmod(self, obj): return obj.created def location(self, obj): return '/t/%s/' % obj.id
17,524
[ 0.0917855054140091, -0.00583036569878459, 0.08075359463691711, -0.00997836422175169, -0.03144095093011856, 0.029168374836444855, 0.029146311804652214, 0.012057879939675331, 0.03177190572023392, 0.07634083181619644, -0.003218560479581356, 0.013050751760601997, 0.03450782224535942, 0.0119585...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cfg", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def rm_config_prefix(cfg): if not cfg: return cfg cmds = cfg.split("\n") for i in range(len(cmds)): if not cmds[i]: continue if '~' in cmds[i]: index = cmds[i].index('~') if cmds[i][:index] == ' ' * index: cmds[i] = cmds[i].replace...
17,525
[ 0.0045741163194179535, -0.04176171496510506, 0.015789220109581947, -0.06608842313289642, -0.060842495411634445, -0.04204458370804787, -0.02323381043970585, -0.00036885440931655467, -0.012079781852662563, 0.03198988363146782, 0.023490963503718376, -0.04075881466269493, 0.01967223547399044, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value...
def main(): if len(sys.argv) != 2: print(f'Usage: python {sys.argv[0]} audience_ids.txt') return lotame = better_lotameapi.Lotame() print('Change all audiences to...') print('1. My Profiles') print('2. All Profiles') audience_type = 0 while audience_type not in [1, 2]: ...
17,526
[ 0.0305176991969347, 0.000006330712949420558, 0.010057888925075531, -0.019130900502204895, 0.007784576620906591, -0.0013415578287094831, 0.0017049842281267047, -0.021330010145902634, 0.06033384054899216, 0.03054468147456646, 0.0137478057295084, -0.002752259373664856, -0.017444467172026634, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "res", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "desired_fun", "annotation": null, "type_comment": null}}, {"_type"...
def _assert_success( res, desired_fun=None, desired_x=None, rtol=1e-7, atol=1e-7): # res: linprog result object # desired_fun: desired objective function value or None # desired_x: desired solution or None assert_(res.success) assert_equal(res.status, 0) i...
17,527
[ -0.020570671185851097, 0.008523698896169662, 0.023984529078006744, -0.012112624011933804, -0.011357637122273445, -0.023700039833784103, 0.004860915243625641, 0.027507802471518517, 0.04227929562330246, 0.029630521312355995, -0.01814158260822296, -0.009924255311489105, 0.0011085458099842072, ...
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": "commands", "annotation": null, "type_comment": null}}], "kwarg"...
def to_command(module, commands): default_output = 'text' transform = ComplexList(dict( command=dict(key=True), output=dict(default=default_output), prompt=dict(), answer=dict() ), module) commands = transform(to_list(commands)) return commands
17,528
[ -0.027773773297667503, -0.023055052384734154, 0.04357123002409935, -0.0009039940196089447, -0.00945026334375143, -0.0322616882622242, 0.017246410250663757, 0.040622029453516006, 0.04444316774606705, 0.0522393137216568, -0.015720520168542862, -0.02401674911379814, -0.0021846522577106953, 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_remove_zero_row(): A = np.eye(3) A[1, :] = 0 b = np.random.rand(3) b[1] = 0 A1, b1, status, message = _remove_redundancy(A, b) assert_equal(status, 0) assert_allclose(A1, A[[0, 2], :]) assert_allclose(b1, b[[0, 2]])
17,529
[ 0.022340986877679825, 0.016597293317317963, 0.06697013974189758, -0.009955734945833683, 0.01610874943435192, 0.019000401720404625, 0.04000779613852501, 0.05117828771471977, 0.031689342111349106, 0.03892507404088974, 0.0009110685787163675, -0.0392683781683445, -0.015805060043931007, 0.05278...
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": "Tuple", "_fields": {"...
def test_no_redundancy(): m, n = 10, 10 A0 = np.random.rand(m, n) b0 = np.random.rand(m) A1, b1, status, message = _remove_redundancy(A0, b0) assert_allclose(A0, A1) assert_allclose(b0, b1) assert_equal(status, 0)
17,530
[ 0.020334351807832718, -0.0014149663038551807, 0.024313408881425858, -0.016094598919153214, 0.006822710391134024, 0.011196242645382881, 0.022625740617513657, 0.026234332472085953, -0.006441955920308828, 0.03479616716504097, -0.022515973076224327, 0.010318106040358543, -0.03762266784906387, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def test_m_gt_n(): np.random.seed(2032) m, n = 20, 10 A0 = np.random.rand(m, n) b0 = np.random.rand(m) x = np.linalg.solve(A0[:n, :], b0[:n]) b0[n:] = A0[n:, :].dot(x) A1, b1, status, message = _remove_redundancy(A0, b0) assert_equal(status, 0) assert_equal(A1.shape[0], n) assert...
17,531
[ 0.0266436655074358, 0.03539292514324188, 0.034258026629686356, -0.03338706120848656, 0.019781503826379776, 0.010768316686153412, 0.030008764937520027, 0.02007182501256466, 0.008901016786694527, 0.04201754927635193, -0.0023192791268229485, 0.011249988339841366, -0.02781815268099308, 0.00387...
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": "Tuple", "_fields": {"...
def test_m_gt_n_rank_deficient(): m, n = 20, 10 A0 = np.zeros((m, n)) A0[:, 0] = 1 b0 = np.ones(m) A1, b1, status, message = _remove_redundancy(A0, b0) assert_equal(status, 0) assert_allclose(A1, A0[0:1, :]) assert_allclose(b1, b0[0])
17,532
[ 0.019200703129172325, -0.03154949098825455, 0.04236426576972008, -0.009344683028757572, 0.00873107835650444, 0.0007546214619651437, 0.013742180541157722, 0.004311209544539452, 0.03257216513156891, 0.044818684458732605, -0.01917513646185398, -0.0027468381449580193, -0.011677657254040241, 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_dense1(): A = np.ones((6, 6)) A[0, :3] = 0 A[1, 3:] = 0 A[3:, ::2] = -1 A[3, :2] = 0 A[4, 2:] = 0 b = np.zeros(A.shape[0]) A2 = A[[0, 1, 3, 4], :] b2 = np.zeros(4) A1, b1, status, message = _remove_redundancy(A, b) assert_allclose(A1, A2) assert_allclose(b1, b2...
17,533
[ 0.0174595694988966, 0.0181376114487648, 0.03870052471756935, -0.032076578587293625, 0.020628109574317932, 0.0035499385558068752, 0.01684672385454178, 0.017902903258800507, 0.0011621240992099047, 0.06175393611192703, -0.022597037255764008, 0.01250465027987957, -0.02172340638935566, 0.024031...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"...
def test_m_lt_n_rank_deficient(): m, n = 9, 10 A0 = np.random.rand(m, n) b0 = np.random.rand(m) A0[-1, :] = np.arange(m - 1).dot(A0[:-1]) b0[-1] = np.arange(m - 1).dot(b0[:-1]) A1, b1, status, message = _remove_redundancy(A0, b0) assert_equal(status, 0) assert_equal(A1.shape[0], 8) a...
17,534
[ 0.0065772924572229385, -0.04237718507647514, 0.048758987337350845, -0.0015631316928192973, 0.017682384699583054, -0.007327721919864416, 0.019460713490843773, 0.016572507098317146, 0.025060556828975677, 0.043184369802474976, -0.02203361503779888, 0.0072331298142671585, -0.004133667331188917, ...
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_dense3(): A = np.eye(6) A[-2, -1] = 1 A[-1, :] = 1 b = np.random.rand(A.shape[0]) b[-1] = np.sum(b[:-1]) A1, b1, status, message = _remove_redundancy(A, b) assert_allclose(A1, A[:-1, :]) assert_allclose(b1, b[:-1]) assert_equal(status, 0)
17,535
[ 0.018960177898406982, -0.03893585875630379, 0.035592131316661835, -0.0038081349339336157, 0.015913669019937515, 0.015034393407404423, 0.01078661996871233, 0.011473941616714, 0.02357947640120983, 0.05146864801645279, -0.017857985571026802, -0.0012562201591208577, 0.0005700592300854623, 0.05...
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_dense2(): A = np.eye(6) A[-2, -1] = 1 A[-1, :] = 1 b = np.zeros(A.shape[0]) A1, b1, status, message = _remove_redundancy(A, b) assert_allclose(A1, A[:-1, :]) assert_allclose(b1, b[:-1]) assert_equal(status, 0)
17,536
[ 0.012704269960522652, -0.01571565307676792, 0.01181026641279459, -0.03178084269165993, 0.012099305167794228, 0.024144835770130157, 0.025811851024627686, 0.011393512599170208, -0.011568279936909676, 0.03691632300615311, -0.026712575927376747, 0.0025946288369596004, -0.015325786545872688, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def test_m_lt_n_sparse(): np.random.seed(2017) m, n = 20, 50 p = 0.05 A = np.random.rand(m, n) A[np.random.rand(m, n) > p] = 0 rank = np.linalg.matrix_rank(A) b = np.zeros(A.shape[0]) A1, b1, status, message = _remove_redundancy(A, b) assert_equal(status, 0) assert_equal(A1.shape...
17,537
[ 0.017468731850385666, -0.003968013450503349, 0.015912648290395737, -0.01822647638618946, 0.00593003211542964, 0.021122146397829056, 0.02892962656915188, 0.012692230753600597, -0.009471814148128033, 0.02232641912996769, -0.024843215942382812, 0.00726623460650444, -0.01830766350030899, 0.052...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def test_m_gt_n_sparse(): np.random.seed(2013) m, n = 20, 5 p = 0.1 A = np.random.rand(m, n) A[np.random.rand(m, n) > p] = 0 rank = np.linalg.matrix_rank(A) b = np.zeros(A.shape[0]) A1, b1, status, message = _remove_redundancy(A, b) assert_equal(status, 0) assert_equal(A1.shape[0...
17,538
[ 0.018706578761339188, -0.018888574093580246, 0.015105659142136574, -0.02029254287481308, 0.010640259832143784, 0.02473844215273857, 0.024842439219355583, 0.016171634197235107, -0.005560624413192272, 0.02473844215273857, -0.021046524867415428, -0.010276268236339092, -0.016015639528632164, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def test_m_eq_n_sparse(): np.random.seed(2017) m, n = 100, 100 p = 0.01 A = np.random.rand(m, n) A[np.random.rand(m, n) > p] = 0 rank = np.linalg.matrix_rank(A) b = np.zeros(A.shape[0]) A1, b1, status, message = _remove_redundancy(A, b) assert_equal(status, 0) assert_equal(A1.sha...
17,539
[ 0.043298229575157166, -0.02568657137453556, 0.0037619108334183693, 0.0012965105706825852, -0.047173261642456055, 0.012123968452215195, 0.009496142156422138, 0.022182801738381386, -0.012599646113812923, 0.054946523159742355, 0.023679444566369057, -0.028656654059886932, 0.008202532306313515, ...
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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, params): self.buffer = "" self.results = [] self.clean() self.num_results_regex_str = None self.nbrecs_regex_str = None for (name, value) in params.iteritems(): setattr(self, name, value) if self.num_results_regex_str: se...
17,540
[ 0.04326900839805603, -0.02579900063574314, 0.0037323867436498404, 0.0012999553000554442, -0.047143496572971344, 0.01209908165037632, 0.009483220987021923, 0.022260917350649834, -0.012574692256748676, 0.05493887886404991, 0.0237109512090683, -0.028629466891288757, 0.008241991512477398, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, params): self.buffer = "" self.results = [] self.clean() self.num_results_regex_str = None self.nbrecs_regex_str = None for (name, value) in params.iteritems(): setattr(self, name, value) if self.num_results_regex_str: se...
17,541
[ -0.002265022834762931, -0.010689153335988522, 0.0250248983502388, 0.01616530679166317, 0.005902216769754887, 0.05954848229885101, -0.006566373165696859, 0.009843293577432632, -0.030751677230000496, 0.03814511373639107, -0.014924714341759682, -0.05303223431110382, 0.028320616111159325, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "operator", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "against", "annotation": null, "type_comment": null}}], "kwarg...
def is_precedent(operator, against): if operator is against and is_natural_self_precedent(operator): return False else: return (_PRECEDENCE.get(operator, getattr(operator, 'precedence', _smallest)) <= _PRECEDENCE.get(against, ...
17,542
[ 0.048460956662893295, 0.04021899029612541, 0.041637688875198364, -0.04900141432881355, -0.05062278360128403, -0.010026599280536175, 0.03422892838716507, 0.014952637255191803, -0.01940014585852623, 0.004016832448542118, 0.0025024274364113808, -0.0708448737859726, -0.031931985169649124, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def tearDown(self): # Delete any tables made for our models self.delete_tables() new_apps.clear_cache() for model in new_apps.get_models(): model._meta._expire_cache() if 'schema' in new_apps.all_models: for model in self.local_models: del ...
17,543
[ -0.004950951784849167, -0.00456751836463809, 0.03347267955541611, -0.017534296959638596, -0.023689953610301018, -0.006409551948308945, -0.02704758383333683, -0.010591046884655952, -0.017213040962815285, 0.010466690175235271, 0.0032151390332728624, -0.038198236376047134, 0.0621783547103405, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "objs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fields", "annotation": null, "type_comment": null}}, {"_type": "a...
def print_list(objs, fields, formatters={}, order_by=None): pt = prettytable.PrettyTable([f for f in fields], caching=False, print_empty=False) pt.aligns = ['l' for f in fields] for o in objs: row = [] for field in fields: if field in formatters:...
17,544
[ 0.07981076091527939, 0.054765734821558, 0.06541334092617035, -0.019663352519273758, -0.011787595227360725, -0.0037642763927578926, 0.06305234879255295, -0.025021877139806747, -0.03404919430613518, 0.022001197561621666, 0.010242534801363945, -0.01865645870566368, -0.0014633226674050093, 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": "M2MFieldClass", "annotation": null, "type_comment": null}}], "kwa...
def _test_m2m_db_constraint(self, M2MFieldClass): class LocalAuthorWithM2M(Model): name = CharField(max_length=255) class Meta: app_label = 'schema' apps = new_apps self.local_models = [LocalAuthorWithM2M] # Create the table with...
17,545
[ -0.0011658759322017431, 0.02086898311972618, 0.03718205913901329, -0.050807785242795944, 0.00372135522775352, 0.020826993510127068, -0.011746675707399845, -0.04959007725119591, -0.043753482401371, 0.010040836408734322, 0.005374707747250795, -0.07180273532867432, 0.08251016587018967, 0.0254...
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": "model", "annotation": null, "type_comment": null}}], "kwarg": nul...
def column_classes(self, model): with connection.cursor() as cursor: columns = { d[0]: (connection.introspection.get_field_type(d[1], d), d) for d in connection.introspection.get_table_description( cursor, model._meta.db_table, ...
17,546
[ 0.03131117671728134, 0.01363412570208311, 0.034708958119153976, -0.028730586171150208, -0.0006834535743109882, -0.004889683332294226, 0.017451250925660133, -0.01567709445953369, -0.030601516366004944, -0.004206901881843805, 0.009424535557627678, -0.04309587925672531, 0.032579969614744186, ...
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_add_foreign_object(self): with connection.schema_editor() as editor: editor.create_model(BookForeignObj) new_field = ForeignObject(Author, on_delete=CASCADE, from_fields=['author_id'], to_fields=['id']) new_field.set_attributes_from_name('author') with connection.sc...
17,547
[ 0.029728610068559647, 0.051955003291368484, 0.03278985992074013, 0.002605834510177374, -0.010374831967055798, -0.02246353216469288, 0.041132841259241104, -0.016351813450455666, -0.06864096969366074, 0.0073081934824585915, -0.020782001316547394, 0.03533371537923813, 0.014724177308380604, 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_alter_text_field(self): # Regression for "BLOB/TEXT column 'info' can't have a default value") # on MySQL. # Create the table with connection.schema_editor() as editor: editor.create_model(Note) old_field = Note._meta.get_field("info") new_field = Tex...
17,548
[ 0.05066235736012459, -0.00042497142567299306, 0.033214036375284195, -0.02920345962047577, 0.00536760501563549, 0.01311505027115345, 0.012584916315972805, 0.004474444780498743, -0.019522754475474358, 0.011870387941598892, 0.013691282831132412, -0.050846751779317856, 0.011415164917707443, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_add_field_default_dropped(self): # Create the table with connection.schema_editor() as editor: editor.create_model(Author) # Ensure there's no surname field columns = self.column_classes(Author) self.assertNotIn("surname", columns) # Create a row ...
17,549
[ 0.05573254078626633, -0.0077133928425610065, 0.06275612115859985, -0.02497018501162529, -0.005350346677005291, -0.0005989566561765969, 0.023066066205501556, -0.0018471096409484744, -0.02095671370625496, 0.007074886001646519, 0.0038937528152018785, -0.03801397234201431, 0.005270533729344606, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_alter_field_default_dropped(self): # Create the table with connection.schema_editor() as editor: editor.create_model(Author) # Create a row Author.objects.create(name='Anonymous1') self.assertEqual(Author.objects.get().height, None) old_field = Author...
17,550
[ 0.06161786615848541, 0.03114212304353714, 0.040027178823947906, -0.03540695086121559, -0.025855515152215958, -0.03331896290183067, 0.029853789135813713, -0.04102674871683121, -0.05060039460659027, -0.007496766280382872, 0.0018033888190984726, -0.04218180477619171, -0.050511546432971954, 0....
6
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Author", "ctx": {"_type": "Load", "_fields": {}}}}, {"_type": "Name", "_fields": {"id": "CASCADE", "ctx": {"_type": "Lo...
class LocalBookWithM2M(Model): author = ForeignKey(Author, CASCADE) title = CharField(max_length=100, db_index=True) pub_date = DateTimeField() tags = M2MFieldClass("TagM2MTest", related_name="books") class Meta: app_label = 'schema' ...
17,551
[ 0.03937656432390213, 0.01305666845291853, 0.04883476719260216, -0.03202743083238602, -0.007142574060708284, -0.07079519331455231, 0.014970052056014538, -0.04279021546244621, -0.0599236935377121, -0.008985293097794056, -0.005794507917016745, -0.033332012593746185, -0.025374075397849083, 0.0...
6
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "IntegerField", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": []}}, "targets": [{"_type": "Name", "_...
class LocalBook(Model): author = IntegerField() title = CharField(max_length=100, db_index=True) pub_date = DateTimeField() class Meta: app_label = 'schema' apps = new_apps
17,552
[ 0.021404022350907326, 0.005717627704143524, 0.09103425592184067, 0.01304167602211237, 0.0333598256111145, -0.01934421993792057, 0.0014916766667738557, -0.03208364173769951, -0.054719068109989166, 0.005493736360222101, -0.011463241651654243, 0.04204681143164635, 0.05042035132646561, 0.00368...
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": "localaddress", "annotation": null, "type_comment": null}}, {"_typ...
def from_legacy_params(self, localaddress='', localport=0, ssl=False, ipv6=False): if localaddress or localport: self.bind_address = (localaddress, localport) if ssl: self.wrapper = importlib.import_module('ssl').wrap_socket if ipv6: self.family = ...
17,553
[ 0.06166248023509979, 0.03114221803843975, 0.03996066376566887, -0.03542926907539368, -0.025833379477262497, -0.033296849578619, 0.029831668362021446, -0.0409824475646019, -0.050644975155591965, -0.007530108094215393, 0.0018117240397259593, -0.04215972125530243, -0.05051169916987419, 0.0491...
6
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Author", "ctx": {"_type": "Load", "_fields": {}}}}, {"_type": "Name", "_fields": {"id": "CASCADE", "ctx": {"_type": "Lo...
class LocalBookWithM2M(Model): author = ForeignKey(Author, CASCADE) title = CharField(max_length=100, db_index=True) pub_date = DateTimeField() tags = M2MFieldClass("TagM2MTest", related_name="books") class Meta: app_label = 'schema' ...
17,554
[ 0.007029997184872627, -0.013163456693291664, -0.006827209144830704, -0.05436151847243309, -0.026454990729689598, -0.014344610273838043, 0.0109434574842453, 0.0251172985881567, -0.03532075509428978, 0.030880756676197052, 0.003625286975875497, -0.04001690819859505, -0.01647922396659851, -0.0...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "limit_offset", "annotation": null, "type_comment": null}}, {"_typ...
def getSoonView(self, limit_offset = None, random = False, late = False, **kwargs): db = get_db() now = time.time() # Get profiles first, determine pre or post theater profiles = fireEvent('profile.all', single = True) pre_releases = fireEvent('quality.pre_releases', single = T...
17,555
[ -0.00034841231536120176, -0.012930872850120068, -0.00888783298432827, -0.02753378078341484, -0.007085597142577171, 0.004933878313750029, -0.012060591019690037, 0.0062221684493124485, -0.00975126214325428, 0.026163259521126747, -0.007229502312839031, -0.06041259691119194, -0.00754472194239497...
17
{"_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 Dashboard(Plugin): def __init__(self): addApiView('dashboard.soon', self.getSoonView) def getSoonView(self, limit_offset = None, random = False, late = False, **kwargs): db = get_db() now = time.time() # Get profiles first, determine pre or post theater profiles...
17,556
[ 0.004921709652990103, 0.05269709601998329, 0.017089270055294037, -0.060402803122997284, 0.013373130932450294, -0.012254560366272926, 0.07153879106044769, 0.025528261438012123, 0.049863383173942566, 0.028312260285019875, -0.018456412479281425, -0.012329131364822388, 0.005468566436320543, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "description", "annotation": null, "type_comment": null}}, {"_type...
def createOrUpdateRunner(self, description, options): changed = False # Because we have already call userExists in main() if self.runnerObject is None: runner = self.createRunner({ 'description': description, 'active': options['active'], ...
17,557
[ 0.02434043027460575, 0.0529959462583065, 0.01887325942516327, -0.059489522129297256, 0.045706383883953094, -0.04390494152903557, 0.01611872762441635, 0.023921489715576172, 0.02245519869029522, 0.04805245250463486, -0.045706383883953094, 0.0015068758511915803, 0.023795807734131813, -0.04909...
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": "arguments", "annotation": null, "type_comment": null}}], "kwarg":...
def createRunner(self, arguments): if self._module.check_mode: return True try: runner = self._gitlab.runners.create(arguments) except (gitlab.exceptions.GitlabCreateError) as e: self._module.fail_json(msg="Failed to create runner: %s " % to_native(e)) ...
17,558
[ -0.004019184038043022, 0.046422481536865234, 0.007664770819246769, -0.06787420064210892, 0.02212660387158394, 0.017583176493644714, -0.019872967153787613, -0.001057521440088749, 0.03547969460487366, 0.06647621840238571, 0.004787468817085028, -0.02757389284670353, 0.0325150191783905, -0.026...
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(): argument_spec = basic_auth_argument_spec() argument_spec.update(dict( url=dict(type='str', required=True, removed_in_version="2.10"), api_token=dict(type='str', no_log=True, aliases=["private_token"]), description=dict(type='str', required=True, aliases=["name"]), act...
17,559
[ 0.0060556684620678425, 0.023502474650740623, 0.009590642526745796, -0.07576487213373184, 0.03483359515666962, -0.004441223572939634, 0.020549660548567772, -0.002915303222835064, 0.030944524332880974, 0.06126488000154495, -0.029672173783183098, -0.008174251765012741, -0.002351147821173072, ...
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": "runner", "annotation": null, "type_comment": null}}, {"_type": "a...
def updateRunner(self, runner, arguments): changed = False for arg_key, arg_value in arguments.items(): if arguments[arg_key] is not None: if isinstance(arguments[arg_key], list): list1 = getattr(runner, arg_key) list1.sort() ...
17,560
[ 0.03145761415362358, -0.003956260159611702, 0.012553106062114239, 0.05765447020530701, 0.020743632689118385, -0.04649139940738678, 0.019546061754226685, -0.012563798576593399, -0.04691910371184349, 0.045593224465847015, -0.013333665207028389, 0.0008995145326480269, 0.014263921417295933, 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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, parent): super(ColorChooser, self).__init__(parent) self.colors = KColorCells(self, 1, 1) self.colors.setAcceptDrags(False) self.colors.setEditTriggers(self.colors.NoEditTriggers) self.otherBtn = KPushButton(self) self.otherBtn.setText(i18nc('@action:bu...
17,561
[ 0.03779784217476845, -0.00225430098362267, 0.014642013236880302, 0.01204847265034914, -0.009843416512012482, 0.03952686861157417, 0.015933312475681305, 0.025235040113329887, 0.017990635707974434, 0.053796812891960144, -0.004481243900954723, -0.007534399162977934, -0.010696986690163612, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pl", "annotation": nul...
class ShellCwdSegment(CwdSegment): def get_shortened_path(self, pl, segment_info, use_shortened_path=True, **kwargs): if use_shortened_path: try: return out_u(segment_info['shortened_path']) except KeyError: pass return super(ShellCwdSegment, self).get_shortened_path(pl, segment_info, **kwargs)
17,562
[ 0.017967283725738525, 0.007202595472335815, 0.06156370788812637, 0.039496660232543945, -0.02294076979160309, -0.04438053444027901, 0.016051817685365677, -0.0478530116379261, -0.046598438173532486, 0.05309533700346947, 0.012814571149647236, -0.020823678001761436, 0.0029908132273703814, -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": "colors", "annotation": null, "type_comment": null}}], "kwarg": nu...
def setColors(self, colors): if len(colors): rows, columns = _calc_dimensions_for_items_count(len(colors)) else: self.hide() self.show_color_dialog(True) return self.colors.setColumnCount(columns) self.colors.setRowCount(rows) self....
17,563
[ -0.004193687811493874, -0.008567294105887413, 0.058124247938394547, 0.019589945673942566, -0.05985993146896362, -0.02770744450390339, 0.03024747036397457, 0.02986646629869938, -0.01526131946593523, 0.023855071514844894, 0.02336823381483555, 0.011027944274246693, 0.012731877155601978, 0.036...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "view", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_color_range_under_cursor(view): assert(view is not None) if view.selection(): # Some text selected, just use it as input... color_range = view.selectionRange() else: # If no selection, try to get a #color u...
17,564
[ 0.0019722734577953815, 0.030048564076423645, 0.019278468564152718, 0.012848722748458385, -0.010603157803416252, -0.015519706532359123, 0.003486818168312311, -0.04859466850757599, -0.0367906428873539, 0.03231028467416763, 0.02832534909248352, 0.006672073621302843, 0.058244671672582626, -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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, parent): super(PaletteView, self).__init__(parent) self.toolView = kate.mainInterfaceWindow().createToolView( 'color_tools_pate_plugin' , kate.Kate.MainWindow.Bottom , KIcon('color').pixmap(32, 32) , i18nc('@title:tab', 'Palette') ) ...
17,565
[ 0.014589049853384495, 0.0212111733853817, 0.011430805549025536, 0.008985713124275208, -0.008196152746677399, -0.02978937141597271, 0.03908072039484978, -0.005970099940896034, -0.0420963354408741, -0.013020114973187447, 0.0043629612773656845, 0.01828725077211857, 0.017614850774407387, 0.031...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "color", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def _insertColorIntoActiveDocument(color): color_str = color.name() # Get it as color string #kate.qDebug('ColorUtils: selected color: {}'.format(color_str)) document = kate.activeDocument() view = kate.activeView() cursor = view.cursorPosition() has_selection = vi...
17,566
[ 0.002329363254830241, -0.03314182907342911, 0.014636657200753689, -0.05783897638320923, -0.0025048027746379375, -0.09444831311702728, -0.025876572355628014, 0.010467392392456532, -0.004753080662339926, 0.018422609195113182, 0.021595261991024017, 0.012655224651098251, 0.025829395279288292, ...
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": "hosts", "annotation": null, "type_comment": null}}], "kwarg": nul...
def convert_with_links(name, hosts): driver = Driver() driver.name = name driver.hosts = hosts driver.links = [ link.Link.make_link('self', pecan.request.public_url, 'drivers', name), link.Link.make_l...
17,567
[ 0.027643460780382156, -0.03069286048412323, 0.04052606597542763, 0.03944331035017967, 0.03789651393890381, -0.0469784177839756, 0.008667584508657455, -0.010523740202188492, -0.021964509040117264, 0.00040706986328586936, 0.01911398395895958, -0.03212917223572731, 0.03489130735397339, -0.042...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "Integer", "value": {"_type": "Name", "_fields": {"id": "db", "ctx": {"_...
class Computer(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Unicode, unique=True) vendor = db.Column(db.Unicode) purchase_time = db.Column(db.DateTime) owner_id = db.Column(db.Integer, db.ForeignKey('person.id')) owner = db.relationship('Person', backref=db.backref...
17,568
[ 0.037970952689647675, 0.03745265305042267, 0.06737872213125229, -0.021498093381524086, -0.016157371923327446, 0.018884070217609406, 0.015717945992946625, 0.07535599917173386, 0.031796447932720184, -0.01664186827838421, 0.045587677508592606, -0.01287857536226511, -0.03341894596815109, -0.00...
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 _cleanup_processes(self): if hasattr(self, '_workers'): for worker_prc in self._workers: if worker_prc and worker_prc.is_alive(): try: worker_prc.terminate() except AttributeError: pass
17,569
[ 0.04273758828639984, 0.0326656699180603, 0.04273758828639984, -0.007819963619112968, -0.03786248341202736, 0.0008491218322888017, 0.03318535163998604, -0.017198970541357994, -0.013548829592764378, 0.03291313722729683, 0.03283889964222908, -0.04541023075580597, -0.01072770357131958, -0.0498...
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": "inventory", "annotation": null, "type_comment": null}}, {"_type":...
def __init__(self, inventory, variable_manager, loader, options, passwords, stdout_callback=None, run_additional_callbacks=True, run_tree=False): self._inventory = inventory self._variable_manager = variable_manager self._loader = loader self._options = options self._stats = Agg...
17,570
[ 0.029850367456674576, 0.01742597669363022, 0.012594900093972683, -0.0033988042268902063, -0.022473029792308807, -0.017607850953936577, -0.004822550807148218, -0.01526620052754879, 0.027554184198379517, 0.0543808676302433, 0.02619011700153351, 0.0038193920627236366, -0.02170005813241005, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def _process_block(b): temp_list = [] for t in b.block: if isinstance(t, Block): temp_list.extend(_process_block(t)) else: temp_list.append(t) return temp_list
17,571
[ 0.010760968551039696, 0.04301811382174492, 0.02597830444574356, -0.025540394708514214, 0.022037124261260033, 0.03400234133005142, -0.024432742968201637, 0.03709346428513527, 0.028747433796525, -0.0012187391985207796, 0.03696466609835625, -0.0255146361887455, -0.01778683066368103, -0.038407...
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 has_dead_workers(self): # [<WorkerProcess(WorkerProcess-2, stopped[SIGKILL])>, # <WorkerProcess(WorkerProcess-2, stopped[SIGTERM])> defunct = False for (idx, x) in enumerate(self._workers): if hasattr(x, 'exitcode'): if x.exitcode in [-9, -11, -15]: ...
17,572
[ -0.014038987457752228, -0.04891001805663109, -0.014605075120925903, -0.024409722536802292, -0.04365672171115875, 0.013597438111901283, -0.01768459565937519, 0.0336029939353466, 0.013133245520293713, 0.01796763949096203, -0.002227557124570012, -0.017571376636624336, -0.014288065955042839, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "interface", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg...
def get_mtu(interface, module): command = 'show interface {0}'.format(interface) mtu = {} body = execute_show_command(command, module) try: mtu_table = body[0]['TABLE_interface']['ROW_interface'] mtu['mtu'] = str( mtu_table.get('eth_mtu', mtu_table...
17,573
[ 0.007516748737543821, 0.004919619765132666, 0.00562711339443922, -0.03634786978363991, -0.05320831388235092, 0.011684096418321133, -0.01992923580110073, 0.015546953305602074, 0.018460514023900032, 0.03923754766583443, 0.0018254534807056189, -0.007385399658232927, -0.03856886178255081, 0.00...
11
{"_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_system_mtu(module): command = 'show run all | inc jumbomtu' sysmtu = '' body = execute_show_command(command, module, command_type='cli_show_ascii') if body: sysmtu = str(body[0].split(' ')[-1]) try: sysmtu = int(sysmtu) except: sysmtu = "" r...
17,574
[ 0.026915300637483597, -0.045157890766859055, 0.03880864381790161, -0.03775043413043022, -0.030043916776776314, 0.0339316800236702, -0.017655976116657257, 0.030642034485936165, -0.015861622989177704, 0.06666712462902069, -0.0047331820242106915, 0.017759496346116066, 0.0010006970260292292, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "delta", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "interface", "annotation": null, "type_comment": null}}], "kwarg"...
def get_commands_config_mtu(delta, interface): CONFIG_ARGS = { 'mtu': 'mtu {mtu}', 'sysmtu': 'system jumbomtu {sysmtu}', } commands = [] for param, value in delta.items(): command = CONFIG_ARGS.get(param, 'DNE').format(**delta) if command and command != 'DNE': ...
17,575
[ 0.012855138629674911, -0.04134269058704376, 0.013909799046814442, -0.03417099639773369, -0.041694242507219315, 0.044694166630506516, -0.02683524787425995, 0.04131925106048584, -0.004444221965968609, 0.06820137798786163, -0.00015682581579312682, -0.002268984680995345, -0.007113098632544279, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "delta", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "interface", "annotation": null, "type_comment": null}}], "kwarg"...
def get_commands_remove_mtu(delta, interface): CONFIG_ARGS = { 'mtu': 'no mtu {mtu}', 'sysmtu': 'no system jumbomtu {sysmtu}', } commands = [] for param, value in delta.items(): command = CONFIG_ARGS.get(param, 'DNE').format(**delta) if command and command != 'DNE': ...
17,576
[ 0.012406762689352036, -0.02375289425253868, 0.009532583877444267, -0.04488694667816162, -0.03511866554617882, 0.039177872240543365, -0.017467673867940903, 0.008504688739776611, 0.020243646577000618, 0.07531788945198059, 0.012190707959234715, -0.018423551693558693, -0.011810976080596447, 0....
13
{"_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 = dict( mtu=dict(type='str'), interface=dict(type='str'), sysmtu=dict(type='str'), state=dict(choices=['absent', 'present'], default='present'), ) module = get_network_module(argument_spec=argument_spec, ...
17,577
[ -0.02939707413315773, 0.00455968314781785, -0.014250410720705986, -0.018922125920653343, 0.03943509981036186, 0.026237783953547478, -0.037216875702142715, 0.004612898454070091, 0.026484252884984016, 0.035133086144924164, -0.0001197336969198659, -0.02744772471487522, 0.02937466651201248, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "interface", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg...
def is_default(interface, module): command = 'show run interface {0}'.format(interface) try: body = execute_show_command( command, module, command_type='cli_show_ascii')[0] if body == 'DNE': return 'DNE' else: raw_list = body.split('\n') ...
17,578
[ 0.02038213051855564, -0.02165125496685505, 0.02327573485672474, -0.040002789348363876, -0.06685744971036911, -0.0030221014749258757, 0.007646472193300724, -0.0713755339384079, 0.013579626567661762, -0.0008939392282627523, 0.039444372057914734, 0.0219685360789299, 0.03238804265856743, -0.03...
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": "test_name", "annotation": null, "type_comment": null}}], "kwarg":...
def load_fixtures(self, test_name): test_side_effects = [] for s in test_name_side_effect_matrix[test_name]: rc = s[0] out = load_fixture(s[1]) if s[1] else None err = s[2] side_effect_with_fixture_loaded = (rc, out, err) test_side_effects.appe...
17,579
[ 0.005749876145273447, 0.0010305384639650583, 0.019629305228590965, -0.03814728930592537, 0.016887241974473, 0.05682230740785599, -0.00002049044633167796, -0.009760294109582901, 0.010883694514632225, -0.005299912299960852, 0.037301719188690186, -0.054503027349710464, 0.007290021516382694, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "openvswitch_db", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "module", "ctx": {"_type": "Store", "_fields": {}}...
class TestOpenVSwitchDBModule(TestOpenVSwitchModule): module = openvswitch_db def setUp(self): self.mock_run_command = ( patch('ansible.module_utils.basic.AnsibleModule.run_command')) self.run_command = self.mock_run_command.start() self.mock_get_bin_path = ( pa...
17,580
[ 0.014692375436425209, 0.03744805231690407, 0.02254110760986805, -0.02789405733346939, -0.0030547943897545338, 0.05899536609649658, -0.02215714193880558, 0.00918132346123457, 0.020666446536779404, 0.0025833058170974255, 0.05407155677676201, -0.05258086323738098, 0.03677046671509743, 0.04327...
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 test_openvswitch_db_absent_removes_key(self): set_module_args(dict(state='absent', table='Bridge', record='test-br', col='other_config', key='disable-in-band', value='True')) self.execute_module( chang...
17,581
[ 0.012778515927493572, 0.011832371354103088, 0.020781785249710083, -0.025512507185339928, -0.009044027887284756, 0.05071334168314934, 0.0019841205794364214, 0.0029747895896434784, 0.01866687461733818, -0.017386795952916145, 0.02364248037338257, -0.021972814574837685, 0.028094924986362457, 0...
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 test_openvswitch_db_present_adds_key(self): set_module_args(dict(state='present', table='Bridge', record='test-br', col='other_config', key='disable-in-band', value='True')) self.execute_module( change...
17,582
[ 0.018963845446705818, 0.011298919096589088, 0.017409615218639374, -0.018594855442643166, -0.005515281111001968, 0.057517703622579575, 0.018259409815073013, 0.004908684175461531, 0.019153932109475136, -0.01285874005407095, 0.018393589183688164, -0.019869549199938774, 0.013428997248411179, 0...
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 test_openvswitch_db_present_updates_key(self): set_module_args(dict(state='present', table='Bridge', record='test-br', col='other_config', key='disable-in-band', value='False')) self.execute_module( ch...
17,583
[ 0.018811294808983803, -0.042700786143541336, 0.02075223997235298, 0.044360965490341187, -0.03706105798482895, -0.010931547731161118, 0.018774673342704773, 0.016516340896487236, 0.003332565538585186, 0.02287629246711731, -0.016430892050266266, -0.01955593377351761, 0.024035977199673653, -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_relative_risk_confidence_interval(): result = relative_risk(exposed_cases=16, exposed_total=128, control_cases=24, control_total=256) rr = result.relative_risk ci = result.confidence_interval(confidence_level=0.95) # The corresponding calculation in R using the epitoo...
17,584
[ -0.033395275473594666, 0.017045006155967712, 0.007276767864823341, 0.0007419009343720973, -0.031646452844142914, -0.016350269317626953, 0.012864606454968452, -0.01360725611448288, -0.056537192314863205, 0.008588382974267006, -0.014972773380577564, -0.01585916243493557, 0.025082390755414963, ...
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": "tablewin", "annotation...
class Ui_tablewin(object): def setupUi(self, tablewin): tablewin.setObjectName(_fromUtf8("tablewin")) tablewin.resize(255, 489) tablewin.setWindowTitle(_fromUtf8("")) self.centralwidget = QtGui.QWidget(tablewin) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) ...
17,585
[ -0.027215860784053802, -0.0010069176787510514, 0.032472897320985794, 0.0010139920050278306, -0.02500236965715885, -0.015180010348558426, 0.011664838530123234, -0.0213425662368536, -0.05745011568069458, 0.014186455868184566, -0.0020421326626092196, -0.0028155965264886618, 0.026335494592785835...
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": "tablewin", "annotation": null, "type_comment": null}}], "kwarg": ...
def setupUi(self, tablewin): tablewin.setObjectName(_fromUtf8("tablewin")) tablewin.resize(255, 489) tablewin.setWindowTitle(_fromUtf8("")) self.centralwidget = QtGui.QWidget(tablewin) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.verticalLayout = QtGu...
17,586
[ 0.018538838252425194, -0.045723192393779755, 0.014516890048980713, -0.021558083593845367, 0.01156449131667614, 0.033913593739271164, 0.03097233735024929, 0.025022974237799644, -0.027407174929976463, 0.05771104618906975, -0.021201567724347115, -0.026404473930597305, 0.020232288166880608, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _old_docker_version(self): cmd_args = [] if self._play_context.docker_extra_args: cmd_args += self._play_context.docker_extra_args.split(' ') old_version_subcommand = ['version'] old_docker_cmd = [self.docker_cmd] + cmd_args + old_version_subcommand p = subproce...
17,587
[ 0.00040290883043780923, -0.052966177463531494, 0.006441416684538126, -0.004476195201277733, 0.006190319545567036, 0.02301896922290325, 0.03722390532493591, 0.03869974613189697, -0.047308798879384995, 0.014399666339159012, -0.0015732019674032927, -0.023059964179992676, 0.02787693403661251, ...
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": "play_context", "annotation": null, "type_comment": null}}, {"_typ...
def __init__(self, play_context, new_stdin, *args, **kwargs): super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs) # Note: docker supports running as non-root in some configurations. # (For instance, setting the UNIX socket file to be readable and # writable by a s...
17,588
[ 0.03305733948945999, -0.019144101068377495, 0.009352311491966248, -0.009668521583080292, -0.00180614844430238, 0.019465669989585876, -0.008532308973371983, -0.0011636794079095125, -0.014127617701888084, 0.06182708591222763, -0.030270403251051903, -0.05145111307501793, -0.02769784815609455, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_docker_version(self): cmd, cmd_output, err, returncode = self._old_docker_version() if returncode == 0: for line in to_text(cmd_output, errors='surrogate_or_strict').split(u'\n'): if line.startswith(u'Server version:'): # old docker versions ret...
17,589
[ 0.031574733555316925, -0.04470525681972504, -0.02338462695479393, -0.015249411575496197, 0.02696368098258972, 0.03293609246611595, 0.05968020111322403, 0.02863244339823723, -0.027446744963526726, 0.040511395782232285, -0.026480618864297867, -0.028017636388540268, -0.022440457716584206, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _new_docker_version(self): # no result yet, must be newer Docker version cmd_args = [] if self._play_context.docker_extra_args: cmd_args += self._play_context.docker_extra_args.split(' ') new_version_subcommand = ['version', '--format', "'{{.Server.Version}}'"] ...
17,590
[ 0.03828837350010872, -0.039189551025629044, 0.0329737551510334, 0.005476369988173246, 0.048709653317928314, -0.0032667585182935, -0.0013900331687182188, 0.011351335793733597, 0.00020850497821811587, 0.05550312250852585, 0.03184150904417038, -0.03761827200651169, -0.014892490580677986, 0.03...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": nu...
class AccountAdapter(DefaultAccountAdapter): def is_safe_url(self, url): challenge_domains = { f"{c.short_name.lower()}{settings.SESSION_COOKIE_DOMAIN}" for c in Challenge.objects.all() } workstation_domains = { f"{r}{settings.SESSION_COOKIE_DOMAIN}" ...
17,591
[ 0.0033896698150783777, -0.05026298016309738, 0.006077438127249479, 0.004008826334029436, 0.04099560156464577, 0.025907576084136963, -0.023339644074440002, -0.003991707228124142, -0.014106504619121552, 0.06824991852045059, 0.026729315519332886, -0.00312146358191967, -0.009649716317653656, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def is_safe_url(self, url): challenge_domains = { f"{c.short_name.lower()}{settings.SESSION_COOKIE_DOMAIN}" for c in Challenge.objects.all() } workstation_domains = { f"{r}{settings.SESSION_COOKIE_DOMAIN}" for r in settings.WORKSTATIONS_ACTIVE_REGI...
17,592
[ 0.048850852996110916, 0.0017908558947965503, -0.01850380003452301, 0.028735795989632607, 0.06009886413812637, -0.03212251514196396, 0.01659492217004299, 0.032881960272789, -0.01681044138967991, -0.021592898294329643, -0.016830965876579285, -0.028920525684952736, 0.010396200232207775, 0.004...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class SocialAccountAdapter(DefaultSocialAccountAdapter): def populate_user(self, *args, **kwargs): user = super().populate_user(*args, **kwargs) if not user_username(user) and user_email(user): # If no username set, use the first part of their email user_username(user, user_...
17,593
[ 0.06470446288585663, -0.036192070692777634, 0.02692129835486412, 0.01088307797908783, 0.02651822194457054, -0.019782593473792076, 0.004725547041743994, 0.027515307068824768, 0.010628503747284412, 0.04467790201306343, 0.0021108505316078663, -0.024672552943229675, -0.022784456610679626, -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": "email", "annotation": null, "type_comment": null}}], "kwarg": nul...
def clean_email(self, email): email = super().clean_email(email=email) domain = email.split("@")[1].lower() if domain in settings.DISALLOWED_EMAIL_DOMAINS: raise forms.ValidationError( f"Email addresses hosted by {domain} cannot be used." ) retu...
17,594
[ 0.014608933590352535, -0.03507426381111145, -0.031098753213882446, 0.029517099261283875, 0.03344986215233803, -0.02663164772093296, 0.03971235826611519, 0.02913237176835537, -0.016628749668598175, -0.0010713574010878801, -0.025584334507584572, 0.003761773696169257, 0.017622627317905426, -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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def populate_user(self, *args, **kwargs): user = super().populate_user(*args, **kwargs) if not user_username(user) and user_email(user): # If no username set, use the first part of their email user_username(user, user_email(user).split("@")[0]) return user
17,595
[ 0.036449216306209564, 0.002000792184844613, 0.042683567851781845, -0.0537894144654274, 0.014817461371421814, 0.023937014862895012, -0.00278189848177135, -0.01873205415904522, -0.02403850294649601, 0.014665227383375168, 0.01274417620152235, 0.015484391711652279, -0.04929488152265549, 0.0267...
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 plot(): def read_table(self): path = "/Users/caojunzhi/Downloads/upload_20170322/red_clump_dr13.fits" star = fits.open(path) table = Table.read(path) # read it: un_cov = star[0].data self.un_cov = un_cov a = table["A"] b = table["B"] ...
17,596
[ 0.04476326331496239, -0.0145111670717597, 0.042932286858558655, -0.05304364487528801, -0.014388191513717175, 0.04110131040215492, 0.00037618697388097644, 0.004017215687781572, -0.03276627138257027, 0.02392566204071045, -0.007105279713869095, -0.010036207735538483, -0.00622395146638155, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def plot_teff_logg(self): # only show visits with 2b>a+c mask = self.mask teff = self.teff[mask] logg = self.logg[mask] feh = self.feh[mask] font = {'family': 'normal', 'weight': 'bold', 'size': 14} matplotlib.rc('font', **fon...
17,597
[ -0.015029598958790302, 0.01474843267351389, 0.016908299177885056, -0.06558834761381149, 0.04718476161360741, 0.015758074820041656, 0.026097314432263374, 0.003792545525357127, -0.03343318775296211, -0.02204596810042858, -0.0035912562161684036, -0.010243386961519718, -0.022212110459804535, -...
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 read_table(self): path = "/Users/caojunzhi/Downloads/upload_20170322/red_clump_dr13.fits" star = fits.open(path) table = Table.read(path) # read it: un_cov = star[0].data self.un_cov = un_cov a = table["A"] b = table["B"] c = table["C"] ...
17,598
[ 0.03090750426054001, -0.00013209802273195237, 0.053854815661907196, -0.010622738860547543, -0.015522374771535397, 0.012063808739185333, 0.0032801481429487467, 0.030550668016076088, -0.04663574695587158, 0.005836330354213715, -0.0008530615596100688, 0.009284603409469128, -0.012901000678539276...
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 plot_shift_bjd(self): mask = self.mask shift =self.shift[mask] BJD = self.BJD[mask] feh = self.feh[mask] font = {'family': 'normal', 'weight': 'bold', 'size': 14} matplotlib.rc('font', **font) f, ax1 = plt.subplots(1,1) ...
17,599
[ 0.017298774793744087, -0.031245823949575424, 0.009708919562399387, -0.016135364770889282, 0.0051695494912564754, 0.02134300209581852, -0.018060529604554176, 0.015359760262072086, -0.003770689480006695, 0.010200598277151585, 0.00909258984029293, 0.005079524125903845, -0.02254796214401722, -...
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 plot_ac_fiber(self): mask = self.mask a = self.a[mask] b = self.b[mask] c = self.c[mask] fiber = self.fiber[mask] portion = (c+a)/(a+b+c) RV = (c - a) / (a + b + c) * 4144.68 font = {'family': 'normal', 'weight': 'bold', ...
17,600
[ 0.0416526235640049, -0.0012040407164022326, 0.020813819020986557, -0.019914301112294197, 0.009007660672068596, -0.002322189975529909, 0.020376553758978844, 0.030233757570385933, -0.07450997084379196, 0.010781708173453808, -0.03150807321071625, 0.03180791437625885, -0.04387642815709114, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def plot_delta_chi_SNR(self): mask = self.mask delta_chi = (self.chi_inf-self.chi_mix)[mask] SNR = self.SNR[mask] RV = self.shift[mask] font = {'family': 'normal', 'weight': 'bold', 'size': 14} matplotlib.rc('font', **font) ...