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
19,301
[ 0.007132787723094225, 0.04006882756948471, 0.011302896775305271, 0.0007581381942145526, 0.0037983772344887257, 0.0364241749048233, 0.032086364924907684, 0.036401811987161636, -0.03380807116627693, 0.048923321068286896, -0.01480221189558506, -0.0529928132891655, -0.009748888202011585, 0.025...
10
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}...
async def get_by(cls, **kwargs): results = await super().get_by(**kwargs) result_list = [] for result in results: obj = WordFilterSetting(guild_id=result.get("guild_id"), setting_type=result.get("setting_type"), value=result.get('value')) ...
19,302
[ 0.02404171973466873, -0.02992788702249527, 0.015290952287614346, -0.05101344361901283, 0.009064696729183197, 0.024264086037874222, -0.020379215478897095, -0.013185013085603714, 0.049600761383771896, 0.01204048004001379, 0.029430832713842392, -0.031366728246212006, -0.01441456750035286, 0.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 HelperFunctionTests(unittest.TestCase): def test_readwriteexc(self): # Check exception handling behavior of read, write and _exception # check that ExitNow exceptions in the object handler method # bubbles all the way up through asyncore read/write/_exception calls tr1 =...
19,303
[ 0.03256406635046005, -0.03771062195301056, 0.036949023604393005, -0.002743482356891036, -0.015578133054077625, -0.0227440744638443, -0.014747299253940582, -0.04477270692586899, -0.06300488859415054, -0.022190185263752937, -0.036556683480739594, -0.0007630400359630585, 0.027071332558989525, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fila", "annotation": null, "type_comment": null}}, {"_type": "arg...
def acomodarPiezas(self, fila, color): self.colocar('torre', color, 0, fila) self.colocar('caballo', color, 1, fila) self.colocar('alfil', color, 2, fila) self.colocar('dama', color, 3, fila) self.colocar('rey', color, 4, fila) self.colocar('dama', color, 5, fila) ...
19,304
[ 0.04907979443669319, 0.019960682839155197, -0.004924939479678869, -0.03613796830177307, 0.044070053845644, 0.030006254091858864, -0.018355999141931534, -0.005260879173874855, 0.028571171686053276, -0.0013641429832205176, 0.0460008904337883, -0.02485300600528717, -0.024696452543139458, 0.06...
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_readwrite(self): # Check that correct methods are called by readwrite() attributes = ('read', 'expt', 'write', 'closed', 'error_handled') expected = ( (select.POLLIN, 'read'), (select.POLLPRI, 'expt'), (select.POLLOUT, 'write'), ...
19,305
[ 0.0647185817360878, 0.027026191353797913, 0.01861432194709778, -0.01750648021697998, 0.04488048329949379, 0.04534422978758812, -0.005619721952825785, 0.008933586068451405, 0.04490624740719795, -0.0005490902694873512, 0.02624039724469185, -0.04354076832532883, -0.02934493124485016, 0.059565...
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_readwriteexc(self): # Check exception handling behavior of read, write and _exception # check that ExitNow exceptions in the object handler method # bubbles all the way up through asyncore read/write/_exception calls tr1 = exitingdummy() self.assertRaises(asyncore...
19,306
[ 0.04513022303581238, 0.0246809720993042, 0.03571280464529991, -0.018810374662280083, 0.015483702532947063, 0.02399607002735138, 0.02717597596347332, -0.0017902266699820757, 0.03595741465687752, 0.028545783832669258, 0.05865705758333206, -0.04089849814772606, -0.005179579835385084, 0.044567...
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": "usedefault", "annotation": null, "type_comment": null}}], "kwarg"...
def closeall_check(self, usedefault): # Check that close_all() closes everything in a given map l = [] testmap = {} for i in range(10): c = dummychannel() l.append(c) self.assertEqual(c.socket.closed, False) testmap[i] = c ...
19,307
[ 0.02602614089846611, -0.029616419225931168, -0.013270486146211624, -0.001370064215734601, 0.013954672031104565, 0.020417174324393272, -0.007526039145886898, -0.014699824154376984, 0.04812329635024071, -0.006123797968029976, 0.017192697152495384, -0.03303057327866554, 0.013324679806828499, ...
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_compact_traceback(self): try: raise Exception("I don't like spam!") except: real_t, real_v, real_tb = sys.exc_info() r = asyncore.compact_traceback() else: self.fail("Expected exception") (f, function, line), t, v, info =...
19,308
[ 0.05114727094769478, -0.039181970059871674, -0.0005769432173110545, -0.05438316985964775, 0.030226808041334152, 0.0444246307015419, 0.014260531403124332, 0.01286834292113781, 0.03155628591775894, -0.0006753214402124286, 0.005183082539588213, 0.010685992427170277, -0.008710588328540325, -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_log(self): d = asyncore.dispatcher() # capture output of dispatcher.log() (to stderr) l1 = "Lovely spam! Wonderful spam!" l2 = "I don't like spam!" with support.captured_stderr() as stderr: d.log(l1) d.log(l2) lines = stderr.ge...
19,309
[ 0.02048872970044613, -0.034673236310482025, 0.012954910285770893, -0.03562430292367935, 0.012357095256447792, 0.03891228511929512, -0.004497194662690163, 0.023953337222337723, 0.007778380531817675, 0.008090874180197716, 0.012289161793887615, 0.005176529288291931, -0.02052948996424675, 0.02...
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 DispatcherTests(unittest.TestCase): def setUp(self): pass def tearDown(self): asyncore.close_all() def test_basic(self): d = asyncore.dispatcher() self.assertEqual(d.readable(), True) self.assertEqual(d.writable(), True) def test_repr(self): ...
19,310
[ 0.05769738554954529, -0.02501256763935089, -0.00757504953071475, -0.05181359872221947, 0.012033248320221901, 0.038179803639650345, 0.023379622027277946, 0.013413474895060062, 0.028848692774772644, 0.003366328775882721, 0.024338653311133385, 0.005206631496548653, -0.00326426955871284, 0.003...
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_log_info(self): d = asyncore.dispatcher() # capture output of dispatcher.log_info() (to stdout via print) l1 = "Have you got anything without spam?" l2 = "Why can't she have egg bacon spam and sausage?" l3 = "THAT'S got spam in it!" with support.captured_...
19,311
[ 0.0409325435757637, -0.006599631160497665, 0.018942762166261673, -0.013711593113839626, 0.016165388748049736, 0.04505815729498863, -0.027638904750347137, 0.02426830679178238, 0.040150564163923264, 0.0040312353521585464, 0.0031312855426222086, 0.0005135948886163533, -0.0007882986101321876, ...
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_unhandled(self): d = asyncore.dispatcher() d.ignore_log_types = () # capture output of dispatcher.log_info() (to stdout via print) with support.captured_stdout() as stdout: d.handle_expt() d.handle_read() d.handle_write() ...
19,312
[ 0.04338158667087555, -0.006446541287004948, -0.0027997265569865704, -0.003049850929528475, 0.01754206232726574, 0.037085119634866714, -0.0008083189022727311, 0.03286968916654587, 0.004198756068944931, -0.016514884307980537, 0.025079146027565002, -0.015060828067362309, -0.024852367118000984, ...
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_issue_8594(self): # XXX - this test is supposed to be removed in next major Python # version d = asyncore.dispatcher(socket.socket()) # make sure the error message no longer refers to the socket # object but the dispatcher instance instead self.assertRaises...
19,313
[ 0.03281857818365097, -0.037640154361724854, 0.013907525688409805, 0.014214560389518738, 0.02892947383224964, 0.020014101639389992, -0.04653278365731239, -0.00784075167030096, 0.04414473846554756, -0.016886897385120392, 0.0025003410410135984, -0.02100343443453312, 0.015385840088129044, 0.03...
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": "sock", "annotation": n...
class BaseTestHandler(asyncore.dispatcher): def __init__(self, sock=None): asyncore.dispatcher.__init__(self, sock) self.flag = False def handle_accept(self): raise Exception("handle_accept not supposed to be called") def handle_accepted(self): raise Exception("h...
19,314
[ -0.009677929803729057, 0.0048243459314107895, 0.046173375099897385, 0.012373716570436954, -0.001144685666076839, -0.020373359322547913, -0.010180831886827946, -0.003011561231687665, 0.014221587218344212, -0.03162431716918945, 0.008525935001671314, -0.034828852862119675, 0.01256084255874157, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "If", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "AF_UNIX", "value": {"_type": "Name", "_fields": {"id": "socket", "ctx": {...
class TestAPI_UseUnixSockets(BaseTestAPI): if HAS_UNIX_SOCKETS: family = socket.AF_UNIX addr = support.TESTFN def tearDown(self): support.unlink(self.addr) BaseTestAPI.tearDown(self)
19,315
[ 0.017602551728487015, -0.007991049438714981, 0.040712520480155945, 0.023131150752305984, 0.008933665230870247, -0.013885044492781162, -0.024020809680223465, -0.01999615877866745, 0.007525037508457899, -0.01810033619403839, 0.023364156484603882, -0.01599268987774849, 0.02696515992283821, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "family", "annotation":...
class BaseClient(BaseTestHandler): def __init__(self, family, address): BaseTestHandler.__init__(self) self.create_socket(family) self.connect(address) def handle_connect(self): pass
19,316
[ 0.025324005633592606, 0.01749865896999836, 0.05466334894299507, -0.06894517689943314, 0.03054850734770298, 0.0054326835088431835, 0.026806941255927086, -0.019198333844542503, 0.019848544150590897, -0.00436040572822094, -0.05589532479643822, -0.040267448872327805, -0.008064896799623966, -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 get_runner_config(self): cfg = super().get_runner_config() leosac_cfg_file = '{}/leosac_config.xml' \ .format(os.path.dirname(os.path.abspath(__file__))) cfg.leosac_config_file = leosac_cfg_file cfg.stream_log = True return cfg
19,317
[ -0.01754378341138363, 0.01577364280819893, -0.007456411141902208, 0.006759266834706068, 0.0201019998639822, -0.03894307464361191, -0.01824698969721794, 0.03743967041373253, -0.005371040664613247, 0.04818174988031387, 0.021556908264756203, -0.014294485561549664, -0.0020035316701978445, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "req", "annotation": nu...
class FlavorRxtxController(wsgi.Controller): def _extend_flavors(self, req, flavors): for flavor in flavors: db_flavor = req.get_db_flavor(flavor['id']) key = 'rxtx_factor' flavor[key] = db_flavor['rxtx_factor'] or "" def _show(self, req, resp_obj): if not au...
19,318
[ 0.05112256482243538, 0.017006654292345047, 0.034398071467876434, 0.017275989055633545, 0.026651453226804733, 0.01621147058904171, -0.007913351990282536, 0.0320894755423069, 0.04437633603811264, -0.021123649552464485, 0.013261598534882069, -0.013633538968861103, -0.018879180774092674, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "wsclient", "annotation": {"_type": "Name", "_fields": {"id":...
async def test_search_zone(self, wsclient: LowLevelWSClient = None): msg = LeosacMessage('search.zone_alias', content={'partial_name': '%'}) rep = await wsclient.req_rep(msg) self.assertEqual(APIStatusCode.SUCCESS, rep.status_code) # This should return an empty array as we have no zone. ...
19,319
[ 0.041508495807647705, 0.0006588776013813913, 0.02636144682765007, 0.01985354535281658, 0.03511476889252663, 0.011753551661968231, 0.016834283247590065, 0.015426140278577805, 0.03564757853746414, -0.045111313462257385, 0.026336075738072395, 0.015717918053269386, -0.021007968112826347, -0.00...
11
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "wsclient", "annotation": {"_type": "Name", "_fields": {"id":...
async def test_create_zone(self, wsclient: LowLevelWSClient = None): msg = LeosacMessage(message_type='zone.read', content={'zone_id': 0}) rep = await wsclient.req_rep(msg) self.assertEqual(APIStatusCode.SUCCESS, rep.status_code) # We should have 0 zones. self.assertEqual(0, len(...
19,320
[ -0.007489131763577461, 0.011656949296593666, -0.013835214078426361, -0.03912249207496643, 0.03562863916158676, -0.04127918928861618, 0.007144059985876083, -0.031099576503038406, 0.02452164888381958, -0.00823858380317688, 0.03323470801115036, -0.01709182746708393, 0.007041616830974817, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs...
def with_json_response(file_name): def wrapper_maker(func): @wraps(func) def wrapper(*args, **kwargs): with patch("agir.lib.geo.requests") as requests: res = requests.get.return_value = Mock() with open(JSON_DIR / file_name) as file: re...
19,321
[ 0.008135111071169376, 0.01950068771839142, 0.010876290500164032, -0.025985196232795715, 0.02997022122144699, -0.04185456037521362, 0.00505202217027545, -0.019748277962207794, 0.00444188853725791, -0.007999526336789131, 0.024806194007396698, -0.0004001236811745912, -0.03305920585989952, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def wrapper_maker(func): @wraps(func) def wrapper(*args, **kwargs): with patch("agir.lib.geo.requests") as requests: res = requests.get.return_value = Mock() with open(JSON_DIR / file_name) as file: res.json.return_value = json.load(file) ...
19,322
[ 0.010037700645625591, 0.0016704926965758204, 0.007961748167872429, -0.023755498230457306, 0.007147880736738443, -0.013269579969346523, -0.040386706590652466, -0.0222221240401268, 0.0015849776100367308, 0.01673736423254013, 0.012479303404688835, 0.006434272043406963, -0.042344704270362854, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value": nul...
def with_no_request(f=None): def wrapper_maker(func): def wrapper(*args, **kwargs): with patch("agir.lib.geo.requests") as requests_patch: res = requests_patch.get.side_effect = requests.ConnectionError func(*args, **kwargs) return wrapper if f is no...
19,323
[ 0.0006811132188886404, -0.00875683594495058, 0.056461989879608154, -0.011775361374020576, -0.031566932797431946, 0.0063544632866978645, -0.016331156715750694, -0.004829640965908766, 0.014376895502209663, -0.004960339982062578, -0.010642636567354202, -0.052379198372364044, -0.0167045835405588...
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_geocode_with_citycode(self): self.person.location_citycode = "00002" self.person.save() geocode_france(self.person) self.assertIsNotNone(self.person.coordinates) self.assertEqual(self.person.coordinates_type, LocationMixin.COORDINATES_CITY) self.assertEqual(sel...
19,324
[ -0.005643622484058142, 0.006728107575327158, 0.00789554137736559, -0.0012649763375520706, 0.0248847808688879, 0.02914898842573166, -0.02259906753897667, 0.016282634809613228, 0.00013892081915400922, 0.07520733773708344, -0.0009577568271197379, -0.0214193444699049, 0.04711518436670303, -0.0...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dom", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def test_domain(dom): for arg in dom: if isinstance(arg, basestring): if arg not in ('AND', 'OR'): return False elif (isinstance(arg, tuple) or (isinstance(arg, list) and len(arg) > 2 and ((arg[1]...
19,325
[ 0.010054752230644226, 0.013974401168525219, -0.007450528908520937, -0.011769598349928856, 0.037236668169498444, 0.020482297986745834, -0.022964032366871834, 0.013537701219320297, 0.0347868874669075, 0.0790320560336113, 0.024859948083758354, -0.026138095185160637, 0.030206860974431038, 0.01...
16
{"_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 domain_validate(value): assert isinstance(value, list), 'domain must be a list' def test_domain(dom): for arg in dom: if isinstance(arg, basestring): if arg not in ('AND', 'OR'): return False elif (isinstance(arg, tuple) or...
19,326
[ 0.014334332197904587, -0.005293746944516897, -0.004175048321485519, 0.011294040828943253, 0.003329333383589983, -0.039502378553152084, 0.0033935648389160633, 0.013788364827632904, -0.0341283418238163, 0.06281841546297073, 0.005711251869797707, 0.004373095463961363, 0.017717191949486732, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fileName", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def ReadHistory(fileName): history = [] csv_file = open(fileName, 'r') reader = csv.reader(csv_file) iter = 0 for row in reader: if(iter is not 0): history.append(row) iter += 1 return history
19,327
[ 0.03993545472621918, 0.0007956662448123097, -0.06210719794034958, 0.028268424794077873, 0.02216077782213688, -0.00006870416837045923, 0.000007501133495679824, -0.013914907351136208, 0.04868572950363159, 0.061317700892686844, 0.04658040031790733, -0.02984742261469364, 0.013882012106478214, ...
11
{"_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 states_validate(value): assert isinstance(value, dict), 'states must be a dict' for state in value: if state == 'icon': continue assert isinstance(value[state], (bool, PYSON)), \ 'values of states must be PYSON' if hasattr(value[state], 'types'): ...
19,328
[ 0.018508045002818108, -0.03794100135564804, 0.014227875508368015, -0.006976185366511345, 0.004978772718459368, 0.00738944299519062, 0.05899747088551521, 0.01949199289083481, -0.019108252599835396, 0.01577267237007618, 0.003886591177433729, -0.007138536311686039, 0.05592755600810051, -0.022...
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": "conn_id", "annotation": {"_type": "Name", "_fields": {"id": "str"...
def __init__(self, conn_id: str = default_conn_name, *args, **kwargs) -> None: super().__init__() self.mongo_conn_id = conn_id self.connection = self.get_connection(conn_id) self.extras = self.connection.extra_dejson.copy() self.client = None srv = self.extras.pop('srv'...
19,329
[ 0.02256593108177185, 0.03785954415798187, -0.00475056329742074, -0.03790786489844322, -0.006505221594125032, -0.03969574347138405, -0.008214578963816166, -0.06257575750350952, -0.007815930061042309, -0.014423834159970284, 0.017927110195159912, -0.01417014840990305, 0.01394062303006649, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fileName", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "simonObject", "annotation": null, "type_comment": null}}], "k...
def WriteHistory(fileName, simonObject): if(not os.path.isfile(fileName)): nameList = [] for key in simonObject.Properties.keys(): nameList.append(key) csv_file = open(fileName, 'w') cwriter = csv.writer(csv_file, delimiter=',', quotechar='|', lineterminator='\n') ...
19,330
[ -0.004513340070843697, -0.005020586773753166, -0.034146904945373535, 0.004248188808560371, -0.010479249991476536, -0.00881917029619217, -0.06442029029130936, 0.024278657510876656, -0.018871871754527092, 0.021269764751195908, 0.00804100837558508, -0.027898551896214485, -0.011366930790245533, ...
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": "user", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_posts(self, user, forum, thread, kwargs): queryset = self.get_posts_queryset(user, forum, thread) queryset = self.exclude_invisible_posts(queryset, user, forum, thread) page = paginate(queryset, kwargs.get('page', 0), settings.MISAGO_POSTS_PER_PAGE, ...
19,331
[ 0.02719011716544628, -0.014342596754431725, -0.03403199091553688, -0.013848461210727692, 0.024618079885840416, 0.00024508798378519714, -0.05075657740235329, 0.027164777740836143, -0.015799662098288536, 0.031548645347356796, 0.0008568181074224412, -0.016775263473391533, -0.013088253326714039,...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": {...
def dispatch(self, request, *args, **kwargs): relations = ['forum', 'starter', 'last_poster', 'first_post'] thread = self.fetch_thread(request, select_related=relations, **kwargs) forum = thread.forum self.check_forum_permissions(request, forum) self.check_thread_permissions(req...
19,332
[ 0.013808803632855415, 0.01651689037680626, 0.018139302730560303, -0.014650506898760796, 0.006392061244696379, 0.005754685029387474, 0.052697908133268356, 0.04589109495282173, -0.03561988100409508, 0.01952994242310524, 0.010692063719034195, -0.02866668626666069, -0.009740574285387993, -0.05...
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 _lazy_init(self): self._init_plugins() self._setup_plugins() self._setup_misc() if self.running_turtleart: self._basic_palettes.make_trash_palette() for name in palette_init_on_start: debug_output('initing palette %s' % (name), self.running_su...
19,333
[ -0.0010334866819903255, 0.03686009719967842, -0.017104066908359528, 0.04448171332478523, 0.00961616262793541, -0.02058059349656105, 0.05843239277601242, 0.02979561686515808, 0.0007758114370517433, 0.005309503059834242, 0.0372612364590168, 0.013114974834024906, 0.006791484076529741, 0.00058...
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 _show_unfullscreen_button(self): if self.activity._is_fullscreen and \ self.activity.props.enable_fullscreen_mode: if not self.activity._unfullscreen_button.props.visible: self.activity._unfullscreen_button.show() # Reset the timer if hasattr(self....
19,334
[ 0.042772967368364334, 0.016429180279374123, 0.04033324867486954, -0.006105788983404636, -0.0291209165006876, 0.019894102588295937, 0.008260009810328484, -0.03067818470299244, 0.015170387923717499, 0.00416569272056222, 0.008993224240839481, -0.0019173865439370275, -0.018596379086375237, 0.0...
13
{"_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 recalculate_constants(self): CONSTANTS['titlex'] = int(-(self.width * TITLEXY[0] ) / (self.coord_scale * 2)) CONSTANTS['leftx'] = int(-(self.width * TITLEXY[0] ) / (self.coord_scale * 2)) CONSTANTS['rightx'] = 0 C...
19,335
[ -0.01168467290699482, -0.00296529452316463, -0.008119259029626846, -0.03144153580069542, -0.0369720458984375, 0.006065910216420889, 0.015073580667376518, -0.02777021937072277, -0.06048259511590004, -0.013473263010382652, -0.024804923683404922, -0.01748582348227501, -0.002263684757053852, -...
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 _create_scaled_cartesian_coordinates(self): # Cartesian overlay has to be scaled to match the coordinate_scale # 200 pixels in the graphic == height / 4. (10 units) pixbuf = svg_str_to_pixbuf( svg_from_file('%s/%s.svg' % (self.images_path, 'Cartesian'))) if self.running_...
19,336
[ 0.031110011041164398, -0.005668879486620426, 0.017982738092541695, -0.006476038135588169, -0.03243650496006012, -0.007195597980171442, 0.01325241383165121, 0.016593674197793007, -0.032411474734544754, -0.01016769278794527, 0.02835691347718239, -0.04169692471623421, 0.005844077095389366, 0....
13
{"_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 _unselect_all_blocks(self): # Unselect things that may have been selected earlier if self.selected_blk is not None: if len(self.selected_blk.spr.labels) > 0: label_with_no_returns = \ self.selected_blk.spr.labels[0].replace(RETURN, ' ') els...
19,337
[ 0.026935959234833717, 0.0055862232111394405, -0.0034051479306071997, 0.02209053933620453, 0.01103255245834589, -0.0003411904035601765, 0.01423103827983141, 0.04916639253497124, -0.020424528047442436, -0.007719607092440128, 0.03510068356990814, -0.010161394253373146, 0.01955972984433174, -0...
14
{"_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": "mask", "annotation": null, "type_comment": null}}, {"_type": "arg...
def button_press(self, mask, x, y): if self.running_turtleart: if self.running_sugar: self._show_unfullscreen_button() if self.interactive_mode: self.activity.hide_store() # Find out what was clicked spr = self.sprite_list.find_sprite((x,...
19,338
[ 0.029760712757706642, 0.0017366224201396108, 0.022361190989613533, -0.0031654152553528547, 0.019898556172847748, 0.017819255590438843, 0.02226826176047325, -0.004022110253572464, -0.02474251203238964, 0.009031597524881363, -0.008137150667607784, -0.03549911826848984, 0.02238442376255989, 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": "spr", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _look_for_a_turtle(self, spr, x, y): # Next, look for a turtle turtle = self.turtles.spr_to_turtle(spr) if turtle is not None: # If turtle is shared, ignore click if self.remote_turtle(turtle.get_name()): return True self.selected_turtle = ...
19,339
[ 0.030051646754145622, 0.008338441140949726, -0.021024273708462715, -0.03686968982219696, -0.061006031930446625, 0.016332415863871574, -0.02400568313896656, 0.024100707843899727, -0.01088629849255085, -0.035895682871341705, 0.08590257167816162, -0.007863316684961319, -0.014859529212117195, ...
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": "blk", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _delete_stack(self, blk): name = blk.spr.labels[0] error_output('deleting proto: clicked on %s %s' % (blk.name, name), self.running_sugar) macro_path = os.path.join(self.macros_path, '%s.tb' % (name)) if os.path.exists(macro_path): try: ...
19,340
[ 0.003226090222597122, -0.005229751113802195, -0.010105418972671032, 0.008351864293217659, 0.007418883498758078, 0.026775425300002098, -0.0016270960913971066, -0.006643272936344147, -0.032215941697359085, -0.006204884499311447, 0.005878903437405825, -0.007553772535175085, 0.02457224205136299,...
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": "orientation", "annotation": null, "type_comment": null}}], "kwarg...
def set_orientation(self, orientation): self.orientation = orientation self.palette_button[self.orientation].set_layer(TAB_LAYER) self.palette_button[1 - self.orientation].hide() o = 1 - self.orientation spr = self.palette_views[self.selected_palette].backgrounds[o] if sp...
19,341
[ -0.0023645597975701094, 0.005095618311315775, -0.0384502150118351, -0.036366961896419525, 0.014312739484012127, 0.03574969992041588, 0.021591275930404663, 0.016588889062404633, -0.009085310623049736, -0.008307304233312607, 0.0043722656555473804, -0.06640699505805969, 0.01972663216292858, 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": "spr", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _check_for_anything_else(self, spr, x, y): # Finally, check for anything else if hasattr(spr, 'type'): if spr.type == 'selector': self._select_category(spr) elif spr.type in ['category', 'category-shift-horizontal', 'category-shif...
19,342
[ 0.020184963941574097, 0.009041940793395042, 0.0037770902272313833, -0.0044177379459142685, 0.005040168762207031, 0.00984958279877901, -0.021630218252539635, -0.014051747508347034, -0.03653211519122124, -0.041778746992349625, 0.03966552019119263, 0.052612073719501495, 0.0190433356910944, -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": "blk", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _restore_from_trash(self, blk): blk.type = None group = find_group(blk) debug_output(group, True) # We serialize the data and use the "paste" mechanism to # restore blocks. This lets us take advantage of the duplicate # block checking mechanism. selected_blk ...
19,343
[ 0.017862776294350624, -0.007781502790749073, -0.011815229430794716, -0.01781410537660122, -0.010677511803805828, -0.001857156865298748, -0.01873888075351715, 0.006759381853044033, 0.0022374102845788, 0.04098217561841011, 0.017461229115724564, -0.007264358457177877, -0.020491087809205055, -...
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 _empty_trash(self): remove_list = [] for blk in self.block_list.list: if blk.type == 'trash': blk.spr.hide() remove_list.append(blk) for blk in remove_list: if blk in self.block_list.list: self.block_list.list.remove(blk...
19,344
[ 0.02325877733528614, -0.013433747924864292, 0.018881749361753464, 0.009109105914831161, 0.01597149297595024, 0.01643713377416134, -0.0054858350194990635, -0.01292154286056757, -0.015727030113339424, 0.02956821583211422, -0.020977135747671127, -0.004985271021723747, -0.017519749701023102, -...
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": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def _turtle_pressed(self, x, y): pos = self.selected_turtle.get_xy() tpos = self.turtles.turtle_to_screen_coordinates(pos) dx = x - tpos[0] dy = y - tpos[1] if not hasattr(self.lc, 'value_blocks'): self.lc.find_value_blocks() self.lc.update_values = True ...
19,345
[ 0.025756066665053368, 0.009969482198357582, 0.010742164216935635, 0.002880282001569867, 0.005050702020525932, 0.005967868957668543, 0.016471318900585175, 0.01598132587969303, -0.018506675958633423, -0.00377860339358449, 0.015478767454624176, -0.01772771216928959, -0.0025379147846251726, 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": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def button_release(self, x, y): if self.running_sugar and self.dragging_canvas[0]: if self.dragging_counter > 0: self.activity.adjust_sw(self.dragging_dx, self.dragging_dy) self.dragging_counter = 0 self.dragging_dx = 0 self.dragging_dy = 0 ...
19,346
[ 0.009431946091353893, 0.043463870882987976, 0.022018738090991974, -0.0002177511778427288, -0.027298543602228165, 0.014353245496749878, 0.0014698713785037398, -0.033164992928504944, -0.01874656416475773, 0.021484240889549255, 0.024326208978891373, 0.007645938545465469, -0.02145816758275032, ...
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": "blk", "annotation": null, "type_comment": null}}], "kwarg": null,...
def __run_stack(self, blk): if self.status_spr is not None: self.status_spr.hide() self._autohide_shape = True if blk is None: return if not self.interactive_mode: self.lc.find_value_blocks() # Are there blocks to update? if self.canvas.cr_svg...
19,347
[ 0.004354310687631369, -0.016096673905849457, 0.00031062387279234827, -0.01206953078508377, -0.004387027584016323, 0.0007599224336445332, -0.013693475164473057, -0.049396444112062454, 0.011088026687502861, 0.023294372484087944, 0.006840788759291172, -0.004848037380725145, -0.01951112039387226...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null...
def _number_style(self, name): if name in block_styles['number-style']: return True if name in block_styles['number-style-porch']: return True if name in block_styles['number-style-block']: return True if name in block_styles['number-style-var-arg']: ...
19,348
[ 0.01382273156195879, -0.00016918446635827422, 0.031779829412698746, 0.018654460087418556, 0.013349520973861217, 0.005768811330199242, 0.006095699965953827, 0.05778150632977486, -0.013772919774055481, -0.016437843441963196, 0.008467979729175568, 0.017110299319028854, 0.003121010959148407, 0...
14
{"_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": "alt_mask", "annotation": null, "type_comment": null}}, {"_type": ...
def _key_press(self, alt_mask, keyname, keyunicode): if keyname is None: return False self.keypress = keyname if alt_mask: if keyname == 'p': self.hideshow_button() elif keyname == 'q': self.quit_plugins() if s...
19,349
[ 0.029805930331349373, 0.03422582149505615, 0.008794449269771576, 0.018869534134864807, -0.022439444437623024, 0.032775189727544785, 0.02130614034831524, 0.035313792526721954, 0.009565096348524094, -0.011809040792286396, 0.029397940263152122, 0.029669933021068573, 0.021759461611509323, 0.03...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _hide_text_entry(self): if hasattr(self, '_text_entry'): if self._focus_out_id is not None: self._text_entry.disconnect(self._focus_out_id) self._focus_out_id = None if self._insert_text_id is not None: self._text_buffer.disconnect(self...
19,350
[ 0.00653977133333683, 0.02464897185564041, 0.013371823355555534, 0.005044879391789436, -0.015770956873893738, 0.0006994936848059297, -0.0010214587673544884, -0.002738605486229062, 0.031468845903873444, 0.054461561143398285, 0.005888230167329311, 0.006466701626777649, -0.04116280749440193, -...
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": "text", "annotation": null, "type_comment": null}}], "kwarg": null...
def _number_check(self, text): text = text.strip() # Ignore any whitespace if text == '': text = '0' if text in ['-', '.', '-.', ',', '-,']: num = 0 elif text is not None: try: num = float(text.replace(self.decimal_point, '.')) ...
19,351
[ 0.018172873184084892, -0.016769319772720337, 0.0014271204126998782, 0.007043952587991953, -0.012862414121627808, -0.02486593648791313, 0.019691644236445427, -0.019932551309466362, -0.027421660721302032, 0.007866183295845985, 0.018183346837759018, 0.04587734118103981, -0.004448949825018644, ...
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": "text", "annotation": null, "type_comment": null}}], "kwarg": null...
def paste_text_in_block_label(self, text): # If we paste plain text from the clipboard, try to insert it into # a block label if self._focus_out_id is not None: self._text_entry.get_buffer().insert_at_cursor(text) else: label = self.selected_blk.spr.labels[0] ...
19,352
[ 0.030774306505918503, 0.00509374076500535, 0.01307484321296215, 0.01775999553501606, -0.011785518378019333, -0.02583492174744606, -0.00022548051492776722, -0.04830428212881088, 0.019006947055459023, -0.01751786842942238, -0.002188220154494047, 0.018704289570450783, 0.0029675655532628298, -...
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _make_block(self, name, x, y, defaults): if defaults is None: self._new_block(name, x, y, defaults) else: for i, v in enumerate(defaults): if isinstance(v, float) and int(v) == v: defaults[i] = int(v) self._new_block(name, x, y,...
19,353
[ 0.024090278893709183, 0.0013315476244315505, 0.02188984677195549, -0.027320971712470055, -0.035944629460573196, 0.00931685883551836, 0.007211820688098669, -0.0024993347469717264, -0.02033809758722782, 0.019689414650201797, 0.022551249712705612, 0.0166749507188797, 0.0008482157136313617, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _test_string(self): if hasattr(self, '_text_entry'): bounds = self._text_buffer.get_bounds() text = self._text_buffer.get_text(bounds[0], bounds[1], True) self._hide_text_entry() else: text = self.selected_blk.spr.labels[0] self.selected_blk.sp...
19,354
[ 0.006311420816928148, 0.02068048156797886, -0.00394836300984025, -0.024304036051034927, 0.03275502100586891, -0.047630663961172104, -0.0188687052577734, 0.010530954226851463, 0.002543341601267457, 0.021049989387392998, -0.0023183594457805157, -0.005712461657822132, -0.024530507624149323, -...
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": "virtapi", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, virtapi, read_only=False): super(FakeDriver, self).__init__(virtapi) self.instances = {} self.resources = Resources( vcpus=self.vcpus, memory_mb=self.memory_mb, local_gb=self.local_gb) self.host_status_base = { 'hypervisor_...
19,355
[ 0.0466298833489418, 0.021286025643348694, 0.008279853500425816, -0.02800607681274414, 0.0033922770526260138, -0.015081998892128468, 0.010783746838569641, 0.07594947516918182, -0.026082711294293404, 0.015410378575325012, 0.02561359666287899, 0.01765039563179016, -0.04681752622127533, -0.006...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def destroy(self, context, instance, network_info, block_device_info=None, destroy_disks=True, migrate_data=None): key = instance.uuid if key in self.instances: flavor = instance.flavor self.resources.release( vcpus=flavor.vcpus, me...
19,356
[ -0.0039703804068267345, -0.007238474674522877, 0.01902332715690136, -0.0050884936936199665, 0.006616273894906044, 0.008439753204584122, -0.025849055498838425, 0.03784952312707901, 0.020341653376817703, -0.002879988867789507, 0.0004115919873584062, -0.009203643538057804, -0.02094537392258644,...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}], "kwarg": ...
def get_instance_diagnostics(self, instance): diags = diagnostics.Diagnostics(state='running', driver='fake', hypervisor_os='fake-os', uptime=46664, config_drive=True) diags.add_cpu(time=17300000000) diags.add_nic(mac_address='01:23:45:67:89:ab', rx_packets=...
19,357
[ 0.0015973019180819392, -0.012194978073239326, -0.015066403895616531, -0.017846308648586273, 0.039353400468826294, -0.01959662139415741, 0.016038797795772552, 0.03880428150296211, -0.02830241620540619, 0.0005326722748577595, 0.014391446486115456, 0.008619995787739754, -0.030613284558057785, ...
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": "instance", "annotation": null, "type_comment": null}}], "kwarg": ...
def get_info(self, instance): if instance.uuid not in self.instances: raise exception.InstanceNotFound(instance_id=instance.uuid) i = self.instances[instance.uuid] return hardware.InstanceInfo(state=i.state, max_mem_kb=0, ...
19,358
[ -0.015764979645609856, -0.012511509470641613, 0.03880242258310318, -0.026314837858080864, -0.011058212257921696, -0.0517684631049633, 0.004219344817101955, 0.0057922545820474625, 0.09009243547916412, 0.00949128344655037, 0.02266664430499077, -0.022893909364938736, -0.009353728964924812, -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_intsum(): g = gen.intsum() assert g.next() == 0 assert g.next() == 1 assert g.next() == 3 assert g.next() == 6 assert g.next() == 10 assert g.next() == 15
19,359
[ -0.017608296126127243, -0.015642551705241203, 0.04169758781790733, -0.03228584676980972, -0.014046129770576954, -0.04713018611073494, 0.0010201017139479518, 0.005358139984309673, 0.09521345794200897, 0.0169411338865757, 0.020396076142787933, -0.029093002900481224, -0.010829458944499493, -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_intsum2(): g = gen.intsum2() assert g.next() == 0 assert g.next() == 1 assert g.next() == 3 assert g.next() == 6 assert g.next() == 10 assert g.next() == 15
19,360
[ 0.01935821957886219, -0.02419777400791645, 0.06124981492757797, 0.014301012270152569, -0.01622147113084793, 0.036770373582839966, -0.015798969194293022, 0.02613103576004505, 0.043888870626688004, 0.0020580911077558994, 0.04568129777908325, -0.05315828323364258, -0.030880969017744064, 0.000...
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_doubler(): g = gen.doubler() assert g.next() == 1 assert g.next() == 2 assert g.next() == 4 assert g.next() == 8 assert g.next() == 16 assert g.next() == 32 for i in range(10): j = g.next() assert j == 2**15
19,361
[ -0.02795543521642685, -0.007247022818773985, 0.03464310243725777, -0.01668228954076767, -0.005424510221928358, 0.012404149398207664, -0.047428350895643234, -0.0226938147097826, 0.03975720331072807, 0.011420668102800846, 0.04310103878378868, -0.04639569669961929, -0.02480829879641533, -0.01...
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_fib(): g = gen.fib() assert g.next() == 1 assert g.next() == 1 assert g.next() == 2 assert g.next() == 3 assert g.next() == 5 assert g.next() == 8 assert g.next() == 13 assert g.next() == 21
19,362
[ 0.0387796089053154, 0.04370836913585663, 0.009782468900084496, -0.0015214740997180343, -0.020915968343615532, 0.010389181785285473, 0.002519110683351755, -0.006085896398872137, 0.011896582320332527, 0.0463353767991066, 0.04555978253483772, 0.005457291379570961, -0.02329278364777565, 0.0078...
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 upgrade(): state_enum = sa.Enum(*istate.States.all(), name='node_state') state_enum.create(op.get_bind()) op.add_column('nodes', sa.Column('version_id', sa.String(36), server_default='')) op.add_column('nodes', sa.Column('state', state_enum, ...
19,363
[ 0.0092889703810215, -0.0063050673343241215, 0.050760649144649506, -0.029770435765385628, 0.02268223650753498, 0.015639768913388252, -0.007985656149685383, 0.039168015122413635, 0.04696503281593323, 0.012164263986051083, 0.09022591263055801, -0.030227739363908768, -0.02309381030499935, 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_prime(): g = gen.prime() assert g.next() == 2 assert g.next() == 3 assert g.next() == 5 assert g.next() == 7 assert g.next() == 11 assert g.next() == 13 assert g.next() == 17 assert g.next() == 19 assert g.next() == 23
19,364
[ 0.05960976332426071, -0.0011039720848202705, 0.0050809504464268684, -0.02028597891330719, -0.015444576740264893, -0.00033509216154925525, -0.0065875849686563015, 0.009745842777192593, -0.000008470877219224349, -0.036461807787418365, 0.035654909908771515, -0.03656267002224922, 0.0457915924489...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "GET"}}, "targets": [{"_type": "Name", "_fields": {"id": "method_allowed", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nu...
class Index(_Index): method_allowed = 'GET' url_name = 'out-odoo' template = 'zato/outgoing/odoo.html' service_name = 'zato.outgoing.odoo.get-list' output_class = OutgoingOdoo class SimpleIO(_Index.SimpleIO): input_required = ('cluster_id',) output_required = ('id', 'name', 'is_...
19,365
[ 0.055381353944540024, -0.009622178971767426, 0.006895066704601049, 0.006525195203721523, 0.007850107736885548, -0.009649781510233879, 0.0018576381262391806, 0.008700260892510414, -0.0029700128361582756, -0.026498256251215935, -0.0020453340839594603, -0.0377158485352993, 0.0688512995839119, ...
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 handle(self): for item in self.items: for protocol in ODOO.PROTOCOL: if item.protocol == protocol.id: item.protocol_name = protocol.name return { 'create_form': CreateForm(), 'edit_form': EditForm(prefix='edit'), '...
19,366
[ 0.04699331894516945, 0.015931691974401474, 0.00407990999519825, -0.03401002660393715, -0.009679279290139675, -0.001521883998066187, 0.048622697591781616, 0.05653681606054306, -0.0008938946411944926, -0.013319515623152256, 0.06238188594579697, -0.00634616706520319, 0.003876237664371729, 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 tearDown(self): pty.STDIN_FILENO = self.orig_stdin_fileno pty.STDOUT_FILENO = self.orig_stdout_fileno pty.close = self.orig_pty_close pty._copy = self.orig_pty__copy pty.fork = self.orig_pty_fork pty.select = self.orig_pty_select pty.setraw = self.orig_pty_set...
19,367
[ -0.007749410346150398, 0.004150264896452427, 0.06613429635763168, -0.030480263754725456, -0.017714545130729675, -0.0012217412004247308, 0.026273762807250023, 0.03331458941102028, -0.02379935048520565, 0.014059161767363548, 0.02924305759370327, -0.011101114563643932, -0.014464066363871098, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "INPUT"}}, "targets": [{"_type": "Name", "_fields": {"id": "INPUT", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class pct2rgb(GdalAlgorithm): INPUT = 'INPUT' BAND = 'BAND' RGBA = 'RGBA' OUTPUT = 'OUTPUT' def __init__(self): super().__init__() def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer'))) self.addPara...
19,368
[ -0.02965068258345127, 0.008133099414408207, 0.07135216891765594, -0.052108991891145706, -0.011467312462627888, -0.032246608287096024, -0.005513359792530537, 0.012140109203755856, -0.00854987557977438, 0.029626866802573204, -0.0022610134910792112, -0.01777850277721882, 0.02169620245695114, ...
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": "parameters", "annotation": null, "type_comment": null}}, {"_type"...
def getConsoleCommands(self, parameters, context, feedback, executing=True): arguments = [] inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context) if inLayer is None: raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT)) arguments.appe...
19,369
[ -0.0032688300125300884, 0.01197562925517559, 0.052653178572654724, -0.02665649726986885, -0.0004776780551765114, -0.02513892389833927, 0.024061227217316628, 0.009957697242498398, -0.03327663242816925, -0.004778155125677586, 0.002343715401366353, -0.020773153752088547, -0.03002155013382435, ...
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": "config", "annotation": null, "type_comment": null}}], "kwarg": nu...
def initAlgorithm(self, config=None): self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer'))) self.addParameter(QgsProcessingParameterBand(self.BAND, self.tr('Band number'), ...
19,370
[ 0.007942578755319118, -0.011475836858153343, -0.05175149813294411, 0.017080316320061684, -0.014260671101510525, 0.018623577430844307, 0.0214548259973526, 0.03515852987766266, 0.03831467404961586, -0.008754822425544262, 0.01902969926595688, -0.028033996000885963, 0.0003785633889492601, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": 0}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "...
class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, state, decodeFun, substrateFun): head, tail = substrate[:length], substrate[length:] if not head or length != 1: ...
19,371
[ 0.02831854112446308, -0.00682493019849062, -0.047236159443855286, 0.01947333849966526, 0.002222878159955144, 0.0014811950968578458, 0.007635354530066252, -0.002593357814475894, 0.04913486912846565, 0.01655581034719944, 0.053488004952669144, -0.027948061004281044, 0.013707748614251614, -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": "fullSubstrate", "annotation": null, "type_comment": null}}, {"_ty...
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, state, decodeFun, substrateFun): head, tail = substrate[:length], substrate[length:] if not head or length != 1: raise error.PyAsn1Error('Not single-octet Boolean payload') byte = oct2int(...
19,372
[ -0.010202012956142426, 0.03775769844651222, 0.03816783055663109, 0.01142599806189537, 0.012310342863202095, 0.013252363540232182, 0.009234359487891197, -0.027555687353014946, -0.04042355343699455, 0.013303629122674465, 0.003896245965734124, 0.004620383959263563, 0.011208116076886654, 0.057...
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": "posx", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _check_place(self, posx, posy, sizex, sizey): res = True for y in range(sizey): for x in range(sizex): if posx+x>=PPR: res = False break row = self.table.setdefault(posy+y, {}) if row.setdefault(posx+...
19,373
[ -0.009677935391664505, -0.0068047987297177315, 0.0449620746076107, -0.011599660851061344, 0.00991736352443695, -0.04125723987817764, 0.004388465080410242, 0.008216164074838161, -0.007044226862490177, 0.0033015874214470387, 0.04090439900755882, -0.04516369849443436, 0.00039517448749393225, ...
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 table_compute(object): def __init__(self): self.table = {} def _check_place(self, posx, posy, sizex, sizey): res = True for y in range(sizey): for x in range(sizex): if posx+x>=PPR: res = False break ...
19,374
[ -0.009345678612589836, -0.005514081567525864, 0.058308620005846024, 0.0010466239182278514, -0.007893220521509647, -0.05312972143292427, 0.005642239470034838, 0.01199427805840969, -0.02273983508348465, 0.005224904511123896, 0.047451335936784744, -0.03483269736170769, -0.02252952568233013, -...
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": "products", "annotation": null, "type_comment": null}}], "kwarg": ...
def process(self, products): # Compute products positions on the grid minpos = 0 index = 0 maxy = 0 for p in products: x = min(max(p.website_size_x, 1), PPR) y = min(max(p.website_size_y, 1), PPR) if index>=PPG: x = y = 1 ...
19,375
[ -0.030469238758087158, 0.013680263422429562, -0.06804410368204117, -0.013400286436080933, -0.024367667734622955, 0.0038617539685219526, 0.009451642632484436, 0.01059086062014103, -0.009688175283372402, 0.04738372191786766, 0.01090945489704609, -0.05178612098097801, 0.0366673544049263, -0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": n...
class QueryURL(object): def __init__(self, path='', **args): self.path = path self.args = args def __call__(self, path=None, **kw): if not path: path = self.path for k,v in self.args.items(): kw.setdefault(k,v) l = [] for k,v in kw.items()...
19,376
[ 0.008019734174013138, -0.0038613532669842243, -0.03250911086797714, -0.03439369797706604, -0.010713462717831135, -0.029702717438340187, 0.005986633710563183, 0.022942788898944855, 0.015947286039590836, 0.06129002198576927, 0.006780413445085287, -0.018180111423134804, 0.026220329105854034, ...
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": "path", "annotation": null, "type_comment": null}}], "kwarg": {"_t...
def __call__(self, path=None, **kw): if not path: path = self.path for k,v in self.args.items(): kw.setdefault(k,v) l = [] for k,v in kw.items(): if v: if isinstance(v, list) or isinstance(v, set): l.append(werkzeug....
19,377
[ -0.0496060736477375, -0.0018696137703955173, 0.009113420732319355, -0.0024191439151763916, 0.01867494359612465, -0.008513933047652245, -0.011850474402308464, 0.06021518632769585, 0.0012489322107285261, -0.0031124905217438936, 0.030737359076738358, -0.06123249977827072, 0.0032790149562060833,...
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 get_pricelist(): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry order = context.get('purchase_collective_order') if order: pricelist = order.pricelist_id else: partner = pool['res.users'].browse(cr, SUPERUSER_ID, uid, context=context).partner_id ...
19,378
[ -0.008231457322835922, -0.028275027871131897, -0.011384054087102413, -0.019123822450637817, -0.01772395335137844, -0.026585930958390236, -0.0217153150588274, 0.04363887384533882, -0.012263310141861439, 0.049053240567445755, 0.022421032190322876, -0.062056977301836014, -0.007600938435643911, ...
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": "search", "annotation": null, "type_comment": null}}, {"_type": "a...
def _get_search_domain(self, search, category, attrib_values): domain = request.website.purchase_product_domain() if search: for srch in search.split(" "): domain += [ '|', '|', '|', ('name', 'ilike', srch), ('description', 'ilike', srch), ...
19,379
[ -0.025929132476449013, -0.030811462551355362, -0.02390582486987114, -0.02848025970160961, -0.01318449154496193, -0.019463343545794487, -0.007488439325243235, 0.029052065685391426, -0.007603899575769901, -0.012205826118588448, 0.06043533235788345, -0.06250262260437012, 0.008566070348024368, ...
14
{"_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": "product", "annotation": null, "type_comment": null}}], "kwarg": n...
def get_attribute_value_ids(self, product): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry currency_obj = pool['res.currency'] attribute_value_ids = [] visible_attrs = set(l.attribute_id.id for l in product.attribute_li...
19,380
[ -0.007172265090048313, -0.00871055293828249, -0.04225162789225578, -0.018305620178580284, 0.00878105778247118, -0.02694566734135151, -0.0157930850982666, 0.06753081828355789, -0.004156580660492182, 0.01239603292196989, 0.03599592670798302, -0.08727217465639114, 0.01211401354521513, -0.0296...
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": "product", "annotation": null, "type_comment": null}}, {"_type": "...
def product(self, product, category='', search='', **kwargs): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry category_obj = pool['product.public.category'] template_obj = pool['product.template'] context.update(active_id=product.id) if categ...
19,381
[ -0.03578786551952362, -0.008596595376729965, -0.045923586934804916, -0.020809516310691833, 0.02913082018494606, -0.035912998020648956, -0.03316008299589157, 0.05430745705962181, -0.01342670526355505, 0.006469344720244408, 0.04862644895911217, -0.08619119226932526, -0.01637982949614525, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "page", "annotation": null, "type_comment": null}}, {"_type": "arg...
def shop(self, page=0, category=None, search='', **post): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry attrib_list = request.httprequest.args.getlist('attrib') attrib_values = [map(int, v.split("-")) for v in attrib_list if v] attrib_set = set([v[1...
19,382
[ -0.006395993288606405, -0.02648722380399704, -0.04001157730817795, -0.0013121551601216197, -0.0037869408261030912, -0.04689581319689751, -0.033591169863939285, 0.05648980289697647, 0.00002567571027611848, 0.015196586959064007, 0.07318773865699768, -0.07245537638664246, -0.046822577714920044,...
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": "order_id", "annotation": null, "type_comment": null}}], "kwarg": ...
def cart(self, order_id=None, **post): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry #request.website.purchase_reset() #request.website.sale_reset() domain = [ # ('state', 'not in', ['draft', 'cancel']), ('id', '=', order_id) ...
19,383
[ -0.001403008820489049, 0.005145587958395481, -0.05045844241976738, 0.026074107736349106, 0.008982776664197445, 0.0032915333285927773, 0.005820322781801224, 0.06806022673845291, 0.04639830067753792, 0.026191452518105507, 0.020863980054855347, -0.04571769759058952, 0.002776681212708354, -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": "product_template_id", "annotation": null, "type_comment": null}}]...
def product_comment(self, product_template_id, **post): if not request.session.uid: return login_redirect() cr, uid, context = request.cr, request.uid, request.context if post.get('comment'): request.registry['product.template'].message_post( cr, uid, prod...
19,384
[ 0.004986634943634272, -0.03532914072275162, -0.021660972386598587, 0.011362551711499691, -0.037268225103616714, -0.015690017491579056, -0.006562139838933945, 0.06380055099725723, 0.026626916602253914, 0.03558926284313202, 0.06682741641998291, -0.07500939816236496, -0.049281079322099686, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "order_id", "annotation": null, "type_comment": null}}], "kwarg": ...
def supplier_orders_followup(self, order_id=None): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry # request.website.purchase_reset() # request.website.sale_reset() domain = [ # ('state', 'not in', ['draft', 'cancel']), ('id', '...
19,385
[ 0.010905635543167591, -0.014874223619699478, -0.06864698976278305, -0.002198416506871581, -0.02423711121082306, 0.005184167064726353, 0.04962330311536789, 0.011841924861073494, 0.0018034197855740786, -0.01780012622475624, 0.05762431398034096, -0.022960353642702103, -0.011852564290165901, -...
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": "product_id", "annotation": null, "type_comment": null}}, {"_type"...
def cart_update_json(self, product_id, line_id, add_qty=None, set_qty=None, display=True): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry order =request.website.purchase_get_order() logging.info("cart_update_json context : %s", pprint.pformat(context)) ...
19,386
[ -0.030436404049396515, 0.007126481272280216, -0.03324437513947487, 0.00886892806738615, 0.012830173596739769, -0.028556067496538162, -0.02419368177652359, 0.02993498183786869, 0.018289420753717422, 0.004512811079621315, 0.06262779235839844, -0.07034971565008163, -0.07165341824293137, -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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "post", "annotation": null, "type_comment": null}}, "var...
def checkout(self, **post): cr, uid, context = request.cr, request.uid, request.context order = request.website.purchase_get_order(context=context) redirection = self.checkout_redirection(order) if redirection: return redirection values = self.checkout_values() ...
19,387
[ 0.0069176252000033855, -0.0017430237494409084, -0.016994481906294823, 0.01118440181016922, 0.009641099721193314, 0.025661181658506393, -0.016764499247074127, 0.020286859944462776, 0.011142036877572536, -0.006457660812884569, 0.03812864422798157, -0.03260906785726547, -0.016231907531619072, ...
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": "order", "annotation": null, "type_comment": null}}], "kwarg": nul...
def checkout_redirection(self, order): cr, uid, context, registry = request.cr, request.uid, request.context, request.registry # must have a draft sale order with lines at this point, otherwise reset if not order or order.state != 'draft': request.session['purchase_order_id'] = None...
19,388
[ 0.023888688534498215, 0.06141383945941925, 0.022594718262553215, 0.00537184439599514, -0.015515205450356007, 0.02433660253882408, 0.00342155690304935, -0.0015816924860700965, -0.009319077245891094, 0.0470806248486042, 0.04772761091589928, -0.03167739510536194, -0.013350293040275574, 0.0097...
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def checkout_form_validate(self, data): cr, uid, context, registry = request.cr, request.uid, request.context, request.registry # Validation error = dict() for field_name in self._get_mandatory_billing_fields(): if not data.get(field_name): error[field_name] ...
19,389
[ -0.017727158963680267, 0.021666526794433594, 0.007094751112163067, -0.018763834610581398, 0.017804909497499466, -0.007606609724462032, -0.011060036718845367, 0.018323248252272606, -0.003949087578803301, 0.028016166761517525, 0.04356630519032478, -0.035454317927360535, -0.044447481632232666, ...
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def checkout_values(self, data=None): cr, uid, context, registry = request.cr, request.uid, request.context, request.registry orm_partner = registry.get('res.partner') orm_user = registry.get('res.users') orm_country = registry.get('res.country') state_orm = registry.get('res.cou...
19,390
[ 0.008270162157714367, 0.015667812898755074, -0.02105245552957058, -0.0002742178912740201, -0.0006703536491841078, 0.007017484866082668, 0.014147150330245495, 0.01934482529759407, -0.01602928154170513, 0.021600890904664993, 0.03704434260725975, -0.02752150408923626, -0.019419612362980843, -...
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": "checkout", "annotation": null, "type_comment": null}}], "kwarg": ...
def checkout_form_save(self, checkout): cr, uid, context, registry = request.cr, request.uid, request.context, request.registry order = request.website.purchase_get_order(force_create=1, context=context) orm_partner = registry.get('res.partner') orm_user = registry.get('res.users') ...
19,391
[ 0.010431233793497086, 0.0028541581705212593, -0.02059425227344036, 0.0037520956248044968, -0.010728603228926659, 0.01334078423678875, 0.007667452562600374, 0.01881003938615322, -0.006093146745115519, -0.0002871650503948331, 0.04916498810052872, -0.029550304636359215, -0.014845121651887894, ...
9
{"_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": "post", "annotation": null, "type_comment": null}}, "var...
def confirm_order(self, **post): logging.debug("Init /purchase/confirm_order") cr, uid, context, registry = request.cr, request.uid, request.context, request.registry order = request.website.purchase_get_order(context=context) if not order: return request.redirect("...
19,392
[ 0.018588503822684288, -0.03189966455101967, -0.048532720655202866, 0.04900391399860382, -0.025703495368361473, -0.010460450313985348, 0.011214356869459152, 0.005990021396428347, 0.007321137469261885, 0.02509094588458538, 0.03538648039102554, -0.06662647426128387, -0.018046634271740913, -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": {"_type": "arg", "_fields": {"arg": "post", "annotation": null, "type_comment": null}}, "var...
def payment_confirmation(self, **post): cr, uid, context = request.cr, request.uid, request.context sale_order_id = request.session.get('sale_last_order_id') if sale_order_id: order = request.registry['sale.order'].browse(cr, SUPERUSER_ID, sale_order_id, context=context) else...
19,393
[ 0.008385004475712776, -0.017048928886651993, -0.006513922940939665, 0.025962717831134796, -0.04502218961715698, -0.009250815957784653, -0.0014512508641928434, 0.004791016224771738, 0.010726762935519218, 0.004233178216964006, 0.039281103760004044, -0.06298922747373581, -0.0355621837079525, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "post", "anno...
class website_sale(openerp.addons.website_sale.controllers.main.website_sale): # Update the total amount in the parent cp and subscribe the user to the wall @http.route(['/shop/confirmation'], type='http', auth="public", website=True) def payment_confirmation(self, **post): cr, uid, context = reque...
19,394
[ -0.009760893881320953, 0.005129220895469189, 0.013484121300280094, -0.026565730571746826, 0.017699306830763817, 0.0341910794377327, 0.04865911602973938, 0.03613654896616936, -0.012343673035502434, 0.057693254202604294, -0.032089076936244965, -0.030635565519332886, 0.021299544721841812, 0.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": "y", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def nll_multiclass(self, y): # negative log likelihood based on multiclass cross entropy error # # y.shape[0] is (symbolically) the number of rows in y, i.e., number of time steps (call it T) in the sequence # # T.arange(y.shape[0]) is a symbolic vector which will contain [0,1,2,...
19,395
[ 0.005818902049213648, -0.04551096633076668, -0.0007998280925676227, -0.03944283723831177, 0.033656440675258636, -0.005152491386979818, 0.01571211963891983, 0.038510944694280624, -0.024879327043890953, -0.00800776295363903, -0.02862856350839138, 0.02802175097167492, -0.022928858175873756, -...
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": "input", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__(self, input, n_in, n_hidden, n_out, activation=T.tanh, output_type='real', use_symbolic_softmax=False): self.input = input self.activation = activation self.output_type = output_type # when using HF, SoftmaxGrad.grad is not implemented # use a symb...
19,396
[ 0.035982806235551834, -0.012792104855179787, -0.011366305872797966, -0.047137245535850525, 0.010988383553922176, 0.01430379506200552, 0.04260217398405075, 0.008320021443068981, -0.015025283209979534, 0.02217145450413227, -0.011389210820198059, -0.01211642473936081, -0.00935071986168623, -0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_in", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, n_in=5, n_hidden=50, n_out=5, learning_rate=0.01, n_epochs=100, L1_reg=0.00, L2_reg=0.00, learning_rate_decay=1, activation='tanh', output_type='real', final_momentum=0.9, initial_momentum=0.5, momentum_switchover=5, ...
19,397
[ 0.018159301951527596, -0.021078553050756454, 0.01132181379944086, -0.03210067376494408, 0.0299473088234663, -0.01000093575567007, 0.03247806802392006, 0.030324701219797134, -0.023997806012630463, 0.013896971940994263, -0.04355568438768387, 0.04246790334582329, 0.005305713042616844, -0.0351...
13
{"_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 ready(self): # input (where first dimension is time) self.x = T.matrix() # target (where first dimension is time) if self.output_type == 'real': self.y = T.matrix(name='y', dtype=theano.config.floatX) elif self.output_type == 'binary': self.y = T.matri...
19,398
[ 0.033840205520391464, 0.017330121248960495, 0.044145338237285614, -0.015444035641849041, -0.04307929053902626, -0.014596663415431976, 0.01394746731966734, -0.03001336380839348, 0.03504292666912079, 0.033976878970861435, -0.010810825042426586, 0.02492913231253624, -0.05043229088187218, -0.0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "results", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def extra_output_maps(results): np.warnings.filterwarnings('ignore') Rb, RM0a, fterm, gM0a, T1a_T2a, s0 = [ np.squeeze(results[n]) for n in ('QMT.Rb', 'QMT.RM0a', 'QMT.fterm', 'QMT.gM0a', 'QMT.T1a_T2a', 'S0.s0')] Rb_std, RM0a_std, fterm_std, gM0a_std, T1a_T2a_std, s0_std = [ ...
19,399
[ -0.014429278671741486, -0.03263276442885399, 0.0322733148932457, -0.03843528404831886, 0.027395090088248253, -0.04909035563468933, 0.030604448169469833, 0.041079796850681305, -0.0053724669851362705, 0.003969977144151926, 0.004390403162688017, 0.018935218453407288, -0.032427363097667694, -0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class MempoolSpendCoinbaseTest(BitcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 1 self.setup_clean_chain = False def setup_network(self): # Just need one node for this test args = ["-checkmempool", "-debug=mempool"] self.nodes = [] ...
19,400
[ 0.013050703331828117, -0.04633762687444687, 0.05817415937781334, -0.0307590551674366, 0.036358848214149475, -0.03245757147669792, 0.00987925659865141, 0.02470809407532215, 0.026127945631742477, -0.010715244337916374, 0.0019307344919070601, 0.03649154677987099, -0.06645441800355911, -0.0384...
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 run_test(self): chain_height = self.nodes[0].getblockcount() assert_equal(chain_height, 200) node0_address = self.nodes[0].getnewaddress() # Coinbase at height chain_height-100+1 ok in mempool, should # get mined. Coinbase at height chain_height-100+2 is # is too imm...