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 |
|---|---|---|---|---|---|
501 | [
0.013575471937656403,
-0.018583206459879875,
0.01002733688801527,
0.007582802791148424,
0.055536020547151566,
-0.022689074277877808,
-0.033464010804891586,
-0.0016791339730843902,
0.03711894527077675,
-0.011659003794193268,
-0.008389736525714397,
-0.015070672146975994,
-0.02386387437582016,
... | 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_good_request_nondefault_port(self):
request = _create_request(_GOOD_REQUEST_NONDEFAULT_PORT)
handshaker = Handshaker(request,
mock.MockDispatcher())
handshaker.do_handshake()
self.assertEqual(_GOOD_RESPONSE_NONDEFAULT_PORT,
... | |
502 | [
0.02219400554895401,
-0.02956951968371868,
0.04317374899983406,
0.014942164532840252,
0.06228712573647499,
-0.02842271700501442,
-0.022385139018297195,
0.016504963859915733,
0.02869255281984806,
-0.012671045027673244,
-0.002564846770837903,
-0.008685343898832798,
-0.012491154484450817,
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 test_good_request_secure_default_port(self):
request = _create_request(_GOOD_REQUEST)
request.connection.local_addr = ('0.0.0.0', 443)
request.is_https_ = True
handshaker = Handshaker(request, mock.MockDispatcher())
handshaker.do_handshake()
self.assertEqual(_GOOD_RES... | |
503 | [
0.024881036952137947,
-0.022607093676924706,
0.002982295351102948,
0.0009211578289978206,
0.028490470722317696,
-0.0269745085388422,
-0.023040225729346275,
0.02162051387131214,
0.05409339442849159,
-0.020513620227575302,
0.01080424152314663,
-0.0333993025124073,
-0.05409339442849159,
-0.00... | 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_good_request_optional_headers(self):
request = _create_request(_GOOD_REQUEST_WITH_OPTIONAL_HEADERS)
handshaker = Handshaker(request, mock.MockDispatcher())
handshaker.do_handshake()
self.assertEqual('AValue',
request.headers_in['AKey'])
self.asse... | |
504 | [
0.023198237642645836,
-0.024493571370840073,
0.02054869383573532,
0.011334164999425411,
0.07032480835914612,
-0.01848793588578701,
-0.034455861896276474,
0.017793165519833565,
0.0369994230568409,
-0.009673782624304295,
0.00031684141140431166,
-0.01964196003973484,
-0.01423688791692257,
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 test_good_request_secure_non_default_port(self):
request = _create_request(_GOOD_REQUEST_NONDEFAULT_PORT)
request.is_https_ = True
handshaker = Handshaker(request, mock.MockDispatcher())
handshaker.do_handshake()
self.assertEqual(_GOOD_RESPONSE_SECURE_NONDEF,
... | |
505 | [
0.018309257924556732,
-0.01358739659190178,
0.04129219427704811,
0.007432113401591778,
0.004285209812223911,
0.01962222531437874,
0.00005542841972783208,
0.006944268010556698,
0.061721473932266235,
0.009744862094521523,
0.02095928229391575,
-0.019248811528086662,
-0.018586305901408195,
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_validate_subprotocol(self):
# should succeed.
_validate_subprotocol('sample')
_validate_subprotocol('Sample')
_validate_subprotocol('sample\x7eprotocol')
_validate_subprotocol('sample\x20protocol')
# should fail.
self.assertRaises(HandshakeException,
... | |
506 | [
0.01166359893977642,
-0.003504955442622304,
0.047335997223854065,
-0.0027102443855255842,
-0.007321332115679979,
0.005582075100392103,
0.006580972578376532,
0.0152772581204772,
0.08103998005390167,
0.021317651495337486,
0.013855298049747944,
-0.014760181307792664,
-0.009818576276302338,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class HyBi00ValidateSubprotocolTest(unittest.TestCase):
def test_validate_subprotocol(self):
# should succeed.
_validate_subprotocol('sample')
_validate_subprotocol('Sample')
_validate_subprotocol('sample\x7eprotocol')
_validate_subprotocol('sample\x20protocol')
# sh... | |
507 | [
0.021366680040955544,
0.016641804948449135,
-0.01056696381419897,
-0.028116503730416298,
-0.03232932463288307,
0.0220649391412735,
-0.0016001735348254442,
-0.013115604408085346,
0.032678451389074326,
0.07010506093502045,
0.0012692285235971212,
-0.07746003568172455,
0.07219982892274857,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_specs = dict(
state=dict(default='present',
choices=['absent', 'present']),
created_by=dict(type='str',),
description=dict(type='str',),
name=dict(type='str',),
rule=dict(type='list',),
tenant_ref=dict(type='str',),
url=... | |
508 | [
0.0034663784317672253,
0.053431831300258636,
0.0806552991271019,
-0.021790312603116035,
-0.007007736712694168,
-0.002457033609971404,
-0.02916141413152218,
-0.026646703481674194,
-0.04747958108782768,
0.00535529525950551,
-0.02936905063688755,
-0.02095976658165455,
0.004922718740999699,
-0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('assets', '0054_auto_20200807_1032'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('applications', '0005_k8sapp'),
('users', '0028_auto_20200728_1805'),
('perms', '0011_auto_20200721_1739'),
]
o... | |
509 | [
-0.039283137768507004,
-0.04120364785194397,
0.017371876165270805,
-0.06298395991325378,
0.008511346764862537,
0.04004697501659393,
-0.015538663603365421,
-0.02182396501302719,
0.025970518589019775,
0.020885534584522247,
0.0339362658560276,
-0.04452088847756386,
0.019619744271039963,
0.023... | 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": "ast1", "annotation": n... | class ASTTestCase(unittest.TestCase):
def assertASTEqual(self, ast1, ast2):
self.assertEqual(ast.dump(ast1), ast.dump(ast2))
def check_roundtrip(self, code1, filename="internal"):
ast1 = compile(code1, filename, "exec", ast.PyCF_ONLY_AST)
unparse_buffer = io.StringIO()
unparse.U... | |
510 | [
0.01701887510716915,
0.025604868307709694,
0.04456707462668419,
-0.08555371314287186,
-0.027183089405298233,
-0.08263282477855682,
0.028078200295567513,
-0.01287310104817152,
0.03335464000701904,
0.031211087480187416,
-0.009928658604621887,
0.003992663696408272,
-0.004878940526396036,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "runner", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def list_files_scenario(runner):
runner.utils.create_release_file(
project=runner.default_project,
release=runner.default_release,
path='/demo/message-for-you.txt',
contents='Hello World!'
)
runner.request(
method='GET',
path='/projects/%s/%s/releases/%s/files... | |
511 | [
0.008703342638909817,
-0.015040483325719833,
0.009829805232584476,
-0.038740258663892746,
-0.00006686407141387463,
0.02343546412885189,
-0.059104692190885544,
0.003404561197385192,
0.07068397849798203,
0.07375500351190567,
0.03546785190701485,
-0.040376462042331696,
0.0009416035027243197,
... | 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_function_arguments(self):
self.check_roundtrip("def f(): pass")
self.check_roundtrip("def f(a): pass")
self.check_roundtrip("def f(b = 2): pass")
self.check_roundtrip("def f(a, b): pass")
self.check_roundtrip("def f(a, b = 2): pass")
self.check_roundtrip("def f(a... | |
512 | [
-0.011473032645881176,
-0.02031669393181801,
0.02076561190187931,
-0.05115086957812309,
-0.007240387611091137,
0.015327304601669312,
-0.04276253655552864,
-0.016135355457663536,
0.037349883466959,
0.021227354183793068,
0.022869108244776726,
-0.046251263469457626,
-0.016840795055031776,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class UnparseTestCase(ASTTestCase):
# Tests for specific bugs found in earlier versions of unparse
def test_del_statement(self):
self.check_roundtrip("del x, y, z")
def test_shifts(self):
self.check_roundtrip("45 << 2")
self.check_roundtrip("13 >> 7")
def test_for_else(self):
... | |
513 | [
0.011563785374164581,
-0.013261315412819386,
0.03543209657073021,
-0.061481475830078125,
-0.011820986866950989,
-0.043209873139858246,
-0.010967077687382698,
0.02131687104701996,
0.01706789992749691,
0.049917690455913544,
0.03606995567679405,
-0.007875514216721058,
0.03109053336083889,
-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_files(self):
# get names of files to test
dist_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
names = []
for d in self.test_directories:
test_dir = os.path.join(dist_dir, d)
for n in os.listdir(test_dir):
if n.endswit... | |
514 | [
0.006054255645722151,
0.024993063881993294,
0.0018730532610788941,
-0.01954936794936657,
0.0009222611552104354,
-0.03982912749052048,
0.002774629509076476,
-0.023714879527688026,
-0.002483614254742861,
-0.026978813111782074,
-0.029375409707427025,
-0.023486632853746414,
0.00137162278406322,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "NoMaliGpu"}}, "targets": [{"_type": "Name", "_fields": {"id": "type", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}... | class NoMaliGpu(PioDevice):
type = 'NoMaliGpu'
cxx_header = "dev/arm/gpu_nomali.hh"
pio_addr = Param.Addr("Device base address")
platform = Param.RealView(Parent.any, "Platform this device is part of.")
gpu_type = Param.NoMaliGpuType("T760", "GPU type")
ver_maj = Param.UInt32(0, "GPU Version ... | |
515 | [
0.017878128215670586,
0.021317608654499054,
-0.01851108856499195,
-0.057754598557949066,
-0.018594687804579735,
0.02166394516825676,
-0.045668646693229675,
0.04886927455663681,
0.032579515129327774,
-0.018988793715834618,
0.026727624237537384,
-0.016445012763142586,
-0.0009300329256802797,
... | 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_gets_instance(self):
obj = models.SearchTest(
title="Hello",
live=True,
)
obj.save()
# Should just return the object
indexed_instance = signal_handlers.get_indexed_instance(obj)
self.assertEqual(indexed_instance, obj) | |
516 | [
0.001740400679409504,
-0.011409127153456211,
-0.011319338344037533,
-0.05468719080090523,
-0.02000487968325615,
0.028301339596509933,
-0.04702523723244667,
0.002919623162597418,
0.020986568182706833,
-0.01716756261885166,
0.03443090245127678,
-0.020902765914797783,
0.009990468621253967,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestGetIndexedInstance(TestCase):
def test_gets_instance(self):
obj = models.SearchTest(
title="Hello",
live=True,
)
obj.save()
# Should just return the object
indexed_instance = signal_handlers.get_indexed_instance(obj)
self.assertEqual... | |
517 | [
0.019755199551582336,
0.03451062738895416,
-0.005249761510640383,
-0.055460892617702484,
-0.032925333827733994,
0.022316059097647667,
-0.05243664234876633,
0.020157620310783386,
0.016145607456564903,
-0.02255995012819767,
0.028047505766153336,
-0.008292306214571,
0.009962962009012699,
0.01... | 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_gets_specific_class(self):
obj = models.SearchTestChild(
title="Hello",
live=True,
)
obj.save()
# Running the command with the parent class should find the specific class again
indexed_instance = signal_handlers.get_indexed_instance(obj.searchtes... | |
518 | [
0.04720893129706383,
0.03352250158786774,
-0.01231085043400526,
-0.040874335914850235,
-0.025870123878121376,
0.021905221045017242,
-0.03255150467157364,
-0.0008373400778509676,
0.028459448367357254,
-0.015108245424926281,
0.020055703818798065,
-0.02265658788383007,
0.016807489097118378,
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_blocks_not_in_indexed_objects(self):
obj = models.SearchTestChild(
title="Don't index me!",
live=True,
)
obj.save()
# We've told it not to index anything with the title "Don't index me"
# get_indexed_instance should return None
indexed_in... | |
519 | [
-0.015342614613473415,
0.028411343693733215,
-0.05652928352355957,
-0.006980584003031254,
-0.022445451468229294,
-0.0063876621425151825,
0.03327697142958641,
-0.004287985619157553,
-0.023716870695352554,
0.04574666544795036,
0.010464763268828392,
0.01487805787473917,
0.002379327779635787,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}], "kwarg": nu... | def wait_for_brick_nn(robot,frame):
img = frame
kernel = np.ones((5,5),np.float32)/25
img = cv2.filter2D(img,-1,kernel)
res = robot.object_detector.detect_with_threshold(img,threshold=0.95, return_closest=True)
if res:
img_res = np.asarray([640,480])
box, score = res
cv2.rect... | |
520 | [
0.016280148178339005,
0.04082690179347992,
-0.032729003578424454,
-0.02320915274322033,
-0.008561840280890465,
-0.030969638377428055,
0.013375991955399513,
0.034440167248249054,
0.006573516875505447,
0.04812946915626526,
0.02046165242791176,
-0.01750929467380047,
0.02523362822830677,
-0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def search_v3(robot, frame, vel_rot):
res = robot.object_detector.detect_with_threshold(frame,threshold=0.9, return_closest=True)
if len(res) == 0:
return "SEARCH", frame, {}
else:
boxes = map(lambda x: x[0], res)
#find the purple box
box = None
if box:
... | |
521 | [
0.015554501675069332,
0.023087911307811737,
-0.0206366665661335,
-0.026386184617877007,
-0.04417375847697258,
-0.008887370117008686,
0.017184387892484665,
-0.022792736068367958,
-0.02199704386293888,
0.01763356849551201,
0.006846804171800613,
0.016273191198706627,
0.03326507285237312,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def move_to_brick_v3_pid(robot, frame, img_res=np.asarray((640, 480)), atol=5,
vel_forward = 299, vel_rot = 50, atol_move_blind=90,
fail_counter=0, center_position_error = 10, tracker=None, m=None, trajectory=None):
ok, bbox = tracker.update(frame)
vel = np.a... | |
522 | [
0.013515369966626167,
0.01950671896338463,
-0.02852541022002697,
-0.024206064641475677,
-0.03673343360424042,
-0.019430719316005707,
0.0023417563643306494,
-0.03090674988925457,
-0.019304051995277405,
0.026524070650339127,
0.0002948966284748167,
0.008740023709833622,
0.02728407271206379,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def move_to_brick_v3(robot, frame, img_res=np.asarray((640, 480)), atol=5,
vel_forward = 299, vel_rot = 50, atol_move_blind=90,
fail_counter=0, center_position_error = 10, tracker=None, m=None, trajectory=None):
ok, bbox = tracker.update(frame)
if not ok:
... | |
523 | [
-0.009917841292917728,
0.008598466403782368,
-0.046339038759469986,
-0.02156052552163601,
-0.023954709991812706,
-0.021689245477318764,
0.00900393258780241,
-0.012601644732058048,
-0.019784195348620415,
0.05442262813448906,
0.009821302257478237,
-0.003478646045550704,
0.02862722985446453,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def move_to_brick_nn_v2(robot, frame, img_res=(640, 480), atol=5,
vel_forward = 299, vel_rot = 50, atol_move_blind=90,
fail_counter=0, center_position_error = 10, tracking=False):
img_res = np.array(img_res)
ts = time.time()
res = robot.object_detector... | |
524 | [
0.0026919671799987555,
0.012055598199367523,
-0.015097091905772686,
-0.009872590191662312,
-0.018212169408798218,
-0.0014486953150480986,
0.02344893477857113,
-0.029630035161972046,
-0.01703481748700142,
0.05371670424938202,
0.034977179020643234,
-0.018935751169919968,
0.010050419718027115,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def euclidian_move_to_brick(robot, frame,
path=[], iteration=0, ltrack_pos=0, rtrack_pos=0, TIME=0):
img_res = np.asarray((640,480))
lego_coords, center = get_purple_lego(frame)
if lego_coords and np.isclose(lego_coords[1], img_res[1], atol=200):
return "MOVE_TO_BRICK",... | |
525 | [
0.003405485302209854,
0.03218069300055504,
-0.01010217797011137,
-0.022958455607295036,
-0.02298131212592125,
-0.00526821706444025,
-0.0016541745280846953,
-0.01145637221634388,
-0.01828448474407196,
0.05800752714276314,
-0.00983933825045824,
-0.036271847784519196,
0.030512234196066856,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def rotation_search_brick_nn(robot, frame, vel=60):
res = robot.object_detector.detect_with_threshold(frame,threshold=0.9, return_closest=True)
detected = len(res) > 0
if detected:
lego_coords, score = res[0]
else:
lego_coords = None
if lego_coords is not None:
return "MOVE_... | |
526 | [
0.012338852509856224,
0.03421600162982941,
-0.023353593423962593,
-0.008618447929620743,
-0.0320599265396595,
-0.011126059107482433,
-0.007640011142939329,
-0.015338611789047718,
-0.01820947416126728,
0.04902731254696846,
-0.007610716857016087,
-0.04565258324146271,
0.03972337022423744,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def rotation_search_brick(robot, frame, vel=60):
res = robot.object_detector.detect_with_threshold(img,threshold=0.7, return_closest=True)
if len(res) > 0:
box, score = res[0]
box = np.asarray((int(box[1]*img_res[0]), int(box[0]*img_res[1]), int(box[3]*img_res[0]), int(box[2]*img_res[1])))
... | |
527 | [
0.011759089305996895,
0.01132772583514452,
0.0009373293723911047,
0.008408634923398495,
-0.03167272359132767,
-0.01110318023711443,
0.017549997195601463,
-0.005486589856445789,
-0.009673180058598518,
0.021674541756510735,
-0.0001650852063903585,
-0.035029083490371704,
0.008148634806275368,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "coords", "annotation": null, "type_comment": null}}, {"_type": "... | def control_PID(robot, coords, img_res=(640, 480),K1=0 ,K2 = 0):
# Compute the relative position from the image
relObjPos = pixel_normalized_pos(coords,img_res)
# Move to circular params
relObjCir[0] = np.sqrt(np.pow(relObjPos(1),2) + np.pow(relObjPos(2),2));
relObjCir[1] = np.atan(relObjPos(1)/r... | |
528 | [
-0.006387525238096714,
0.014822260476648808,
-0.006358932703733444,
0.008549104444682598,
-0.005463993176817894,
-0.030216367915272713,
0.0037227205466479063,
-0.0054411194287240505,
-0.008966553024947643,
0.030605223029851913,
0.003685550531372428,
-0.0013252542121335864,
0.0416532978415489... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def rotation_search_box(robot, frame, vel=400):
box_coords = get_white_box(frame)
if box_coords:
return "MOVE_TO_BOX", frame, {}
else:
robot.rotate(vel)
return "SEARCH_BOX", frame, {} | |
529 | [
0.01146338228136301,
0.014525518752634525,
-0.029260415583848953,
-0.010815623216331005,
-0.015886468812823296,
0.021749019622802734,
-0.005659718066453934,
-0.019380444660782814,
0.033762019127607346,
0.021343352273106575,
0.02198456972837448,
0.008577907457947731,
0.027428368106484413,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def move_to_brick_blind_and_grip(robot, frame, vel=400, t=1700):
# Make sure the grip is open
robot.grip.open()
print("Velocity: ", vel)
# Make sure the elevator is down
print(robot.elevator.is_raised)
print(robot.elevator.position)
robot.elevator.down()
robot.elevator.wait_until_not_mov... | |
530 | [
-0.007424116600304842,
0.011679324321448803,
-0.048028573393821716,
-0.021893110126256943,
-0.029259376227855682,
0.005328651517629623,
-0.003798833815380931,
-0.026559697464108467,
0.020504703745245934,
0.008844662457704544,
-0.003949887119233608,
-0.0018560291500762105,
0.03442733362317085... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "robot", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "a... | def move_to_brick_blind_no_sensor(robot, frame, vel=60, time=500):
robot.elevator.down()
time.sleep(2.5)
robot.move_straight(vel, time)
time.sleep(0.5)
robot.pick_up()
time.sleep(2.5)
return "SEARCH_BOX", frame, {} | |
531 | [
0.005453947000205517,
0.0026637152768671513,
0.0519266352057457,
-0.0905635729432106,
0.051838621497154236,
0.019615506753325462,
0.004073270596563816,
-0.015853025019168854,
0.024049071595072746,
0.02635936811566353,
-0.017283208668231964,
-0.02086966671049595,
0.03190407529473305,
0.0008... | 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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ServiceLauncherTest(unittest.TestCase):
def testReadFile(self):
launcher = ServiceLauncher()
config = launcher.readConfigurationFromFile("tests/agentsConfig.json", None)
print (serializeObject(config, JSON_STANDARD_FORMAT))
def testLaunchServices(self):
... | |
532 | [
0.044702693819999695,
0.009869356639683247,
0.004956006072461605,
0.01843772828578949,
0.021188991144299507,
-0.030519826337695122,
0.03263125941157341,
-0.015675801783800125,
-0.014076230116188526,
0.016614217311143875,
0.0375579409301281,
-0.04389224573969841,
-0.00793920736759901,
0.016... | 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": "jvalue", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, jvalue, bigdl_type, *args):
if (jvalue):
assert(type(jvalue) == JavaObject)
self.value = jvalue
else:
self.value = callBigDlFunc(
bigdl_type, JavaValue.jvm_class_constructor(self), *args)
self.bigdl_type = bigdl_type | |
533 | [
-0.03893890231847763,
-0.03745570406317711,
-0.024067366495728493,
-0.05141754448413849,
0.023474086076021194,
-0.058457791805267334,
-0.04773921146988869,
-0.0019738897681236267,
0.009996756911277771,
-0.005542217753827572,
-0.020329706370830536,
0.013447665609419346,
0.035517655313014984,
... | 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}}], "kwarg": null, "... | def _to_jtensors(self, x):
x = to_list(x)
if isinstance(x[0], np.ndarray):
return [JTensor.from_ndarray(i) for i in x]
elif isinstance(x[0], JTensor):
return x
else:
raise Exception("Not supported type: %s" % type(x[0])) | |
534 | [
0.020929433405399323,
0.0066787428222596645,
0.008125126361846924,
-0.005333859007805586,
-0.0014514592476189137,
0.005541935563087463,
0.06386420875787735,
-0.03938225284218788,
-0.035687629133462906,
0.08314932882785797,
-0.031241899356245995,
0.03997095674276352,
-0.023162446916103363,
... | 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": "input_size", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, input_size, output_size, with_bias=True, wRegularizer=None, bRegularizer=None,
init_weight=None, init_bias=None, init_grad_weight=None, init_grad_bias=None, bigdl_type="float"):
super(Linear, self).__init__(None, bigdl_type, input_size, output_size,
... | |
535 | [
0.006484591402113438,
-0.021663956344127655,
-0.005118865519762039,
0.01376151293516159,
-0.013553004711866379,
0.007052775472402573,
0.03202679380774498,
-0.026021769270300865,
-0.03832372650504112,
0.055921781808137894,
-0.009195192717015743,
0.008929344825446606,
0.04457896202802658,
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": "input_frame_size", "annotation": null, "type_comment": null}}, {"... | def __init__(self,
input_frame_size,
output_frame_size,
kernel_w,
stride_w=1,
propagate_back=True,
weight_regularizer=None,
bias_regularizer=None,
init_weight=None,
in... | |
536 | [
0.0239363145083189,
-0.014153382740914822,
0.0002646171778906137,
-0.012190726585686207,
-0.0017603207379579544,
0.021467819809913635,
0.05904155969619751,
-0.044594790786504745,
-0.020365089178085327,
0.0800035372376442,
-0.025797802954912186,
0.024280285462737083,
-0.018776753917336464,
... | 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": "input_size", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, input_size, output_size, with_bias=True, backwardStart=-1, backwardLength=-1,
wRegularizer=None, bRegularizer=None, init_weight=None, init_bias=None,
init_grad_weight=None, init_grad_bias=None, bigdl_type="float"):
super(SparseLinear, self).__init__(None, big... | |
537 | [
0.03225017711520195,
-0.027046622708439827,
-0.02583971433341503,
-0.017608992755413055,
-0.0006108738016337156,
0.004629780072718859,
0.041945017874240875,
0.021605640649795532,
-0.018964292481541634,
0.030133143067359924,
-0.05991014838218689,
0.03872000053524971,
0.002638875739648938,
-... | 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": "input_size", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, input_size, hidden_size, p=0.0, activation=None, inner_activation=None,
wRegularizer=None, uRegularizer=None, bRegularizer=None, bigdl_type="float"):
if not activation:
activation = Tanh()
if not inner_activation:
inner_activation = Sigmoid()
... | |
538 | [
0.015939196571707726,
-0.015075022354722023,
0.03258253261446953,
0.024282202124595642,
-0.011436959728598595,
0.007185440510511398,
0.04497968405485153,
-0.030384758487343788,
-0.016568655148148537,
0.05906250700354576,
-0.02613857388496399,
0.03072616085410118,
0.01251450926065445,
0.045... | 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": "n_input_plane", "annotation": null, "type_comment": null}}, {"_ty... | def __init__(self,
n_input_plane,
n_output_plane,
kernel_w,
kernel_h,
stride_w=1,
stride_h=1,
pad_w=0,
pad_h=0,
n_group=1,
propagate_back=True,
... | |
539 | [
0.0219937264919281,
0.008620603010058403,
0.026469193398952484,
0.0036762768868356943,
-0.006803776137530804,
-0.004499443341046572,
0.0683680921792984,
0.020128948614001274,
-0.023080624639987946,
0.03618735074996948,
-0.024231459945440292,
0.038702137768268585,
0.006873039528727531,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "input_size", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, input_size, hidden_size, p=0.0, activation=None, inner_activation=None,
wRegularizer=None, uRegularizer=None, bRegularizer=None, bigdl_type="float"):
if not activation:
activation = Tanh()
if not inner_activation:
inner_activation = Sigmoid()
... | |
540 | [
0.0200821440666914,
0.009203464724123478,
0.015189291909337044,
0.013401716016232967,
0.004775382578372955,
-0.020981039851903915,
0.06271839141845703,
-0.010153434239327908,
-0.006573173683136702,
0.02396373823285103,
-0.06292268633842468,
0.04429103434085846,
0.011460918001830578,
-0.007... | 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": "input_size", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self,
input_size,
hidden_size,
activation,
isInputWithBias=True,
isHiddenWithBias=True,
wRegularizer=None,
uRegularizer=None,
bRegularizer=None,
bigdl_typ... | |
541 | [
0.03259963169693947,
-0.017543213441967964,
-0.042569421231746674,
-0.016571102663874626,
-0.004227552562952042,
-0.005038587376475334,
0.06565140932798386,
-0.011450564488768578,
-0.04085127264261246,
0.03547075018286705,
-0.018944861367344856,
0.017384963110089302,
-0.029751120135188103,
... | 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": "n_output", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self,
n_output,
eps=1e-5,
momentum=0.1,
affine=True,
init_weight=None,
init_bias=None,
init_grad_weight=None,
init_grad_bias=None,
bigdl_type="float"):
... | |
542 | [
0.018045425415039062,
-0.0070427898317575455,
0.0011857476783916354,
-0.008322294801473618,
-0.011835416778922081,
-0.005774315446615219,
0.06821082532405853,
-0.03518637269735336,
-0.047738753259181976,
0.033465661108493805,
-0.01786894164979458,
0.030708108097314835,
-0.02726668305695057,
... | 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": "n_output", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self,
n_output,
eps=1e-5,
momentum=0.1,
affine=True,
init_weight=None,
init_bias=None,
init_grad_weight=None,
init_grad_bias=None,
bigdl_type="float"):
... | |
543 | [
0.027876954525709152,
-0.01418151892721653,
0.008251287043094635,
0.0009600171470083296,
0.009989039041101933,
-0.01143514085561037,
0.037574343383312225,
0.003597026225179434,
-0.0373799093067646,
0.08491898328065872,
-0.04095263034105301,
0.004599575884640217,
-0.025422226637601852,
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}}, {"_type": "arg", "_fields": {"arg": "lower", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self,
lower=1.0/8,
upper=1.0/3,
inplace=False,
bigdl_type="float"):
super(RReLU, self).__init__(None, bigdl_type,
lower,
upper,
... | |
544 | [
0.019940074533224106,
-0.033102016896009445,
0.03738630935549736,
0.025023674592375755,
-0.0025044989306479692,
-0.008925608359277248,
0.05597288906574249,
-0.021101735532283783,
-0.020131908357143402,
0.05499240383505821,
-0.007929136976599693,
0.023531632497906685,
0.03397592902183533,
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": "n_input_plane", "annotation": null, "type_comment": null}}, {"_ty... | def __init__(self,
n_input_plane,
n_output_plane,
kernel_w,
kernel_h,
stride_w=1,
stride_h=1,
pad_w=0,
pad_h=0,
n_group=1,
propagate_back=True,
... | |
545 | [
0.00238066166639328,
-0.027854016050696373,
0.05873946100473404,
0.03541062772274017,
-0.015958944335579872,
0.00497824652120471,
0.04573506489396095,
-0.0362234003841877,
-0.024031776934862137,
0.04393377900123596,
-0.020791660994291306,
0.03358737379312515,
0.022757697850465775,
0.040199... | 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": "conn_table", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self,
conn_table,
kw,
kh,
dw=1,
dh=1,
pad_w=0,
pad_h=0,
wRegularizer=None,
bRegularizer=None,
bigdl_type="float"):
super(SpatialC... | |
546 | [
0.006840365007519722,
0.011270874179899693,
0.01531218085438013,
-0.0033268805127590895,
0.024674363434314728,
-0.006003313232213259,
0.06325338035821915,
-0.007410839665681124,
-0.0319252572953701,
0.04828241840004921,
-0.03631844371557236,
0.01940680295228958,
-0.012465138919651508,
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": "n_input_plane", "annotation": null, "type_comment": null}}, {"_ty... | def __init__(self,
n_input_plane=1,
kernel=None,
threshold=1e-4,
thresval=1e-4,
bigdl_type="float"):
super(SpatialContrastiveNormalization, self).__init__(None, bigdl_type,
... | |
547 | [
0.061702828854322433,
-0.03659845143556595,
-0.009906893596053123,
0.016680926084518433,
-0.006426513660699129,
0.010799032635986805,
0.04278118163347244,
0.007552061229944229,
0.0017700144089758396,
0.010083246976137161,
-0.017137369140982628,
0.033195871859788895,
0.035083889961242676,
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": "input_size", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, input_size, output_size, kernel_i, kernel_c, stride=1, padding=-1,
activation=None, inner_activation=None,
wRegularizer=None, uRegularizer=None, bRegularizer=None, cRegularizer=None,
with_peephole=True, bigdl_type="float"):
if not activation:... | |
548 | [
0.03594839572906494,
0.03126230463385582,
0.037358563393354416,
-0.014774205163121223,
0.027357228100299835,
0.0014155900571495295,
0.05775173753499985,
-0.004401346202939749,
-0.022117916494607925,
0.05835919454693794,
-0.02957010455429554,
-0.0028067734092473984,
-0.009675910696387291,
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": "n_input_plane", "annotation": null, "type_comment": null}}, {"_ty... | def __init__(self,
n_input_plane=1,
kernel=None,
threshold=1e-4,
thresval=1e-4,
bigdl_type="float"):
super(SpatialDivisiveNormalization, self).__init__(None, bigdl_type,
... | |
549 | [
0.007472801487892866,
0.0041478038765490055,
0.00326666422188282,
-0.031045591458678246,
0.016185952350497246,
0.002603506902232766,
-0.06498942524194717,
0.028098223730921745,
0.005157890729606152,
0.022731561213731766,
0.020361388102173805,
-0.03861049562692642,
0.02733682096004486,
0.03... | 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": "sck_path", "annotation... | class SuricataSC:
def __init__(self, sck_path, verbose=False):
self.basic_commands = [
"shutdown",
"quit",
"pcap-file-number",
"pcap-file-list",
"pcap-last-processed",
"pcap-interrupt",
"iface-lis... | |
550 | [
0.047670088708400726,
0.006982835475355387,
-0.021381769329309464,
0.025275500491261482,
-0.045396871864795685,
-0.03614644333720207,
-0.009526140987873077,
0.0448341928422451,
0.02428518794476986,
0.06378519535064697,
0.006026282906532288,
-0.020087609067559242,
-0.009154773317277431,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "words", "annotation": ... | class SuricataCompleter:
def __init__(self, words):
self.words = words
self.generator = None
def complete(self, text):
for word in self.words:
if word.startswith(text):
yield word
def __call__(self, text, state):
if state == 0:
self.g... | |
551 | [
0.026188194751739502,
-0.01338600367307663,
-0.009304523468017578,
-0.014126195572316647,
0.0015351161127910018,
-0.005759943276643753,
-0.06805594265460968,
0.023748688399791718,
0.004276953171938658,
0.02316487580537796,
-0.02977447584271431,
-0.0014295605942606926,
0.04099202901124954,
... | 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": "command", "annotation": null, "type_comment": null}}, {"_type": "... | def send_command(self, command, arguments=None):
if command not in self.cmd_list and command != 'command-list':
raise SuricataCommandException("Command not found: {}".format(command))
cmdmsg = {}
cmdmsg['command'] = command
if arguments:
cmdmsg['arguments'] = arg... | |
552 | [
0.0471726655960083,
-0.004198994021862745,
-0.03972068428993225,
-0.01167709194123745,
0.028066808357834816,
0.0280435923486948,
0.004613960161805153,
0.03342944756150246,
0.00547000952064991,
-0.01322088297456503,
0.042506471276283264,
-0.012431575916707516,
-0.0030962866730988026,
0.0164... | 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 json_recv(self):
cmdret = None
data = ""
while True:
if sys.version < '3':
received = self.socket.recv(INC_SIZE)
else:
received = self.socket.recv(INC_SIZE).decode('iso-8859-1')
if not received:
break
... | |
553 | [
0.00008553035877412185,
-0.03634258732199669,
-0.0017653682734817266,
-0.009623498655855656,
0.03835519403219223,
0.00773234199732542,
-0.02239314094185829,
0.032456174492836,
0.008542011491954327,
0.008489961735904217,
0.00027723945095203817,
-0.006020469591021538,
0.01927012950181961,
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 connect(self):
try:
if self.socket is None:
self.socket = socket(AF_UNIX)
self.socket.connect(self.sck_path)
except error as err:
raise SuricataNetException(err)
self.socket.settimeout(10)
#send version
if self.verbose:
... | |
554 | [
0.023206178098917007,
0.01264715101569891,
-0.0033286225516349077,
-0.0357779823243618,
-0.005475947633385658,
-0.003215605393052101,
-0.058510564267635345,
0.043032605201005936,
0.021118052303791046,
0.08076955378055573,
0.015370325185358524,
-0.0409875325858593,
0.054377369582653046,
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": "command", "annotation": null, "type_comment": null}}], "kwarg": n... | def execute(self, command):
full_cmd = command.split()
cmd = full_cmd[0]
cmd_specs = argsd[cmd]
required_args_count = len([d["required"] for d in cmd_specs if d["required"] and not "val" in d])
arguments = dict()
for c, spec in enumerate(cmd_specs, 1):
spec_ty... | |
555 | [
0.023790406063199043,
0.01575886271893978,
-0.011365851387381554,
-0.02034657634794712,
-0.01045926008373499,
0.009577007032930851,
-0.048091910779476166,
0.04524436220526695,
0.006130136549472809,
0.06050429493188858,
0.009437063708901405,
-0.025165503844618797,
0.039013832807540894,
0.01... | 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 interactive(self):
print("Command list: " + ", ".join(self.cmd_list))
try:
readline.set_completer(SuricataCompleter(self.cmd_list))
readline.set_completer_delims(";")
readline.parse_and_bind('tab: complete')
while True:
if sys.version <... | |
556 | [
0.0026681541930884123,
0.011730176396667957,
-0.026972612366080284,
-0.030213207006454468,
0.02349916100502014,
-0.00015811844787094742,
-0.0853809341788292,
0.025342613458633423,
0.05095689371228218,
0.03366725519299507,
-0.022839399054646492,
-0.008732140995562077,
0.041836656630039215,
... | 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": "command", "annotation": null, "type_comment": null}}], "kwarg": n... | def parse_command(self, command):
arguments = None
cmd = command.split()[0] if command else None
if cmd in self.cmd_list:
if cmd in self.fn_commands:
cmd, arguments = getattr(self, "execute")(command=command)
else:
raise SuricataCommandException("U... | |
557 | [
0.025664255023002625,
0.01768914796411991,
0.03756095468997955,
-0.04000745341181755,
-0.01535058207809925,
0.021874578669667244,
-0.011021237820386887,
-0.01915225014090538,
0.042645834386348724,
0.03062920831143856,
0.0028107755351811647,
-0.003936584573239088,
-0.03789674863219261,
-0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "SubWorkflow", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "CORRELATE", "ctx": {"_type": "Store", "_fields": {}}... | class TaskSpecTest(unittest.TestCase):
CORRELATE = SubWorkflow
def testConstructor(self):
pass #FIXME
def testSerialize(self):
pass #FIXME
def testTest(self):
pass #FIXME
def load_workflow_spec(self, folder, f):
file = os.path.join(os.path.dirname(__file__), '..',... | |
558 | [
0.03936022147536278,
0.015524682588875294,
0.03078341856598854,
0.0013989944709464908,
-0.03215748071670532,
-0.030273685231804848,
0.0035930608864873648,
-0.011601957492530346,
0.042529430240392685,
0.003856237977743149,
0.015635494142770767,
0.012931695207953453,
-0.05522841960191727,
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_block_to_subworkflow(self):
self.load_workflow_spec('data', 'block_to_subworkflow.xml')
self.do_next_unique_task('Start')
self.do_next_unique_task('first')
self.do_next_unique_task('sub_workflow_1')
#Inner:
self.do_next_unique_task('Start')
self.do_next_u... | |
559 | [
0.034526292234659195,
0.03596488758921623,
0.05777585133910179,
-0.034595903009176254,
-0.030720975250005722,
-0.024943390861153603,
-0.00509309209883213,
0.008724385872483253,
0.023203153163194656,
0.015580917708575726,
0.002701717196032405,
0.0074540129862725735,
-0.027379721403121948,
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_subworkflow_to_join(self):
self.load_workflow_spec('control-flow', 'subworkflow_to_join.xml')
self.do_next_unique_task('Start')
self.do_next_unique_task('first')
self.do_next_named_step('second', ['sub_workflow_1'])
self.do_next_unique_task('sub_workflow_1')
#Inn... | |
560 | [
0.04429683834314346,
0.014125095680356026,
0.029351431876420975,
0.002753101522102952,
-0.02258666791021824,
-0.036992691457271576,
-0.0035986967850476503,
-0.02132810838520527,
0.04452158138155937,
0.00317168515175581,
0.023530589416623116,
0.017945725470781326,
-0.05043232440948486,
-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_subworkflow_to_block(self):
self.load_workflow_spec('data', 'subworkflow_to_block.xml')
self.do_next_unique_task('Start')
self.do_next_unique_task('first')
self.do_next_unique_task('sub_workflow_1')
#Inner:
self.do_next_unique_task('Start')
self.do_next_u... | |
561 | [
0.022067587822675705,
0.05080106109380722,
0.05211085081100464,
-0.028955670073628426,
-0.031434912234544754,
0.0038504258263856173,
0.0012798206880688667,
0.013132963329553604,
0.018921758979558945,
0.026406260207295418,
0.007887964136898518,
0.026920821517705917,
-0.05524498596787453,
-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_subworkflow_to_join_refresh_waiting(self):
self.load_workflow_spec('control-flow', 'subworkflow_to_join.xml')
self.do_next_unique_task('Start')
self.do_next_unique_task('first')
self.do_next_named_step('second', ['sub_workflow_1'])
self.do_next_unique_task('sub_workflow_... | |
562 | [
0.005121632479131222,
0.05492031201720238,
0.011510100215673447,
-0.020583052188158035,
-0.000025167033527395688,
0.0053086415864527225,
0.02726711332798004,
-0.016963522881269455,
0.05622334033250809,
0.036557234823703766,
0.028618404641747475,
0.013187148608267307,
0.005679643247276545,
... | 10 | {"_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 analyse_text(text):
if _oc_keywords.search(text):
return 1.0
elif '@"' in text: # strings
return 0.8
elif re.search('@[0-9]+', text):
return 0.7
elif _oc_message.search(text):
return 0.8
retu... | |
563 | [
-0.0012579194735735655,
-0.04502056911587715,
0.0343056283891201,
-0.018300047144293785,
0.028313281014561653,
-0.0007852424751035869,
0.0325680710375309,
0.02416987344622612,
0.038092613220214844,
-0.01019701361656189,
0.02786775305867195,
-0.028870191425085068,
-0.011628271080553532,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_get_s3_connection(self):
aws_connect_kwargs = dict(aws_access_key_id="access_key",
aws_secret_access_key="secret_key")
location = None
rgw = True
s3_url = "http://bla.blubb"
actual = s3.get_s3_connection(None, aws_connect_kwargs, locatio... | |
564 | [
-0.05366387590765953,
-0.024821801111102104,
-0.007549305912107229,
-0.04008980840444565,
0.05510936677455902,
-0.005217321217060089,
-0.016408588737249374,
-0.015708427876234055,
0.03351733833551407,
0.026447979733347893,
0.013336919248104095,
-0.033223722130060196,
-0.009536856785416603,
... | 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 TestUrlparse(unittest.TestCase):
def test_urlparse(self):
actual = urlparse("http://test.com/here")
self.assertEqual("http", actual.scheme)
self.assertEqual("test.com", actual.netloc)
self.assertEqual("/here", actual.path)
def test_is_fakes3(self):
actual = s3.is_... | |
565 | [
0.0186246819794178,
-0.024659693241119385,
0.036706093698740005,
-0.03703678026795387,
-0.011550373397767544,
0.0009927947539836168,
-0.08186829090118408,
0.0010880144545808434,
0.023183418437838554,
0.036091964691877365,
-0.011449987068772316,
-0.04759509861469269,
0.013251041993498802,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "names", "annotation": null, "type_comment": null}}], "kwarg... | def list_elbs(connection, names):
paginator = connection.get_paginator('describe_load_balancers')
load_balancers = paginator.paginate(LoadBalancerNames=names).build_full_result().get('LoadBalancerDescriptions', [])
results = []
for lb in load_balancers:
description = camel_dict_to_snake_dict(lb... | |
566 | [
0.05031397193670273,
-0.004844964016228914,
0.03661918267607689,
-0.0038437480106949806,
-0.020714810118079185,
0.05381247401237488,
-0.03203890472650528,
0.017975851893424988,
0.03848351538181305,
0.05781733617186546,
0.044813040643930435,
-0.0979580357670784,
-0.0034121896605938673,
0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
names={'default': [], 'type': 'list'}
)
)
module = AnsibleAWSModule(argument_spec=argument_spec,
supports_check_mode=True)
region, ec2_url, aws_connect_params = get_aws_connection_in... | |
567 | [
-0.0008702253107912838,
0.025446588173508644,
0.01470094919204712,
-0.010362682864069939,
0.004824106115847826,
0.04181654006242752,
0.0020705361384898424,
0.008144966326653957,
0.032945673912763596,
0.0630563274025917,
0.018256155773997307,
-0.04243384301662445,
0.05528288707137108,
-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": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = InfluxDb.influxdb_argument_spec()
argument_spec.update(
database_name=dict(required=True, type='str'),
state=dict(default='present', type='str', choices=['present', 'absent'])
)
module = AnsibleModule(
argument_spec=argument_spec,
supports_chec... | |
568 | [
0.013180701993405819,
0.01858280971646309,
0.03872793912887573,
0.019484994933009148,
0.009731494821608067,
0.009698488749563694,
0.015260128304362297,
-0.012399542145431042,
-0.0044009024277329445,
-0.011651388369500637,
0.0073220012709498405,
-0.05747578293085098,
0.04018023610115051,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "interest.group"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class InterestGroup(models.Model):
_name = "interest.group"
_description = "Interest Group"
_parent_name = "parent_id"
_parent_store = True
_parent_order = "name"
_order = "name"
name = fields.Char(required=True)
parent_id = fields.Many2one(
comodel_name="interest.group",
... | |
569 | [
0.0347626730799675,
-0.000742523989174515,
0.029115308076143265,
-0.005762404762208462,
0.026082463562488556,
-0.015425674617290497,
0.030370278283953667,
0.028571486473083496,
-0.0074095530435442924,
0.017642788589000702,
0.02650078572332859,
0.024095427244901657,
-0.041079357266426086,
-... | 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 sha256sum(self):
blocksize = 65536
hasher = hashlib.sha256()
with open(self.original_path, "rb") as fp:
buf = fp.read(blocksize)
while buf:
hasher.update(buf)
buf = fp.read(blocksize)
return hasher.hexdigest() | |
570 | [
0.019377080723643303,
0.005259871482849121,
-0.015448722057044506,
-0.010927403345704079,
0.0211771372705698,
-0.027318507432937622,
0.011213294230401516,
-0.017682909965515137,
-0.03066449612379074,
0.03492109850049019,
0.002614052966237068,
-0.008523797616362572,
0.025264324620366096,
-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 _load_original_image(self):
img = Image.open(self.original_path)
# if there is no exif data, simply return the image
exif = img._getexif()
if exif is None:
return img
# get the orientation tag code from the ExifTags dict
orientation = next(
(k... | |
571 | [
0.004935160744935274,
0.003992806654423475,
0.04268580302596092,
-0.06425466388463974,
-0.040323495864868164,
0.01901140995323658,
0.07789439707994461,
-0.040118079632520676,
-0.0208396278321743,
0.03999482840299606,
-0.020459605380892754,
0.011164452880620956,
-0.023951705545186996,
-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": "mode", "annotation": null, "type_comment": null}}], "kwarg": null... | def _get_path(self, mode):
mode_dir = getattr(settings, f"dirname_{mode}")
thedir = os.path.join(settings.output_dir, self.album_name, mode_dir)
os.makedirs(thedir, exist_ok=True)
width, height = self.resize_dims(mode)
ext = settings.output_format
fname = f"{self.clean_na... | |
572 | [
0.009178918786346912,
-0.0015967022627592087,
0.009145006537437439,
-0.023874232545495033,
0.006533762440085411,
-0.022506438195705414,
-0.016956130042672157,
0.013270998373627663,
0.01537355873733759,
0.07338613271713257,
0.02358032576739788,
-0.012524928897619247,
0.008500673808157444,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "string", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def parse_plf_tail(string):
parts = string.split(',')
if not parts:
raise ValueError("PLF ERROR: expected at least the destination state")
fpairs = []
if len(parts) > 1:
for part in parts[:-1]:
pair = part.split('=')
if len(pair) != 2:
raise ValueE... | |
573 | [
-0.010560422204434872,
0.03858354315161705,
-0.017623361200094223,
-0.009825085289776325,
0.03470294177532196,
0.01955130137503147,
-0.033195193856954575,
-0.04933552443981171,
0.002085513435304165,
0.05516878142952919,
0.01735147088766098,
-0.00036747517879121006,
0.04664134979248047,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "Q", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def parse_plf_arc(Q):
eat_blank(Q)
if pop(Q) != '(':
raise ValueError("PLF ERROR: expected '('")
word = get_escaped_string(Q)
eat_blank(Q)
if pop(Q) != ',':
raise ValueError("PLF ERROR: expected ','")
string = ''
while Q:
ch = pop(Q)
if ch == ')':
... | |
574 | [
0.020144222304224968,
0.038160696625709534,
-0.0301816426217556,
-0.004489663988351822,
0.04264746978878975,
-0.000229831479373388,
-0.013309989124536514,
-0.05513642728328705,
0.009904435835778713,
0.04618600755929947,
0.033581413328647614,
-0.008788524195551872,
0.027799490839242935,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "Q", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parse_element", "annotation": null, "type_comment": null}}], "kwarg"... | def parse_plf_block(Q, parse_element):
eat_blank(Q)
if pop(Q) != '(':
raise ValueError("PLF ERROR: expected '('")
elements = []
while True:
# parses an element
elements.append(parse_element(Q))
eat_blank(Q)
ch = pop(Q)
if ch == ')': # closing
... | |
575 | [
0.03479553759098053,
0.03657509386539459,
0.023364512249827385,
-0.017764147371053696,
-0.012142847292125225,
0.012655777856707573,
0.00037390284705907106,
0.02535342611372471,
-0.006662863772362471,
0.03917114809155464,
0.04291868209838867,
0.00343872862868011,
-0.004401782061904669,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def save_file(path, data):
file_size = data.nbytes
available = list(psutil.virtual_memory())[1]
percent = list(psutil.virtual_memory())[2]
# [total, available, percent, used, free, active, inactive, buffers, cached, shared] = list(psutil.virtual_memory())
if file_size > available:
qtutil.cr... | |
576 | [
0.027549047023057938,
0.028286581858992577,
-0.020358094945549965,
-0.04167064651846886,
0.029284421354532242,
-0.01719103939831257,
0.06134543940424919,
0.025770289823412895,
0.023037077859044075,
-0.004506547003984451,
0.06711555272340775,
0.011865613050758839,
-0.006914377212524414,
0.0... | 11 | {"_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": "progress_callback", "annotation": null, "type_comment": null}... | def load_npy(filename, progress_callback=None, segment=None):
if segment:
frames_mmap = np.load(filename, mmap_mode='r')
frames_mmap = frames_mmap[segment[0]:segment[1]]
frames = np.empty((frames_mmap.shape[0], frames_mmap.shape[1], frames_mmap.shape[2]),
dtype=frames_mmap.dt... | |
577 | [
0.021590016782283783,
0.03937455639243126,
-0.013880081474781036,
-0.02921196259558201,
0.019830258563160896,
0.014858946204185486,
0.025142524391412735,
0.021139077842235565,
-0.01676168292760849,
0.006901545915752649,
0.04716148227453232,
0.017014648765325546,
0.00632962491363287,
-0.007... | 11 | {"_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": "progress_callback", "annotation": null, "type_comment": null}... | def load_file(filename, progress_callback=None, segment=None):
file_size = os.path.getsize(filename)
available = list(psutil.virtual_memory())[1]
percent = list(psutil.virtual_memory())[2]
# [total, available, percent, used, free, active, inactive, buffers, cached, shared] = list(psutil.virtual_memory())
if ... | |
578 | [
0.00456321332603693,
0.040903735905885696,
0.0028287791647017,
-0.03099268302321434,
-0.02165977656841278,
-0.007082272320985794,
0.011387385427951813,
0.009560034610331059,
-0.013008254580199718,
-0.0002766512625385076,
0.03989198058843613,
0.0012634010054171085,
0.036485057324171066,
-0.... | 10 | {"_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": "offset", "annotation": null, "type_comment": null}}], "kwarg"... | def load_reference_frame_npy(filename, offset):
frames_mmap = np.load(filename, mmap_mode='c')
if frames_mmap is None:
return None
frame = np.array(frames_mmap[offset])
frame[np.isnan(frame)] = 0
frame = frame.swapaxes(0, 1)
if frame.ndim == 2:
frame = frame[:, ::-1]
elif frame.ndim == 3:
fram... | |
579 | [
0.05878200754523277,
0.03724091872572899,
0.00479075638577342,
-0.021887408569455147,
-0.0005952370702289045,
0.0164501890540123,
-0.012375159189105034,
-0.008588729426264763,
-0.023642094805836678,
0.04234336316585541,
0.019451625645160675,
-0.0003329720057081431,
-0.010100992396473885,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def save(self, *args, **kwargs):
self.is_template = self.title.startswith(TEMPLATE_TITLE_PREFIX)
self._raise_if_collides('slug', SlugCollision)
self._raise_if_collides('title', TitleCollision)
# These are too important to leave to a (possibly omitted) is_valid
# call:
s... | |
580 | [
0.05647546425461769,
0.01928619295358658,
0.017194919288158417,
-0.017194919288158417,
0.0012738513760268688,
0.0019903064239770174,
0.007828446105122566,
0.0014066307339817286,
0.0130234370008111,
0.05324450135231018,
-0.004016574006527662,
0.0001591449836269021,
0.01764858141541481,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _clean_template_status(self):
if (self.category == TEMPLATES_CATEGORY and
not self.title.startswith(TEMPLATE_TITLE_PREFIX)):
raise ValidationError(_(u'Documents in the Template category must have titles that '
u'start with "{prefix}". (Current ... | |
581 | [
-0.009281454607844353,
0.07012397050857544,
0.023687709122896194,
-0.054355353116989136,
-0.004107377026230097,
0.06506873667240143,
0.0076929982751607895,
0.008597374893724918,
-0.033299610018730164,
0.02213403768837452,
0.009832196868956089,
-0.07253564149141312,
0.004727686755359173,
0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "topic"}}, {"_type": "Constant", "_fields": {"kind": null,... | class DocumentMappingType(SearchMappingType):
list_keys = [
'topic',
'product'
]
@classmethod
def get_model(cls):
return Document
@classmethod
def get_query_fields(cls):
return ['document_title',
'document_content',
'document_summ... | |
582 | [
0.005870995577424765,
0.047060925513505936,
-0.01885922998189926,
-0.04599188640713692,
-0.01277035940438509,
0.04494608938694,
-0.0263773575425148,
-0.008744035847485065,
0.005327761638909578,
0.02139238640666008,
0.037974100559949875,
-0.07357772439718246,
0.0007574775372631848,
0.008023... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj_id", "annotation": null, "type_comment": null}}, {"_type": "ar... | def extract_document(cls, obj_id, obj=None):
if obj is None:
model = cls.get_model()
obj = model.objects.select_related(
'current_revision', 'parent').get(pk=obj_id)
if obj.html.startswith(REDIRECT_HTML):
# It's possible this document is indexed and w... | |
583 | [
0.04658470302820206,
0.04529562592506409,
0.0221366249024868,
-0.049429573118686676,
0.009473631158471107,
0.04382874071598053,
0.009751450270414352,
0.01257964875549078,
-0.037983424961566925,
0.0035671971272677183,
0.07116613537073135,
-0.061964768916368484,
-0.004108944442123175,
-0.006... | 8 | {"_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 get_indexable(cls):
# This function returns all the indexable things, but we
# really need to handle the case where something was indexable
# and isn't anymore. Given that, this returns everything that
# has a revision.
indexable = super(cls, cls).get_indexable()
inde... | |
584 | [
0.041348762810230255,
0.04486875608563423,
0.044289518147706985,
-0.0635826364159584,
-0.003163537010550499,
0.0775289312005043,
-0.0058759357780218124,
0.02312500961124897,
-0.024372601881623268,
0.035378143191337585,
0.03923231363296509,
-0.06442921608686447,
0.005697708111256361,
0.0094... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "document", "annotation": null, "type_comment": null}}], "kwarg": {... | def index(cls, document, **kwargs):
# If there are no revisions or the current revision is a
# redirect, we want to remove it from the index.
if (document['document_current_id'] is None or
document['document_content'].startswith(REDIRECT_HTML)):
cls.unindex(document[... | |
585 | [
0.05299077928066254,
0.021558986976742744,
0.049892935901880264,
-0.04276537522673607,
-0.02903915010392666,
0.012007297948002815,
0.006592365447431803,
0.03468075394630432,
-0.049011435359716415,
0.039793457835912704,
0.044528376311063766,
-0.003636190202087164,
-0.04661878943443298,
-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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def save(self, *args, **kwargs):
_, is_clean = self._based_on_is_clean()
if not is_clean: # No more Mister Nice Guy
# TODO(erik): This error message ignores non-translations.
raise ProgrammingError('Revision.based_on must be None or refer '
'to... | |
586 | [
-0.009229304268956184,
-0.022928230464458466,
0.006447328720241785,
-0.05060295760631561,
0.017061028629541397,
-0.0029039348009973764,
0.02845262736082077,
0.028294410556554794,
0.02708141691982746,
-0.03435938432812691,
0.01372529473155737,
-0.022071223706007004,
-0.01278917957097292,
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 TestGetJournalType(TransactionCase):
def test_so_and_po_on_delivery_gets_first_purchase_journal(self):
self.so.order_policy = 'picking'
self.so.action_button_confirm()
po = self.so.procurement_group_id.procurement_ids.purchase_id
self.assertTrue(po)
po.invoice_method ... | |
587 | [
0.011511075310409069,
-0.033049575984478,
0.003964926116168499,
-0.02524762600660324,
0.02615572139620781,
-0.006215980742126703,
0.02226753532886505,
0.045865241438150406,
0.0312589667737484,
-0.027319619432091713,
0.03918881714344025,
-0.013288897462189198,
-0.007482198998332024,
-0.0099... | 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_so_and_po_on_delivery_gets_first_purchase_journal(self):
self.so.order_policy = 'picking'
self.so.action_button_confirm()
po = self.so.procurement_group_id.procurement_ids.purchase_id
self.assertTrue(po)
po.invoice_method = 'picking'
po.signal_workflow('purchase... | |
588 | [
0.004290987737476826,
-0.020309049636125565,
-0.0005314211593940854,
-0.008356454782187939,
0.023185960948467255,
-0.014689317904412746,
0.027842657640576363,
0.06504747271537781,
0.02616039477288723,
-0.03864326700568199,
0.03944782912731171,
-0.006146961357444525,
-0.011099273338913918,
... | 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_po_on_delivery_gets_purchase_journal(self):
self.so.action_button_confirm()
po = self.so.procurement_group_id.procurement_ids.purchase_id
self.assertTrue(po)
po.invoice_method = 'picking'
po.signal_workflow('purchase_confirm')
picking = po.picking_ids
s... | |
589 | [
-0.014707721769809723,
-0.01505583431571722,
0.020078590139746666,
-0.031330060213804245,
-0.009069554507732391,
-0.025760270655155182,
0.03137978911399841,
0.04023177549242973,
-0.03406522423028946,
-0.018798034638166428,
0.012053369544446468,
-0.018238570541143417,
-0.034040357917547226,
... | 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 setUp(self):
super(TestGetJournalType, self).setUp()
self.Wizard = self.env['stock.invoice.onshipping']
customer = self.env.ref('base.res_partner_3')
product = self.env.ref('product.product_product_36')
dropship_route = self.env.ref('stock_dropshipping.route_drop_shipping')
... | |
590 | [
0.018953697755932808,
-0.030761340633034706,
0.021079586818814278,
-0.03560221940279007,
0.030300304293632507,
-0.001046935678459704,
0.005282703321427107,
0.03124799020588398,
0.030377143993973732,
-0.025677138939499855,
0.040852904319763184,
-0.014074401929974556,
-0.012678487226366997,
... | 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_so_on_delivery_gets_sale_journal(self):
self.so.order_policy = 'picking'
self.so.action_button_confirm()
po = self.so.procurement_group_id.procurement_ids.purchase_id
self.assertTrue(po)
po.signal_workflow('purchase_confirm')
picking = po.picking_ids
sel... | |
591 | [
0.04328658804297447,
0.0011914294445887208,
0.04507138207554817,
-0.03752364590764046,
-0.03857731819152832,
0.05793048441410065,
-0.003972775302827358,
0.0010388888185843825,
0.010681874118745327,
-0.005230731330811977,
0.04545844346284866,
-0.0641234964132309,
-0.02040684223175049,
0.020... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwar... | def delete_scaling_policy(connection, module):
sp_name = module.params.get('name')
asg_name = module.params.get('asg_name')
scalingPolicies = connection.get_all_policies(as_group=asg_name, policy_names=[sp_name])
if scalingPolicies:
try:
connection.delete_policy(sp_name, asg_name)
... | |
592 | [
0.023344889283180237,
-0.007656560745090246,
0.04486064612865448,
-0.014281302690505981,
-0.013026705943048,
0.035457026213407516,
0.005950543098151684,
-0.03344029188156128,
0.0013190858298912644,
0.008049354888498783,
0.03895113989710808,
-0.03144700825214386,
-0.000730260566342622,
0.01... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwar... | def create_scaling_policy(connection, module):
sp_name = module.params.get('name')
adjustment_type = module.params.get('adjustment_type')
asg_name = module.params.get('asg_name')
scaling_adjustment = module.params.get('scaling_adjustment')
min_adjustment_step = module.params.get('min_adjustment_step... | |
593 | [
0.05461400747299194,
0.013122925534844398,
0.033838991075754166,
-0.0016049939440563321,
-0.01334694679826498,
0.04723309725522995,
-0.010870923288166523,
0.014891513623297215,
0.03089134208858013,
0.0572551004588604,
0.04395531490445137,
-0.07772356271743774,
-0.005886451341211796,
0.0156... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = ec2_argument_spec()
argument_spec.update(
dict(
name=dict(required=True, type='str'),
adjustment_type=dict(type='str', choices=['ChangeInCapacity', 'ExactCapacity', 'PercentChangeInCapacity']),
asg_name=dict(required=True, type='str'),
... | |
594 | [
-0.007062183693051338,
-0.002643934218212962,
-0.039239551872015,
-0.050651293247938156,
-0.03397798910737038,
-0.01793607696890831,
0.02186470851302147,
-0.010458813980221748,
-0.029137354344129562,
-0.021478859707713127,
0.024133024737238884,
-0.026284419000148773,
-0.04386972263455391,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def sample_update_slate():
# Create a client
client = stitcher_v1.VideoStitcherServiceClient()
# Initialize request argument(s)
request = stitcher_v1.UpdateSlateRequest(
)
# Make the request
response = client.update_slate(request=request)
# Handle the response
print(response) | |
595 | [
0.010024725459516048,
0.017589328810572624,
0.02941308729350567,
-0.014760730788111687,
0.02620517462491989,
-0.0027608636301010847,
-0.04376199096441269,
-0.011048872955143452,
-0.007060658186674118,
0.023820916190743446,
-0.0046357582323253155,
-0.046167925000190735,
0.045951176434755325,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "layout_callable", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poson... | def check_children_prop(layout_callable):
## component subclasses are layouts, widgets and plots
components = [Row(), Column(), Figure()]
# Test layout accepts splatted components
layout1 = layout_callable(*components)
assert layout1.children == components
# Test layout accepts children argume... | |
596 | [
0.006038141902536154,
0.038957834243774414,
-0.02120870351791382,
-0.0034434599801898003,
-0.007832393981516361,
-0.01704002358019352,
-0.01079237274825573,
0.0010932044824585319,
0.019360732287168503,
0.03650819510221481,
0.012935805134475231,
-0.019478917121887207,
0.04486704617738724,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "layout_callable", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poson... | def check_widget_wrapped_in_widget_box(layout_callable):
components = [Slider()]
layout = layout_callable(*components)
assert len(layout.children) == 1
assert isinstance(layout.children[0], WidgetBox)
assert len(layout.children[0].children) == 1
assert layout.children[0].children == components | |
597 | [
0.05597740039229393,
0.04765765741467476,
0.0736568495631218,
-0.03954138606786728,
0.0012907752534374595,
0.01223092619329691,
0.024213165044784546,
0.0513201542198658,
-0.05100363865494728,
0.009681874886155128,
0.00026158159016631544,
0.008438434451818466,
0.015746470540761948,
0.002560... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('erudit', '0006_create_eruditdocument_data'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='id',
),
migrations.RemoveField(
model_name='article',
... | |
598 | [
0.0021307356655597687,
0.021398261189460754,
0.018202846869826317,
-0.013905564323067665,
0.02371218241751194,
-0.007233757991343737,
-0.031491365283727646,
-0.007927934639155865,
0.008252984844148159,
0.02492423541843891,
0.009949861094355583,
-0.03893998637795448,
0.03843312710523605,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "layout_callable", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poson... | def check_widget_box_children_prop(layout_callable):
## component subclasses are layouts, widgets and plots
components = [Slider()]
# Test layout accepts splatted components
layout1 = layout_callable(*components)
assert layout1.children == components
# Test layout accepts children argument
... | |
599 | [
-0.016575610265135765,
-0.018013840541243553,
0.018553176894783974,
-0.023826690390706062,
-0.03116166777908802,
-0.0077784317545592785,
-0.005360405892133713,
-0.025432715192437172,
-0.02725447341799736,
0.04868411272764206,
0.017570385709404945,
-0.04966690391302109,
0.016947152093052864,
... | 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": "val", "annotation": nu... | class Approximate(object):
def __init__(self, val, places=7):
self.val = val
self.places = places
def __repr__(self):
return repr(self.val)
def __eq__(self, other):
if self.val == other:
return True
return round(abs(self.val - other), self.places) == 0 | |
600 | [
-0.006805010139942169,
-0.017165251076221466,
-0.002984390128403902,
-0.007941681891679764,
0.004899707622826099,
-0.016384100541472435,
0.02880236878991127,
0.05351872742176056,
-0.039598248898983,
-0.014000595547258854,
-0.009128428064286709,
-0.023754943162202835,
0.03140619769692421,
-... | 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": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __getitem__(self, key):
if isinstance(key, six.string_types):
for subcontext in self:
if key in subcontext:
return subcontext[key]
raise KeyError(key)
else:
return super(ContextList, self).__getitem__(key) |