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 |
|---|---|---|---|---|---|
18,301 | [
0.004837486892938614,
0.038791656494140625,
0.03982396051287651,
0.005924272816628218,
-0.019636699929833412,
0.03791993483901024,
0.010242740623652935,
0.036543529480695724,
-0.00011246010399190709,
-0.015461606904864311,
0.03450186550617218,
-0.042163848876953125,
0.05390916392207146,
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": "gid", "annotation": null, "type_comment": null}}], "kwarg": null,... | def group_mod(self, gid=None):
info = self.group_info()
if self.gid is not None and int(self.gid) != info[2]:
cmd = [self.module.get_bin_path('dseditgroup', True)]
cmd += ['-o', 'edit']
if gid is not None:
cmd += ['-i', gid]
cmd += ['-L', s... | |
18,302 | [
-0.0023913888726383448,
0.027010014280676842,
0.03944169729948044,
0.0019358160207048059,
-0.029935115948319435,
0.023471584543585777,
-0.0056113600730896,
0.04088066145777702,
0.030359728261828423,
0.010320420376956463,
-0.0033143293112516403,
-0.018505988642573357,
0.017869070172309875,
... | 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": "kwargs", "annotation": null, "type_comment": null}}, "v... | def group_mod(self, **kwargs):
cmd = [self.module.get_bin_path('groupmod', True)]
info = self.group_info()
if self.gid is not None and int(self.gid) != info[2]:
cmd.append('-g')
cmd.append('%d' % int(self.gid))
if len(cmd) == 1:
return (None, '', '')
... | |
18,303 | [
-0.015270907431840897,
0.027327600866556168,
0.042639195919036865,
0.007662578020244837,
0.009167969226837158,
0.011832918971776962,
-0.009764701128005981,
0.004519564565271139,
-0.013141660019755363,
0.011398931965231895,
0.031626783311367035,
-0.026418941095471382,
-0.04703330993652344,
... | 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_lowest_available_system_gid(self):
# check for lowest available system gid (< 500)
try:
cmd = [self.module.get_bin_path('dscl', True)]
cmd += ['/Local/Default', '-list', '/Groups', 'PrimaryGroupID']
(rc, out, err) = self.execute_command(cmd)
lines ... | |
18,304 | [
-0.0023913888726383448,
0.027010014280676842,
0.03944169729948044,
0.0019358160207048059,
-0.029935115948319435,
0.023471584543585777,
-0.0056113600730896,
0.04088066145777702,
0.030359728261828423,
0.010320420376956463,
-0.0033143293112516403,
-0.018505988642573357,
0.017869070172309875,
... | 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": "kwargs", "annotation": null, "type_comment": null}}, "v... | def group_mod(self, **kwargs):
cmd = [self.module.get_bin_path('groupmod', True)]
info = self.group_info()
if self.gid is not None and int(self.gid) != info[2]:
cmd.append('-g')
cmd.append('%d' % int(self.gid))
if len(cmd) == 1:
return (None, '', '')
... | |
18,305 | [
-0.014011943712830544,
0.01625151000916958,
0.010060458444058895,
-0.010189439170062542,
-0.02270052209496498,
0.07499614357948303,
0.0025400312151759863,
-0.010476713068783283,
0.02520977333188057,
0.04762888327240944,
0.022665346041321754,
-0.0518266037106514,
0.017588214948773384,
0.025... | 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():
module = AnsibleModule(
argument_spec=dict(
state=dict(type='str', default='present', choices=['absent', 'present']),
name=dict(type='str', required=True),
gid=dict(type='str'),
system=dict(type='bool', default=False),
local=dict(type='... | |
18,306 | [
0.05375367030501366,
-0.033195409923791885,
0.07861588895320892,
0.013919178396463394,
0.033058051019907,
-0.009042887017130852,
0.0058006118051707745,
0.03827774152159691,
0.023225339129567146,
-0.020043158903717995,
0.0023294019047170877,
-0.009048610925674438,
-0.018257474526762962,
-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": "concurrency", "annotation": null, "type_comment": null}}], "kwarg... | def __init__(self, concurrency=10):
self.concurrency = concurrency
if self.concurrency and GreenPool:
self._pool = GreenPool(self.concurrency)
else:
self._pool = None
self._queue = queue.Queue()
self._results = {} | |
18,307 | [
0.03969276323914528,
-0.030073106288909912,
0.018363740295171738,
-0.03532655909657478,
0.04466603323817253,
-0.0636485144495964,
-0.019449453800916672,
-0.019274339079856873,
0.006023960653692484,
0.00619907584041357,
0.02120060659945011,
-0.0825609490275383,
-0.020371727645397186,
0.0057... | 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": "headers", "annotation"... | class FakeApp(object):
def __init__(self, headers=None):
if headers is None:
headers = []
self.headers = headers
def __call__(self, env, start_response):
if 'swift.authorize' in env:
aresp = env['swift.authorize'](Request(env))
if aresp:
... | |
18,308 | [
-0.014641457237303257,
-0.011347129009664059,
-0.05934096500277519,
-0.003111309604719281,
0.009312397800385952,
-0.05012545734643936,
-0.03910130262374878,
0.011024155654013157,
-0.010986476205289364,
0.02672065980732441,
0.021520789712667465,
-0.05301068723201752,
-0.018753984943032265,
... | 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": "app", "annotation": nu... | class FakeAuthFilter(object):
def __init__(self, app):
self.app = app
@wsgify
def __call__(self, req):
def authorize(req):
if req.headers['x-auth-token'] == 'secret':
return
return HTTPForbidden(request=req)
req.environ['swift.authorize'] = a... | |
18,309 | [
0.04416292533278465,
-0.02678528241813183,
0.0030265855602920055,
-0.030215412378311157,
0.0265582874417305,
-0.032611459493637085,
-0.030518069863319397,
0.02804635837674141,
0.0035940702073276043,
0.023216431960463524,
0.0393708311021328,
-0.0646175965666771,
-0.027491485700011253,
0.036... | 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": "env", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __call__(self, env, start_response):
if 'swift.authorize' in env:
aresp = env['swift.authorize'](Request(env))
if aresp:
return aresp(env, start_response)
if env['REQUEST_METHOD'] == "HEAD" and \
env['PATH_INFO'] == '/v1/a/c2/o2':
e... | |
18,310 | [
0.0353059284389019,
0.012006748467683792,
0.027032265439629555,
0.0027159599121659994,
0.039952099323272705,
-0.023553848266601562,
-0.02310662344098091,
0.06768004596233368,
0.04964197427034378,
-0.03187720105051994,
0.049716509878635406,
-0.014149701222777367,
-0.06126982346177101,
0.040... | 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_unauthorized(self):
headers = [('x-account-bytes-used', '1000'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
environ={'REQUEST_METHOD': 'PUT',
... | |
18,311 | [
0.028085287660360336,
0.013639505952596664,
0.005600260104984045,
0.0001660845009610057,
0.030342860147356987,
0.005368455778807402,
-0.04418393597006798,
0.021151311695575714,
0.034535497426986694,
0.0013765486655756831,
0.07460742443799973,
-0.024376416578888893,
-0.054692402482032776,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestAccountQuota(unittest.TestCase):
def test_unauthorized(self):
headers = [('x-account-bytes-used', '1000'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
environ={'REQUEST... | |
18,312 | [
0.029538461938500404,
0.013990559615194798,
0.03359776735305786,
-0.007473971229046583,
0.05284755304455757,
-0.029793765395879745,
0.0013140083756297827,
0.052745431661605835,
0.043299250304698944,
-0.04853294417262077,
0.04955415427684784,
-0.024100525304675102,
-0.05882162228226662,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_no_quotas(self):
headers = [('x-account-bytes-used', '1000'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
environ={'REQUEST_METHOD': 'PUT',
... | |
18,313 | [
0.04522368311882019,
0.01807495579123497,
-0.006956559140235186,
0.0019054922740906477,
0.03781948611140251,
-0.021268922835588455,
0.0036658041644841433,
0.02302318625152111,
0.04984525963664055,
-0.04788532480597496,
0.03961004316806793,
-0.0353030264377594,
-0.05337798222899437,
0.03864... | 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_obj_request_ignores_attempt_to_set_quotas(self):
# If you try to set X-Account-Meta-* on an object, it's ignored, so
# the quota middleware shouldn't complain about it even if we're not a
# reseller admin.
headers = [('x-account-bytes-used', '1000')]
app = account_quotas... | |
18,314 | [
0.04240753501653671,
0.012168005108833313,
0.018432490527629852,
0.01245910581201315,
0.03961297124624252,
-0.02364901266992092,
0.0004835908766835928,
0.02668810449540615,
0.04063764587044716,
-0.034675903618335724,
0.027270305901765823,
-0.008733018301427364,
-0.025011364370584488,
0.049... | 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_container_request_ignores_attempt_to_set_quotas(self):
# As with an object, if you try to set X-Account-Meta-* on a
# container, it's ignored.
headers = [('x-account-bytes-used', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(Non... | |
18,315 | [
0.04832625016570091,
0.028153004124760628,
0.0025990172289311886,
0.01433985959738493,
0.019883552566170692,
-0.020541947335004807,
-0.003980002366006374,
0.041373591870069504,
0.032366737723350525,
-0.0671563670039177,
0.03974076732993126,
-0.009638913907110691,
-0.03963542729616165,
0.02... | 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_bogus_quota_is_ignored(self):
# This can happen if the metadata was set by a user prior to the
# activation of the account-quota middleware
headers = [('x-account-bytes-used', '1000'),
('x-account-meta-quota-bytes', 'pasty-plastogene')]
app = account_quotas.Ac... | |
18,316 | [
0.050611842423677444,
0.012579891830682755,
0.025939177721738815,
-0.009718057699501514,
0.0213602427393198,
-0.01624547503888607,
0.00126499158795923,
0.04824930429458618,
0.01949700526893139,
-0.03305114060640335,
0.05616501718759537,
-0.017304962500929832,
-0.06688167154788971,
0.017195... | 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_exceed_bytes_quota(self):
headers = [('x-account-bytes-used', '1000'),
('x-account-meta-quota-bytes', '0')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
envir... | |
18,317 | [
0.030598431825637817,
0.010815609246492386,
0.012876319698989391,
-0.008630006574094296,
0.019433127716183662,
-0.026377098634839058,
-0.021531304344534874,
0.04466122388839722,
0.026077358052134514,
-0.01252037938684225,
0.052004847675561905,
-0.022205719724297523,
-0.05665081366896629,
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_exceed_quota_not_authorized(self):
headers = [('x-account-bytes-used', '1000'),
('x-account-meta-quota-bytes', '0')]
app = FakeAuthFilter(
account_quotas.AccountQuotaMiddleware(FakeApp(headers)))
cache = FakeCache(None)
req = Request.blank('/v1/a/c... | |
18,318 | [
0.006168024148792028,
0.01667674072086811,
0.0019598600920289755,
-0.004914462100714445,
0.02729148045182228,
-0.039914414286613464,
-0.02243938483297825,
0.05318595841526985,
0.032255835831165314,
-0.027865249663591385,
0.05573049932718277,
-0.00981021486222744,
-0.056828148663043976,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_under_quota_not_authorized(self):
headers = [('x-account-bytes-used', '0'),
('x-account-meta-quota-bytes', '1000')]
app = FakeAuthFilter(
account_quotas.AccountQuotaMiddleware(FakeApp(headers)))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/... | |
18,319 | [
0.04350392147898674,
0.011241937056183815,
0.015883810818195343,
-0.002190925646573305,
0.023960541933774948,
-0.01914532110095024,
-0.02524460107088089,
0.045917950570583344,
0.024153150618076324,
-0.015087693929672241,
0.0633297935128212,
-0.0211099311709404,
-0.07437270134687424,
0.0409... | 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_exceed_quota_authorized(self):
headers = [('x-account-bytes-used', '1000'),
('x-account-meta-quota-bytes', '0')]
app = FakeAuthFilter(
account_quotas.AccountQuotaMiddleware(FakeApp(headers)))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',... | |
18,320 | [
0.01629035733640194,
0.012652887031435966,
0.0013898768229410052,
-0.0012083163019269705,
0.02447936125099659,
-0.03834056481719017,
-0.02005930244922638,
0.062406718730926514,
0.036687739193439484,
-0.02196255698800087,
0.07147222012281418,
-0.006007147487252951,
-0.07217342406511307,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_under_quota_authorized(self):
headers = [('x-account-bytes-used', '0'),
('x-account-meta-quota-bytes', '1000')]
app = FakeAuthFilter(
account_quotas.AccountQuotaMiddleware(FakeApp(headers)))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o', ... | |
18,321 | [
0.04352865740656853,
0.011525474488735199,
0.015571716241538525,
0.018649986013770103,
0.03186490014195442,
-0.026381732895970345,
0.005200592335313559,
0.06233496218919754,
0.030037179589271545,
-0.03732402250170708,
0.056563206017017365,
0.012024491094052792,
-0.03422170132398605,
0.0274... | 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_over_quota_container_create_still_works(self):
headers = [('x-account-bytes-used', '1001'),
('x-account-meta-quota-bytes', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/new_container',... | |
18,322 | [
0.026490943506360054,
0.00876538548618555,
0.014112584292888641,
0.027647094801068306,
0.0324225015938282,
-0.01918959617614746,
-0.002703445963561535,
0.06283430755138397,
0.033754587173461914,
-0.03641876205801964,
0.058913443237543106,
-0.004586904309689999,
-0.04981503635644913,
0.0379... | 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_over_quota_container_post_still_works(self):
headers = [('x-account-bytes-used', '1001'),
('x-account-meta-quota-bytes', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/new_container',
... | |
18,323 | [
0.015290321782231331,
0.023032093420624733,
-0.00034156060428358614,
-0.011973340064287186,
0.023714812472462654,
-0.018034078180789948,
0.002545703435316682,
0.05363849923014641,
0.0415041409432888,
-0.04240584746003151,
0.05693615972995758,
-0.03310541436076164,
-0.07466108351945877,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_over_quota_obj_post_still_works(self):
headers = [('x-account-bytes-used', '1001'),
('x-account-meta-quota-bytes', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
... | |
18,324 | [
0.07526426762342453,
0.006359354127198458,
0.0017372112488374114,
-0.029796075075864792,
0.014826584607362747,
0.0013248655013740063,
0.0008179927826859057,
0.031701501458883286,
0.006841664668172598,
-0.03182058781385422,
0.07069125026464462,
-0.015195760875940323,
-0.055781301110982895,
... | 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_exceed_bytes_quota_copy_verb(self):
headers = [('x-account-bytes-used', '500'),
('x-account-meta-quota-bytes', '1000'),
('content-length', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = R... | |
18,325 | [
0.07874081283807755,
0.00644029350951314,
0.008943546563386917,
-0.02705393359065056,
0.02456243336200714,
-0.007074920926243067,
-0.0016335780965164304,
0.03177838400006294,
0.010236306115984917,
-0.0361267551779747,
0.07356977462768555,
-0.014537669718265533,
-0.05518908426165581,
0.0201... | 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_exceed_bytes_quota_copy_from(self):
headers = [('x-account-bytes-used', '500'),
('x-account-meta-quota-bytes', '1000'),
('content-length', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = R... | |
18,326 | [
0.08404939621686935,
-0.007117086090147495,
0.006515230983495712,
-0.03538675978779793,
0.026878979057073593,
-0.0005974729428999126,
0.0073508163914084435,
0.040832675993442535,
0.02856183610856533,
-0.03774743527173996,
0.0655847117304802,
-0.016384489834308624,
-0.0518413707613945,
0.02... | 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_not_exceed_bytes_quota_copy_from(self):
headers = [('x-account-bytes-used', '0'),
('x-account-meta-quota-bytes', '1000'),
('content-length', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req =... | |
18,327 | [
0.0842059925198555,
-0.004811011720448732,
-0.003171900985762477,
-0.039693061262369156,
0.013762624002993107,
0.005023653153330088,
0.007944518700242043,
0.039456792175769806,
0.023201540112495422,
-0.031423673033714294,
0.05712965503334999,
-0.011033725924789906,
-0.052876830101013184,
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_not_exceed_bytes_quota_copy_verb(self):
headers = [('x-account-bytes-used', '0'),
('x-account-meta-quota-bytes', '1000'),
('content-length', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req =... | |
18,328 | [
0.05676547810435295,
0.0008113799849525094,
0.013847552239894867,
-0.03929005563259125,
0.032318856567144394,
-0.027197161689400673,
0.0013011719565838575,
0.03172606974840164,
0.03179720416665077,
-0.043415870517492294,
0.0731738805770874,
-0.00980473030358553,
-0.038649845868349075,
0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_quota_copy_from_no_src(self):
headers = [('x-account-bytes-used', '0'),
('x-account-meta-quota-bytes', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
e... | |
18,329 | [
0.03565570339560509,
0.009172209538519382,
0.022086378186941147,
-0.023396695032715797,
0.03255630284547806,
-0.023610880598425865,
-0.006520080380141735,
0.01653013564646244,
0.031447574496269226,
-0.0421568863093853,
0.07403283566236496,
-0.03321146219968796,
-0.04056938737630844,
0.0348... | 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_quota_copy_from_bad_src(self):
headers = [('x-account-bytes-used', '0'),
('x-account-meta-quota-bytes', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
... | |
18,330 | [
0.04406238719820976,
-0.005968817044049501,
0.03209422156214714,
0.008402139879763126,
0.021799158304929733,
-0.021200750023126602,
-0.0128352465108037,
0.05358806997537613,
0.04315866902470589,
-0.012603210285305977,
0.04330521821975708,
-0.029358642175793648,
-0.05461391061544418,
0.0146... | 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_exceed_bytes_quota_reseller(self):
headers = [('x-account-bytes-used', '1000'),
('x-account-meta-quota-bytes', '0')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a',
... | |
18,331 | [
0.0749988853931427,
-0.01662779040634632,
0.02051200345158577,
-0.018078375607728958,
0.02253802865743637,
-0.004330778028815985,
-0.00891930516809225,
0.038554415106773376,
0.03126551955938339,
-0.020643875002861023,
0.07346438616514206,
-0.030905870720744133,
-0.04421290010213852,
0.0209... | 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_exceed_bytes_quota_reseller_copy_from(self):
headers = [('x-account-bytes-used', '500'),
('x-account-meta-quota-bytes', '1000'),
('content-length', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
... | |
18,332 | [
0.0013363499892875552,
0.011894148774445057,
0.044916559010744095,
0.01295182853937149,
0.03136305883526802,
-0.03964716196060181,
0.0018398562679067254,
0.029589703306555748,
0.040229834616184235,
-0.02267361618578434,
0.036531124264001846,
-0.04772859439253807,
-0.0517059788107872,
0.032... | 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_bad_application_quota(self):
headers = []
app = account_quotas.AccountQuotaMiddleware(FakeBadApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
environ={'REQUEST_METHOD': 'PUT',
'swift.cache': c... | |
18,333 | [
0.07285529375076294,
-0.012895919382572174,
0.0065809073857963085,
-0.019422437995672226,
0.013403537683188915,
0.002501832554116845,
-0.006357313599437475,
0.03884487599134445,
0.02970775030553341,
-0.020691484212875366,
0.06860097497701645,
-0.026371974498033524,
-0.044887952506542206,
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_exceed_bytes_quota_reseller_copy_verb(self):
headers = [('x-account-bytes-used', '500'),
('x-account-meta-quota-bytes', '1000'),
('content-length', '1000')]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
... | |
18,334 | [
0.060974832624197006,
0.002497804118320346,
0.02093743160367012,
-0.016380034387111664,
0.020441800355911255,
-0.011327005922794342,
0.007694385480135679,
0.05773508921265602,
0.03812740370631218,
-0.028408179059624672,
0.039747271686792374,
-0.02304084599018097,
-0.0636826753616333,
0.023... | 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_not_exceed_bytes_quota(self):
headers = [('x-account-bytes-used', '1000'),
('x-account-meta-quota-bytes', 2000)]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
... | |
18,335 | [
0.03953662887215614,
0.007397498469799757,
0.017119210213422775,
-0.0034800730645656586,
0.03341370075941086,
-0.0347132608294487,
-0.000016766791304689832,
0.05100775137543678,
0.03856195881962776,
-0.03426341339945793,
0.04740896821022034,
-0.01042772363871336,
-0.044659897685050964,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_no_info_quota(self):
headers = []
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a/c/o',
environ={'REQUEST_METHOD': 'PUT',
'swift.cache': cache})
... | |
18,336 | [
0.016416478902101517,
0.029229646548628807,
0.03457161784172058,
0.009858706034719944,
0.06319651007652283,
-0.022501789033412933,
-0.015484153293073177,
0.033866073936223984,
0.02602950483560562,
-0.03127068281173706,
0.04238298907876015,
-0.009310650639235973,
-0.06979838013648987,
0.031... | 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_valid_quotas_admin(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a',
environ={'REQUEST_METHOD': 'POST',
... | |
18,337 | [
0.017007824033498764,
0.02704796940088272,
0.03789800778031349,
0.010933601297438145,
0.04795100912451744,
-0.027767876163125038,
-0.007430477999150753,
0.03812940791249275,
0.038540784269571304,
-0.02743363380432129,
0.039055004715919495,
-0.03874647244811058,
-0.06803129613399506,
0.0339... | 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_invalid_quotas(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a',
environ={'REQUEST_METHOD': 'POST',
... | |
18,338 | [
0.015665970742702484,
0.007570427376776934,
0.03368246182799339,
0.017928972840309143,
0.04080904275178909,
-0.025105562061071396,
-0.02590573951601982,
0.05301174521446228,
0.04636027291417122,
-0.012459010817110538,
0.034732695668935776,
-0.025805717334151268,
-0.0727161094546318,
0.0411... | 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_valid_quotas_reseller(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a',
environ={'REQUEST_METHOD': 'POST',
... | |
18,339 | [
0.03195251524448395,
0.03692914545536041,
0.0192940104752779,
-0.020429702475667,
0.03687810152769089,
-0.012039615772664547,
-0.017316119745373726,
0.06696756929159164,
0.050429847091436386,
-0.039149485528469086,
0.04767356067895889,
-0.024972472339868546,
-0.05920913442969322,
0.0284561... | 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_delete_quotas(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a',
environ={'REQUEST_METHOD': 'POST',
... | |
18,340 | [
0.03969001770019531,
0.03971490263938904,
0.023552728816866875,
-0.0265014860779047,
0.032274581491947174,
0.002202236093580723,
-0.02166154235601425,
0.062110524624586105,
0.054147638380527496,
-0.030308742076158524,
0.0593235157430172,
-0.03137875348329544,
-0.07281065732240677,
0.032797... | 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_delete_quotas_with_remove_header(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a', environ={
'REQUEST_METHOD': 'POST',
'swift.cache': cache... | |
18,341 | [
0.030691739171743393,
0.022662781178951263,
0.020968597382307053,
-0.002774533350020647,
0.021079087629914284,
-0.017015499994158745,
-0.02668953686952591,
0.07753961533308029,
0.05991027504205704,
-0.016131578013300896,
0.04296843707561493,
-0.03449751436710358,
-0.062267400324344635,
0.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_delete_quotas_reseller(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
req = Request.blank('/v1/a',
environ={'REQUEST_METHOD': 'POST',
'HTTP_X_ACCOUNT_META_Q... | |
18,342 | [
0.037013113498687744,
0.03266291692852974,
0.027875274419784546,
-0.020876076072454453,
0.02164161391556263,
0.003110754070803523,
-0.030208339914679527,
0.06503420323133469,
0.06134018301963806,
-0.019989026710391045,
0.054827041923999786,
-0.03786370903253555,
-0.07042942196130753,
0.039... | 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_delete_quotas_with_remove_header_reseller(self):
headers = [('x-account-bytes-used', '0'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1/a', environ={
'REQUEST_METHOD': 'POST',
'swift.cach... | |
18,343 | [
0.02031807415187359,
0.008436549454927444,
0.016509193927049637,
-0.006617020815610886,
0.05740007758140564,
-0.028117788955569267,
-0.01983286626636982,
0.062009550631046295,
0.04070892930030823,
-0.035347383469343185,
0.04024798423051834,
-0.037045612931251526,
-0.06254328042268753,
0.02... | 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_invalid_request_exception(self):
headers = [('x-account-bytes-used', '1000'), ]
app = account_quotas.AccountQuotaMiddleware(FakeApp(headers))
cache = FakeCache(None)
req = Request.blank('/v1',
environ={'REQUEST_METHOD': 'PUT',
... | |
18,344 | [
0.03061717562377453,
0.008560162968933582,
0.04717817157506943,
-0.03591863811016083,
0.027917806059122086,
-0.007447585463523865,
-0.013788672164082527,
0.002516979817301035,
-0.007204398978501558,
0.01506540086120367,
-0.013350936584174633,
-0.013545485213398933,
0.022616339847445488,
-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_explain(self):
schema = RowType() \
.add('a', DataTypes.INT()) \
.add('b', DataTypes.STRING()) \
.add('c', DataTypes.STRING())
t_env = self.t_env
t = t_env.from_elements([], schema)
result = t.select(t.a + 1, t.b, t.c)
actual = result... | |
18,345 | [
0.03908790647983551,
0.0005276534939184785,
0.057290252298116684,
-0.034180767834186554,
0.011445963755249977,
0.01415335200726986,
0.0046654087491333485,
0.004689582157880068,
-0.01437090989202261,
0.017320027574896812,
-0.005251606460660696,
0.008901745080947876,
0.011736041866242886,
-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_explain_with_extended(self):
schema = RowType() \
.add('a', DataTypes.INT()) \
.add('b', DataTypes.STRING()) \
.add('c', DataTypes.STRING())
t_env = self.t_env
t = t_env.from_elements([], schema)
result = t.select(t.a + 1, t.b, t.c)
a... | |
18,346 | [
-0.008884887211024761,
0.010982874780893326,
0.06069135293364525,
-0.02351669780910015,
0.003925460856407881,
0.02233845740556717,
0.008536224253475666,
-0.007400065194815397,
0.02267509698867798,
0.04888491332530975,
0.02331230789422989,
-0.0123835364356637,
0.019825682044029236,
-0.00101... | 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_register_functions(self):
t_env = self.t_env
t_env.register_function(
"python_scalar_func", udf(lambda i: i, result_type=DataTypes.INT()))
t_env.register_java_function("scalar_func",
"org.apache.flink.table.legacyutils.RichFunc0")
... | |
18,347 | [
-0.005519375670701265,
0.012166034430265427,
0.03444681689143181,
-0.03570346161723137,
0.015979085117578506,
0.0782075822353363,
-0.01208595372736454,
0.011389872059226036,
-0.025403911247849464,
0.02233622409403324,
0.016262445598840714,
-0.04105035588145256,
0.011014111340045929,
0.0208... | 16 | {"_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_load_module_twice(self):
t_env = self.t_env
self.check_list_modules('core')
self.check_list_full_modules(1, 'core')
self.assertRaisesRegex(
Py4JJavaError, "A module with name 'core' already exists",
t_env.load_module, 'core', Module(
get_g... | |
18,348 | [
-0.014839870855212212,
-0.011769130825996399,
0.0342063307762146,
-0.05740203708410263,
0.022314859554171562,
0.023232409730553627,
-0.02897016704082489,
-0.024101026356220245,
-0.00311508821323514,
0.0009687817073427141,
0.041546743363142014,
-0.048911627382040024,
-0.00951807014644146,
0... | 16 | {"_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_use_modules(self):
# please do not change this order since ModuleMock depends on FunctionDefinitionMock
_load_specific_flink_module_jars('/flink-table/flink-table-common')
_load_specific_flink_module_jars('/flink-table/flink-table-api-java')
t_env = self.t_env
t_env.loa... | |
18,349 | [
0.006932484917342663,
0.03095063380897045,
0.042440056800842285,
-0.01928989589214325,
0.004811053164303303,
0.06327177584171295,
-0.01659456454217434,
0.04143501818180084,
-0.0031293260399252176,
0.03264092653989792,
0.03590730205178261,
-0.01265435479581356,
0.01817064918577671,
0.022076... | 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_unload_module_twice(self):
t_env = self.t_env
t_env.unload_module('core')
self.check_list_modules()
self.check_list_full_modules(0)
self.assertRaisesRegex(
Py4JJavaError, "No module with name 'core' exists",
t_env.unload_module, 'core') | |
18,350 | [
0.025558950379490852,
0.025421535596251488,
0.034719862043857574,
-0.03808650001883507,
0.014978094026446342,
0.06266064941883087,
-0.0053963507525622845,
0.001699063228443265,
-0.002494917716830969,
0.0051644654013216496,
0.023165661841630936,
-0.008519650436937809,
-0.008090232498943806,
... | 16 | {"_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_unload_and_load_module(self):
t_env = self.t_env
t_env.unload_module('core')
t_env.load_module('core', Module(
get_gateway().jvm.org.apache.flink.table.module.CoreModule.INSTANCE))
table_result = t_env.execute_sql("select concat('unload', 'load') as test_module")
... | |
18,351 | [
0.031559545546770096,
0.02333523891866207,
0.045456647872924805,
-0.06029508635401726,
0.01152518019080162,
0.010385666973888874,
-0.003094953717663884,
0.008806451223790646,
0.0034556961618363857,
0.009196610189974308,
0.031237510964274406,
-0.019037293270230293,
0.025515176355838776,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_create_and_drop_java_function(self):
t_env = self.t_env
t_env.create_java_temporary_system_function(
"scalar_func", "org.apache.flink.table.legacyutils.RichFunc0")
t_env.create_java_function(
"agg_func", "org.apache.flink.table.legacyutils.ByteMaxAggFunction")
... | |
18,352 | [
0.04516579955816269,
-0.012589966878294945,
0.04373554885387421,
-0.028454452753067017,
0.02077626809477806,
0.018668530508875847,
0.012226130813360214,
-0.007414718624204397,
-0.003575625829398632,
-0.03563079610466957,
0.03462711349129677,
-0.0017282190965488553,
-0.0017642889870330691,
... | 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_to_data_stream_atomic(self):
table = self.t_env.from_elements([(1,), (2,), (3,)], ["a"])
ds = self.t_env.to_data_stream(table)
ds.add_sink(self.test_sink)
self.env.execute()
results = self.test_sink.get_results(False)
results.sort()
expected = ['+I[1]', '... | |
18,353 | [
0.03354627639055252,
0.016387145966291428,
0.040494147688150406,
-0.019650539383292198,
0.03078584559261799,
0.0012552074622362852,
-0.006789963226765394,
-0.03335912898182869,
0.010825341567397118,
-0.022563030943274498,
0.031932126730680466,
0.009667363949120045,
0.018036387860774994,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_from_data_stream_atomic(self):
data_stream = self.env.from_collection([(1,), (2,), (3,), (4,), (5,)])
result = self.t_env.from_data_stream(data_stream).execute()
self.assertEqual("""(
`f0` RAW('[B', '...')
)""",
result._j_table_result.getResolvedSchema().toStr... | |
18,354 | [
0.03844762593507767,
-0.013588405214250088,
0.07552909106016159,
-0.04640062525868416,
0.03256826102733612,
0.02237085811793804,
0.015113136731088161,
-0.0032019359059631824,
-0.03276342526078224,
-0.007007665000855923,
0.020443597808480263,
-0.0023038689978420734,
0.03613003343343735,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_from_data_stream(self):
self.env.set_parallelism(1)
ds = self.env.from_collection([(1, 'Hi', 'Hello'), (2, 'Hello', 'Hi')],
type_info=Types.ROW([Types.INT(),
Types.STRING(),
... | |
18,355 | [
0.06725411117076874,
-0.0326065793633461,
0.04798658564686775,
-0.03433166816830635,
0.008011937141418457,
0.01709294319152832,
0.014626797288656235,
-0.02030014805495739,
-0.02313074842095375,
-0.006469077430665493,
-0.005624756682664156,
-0.002220138907432556,
0.008965594694018364,
0.007... | 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_to_append_stream(self):
self.env.set_parallelism(1)
t_env = StreamTableEnvironment.create(
self.env,
environment_settings=EnvironmentSettings.in_streaming_mode())
table = t_env.from_elements([(1, "Hi", "Hello"), (2, "Hello", "Hi")], ["a", "b", "c"])
new_t... | |
18,356 | [
-0.03505980968475342,
0.031052974984049797,
-0.006138378754258156,
-0.017704620957374573,
0.020674804225564003,
-0.007838954217731953,
-0.02114071510732174,
-0.02026713266968727,
-0.01624864898622036,
0.011764255352318287,
-0.04062744602560997,
-0.04305018484592438,
0.05982298403978348,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"... | class VectorUDT(UserDefinedType):
@classmethod
def sql_type(cls):
return DataTypes.ROW(
[
DataTypes.FIELD("type", DataTypes.TINYINT()),
DataTypes.FIELD("size", DataTypes.INT()),
DataTypes.FIELD("indices", DataTypes.ARRAY(DataTypes.INT())),
... | |
18,357 | [
0.06730803847312927,
0.007408078294247389,
0.04675539955496788,
-0.02522817812860012,
-0.012071281671524048,
0.04608922824263573,
-0.01852944865822792,
0.00839499942958355,
-0.019059918820858,
0.011361932381987572,
0.00705648772418499,
-0.039575546979904175,
0.006526017561554909,
0.0346656... | 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_to_retract_stream(self):
self.env.set_parallelism(1)
t_env = StreamTableEnvironment.create(
self.env,
environment_settings=EnvironmentSettings.in_streaming_mode())
table = t_env.from_elements([(1, "Hi", "Hello"), (1, "Hi", "Hello")], ["a", "b", "c"])
new_... | |
18,358 | [
-0.004990570247173309,
0.032508768141269684,
0.011253035627305508,
-0.035268135368824005,
0.042058758437633514,
0.021428193897008896,
-0.009485317394137383,
-0.05044464021921158,
-0.04940987750887871,
0.014594453386962414,
-0.029232023283839226,
-0.0318620428442955,
0.05949880927801132,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def sql_type(cls):
return DataTypes.ROW(
[
DataTypes.FIELD("type", DataTypes.TINYINT()),
DataTypes.FIELD("size", DataTypes.INT()),
DataTypes.FIELD("indices", DataTypes.ARRAY(DataTypes.INT())),
DataTypes.FIELD("values", DataTypes.ARRAY(D... | |
18,359 | [
0.03406781330704689,
0.004621913190931082,
-0.02336021326482296,
0.019881244748830795,
-0.0015151554252952337,
0.014517419971525669,
0.005373851396143436,
-0.03126057609915733,
0.01603132113814354,
0.04908652603626251,
-0.0006009239004924893,
-0.006617056205868721,
0.06264146417379379,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "VectorUDT", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": []}}, "targets": [{"_type": "Name", "_fie... | class DenseVector(object):
__UDT__ = VectorUDT()
def __init__(self, values):
self._values = values
def size(self) -> int:
return len(self._values)
def get(self, i: int):
return self._values[i]
def to_array(self):
return self._values
@property
def values(s... | |
18,360 | [
-0.014219196513295174,
0.013214305974543095,
0.05031987652182579,
-0.03878876194357872,
0.00508097605779767,
0.04120049998164177,
-0.031628917902708054,
-0.009332917630672455,
-0.0015544395428150892,
0.023212963715195656,
0.03592482581734657,
-0.04456688091158867,
0.008447358384728432,
0.0... | 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 BatchTableEnvironmentTests(PyFlinkBatchTableTestCase):
def test_udt(self):
self.t_env.from_elements([
(DenseVector([1, 2, 3, 4]), 0., 1.),
(DenseVector([2, 2, 3, 4]), 0., 2.),
(DenseVector([3, 2, 3, 4]), 0., 3.),
(DenseVector([4, 2, 3, 4]), 0., 4.),
... | |
18,361 | [
-0.010096363723278046,
-0.027055615559220314,
0.048964064568281174,
-0.011515134014189243,
-0.005025085527449846,
-0.005091074854135513,
0.01328364759683609,
0.015863830223679543,
-0.006173299625515938,
0.06356090307235718,
-0.024904364719986916,
0.005447417497634888,
0.04154686629772186,
... | 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_udt(self):
self.t_env.from_elements([
(DenseVector([1, 2, 3, 4]), 0., 1.),
(DenseVector([2, 2, 3, 4]), 0., 2.),
(DenseVector([3, 2, 3, 4]), 0., 3.),
(DenseVector([4, 2, 3, 4]), 0., 4.),
(DenseVector([5, 2, 3, 4]), 0., 5.),
(DenseVe... | |
18,362 | [
0.0007051823777146637,
-0.00504680210724473,
0.07407372444868088,
-0.048020895570516586,
0.005597871728241444,
0.007827057503163815,
0.03093462437391281,
0.020025311037898064,
-0.0497145801782608,
-0.010243047028779984,
0.02424706518650055,
-0.017372705042362213,
0.018817316740751266,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_explain_with_multi_sinks(self):
t_env = self.t_env
source = t_env.from_elements([(1, "Hi", "Hello"), (2, "Hello", "Hello")], ["a", "b", "c"])
field_names = ["a", "b", "c"]
field_types = [DataTypes.BIGINT(), DataTypes.STRING(), DataTypes.STRING()]
t_env.register_table_sin... | |
18,363 | [
-0.01701851561665535,
0.015221912413835526,
0.039697565138339996,
-0.019159674644470215,
0.004666863474994898,
0.028302665799856186,
0.02074708417057991,
-0.020144114270806313,
0.00024976333952508867,
0.01887664757668972,
0.03686729818582535,
-0.009426018223166466,
0.02918866276741028,
0.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_register_java_function(self):
t_env = self.t_env
t_env.register_java_function(
"scalar_func", "org.apache.flink.table.legacyutils.RichFunc0")
t_env.register_java_function(
"agg_func", "org.apache.flink.table.legacyutils.ByteMaxAggFunction")
t_env.regis... | |
18,364 | [
0.025558950379490852,
0.025421535596251488,
0.034719862043857574,
-0.03808650001883507,
0.014978094026446342,
0.06266064941883087,
-0.0053963507525622845,
0.001699063228443265,
-0.002494917716830969,
0.0051644654013216496,
0.023165661841630936,
-0.008519650436937809,
-0.008090232498943806,
... | 16 | {"_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_unload_and_load_module(self):
t_env = self.t_env
t_env.unload_module('core')
t_env.load_module('core', Module(
get_gateway().jvm.org.apache.flink.table.module.CoreModule.INSTANCE))
table_result = t_env.execute_sql("select concat('unload', 'load') as test_module")
... | |
18,365 | [
-0.014912965707480907,
-0.010125248692929745,
0.03232172131538391,
-0.05569813773036003,
0.02614402212202549,
0.021856699138879776,
-0.029727088287472725,
-0.026613527908921242,
-0.003910483792424202,
-0.0015058141434565187,
0.04146471619606018,
-0.051546722650527954,
-0.011076614260673523,
... | 16 | {"_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_use_modules(self):
# please do not change this order since ModuleMock depends on FunctionDefinitionMock
_load_specific_flink_module_jars('/flink-table/flink-table-common')
_load_specific_flink_module_jars('/flink-table/flink-table-api-java')
self.t_env.load_module('x', Module(
... | |
18,366 | [
-0.031135041266679764,
0.019626641646027565,
-0.011859888210892677,
0.021225344389677048,
0.012880337424576283,
0.0025978938210755587,
0.05124923214316368,
-0.024286692962050438,
-0.002762299496680498,
0.030205298215150833,
-0.010658025741577148,
-0.020159542560577393,
0.041679684072732925,
... | 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": "windows", "annotation"... | class MyTumblingEventTimeWindow(MergingWindowAssigner[tuple, TimeWindow]):
def merge_windows(self,
windows,
callback: 'MergingWindowAssigner.MergeCallback[TimeWindow]') -> None:
window_list = [w for w in windows]
window_list.sort()
for i in range(... | |
18,367 | [
0.031559545546770096,
0.02333523891866207,
0.045456647872924805,
-0.06029508635401726,
0.01152518019080162,
0.010385666973888874,
-0.003094953717663884,
0.008806451223790646,
0.0034556961618363857,
0.009196610189974308,
0.031237510964274406,
-0.019037293270230293,
0.025515176355838776,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_create_and_drop_java_function(self):
t_env = self.t_env
t_env.create_java_temporary_system_function(
"scalar_func", "org.apache.flink.table.legacyutils.RichFunc0")
t_env.create_java_function(
"agg_func", "org.apache.flink.table.legacyutils.ByteMaxAggFunction")
... | |
18,368 | [
0.02402157336473465,
0.014892145991325378,
-0.01650177501142025,
-0.07362519949674606,
-0.03548557683825493,
-0.05015655234456062,
0.06064986437559128,
-0.047871123999357224,
0.017730500549077988,
-0.026786204427480698,
0.018492311239242554,
-0.028260674327611923,
0.009006554260849953,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "audio_source", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya... | def initSoundPack(audio_source):
global list_tracks, audio_folder, before_race_tracks, epic_tracks, win_tracks, win_with_sweat_tracks
global start_race_tracks, lose_tracks, suspense_tracks, surprise_tracks, pit_tracks
audio_folder = "apps\\python\\EpicRace\\SoundPacks\\" + audio_source
list_tracks = os.... | |
18,369 | [
-0.010489347390830517,
-0.008093799464404583,
0.010674037970602512,
0.011054283939301968,
0.014134272933006287,
-0.014384148642420769,
0.04954057186841965,
-0.007398493587970734,
-0.006442447192966938,
0.05262599512934685,
0.01918610744178295,
-0.0012432674411684275,
0.005084427073597908,
... | 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": "windows", "annotation": null, "type_comment": null}}, {"_type": "... | def merge_windows(self,
windows,
callback: 'MergingWindowAssigner.MergeCallback[TimeWindow]') -> None:
window_list = [w for w in windows]
window_list.sort()
for i in range(1, len(window_list)):
if window_list[i - 1].end > window_list[i].sta... | |
18,370 | [
0.021065128967165947,
0.03235644847154617,
-0.005854639690369368,
-0.03320522606372833,
-0.03212496265769005,
0.014737873338162899,
0.005613509565591812,
-0.02076934091746807,
-0.014493527822196484,
-0.03855510056018829,
0.017489971593022346,
-0.014210602268576622,
-0.05524773523211479,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "location", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def priority_queue(location):
try:
global sound_player
global isPlayingStartRace, isPlayingBeforeRace, isPlayingSuspense, isPlayingAfterRace, isPlayingOvertake
global overflow
# priority clip cancels other audio.
stopPlaying()
# new fmod audio:
sound_player.qu... | |
18,371 | [
0.029174460098147392,
0.033179812133312225,
-0.014974844641983509,
-0.04912369325757027,
-0.03217201307415962,
0.016163529828190804,
0.006528076250106096,
-0.0287610050290823,
-0.019290287047624588,
-0.033774152398109436,
0.026396555826067924,
-0.01939365081489086,
-0.05964097008109093,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "location", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def queue(location):
try:
global sound_player
global isPlayingStartRace, isPlayingBeforeRace, isPlayingSuspense, isPlayingAfterRace, isPlayingOvertake
global overflow
# new fmod audio:
sound_player.queueSong(location)
overflow += 1
except:
ac.log('EpicRace... | |
18,372 | [
0.030957184731960297,
-0.002295610960572958,
-0.022271452471613884,
-0.05106727406382561,
-0.028836093842983246,
-0.026084046810865402,
0.05412808805704117,
-0.027251988649368286,
-0.014095855876803398,
0.006296148989349604,
0.03189690783619881,
-0.020915566012263298,
-0.02827225998044014,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "win_or_lose", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def playAfterRace(win_or_lose):
global audio_folder, win_tracks, isPlayingAfterRace, count_overtake, win_with_sweat_tracks, lose_tracks, overtake
global ar_once, hot_once, sweat
if win_or_lose == "win" and count_overtake < sweat:
location = random.choice(win_tracks)
location = os.path.join(a... | |
18,373 | [
0.02335534244775772,
-0.03225451335310936,
-0.029575476422905922,
-0.028514472767710686,
-0.04824914038181305,
0.028726674616336823,
0.04005288705229759,
-0.02518557384610176,
-0.014389862306416035,
-0.04403165355324745,
0.07188300043344498,
-0.0341377928853035,
-0.004804357420653105,
0.03... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["audio_folder", "epic_tracks", ... | def playOvertake():
global audio_folder, epic_tracks, surprise_tracks, isPlayingSuspense, isPlayingOvertake, ov_once
ov_once = True
if isPlayingSuspense:
location = random.choice(surprise_tracks)
location = os.path.join(audio_folder, location)
priority_queue(location)
else:
... | |
18,374 | [
0.01529758982360363,
-0.0091893645003438,
0.020513905212283134,
-0.06319039314985275,
0.027973506599664688,
0.004979825112968683,
0.019054418429732323,
-0.03821694478392601,
0.016554370522499084,
0.024554522708058357,
0.05627134442329407,
-0.021459870040416718,
-0.013567826710641384,
0.039... | 41 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "deltaT", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def acUpdate(deltaT):
global enable_overtake, enable_lose, enable_win, enable_before_race, enable_pit
global enable_suspense, enable_hotlap, suspense_laps, log
global audio, overtake, iovertake, done, position, newposition
global start_time, finish_time, count_overtake, bestlap, lastlap, hot_once, pit_o... | |
18,375 | [
0.004192105028778315,
0.0062366994097828865,
0.01656258851289749,
-0.04821949824690819,
-0.003643220290541649,
-0.009777003899216652,
0.02449396811425686,
-0.06696390360593796,
0.012658647261559963,
0.01634303480386734,
0.015135488472878933,
-0.03683014586567879,
-0.013680944219231606,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ac_version", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def acMain(ac_version):
global appWindow
global sound_player, SoundPackSpinner, VolumeSpinner
global Beforerace, Overtake, Suspense, Win, Lose, labeldesc, Hotlap
global StatusLabel, NotificationLabel, audio, audiolist, BeforeraceLabel, OvertakeLabel, SuspenseLabel
global WinLabel, LoseLabel, audiola... | |
18,376 | [
0.006193390116095543,
0.010368641465902328,
-0.012447203509509563,
-0.03231438994407654,
-0.015105829574167728,
0.030018305405974388,
0.061873480677604675,
0.0006442636367864907,
0.015021237544715405,
0.05486437305808067,
0.013148114085197449,
-0.02060435153543949,
-0.03581894561648369,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["Status", "StatusLabel", "branc... | def CheckNewUpdate():
global Status, StatusLabel, branch
try:
Status = update.update()
if Status == 0:
Status = "New update is installed. Restart to see changes"
ac.log('EpicRace: ' + Status)
ac.setText(StatusLabel, Status)
if Status == 2:
... | |
18,377 | [
0.010696551762521267,
0.0205556508153677,
-0.018055982887744904,
0.01067751832306385,
-0.015848152339458466,
-0.001979433000087738,
0.04900365695357323,
-0.015391360968351364,
0.03512224927544594,
0.037964511662721634,
0.007137378677725792,
-0.01823362335562706,
-0.029818382114171982,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["Notify", "NotificationLabel", ... | def getNotification():
global Notify, NotificationLabel, StatusLabel
try:
Notify = box.notification('186810231:AAGvhq85_lqUb3wPOStvazULUsmN5ET37gM')
ac.setText(NotificationLabel, Notify)
except:
ac.log('EpicRace: No internet connection')
Status = "No internet connection"
... | |
18,378 | [
-0.0027754558250308037,
0.0035103450063616037,
-0.002911017742007971,
-0.0548412911593914,
-0.021016407757997513,
-0.007808377034962177,
0.03532034903764725,
-0.053928032517433167,
0.017648758366703987,
-0.01705513894557953,
0.008932828903198242,
-0.008527569472789764,
0.02113056555390358,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def onSoundPackChanged(x):
global audiolist, audiolabel, config, audio, SoundPackSpinner
audio = audiolist[int(ac.getValue(SoundPackSpinner))]
ac.setText(audiolabel, audio)
config['Audio']['source'] = str(audio)
initSoundPack(audio)
setDescription(SoundPackSpinner, '''
Select the audio set... | |
18,379 | [
-0.02434990368783474,
-0.029505271464586258,
0.006875740829855204,
0.03834304213523865,
-0.016041478142142296,
-0.03217501565814018,
0.03383209556341171,
0.02384357340633869,
0.029252106323838234,
0.000045647979277418926,
0.004781372845172882,
-0.019079461693763733,
0.040207259356975555,
-... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "item", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setHighlight(item):
global uihighlight
# dehighlight the old one
ac.setBackgroundColor(uihighlight, 0.5, 0.5, 0.5)
ac.drawBackground(uihighlight, 0)
# set the new one
uihighlight = item
ac.setBackgroundColor(uihighlight, 1, 0, 0)
ac.drawBackground(uihighlight, 1) | |
18,380 | [
0.020199526101350784,
0.004459732677787542,
-0.051315560936927795,
-0.01796841435134411,
-0.02008996158838272,
-0.00306528783403337,
0.043546512722969055,
-0.010886628180742264,
0.02639484405517578,
-0.020916668698191643,
-0.008600735105574131,
0.01184281799942255,
-0.04027952626347542,
0.... | 8 | {"_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 onVolumeChanged(value):
global audio_volume, VolumeSpinner, sound_player
audio_volume = int(ac.getValue(VolumeSpinner))
sound_player.set_volume(audio_volume / 100)
config['Audio']['volume'] = str(audio_volume)
setDescription(VolumeSpinner, '''
Set the overall volume of
the app.''') | |
18,381 | [
0.056798722594976425,
0.03092374838888645,
-0.006686362903565168,
0.0006055945996195078,
-0.021990463137626648,
-0.0002206798963015899,
0.0017096741357818246,
-0.04058605805039406,
0.04874679446220398,
-0.035167332738637924,
0.017790405079722404,
-0.03536318987607956,
0.04076015576720238,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _escape_cdata(text):
# escape character data
try:
# it's worth avoiding do-nothing calls for strings that are
# shorter than 500 character, or so. assume that's, by far,
# the most common case in most applications.
if "&" in text:
text = text.replace("&", "&"... | |
18,382 | [
0.02455202490091324,
0.03342803567647934,
-0.03891464322805405,
-0.03120373748242855,
0.004167912527918816,
0.013504672795534134,
0.013949532993137836,
-0.04711277037858963,
0.059102803468704224,
-0.041753269731998444,
0.03459314629435539,
-0.011269781738519669,
0.03830030933022499,
-0.005... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _escape_attrib(text):
# escape attribute value
try:
if "&" in text:
text = text.replace("&", "&")
if "<" in text:
text = text.replace("<", "<")
if ">" in text:
text = text.replace(">", ">")
if "\"" in text:
text = text... | |
18,383 | [
0.0028584126848727465,
0.029772572219371796,
-0.03909571096301079,
-0.022396022453904152,
0.008247391320765018,
-0.009640740230679512,
0.008078346028923988,
-0.04126769304275513,
0.0536029227077961,
-0.031514257192611694,
0.042415156960487366,
-0.008370334282517433,
0.02473193034529686,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _escape_attrib_html(text):
# escape attribute value
try:
if "&" in text:
text = text.replace("&", "&")
if "<" in text:
text = text.replace("<", "<")
if ">" in text:
text = text.replace(">", ">")
if "\"" in text:
text =... | |
18,384 | [
0.04207388311624527,
0.04447581619024277,
0.02632119692862034,
-0.020716683939099312,
0.05192181468009949,
-0.013831138610839844,
-0.033066630363464355,
-0.03676960989832878,
-0.02439964935183525,
0.018204661086201668,
0.0167134590446949,
0.0012497564312070608,
0.01062855962663889,
-0.0390... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "root", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "encoding", "annotation": null, "type_comment": null}}, {"_type": ... | def _write_html(root,
encoding=None,
default_namespace=None,
format="html"):
assert root is not None
data = []
write = data.append
qnames, namespaces = _namespaces(root, default_namespace)
_serialize_html(write, root, qnames, namespaces, format)
if... | |
18,385 | [
0.048338133841753006,
0.05642477422952652,
-0.010369529016315937,
-0.009307589381933212,
0.03211941570043564,
0.0004578550287988037,
-0.025395691394805908,
-0.054562121629714966,
0.0257591363042593,
-0.0018796900985762477,
0.05369894206523895,
-0.0034555632155388594,
-0.0009916642447933555,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "write", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "elem", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _serialize_html(write, elem, qnames, namespaces, format):
tag = elem.tag
text = elem.text
if tag is Comment:
write("<!--%s-->" % _escape_cdata(text))
elif tag is ProcessingInstruction:
write("<?%s?>" % _escape_cdata(text))
else:
tag = qnames[tag]
if tag is None:
... | |
18,386 | [
0.03585217893123627,
0.059292372316122055,
0.00951340701431036,
-0.003278587246313691,
0.00919367279857397,
0.0203896164894104,
-0.039332564920186996,
-0.04755130782723427,
-0.041974302381277084,
0.02681575156748295,
0.005807633511722088,
0.019173577427864075,
0.016678601503372192,
-0.0369... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "elem", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "default_namespace", "annotation": null, "type_comment": null}}], ... | def _namespaces(elem, default_namespace=None):
# identify namespaces used in this tree
# maps qnames to *encoded* prefix:local names
qnames = {None: None}
# maps uri:s to prefixes
namespaces = {}
if default_namespace:
namespaces[default_namespace] = ""
def add_qname(qname):
... | |
18,387 | [
0.06615892052650452,
0.03785289451479912,
-0.030425073578953743,
0.001770520699210465,
-0.010026444680988789,
0.0020744367502629757,
-0.04427695646882057,
-0.04670828580856323,
0.004399813711643219,
-0.05487219989299774,
0.010729076340794563,
0.028239106759428978,
0.010110091418027878,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "qname", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def add_qname(qname):
# calculate serialized qname representation
try:
if qname[:1] == "{":
uri, tag = qname[1:].split("}", 1)
prefix = namespaces.get(uri)
if prefix is None:
prefix = _namespace_map.get(uri)
... | |
18,388 | [
0.03319169208407402,
0.0041781337931752205,
-0.018475843593478203,
-0.07333289086818695,
-0.029224246740341187,
0.006249373313039541,
-0.010631714016199112,
-0.01655695028603077,
0.07281427085399628,
0.009166611358523369,
0.031609900295734406,
-0.030183695256710052,
-0.036588653922080994,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "For", "_fields": {"body": [{"_type": "With", "_fields": {"body... | def cleanup():
for f in glob.glob('/sys/class/tacho-motor/motor*/command'):
with open(f, 'w') as f:
f.write('stop')
for f in glob.glob('/sys/class/leds/*/trigger'):
with open(f, 'w') as f:
f.write('none')
for f in glob.glob('/sys/class/leds/*/brightness'):
wit... | |
18,389 | [
0.037095487117767334,
0.039320796728134155,
-0.036738596856594086,
-0.007914543151855469,
0.013068444095551968,
-0.002134774811565876,
-0.008806766010820866,
-0.045303937047719955,
-0.002279105130583048,
-0.006539470050483942,
-0.009604519233107567,
-0.036192767322063446,
0.02527615427970886... | 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class create_ev3_property(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def __call__(self, cls):
for name, args in self.kwargs.items():
def ev3_property(name, read_only=False, write_only=False, flush_on_write=False, property_type=Ev3StringType):
def fg... | |
18,390 | [
0.061418674886226654,
0.03141399472951889,
-0.03773316368460655,
-0.0172299612313509,
0.031073031947016716,
0.006557841785252094,
-0.015786554664373398,
-0.052644580602645874,
0.013865800574421883,
-0.030163798481225967,
0.022458050400018692,
-0.026254096999764442,
-0.01049027405679226,
0.... | 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": "read_only", "annotation": null, "type_comment": null}}, {"_type":... | def ev3_property(name, read_only=False, write_only=False, flush_on_write=False, property_type=Ev3StringType):
def fget(self):
if not write_only:
return property_type.post_read(self.read_value(name))
else:
return None... | |
18,391 | [
0.03222348913550377,
0.01863698475062847,
0.008180355653166771,
-0.027007030323147774,
0.008541951887309551,
-0.014025161042809486,
-0.012039350345730782,
-0.03153586387634277,
0.011529560200870037,
-0.015317420475184917,
0.0008017341606318951,
-0.020012233406305313,
0.02435137890279293,
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": "cls", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __call__(self, cls):
for name, args in self.kwargs.items():
def ev3_property(name, read_only=False, write_only=False, flush_on_write=False, property_type=Ev3StringType):
def fget(self):
if not write_only:
return property_type.post_read(... | |
18,392 | [
0.05776412412524223,
0.008890604600310326,
-0.054104261100292206,
-0.04094197601079941,
0.030579710379242897,
-0.02374502457678318,
0.006696890573948622,
-0.025111962109804153,
0.024715108796954155,
-0.011106365360319614,
0.03900180757045746,
-0.009039424359798431,
0.00321891694329679,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class Ev3Dev(object):
def __init__(self):
self.sys_path = ""
def read_value(self, name):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file) as f:
value = f.read().strip()
return value
else... | |
18,393 | [
0.06111697852611542,
0.07154533267021179,
-0.07141710817813873,
-0.0411577969789505,
0.04316653683781624,
-0.03453322872519493,
-0.025322943925857544,
-0.038144685328006744,
0.02750263921916485,
0.014574048109352589,
0.03993973135948181,
-0.007746470160782337,
0.0019953837618231773,
0.0192... | 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": "name", "annotation": null, "type_comment": null}}], "kwarg": null... | def read_value(self, name):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file) as f:
value = f.read().strip()
return value
else:
return None | |
18,394 | [
0.03960341960191727,
-0.003136259038001299,
-0.052504174411296844,
-0.040599435567855835,
-0.005780439358204603,
0.04747667536139488,
-0.03407791256904602,
-0.08200516551733017,
0.02035900391638279,
-0.0027182886842638254,
-0.009053057059645653,
-0.03384076803922653,
0.0032103671692311764,
... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "port", "annotation": n... | class LegoSensor(Ev3Dev):
def __init__(self, port=-1, name=None):
Ev3Dev.__init__(self)
sensor_existing = False
if (port > 0):
self.port = port
for p in glob.glob('/sys/class/lego-sensor/sensor*/uevent'):
with open(p) as f:
for val... | |
18,395 | [
0.07184682786464691,
0.03926461935043335,
-0.04015997424721718,
-0.042540308088064194,
0.03197074681520462,
-0.048829637467861176,
0.01085345633327961,
-0.04594702646136284,
0.020822476595640182,
0.01073880773037672,
0.0417323037981987,
0.02900078520178795,
-0.015472181141376495,
0.0070427... | 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 write_value(self, name, value, flush = False):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file, 'w') as f:
f.write(str(value))
if flush:
f.flush()
else:
return | |
18,396 | [
0.04497559741139412,
0.025607727468013763,
-0.04072114825248718,
-0.0079517662525177,
0.010788065381348133,
0.01607573591172695,
0.005642208736389875,
0.0028033775743097067,
-0.011922584846615791,
0.04145048186182976,
-0.009481341578066349,
-0.059440720826387405,
0.0672202855348587,
-0.046... | 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class Enum(object):
def __init__(self, *args, **kwargs):
for arg in args:
kwargs[arg] = arg
self.enum_dict = kwargs
def __getattr__(self, name):
if (name in self.enum_dict.keys()):
return self.enum_dict[name]
else:
raise NameError("no such it... | |
18,397 | [
0.05158381164073944,
-0.009110208600759506,
-0.030041707679629326,
-0.03570811077952385,
-0.005767153110355139,
0.02838086523115635,
-0.012419681996107101,
-0.061402320861816406,
0.007156276609748602,
0.017902903258800507,
0.00864615011960268,
-0.01594897173345089,
0.019966745749115944,
-0... | 15 | {"_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": "port", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, port=-1, name=None):
Ev3Dev.__init__(self)
sensor_existing = False
if (port > 0):
self.port = port
for p in glob.glob('/sys/class/lego-sensor/sensor*/uevent'):
with open(p) as f:
for value in f:
... | |
18,398 | [
0.032669853419065475,
0.010539653711020947,
-0.030531195923686028,
-0.03200613334774971,
-0.003675051499158144,
0.020157473161816597,
-0.01307777501642704,
-0.03367772698402405,
0.004516994580626488,
0.03168656304478645,
0.011227957904338837,
-0.031293246895074844,
0.01778528280556202,
0.0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "port", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, port='', _type=''):
Ev3Dev.__init__(self)
motor_existing = False
searchpath = '/sys/class/tacho-motor/motor*/'
if (port != ''):
self.port = port
for p in glob.glob(searchpath + 'uevent'):
with open(p) as f:
fo... | |
18,399 | [
0.02092832885682583,
0.008951890282332897,
-0.021812623366713524,
-0.05362163111567497,
-0.015686634927988052,
0.03188590332865715,
-0.03549998253583908,
-0.011143405921757221,
0.02983536384999752,
0.0185061264783144,
0.020313166081905365,
-0.04482993856072426,
0.006548913661390543,
0.0075... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "Enum", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields": {"arg": "COAS... | class Motor(Ev3Dev):
STOP_MODE = Enum(COAST='coast', BRAKE='brake', HOLD='hold')
POSITION_MODE = Enum(RELATIVE='relative', ABSOLUTE='absolute')
PORT = Enum('A', 'B', 'C', 'D')
def __init__(self, port='', _type=''):
Ev3Dev.__init__(self)
motor_existing = False
searchpath = '/sys/... | |
18,400 | [
0.04337991774082184,
0.023692455142736435,
-0.024569954723119736,
-0.06830987334251404,
-0.03568493202328682,
0.03633743152022362,
0.0020714025013148785,
0.005099053028970957,
0.0437399186193943,
0.017696216702461243,
-0.015097471885383129,
0.003524055937305093,
0.017358718439936638,
-0.01... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "time_sp", "annotation": null, "type_comment": null}}, {"_type": "... | def setup_time_limited(self, time_sp, speed_sp, **kwargs):
self.mode = 'run-timed'
for k in kwargs:
v = kwargs[k]
if (v != None):
setattr(self, k, v)
speed_regulation = self.speed_regulation
if (speed_regulation):
self.speed_sp = int(sp... |