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
12,301
[ 0.03472922742366791, -0.0029835207387804985, 0.06265393644571304, -0.06003681197762489, -0.015218572691082954, 0.042737625539302826, -0.026079634204506874, -0.011312516406178474, 0.05611112713813782, 0.01909191533923149, 0.03085588477551937, -0.029494980350136757, -0.032269131392240524, -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_index(self): serializer = limits.LimitsTemplate() fixture = { "limits": { "rate": [{ "uri": "*", "regex": ".*", "limit": [{ "value": 10, "verb": "POST", ...
12,302
[ 0.0515175461769104, 0.027238629758358, 0.05822315067052841, -0.026891788467764854, -0.0016128136776387691, 0.043817661702632904, 0.015284154564142227, -0.02457951009273529, 0.08139216899871826, -0.010272293351590633, 0.02619810588657856, -0.030406450852751732, 0.010775214061141014, -0.0320...
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_xml_declaration(self): serializer = limits.LimitsTemplate() fixture = {"limits": { "rate": [], "absolute": {}}} output = serializer.serialize(fixture) has_dec = output.startswith("<?xml version='1.0' encoding='UTF-8'?>") self.asser...
12,303
[ 0.06918861716985703, 0.0074318815022706985, 0.08343776315450668, -0.043876320123672485, -0.034619394689798355, 0.03449396416544914, -0.02636593207716942, -0.02149914763867855, 0.05283220857381821, 0.0116526884958148, 0.029802784323692322, -0.03160901367664337, -0.011734219267964363, -0.035...
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_index_no_limits(self): serializer = limits.LimitsTemplate() fixture = {"limits": { "rate": [], "absolute": {}}} output = serializer.serialize(fixture) root = etree.XML(output) xmlutil.validate_schema(root, 'limits') #verif...
12,304
[ 0.01589992269873619, 0.051840610802173615, 0.05348779633641243, -0.03742773085832596, -0.006102595943957567, 0.018290629610419273, 0.03397321328520775, -0.007023418787866831, -0.020967306569218636, 0.010294913314282894, -0.007967119105160236, 0.025645773857831955, -0.023369453847408295, 0....
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 = [ ('verify_student', '0002_auto_20151124_1024'), ] operations = [ migrations.AlterField( model_name='historicalverificationdeadline', name='deadline_is_explicit', field=models.BooleanField(default=Fal...
12,305
[ -0.01369871012866497, 0.00860039796680212, -0.007527350448071957, -0.052702128887176514, 0.035768259316682816, 0.008717846125364304, -0.013880220241844654, -0.011146885342895985, -0.006651828996837139, -0.020564081147313118, 0.0021314145997166634, -0.013997668400406837, -0.017926838248968124...
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_object(self): class _TestOptimizer(optimizer_lib.Optimizer): def __init__(self): super(_TestOptimizer, self).__init__( use_locking=False, name='TestOptimizer') opt = optimizers.get_optimizer_instance(_TestOptimizer()) self.assertIsInstance(opt, _TestOptimizer)
12,306
[ 0.0009583656792528927, -0.005547733046114445, 0.032015472650527954, -0.04473653808236122, -0.00135811569634825, 0.03733562305569649, -0.021647093817591667, -0.015215625055134296, 0.005807829089462757, -0.007318160030990839, 0.017922990024089813, -0.0360824316740036, -0.009523065760731697, ...
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 GetOptimizerInstance(test.TestCase): def test_unsupported_name(self): with self.assertRaisesRegexp( ValueError, 'Unsupported optimizer name: unsupported_name'): optimizers.get_optimizer_instance('unsupported_name', learning_rate=0.1) def test_supported_name_but_learning_rate_none(self): ...
12,307
[ 0.03108028508722782, -0.0002869253803510219, 0.028336355462670326, -0.017518937587738037, 0.0183632243424654, 0.05714762210845947, -0.017637666314840317, 0.024233652278780937, 0.050683554261922836, 0.01891728676855564, 0.039232924580574036, -0.04326966777443886, -0.04044658690690994, 0.025...
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 DiscussionsTest(APITestCase): def create_app(self): app = super(DiscussionsTest, self).create_app() app.register_blueprint(user_bp) return app def test_new_discussion(self): user = self.login() dataset = Dataset.objects.create(title='Test dataset') with se...
12,308
[ 0.020598644390702248, 0.02511690743267536, 0.02958882972598076, -0.032832708209753036, -0.01869865693151951, -0.011556326411664486, -0.012349918484687805, -0.047453343868255615, -0.01880292408168316, 0.016242574900388718, -0.0038839683402329683, -0.0331570990383625, 0.014249905943870544, -...
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": "app", "annotation": nu...
class IncludeMachineName(object): def __init__(self, app, config): self.app = app self.config = config def __call__(self, environ, start_response): def local_response(status, headers, exc_info=None): machine_id = '%s:%s (PID %d)' % ( platform.node(), environ...
12,309
[ 0.027791669592261314, -0.008312483318150043, -0.0025940975174307823, -0.0034711158368736506, 0.026586301624774933, 0.0321810245513916, -0.0014583803713321686, 0.06577210128307343, 0.029474634677171707, -0.003579143900424242, 0.014362061396241188, -0.040186479687690735, -0.0018563788617029786...
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_new_discussion_missing_comment(self): self.login() dataset = Dataset.objects.create(title='Test dataset') response = self.post(url_for('api.discussions'), { 'title': 'test title', 'subject': { 'class': 'Dataset', 'id': dataset.id,...
12,310
[ 0.04503058269619942, -0.012635265477001667, 0.012598852626979351, 0.00041457568295300007, 0.02222398854792118, 0.01762382872402668, -0.0011234887642785907, 0.05991130694746971, 0.021629244089126587, 0.008611643686890602, 0.009661547839641571, -0.03867046907544136, -0.020646097138524055, 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_new_discussion(self): user = self.login() dataset = Dataset.objects.create(title='Test dataset') with self.assert_emit(on_new_discussion): response = self.post(url_for('api.discussions'), { 'title': 'test title', 'comment': 'bla bla', ...
12,311
[ 0.023115403950214386, -0.02698461338877678, 0.02578640542924404, -0.03989029675722122, 0.018310096114873886, 0.03242646902799606, -0.030729008838534355, 0.05017490312457085, 0.0292062871158123, 0.04363469406962395, 0.010852507315576077, -0.04907654970884323, -0.031652625650167465, -0.00073...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_list_discussions(self): dataset = Dataset.objects.create(title='Test dataset') open_discussions = [] closed_discussions = [] for i in range(2): user = UserFactory() message = Message(content=faker.sentence(), posted_by=user) discussion = Discu...
12,312
[ 0.020868435502052307, -0.0026667749043554068, -0.0008612347883172333, -0.01663113199174404, 0.02262924611568451, 0.015767768025398254, -0.00650363601744175, 0.05339229851961136, 0.01663113199174404, -0.008752929046750069, 0.013529835268855095, -0.03419379144906998, -0.0057595521211624146, ...
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_new_discussion_missing_title(self): self.login() dataset = Dataset.objects.create(title='Test dataset') response = self.post(url_for('api.discussions'), { 'comment': 'bla bla', 'subject': { 'class': 'Dataset', 'id': dataset.id, ...
12,313
[ 0.011038118042051792, -0.040941838175058365, 0.02247445471584797, -0.04380403086543083, 0.016799842938780785, 0.030364159494638443, -0.039473406970500946, 0.05005108565092087, 0.035839661955833435, 0.02420421689748764, -0.005183062516152859, -0.03462011739611626, -0.03255436196923256, -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_list_discussions_for(self): dataset = DatasetFactory() discussions = [] for i in range(3): user = UserFactory() message = Message(content=faker.sentence(), posted_by=user) discussion = Discussion.objects.create( subject=dataset, ...
12,314
[ 0.023096513003110886, -0.02292163483798504, 0.013540627434849739, -0.041521258652210236, 0.020972982048988342, 0.033951498568058014, -0.031378280371427536, 0.04944077879190445, 0.031852953135967255, 0.04431932419538498, 0.01196671649813652, -0.062057044357061386, -0.03832347318530083, 0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_list_discussions_closed_filter(self): dataset = Dataset.objects.create(title='Test dataset') open_discussions = [] closed_discussions = [] for i in range(2): user = UserFactory() message = Message(content=faker.sentence(), posted_by=user) disc...
12,315
[ 0.03846710920333862, -0.013967366889119148, -0.014051146805286407, -0.002546321600675583, 0.004120193421840668, 0.05136926844716072, -0.0012769009917974472, 0.04440353810787201, 0.03145350515842438, -0.013632245361804962, 0.013368936255574226, -0.020502226427197456, -0.02361406572163105, 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_add_comment_to_discussion(self): dataset = Dataset.objects.create(title='Test dataset') user = UserFactory() message = Message(content='bla bla', posted_by=user) discussion = Discussion.objects.create( subject=dataset, user=user, title='test d...
12,316
[ 0.021100057289004326, -0.024982281029224396, -0.014766521751880646, -0.014004151336848736, 0.012162734754383564, 0.01867220178246498, -0.017534511163830757, 0.045976780354976654, 0.0204315185546875, -0.011658397503197193, 0.021921072155237198, -0.05024605244398117, -0.011382771655917168, -...
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_discussion(self): dataset = Dataset.objects.create(title='Test dataset') user = UserFactory() message = Message(content='bla bla', posted_by=user) discussion = Discussion.objects.create( subject=dataset, user=user, title='test discussion',...
12,317
[ 0.03402691334486008, -0.0008495685178786516, 0.020471682772040367, -0.013555232435464859, 0.03077062964439392, 0.03642495349049568, -0.0003453097597230226, 0.04765787348151207, 0.025217276066541672, 0.0033067697659134865, 0.030871599912643433, -0.0314774215221405, -0.030316263437271118, 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_close_discussion(self): owner = self.login() user = UserFactory() dataset = Dataset.objects.create(title='Test dataset', owner=owner) message = Message(content='bla bla', posted_by=user) discussion = Discussion.objects.create( subject=dataset, use...
12,318
[ 0.026261204853653908, 0.009796327911317348, 0.022641481831669807, 0.0018356727669015527, 0.014879729598760605, 0.060199134051799774, -0.0007432273123413324, 0.05835283175110817, 0.03265037760138512, -0.004372818395495415, 0.05320262536406517, -0.03345206007361412, -0.041541773825883865, 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_close_discussion_permissions(self): dataset = Dataset.objects.create(title='Test dataset') user = UserFactory() message = Message(content='bla bla', posted_by=user) discussion = Discussion.objects.create( subject=dataset, user=user, title='tes...
12,319
[ 0.03804045543074608, 0.011161014437675476, -0.000863961351569742, -0.017357703298330307, 0.0005228092195466161, 0.06933780014514923, -0.02081064134836197, 0.07775506377220154, 0.030297502875328064, -0.008597468957304955, 0.05766524001955986, -0.03271572291851044, -0.05231725424528122, 0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_delete_discussion_permissions(self): dataset = Dataset.objects.create(title='Test dataset') user = UserFactory() message = Message(content='bla bla', posted_by=user) discussion = Discussion.objects.create( subject=dataset, user=user, title='te...
12,320
[ 0.061512235552072525, 0.0041915038600564, 0.0088743194937706, -0.014899030327796936, 0.025769304484128952, 0.05664825066924095, -0.02011921815574169, 0.05925220251083374, 0.03367942199110985, 0.002138741547241807, 0.03923124819993973, -0.027906509116292, -0.043088044971227646, -0.011994149...
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_delete_discussion(self): owner = self.login(AdminFactory()) user = UserFactory() dataset = Dataset.objects.create(title='Test dataset', owner=owner) message = Message(content='bla bla', posted_by=user) discussion = Discussion.objects.create( subject=dataset, ...
12,321
[ 0.03110843524336815, -0.03812406212091446, 0.048709917813539505, 0.0217584278434515, 0.02426757477223873, 0.012115062214434147, -0.001646237913519144, 0.013432052917778492, 0.03839869424700737, 0.03445396572351456, 0.013844002969563007, -0.047636352479457855, -0.01590375043451786, 0.038248...
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 DiscussionCsvTest(FrontTestCase): def test_discussions_csv_content_empty(self): organization = OrganizationFactory() response = self.get( url_for('organizations.discussions_csv', org=organization)) self.assert200(response) self.assertEqual( response.da...
12,322
[ 0.028805511072278023, -0.017361415550112724, 0.041870951652526855, 0.020367413759231567, 0.03869926929473877, -0.008994325995445251, -0.011929316446185112, 0.03434412181377411, 0.02863982692360878, 0.014402755536139011, 0.006225020159035921, -0.058936502784490585, 0.003130262019112706, 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_discussions_csv_content_empty(self): organization = OrganizationFactory() response = self.get( url_for('organizations.discussions_csv', org=organization)) self.assert200(response) self.assertEqual( response.data, ('"id";"user";"subject";"titl...
12,323
[ 0.02273123525083065, -0.020789824426174164, 0.03093402273952961, -0.018912697210907936, 0.009122065268456936, 0.0448453351855278, 0.02067410945892334, 0.012638464570045471, 0.02154838852584362, 0.028362616896629333, -0.004734602756798267, -0.032862577587366104, -0.028131190687417984, 0.041...
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 DiscussionsNotificationsTest(TestCase, DBTestMixin): def test_notify_user_discussions(self): owner = UserFactory() dataset = DatasetFactory(owner=owner) open_discussions = {} for i in range(3): user = UserFactory() message = Message(content=faker.senten...
12,324
[ 0.033132608979940414, -0.023342257365584373, 0.030143974348902702, 0.023071734234690666, 0.032591562718153, 0.008122126571834087, -0.006956302095204592, 0.05206920951604843, 0.012907804921269417, 0.009120484814047813, 0.035812072455883026, -0.042407676577568054, -0.0011022195685654879, 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_discussions_csv_content_filled(self): organization = OrganizationFactory() dataset = DatasetFactory(organization=organization) user = UserFactory(first_name='John', last_name='Snow') discussion = DiscussionFactory(subject=dataset, user=user) response = self.get( ...
12,325
[ 0.038690321147441864, -0.010295138694345951, 0.035387489944696426, -0.0024787625297904015, 0.014784106984734535, 0.035387489944696426, 0.0018643965013325214, 0.042412564158439636, 0.01887332834303379, 0.013067158870398998, -0.00891895778477192, -0.03273998200893402, -0.03142933547496796, 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_notify_org_discussions(self): recipient = UserFactory() member = Member(user=recipient, role='editor') org = OrganizationFactory(members=[member]) dataset = DatasetFactory(organization=org) open_discussions = {} for i in range(3): user = UserFactory(...
12,326
[ 0.026144877076148987, -0.013705180026590824, 0.040292974561452866, -0.02137400582432747, 0.006713386625051498, 0.02882770076394081, 0.011389345861971378, 0.025195764377713203, 0.03528166189789772, 0.022183915600180626, -0.002293687779456377, -0.02771407552063465, -0.056744251400232315, 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_notify_user_discussions(self): owner = UserFactory() dataset = DatasetFactory(owner=owner) open_discussions = {} for i in range(3): user = UserFactory() message = Message(content=faker.sentence(), posted_by=user) discussion = Discussion.objec...
12,327
[ 0.05628632754087448, -0.001850977074354887, 0.005385200493037701, 0.0251507256180048, 0.039614174515008926, 0.018667111173272133, -0.0038266389165073633, 0.031468093395233154, 0.051536425948143005, 0.00359804998151958, 0.011839128099381924, -0.027406929060816765, -0.04552780091762543, -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_new_discussion_mail(self): user = UserFactory() owner = UserFactory() message = Message(content=faker.sentence(), posted_by=user) discussion = Discussion.objects.create( subject=DatasetFactory(owner=owner), user=user, title=faker.sentence(), ...
12,328
[ 0.055738773196935654, -0.016568612307310104, 0.026740562170743942, 0.002522605936974287, 0.02263917215168476, 0.026514798402786255, -0.0024645968805998564, -0.007211924530565739, 0.039132531732320786, 0.02929922752082348, 0.0020209066569805145, -0.04791226610541344, -0.02389341965317726, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class DiscussionsMailsTest(TestCase, DBTestMixin): def create_app(self): app = super(DiscussionsMailsTest, self).create_app() app.register_blueprint(user_bp) app.register_blueprint(dataset_bp) return app def test_new_discussion_mail(self): user = UserFactory() ow...
12,329
[ 0.06038305535912514, -0.00035757297882810235, 0.010110355913639069, 0.009184313006699085, 0.029963187873363495, 0.020639333873987198, -0.008264613337814808, 0.014195092022418976, 0.058657824993133545, 0.02469869889318943, 0.01484205387532711, -0.0347583144903183, -0.04564248397946358, 0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_closed_discussion_mail(self): owner = UserFactory() poster = UserFactory() commenter = UserFactory() message = Message(content=faker.sentence(), posted_by=poster) second_message = Message(content=faker.sentence(), posted_by=commenter) closing_message = Message(co...
12,330
[ 0.05721917375922203, -0.010201354511082172, -0.013846847228705883, 0.022270645946264267, 0.02392166294157505, 0.028248049318790436, -0.0033653019927442074, 0.03104393184185028, 0.06936679780483246, 0.007779059931635857, 0.0017986439634114504, -0.030007528141140938, -0.02475319802761078, -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_new_discussion_comment_mail(self): owner = UserFactory() poster = UserFactory() commenter = UserFactory() message = Message(content=faker.sentence(), posted_by=poster) new_message = Message(content=faker.sentence(), posted_by=commenter) discussion = Discussion.ob...
12,331
[ 0.006575198378413916, 0.03447027504444122, 0.041379913687705994, -0.0019271012861281633, -0.011273624375462532, -0.008714978583157063, 0.03332732617855072, -0.019378164783120155, -0.02150820381939411, -0.000774818123318255, 0.02410581335425377, -0.010890476405620575, -0.03291171044111252, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setup(self): self.baseNode = render.attachNewNode('targetGameTargets') target = CollisionSphere(0, 0, 0, 5.0) target.setTangible(0) targetNode = CollisionNode('thing') targetNode.addSolid(target) targetNodePath = self.baseNode.attachNewNode(targetNode) self.sl...
12,332
[ 0.0019438290037214756, 0.013561086729168892, 0.04956306889653206, -0.002550932578742504, 0.0046666525304317474, 0.005076264496892691, 0.03145235776901245, -0.011278962716460228, -0.021446119993925095, -0.021182797849178314, 0.039498310536146164, -0.011842179112136364, -0.008045952767133713, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "SomeCounter", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class RubberBand: SomeCounter = 0 def __init__(self, heldObject = None, heldOffset = None, taskPriority = 0): self.heldObject = heldObject self.heldOffset = heldOffset self.bandNumber = self.SomeCounter self._taskPriority = taskPriority self.SomeCounter += 1 if n...
12,333
[ 0.0009114210261031985, 0.025305336341261864, 0.056701112538576126, 0.0018532228423282504, -0.0130672762170434, 0.008049098774790764, 0.016655772924423218, -0.010601078160107136, -0.022617539390921593, 0.010429516434669495, 0.01964380405843258, 0.015969526022672653, -0.02293206751346588, -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": "task", "annotation": null, "type_comment": null}}], "kwarg": null...
def redraw(self, task): color = {} color['Red'] = 1.0 color['Green'] = 0.3 color['Blue'] = 0.2 color['Alpha'] = 0.5 self.bandGN.removeAllGeoms() objPosX = self.heldObject.getX(self.baseNode) + self.heldOffset[0] objPosY = self.heldObject.getY(self.baseNode...
12,334
[ -0.02448718436062336, 0.004133340436965227, 0.028349781408905983, -0.016184404492378235, 0.015077367424964905, 0.012357905507087708, 0.012490268796682358, 0.019312988966703415, 0.020925411954522133, 0.032272543758153915, 0.0311895739287138, -0.09106585383415222, -0.006503844168037176, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ad_group_id", "annotation": null, "type_comment": null}}], "kwa...
def main(client, ad_group_id): # Initialize appropriate service. ad_group_criterion_service = client.GetService( 'AdGroupCriterionService', version='v201802') # Construct keyword ad group criterion object. keyword1 = { 'xsi_type': 'BiddableAdGroupCriterion', 'adGroupId': ad_group_id, 'c...
12,335
[ 0.0012894133105874062, -0.0035804971121251583, 0.04907914251089096, 0.019392775371670723, 0.0049242014065384865, 0.014973482117056847, -0.014973482117056847, 0.01441971305757761, 0.004829192068427801, 0.03961077705025673, 0.0046337442472577095, -0.011455419473350048, 0.04751555994153023, 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 CanReconnectTest(TestCase): def test_can_reconnect_on_interface_error(self): exc = psycopg2.InterfaceError('herp derp') assert can_reconnect(exc) is True def test_can_reconnect_on_default_isolation_level_error(self): exc = psycopg2.OperationalError("can't fetch default_isolation_l...
12,336
[ -0.001905085751786828, 0.026142233982682228, 0.033488694578409195, 0.005013100802898407, -0.021738652139902115, -0.013167780824005604, -0.02887030504643917, -0.01949390023946762, -0.03973963111639023, 0.030159158632159233, 0.003759154351428151, -0.05881465598940849, 0.026528889313340187, -...
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": "client", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, client, kind=None, dataset_id=None, namespace=None, ancestor=None, filters=(), projection=(), order=(), group_by=()): self._client = client...
12,337
[ 0.018407585099339485, 0.0359141007065773, 0.025616150349378586, -0.022616872563958168, -0.008579479530453682, -0.020917709916830063, 0.00266620353795588, -0.0057089258916676044, -0.0032518994994461536, 0.0021818780805915594, -0.004997723735868931, -0.06889328360557556, -0.023067407310009003,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Keyword' db.create_table('generic_keyword', ( ('slug', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)), ('id', self.gf('django.db.models.fields.AutoFi...
12,338
[ 0.02121615782380104, 0.03147825598716736, 0.02659936249256134, -0.0015774313360452652, -0.013721892610192299, -0.026880836114287376, 0.016548369079828262, 0.028804248198866844, 0.03380042314529419, 0.004814390558749437, -0.018565604463219643, -0.0420101024210453, -0.008755036629736423, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding model 'Keyword' db.create_table('generic_keyword', ( ('slug', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('tit...
12,339
[ -0.02993929386138916, 0.02850400097668171, 0.01599005050957203, -0.03718303143978119, -0.02469150722026825, 0.005438411142677069, 0.006845669820904732, 0.0010295136598870158, 0.0321146585047245, 0.040546998381614685, 0.02917679399251938, 0.012570017948746681, -0.019241882488131523, -0.0505...
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": "Subscript", "_fields"...
def main(): program_name = os.path.splitext(os.path.basename(__file__))[0] # remove path, then remove extension. local_home = os.environ['HOME'] # Get home directory start_datetime = time.strftime("%Y%m%d_%H%M%S") # Startup t...
12,340
[ 0.03161534667015076, 0.019057102501392365, 0.05870279669761658, -0.05084557086229324, 0.013703534379601479, 0.024610428139567375, 0.014622430317103863, -0.03880670294165611, 0.03148217126727104, -0.00597615260630846, 0.04426681250333786, -0.002829933073371649, 0.01911037042737007, -0.02194...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class OSDBInstanceTest(common.HeatTestCase): def setUp(self): super(OSDBInstanceTest, self).setUp() self.fc = self.m.CreateMockAnything() self.nova = self.m.CreateMockAnything() self.m.StubOutWithMock(trove.TroveClientPlugin, '_create') self.stub_TroveFlavorConstraint_validat...
12,341
[ 0.012721631675958633, -0.025113003328442574, 0.004105137195438147, -0.013567098416388035, -0.0088840052485466, 0.024439271539449692, 0.003831021022051573, 0.06230032816529274, 0.006525946315377951, 0.009465264156460762, 0.020159097388386726, -0.03875936567783356, 0.016909334808588028, -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 _stubout_common_create(self): trove.TroveClientPlugin._create().AndReturn(self.fc) self.m.StubOutWithMock(self.fc, 'flavors') self.m.StubOutWithMock(trove.TroveClientPlugin, 'get_flavor_id') trove.TroveClientPlugin.get_flavor_id('1GB').AndReturn(1) self.m.StubOutWithMock(self...
12,342
[ -0.021451221778988838, -0.021776409819722176, 0.05431767925620079, -0.04350796714425087, 0.01935431733727455, 0.0061000860296189785, 0.0573677197098732, -0.006453307811170816, -0.023211725056171417, -0.014241009950637817, -0.013579419814050198, -0.014521344564855099, 0.029289383441209793, ...
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 _setup_test_clouddbinstance(self, name, t): stack_name = '%s_stack' % name template = tmpl.Template(t) self.stack = parser.Stack(utils.dummy_context(), stack_name, template, stack_id=str(uui...
12,343
[ -0.009152288548648357, 0.03130386024713516, 0.039512548595666885, -0.051970746368169785, -0.02866441383957863, 0.05373917520046234, 0.0018855561502277851, 0.0003311683249194175, 0.013467786833643913, 0.028162917122244835, 0.050149526447057724, -0.024692043662071228, 0.005325087811797857, -...
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": "instance", "annotation": null, "type_comment": null}}, {"_type": ...
def _stubout_validate(self, instance, neutron=None, mock_net_constraint=False, with_port=True): if mock_net_constraint: self.stub_NetworkConstraint_validate() trove.TroveClientPlugin._create().AndReturn(self.fc) self.m.StubOutWithM...
12,344
[ 0.011736634187400341, -0.013979117386043072, 0.02744566835463047, -0.0140956100076437, 0.0048577431589365005, -0.008783545345067978, 0.03103364072740078, 0.04119180142879486, 0.01152112241834402, -0.02949593774974346, 0.016774941235780716, 0.004284017253667116, 0.024743037298321724, -0.064...
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": "instance", "annotation": null, "type_comment": null}}, {"_type": ...
def _stubout_create(self, instance, fake_dbinstance): self._stubout_common_create() users = [{"name": "testuser", "password": "pass", "host": "%", "databases": [{"name": "validdb"}]}] databases = [{"collate": "utf8_general_ci", "character_set": "utf8", ...
12,345
[ 0.015313629060983658, 0.01973542384803295, 0.055808600038290024, -0.015554598532617092, 0.0037079225294291973, -0.001765103661455214, 0.019373970106244087, -0.008843590505421162, 0.011807519011199474, 0.012650913558900356, 0.028844082728028297, -0.011078585870563984, 0.027711523696780205, ...
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_failed(self): mock_stack = mock.Mock() mock_stack.db_resource_get.return_value = None res_def = mock.Mock(spec=rsrc_defn.ResourceDefinition) osdb_res = os_database.OSDBInstance("test", res_def, mock_stack) trove_mock = mock.Mock() self.patchobject(osdb_re...
12,346
[ 0.016140345484018326, -0.0007817980367690325, 0.03873683139681816, -0.03334134444594383, 0.0028058262541890144, -0.010554633103311062, 0.05635286495089531, 0.004147492349147797, 0.003769923700019717, -0.005208143964409828, 0.02476390264928341, -0.015287213958799839, 0.03564710542559624, -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_osdatabase_create(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_create', t) self._stubout_create(instance, fake_dbinstance) self._stubout_check_create_complete(fake_dbinstance) ...
12,347
[ 0.0180569626390934, -0.010776911862194538, 0.04115818068385124, -0.026439683511853218, 0.0034207100979983807, 0.009655967354774475, 0.01696038618683815, 0.03604082018136978, -0.003466400783509016, -0.017752358689904213, -0.0015793751226738095, 0.0066342889331281185, 0.023661687970161438, -...
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_osdatabase_restore_point(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['restore_point'] = "1234" instance = self._setup_test_clouddbinstance('dbinstance_create', t) trove.TroveClientPlugin._...
12,348
[ 0.03990019112825394, 0.0011981070274487138, 0.05336807668209076, -0.015519537962973118, -0.021586380898952484, -0.002718751085922122, 0.030334213748574257, 0.016866326332092285, -0.027338553220033646, -0.01629992015659809, 0.018175354227423668, -0.0010415585711598396, -0.0013192550977692008,...
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_osdatabase_create_overlimit(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_create', t) self._stubout_create(instance, fake_dbinstance) # Simulate an OverLimit exception se...
12,349
[ 0.010939070023596287, 0.02105090767145157, 0.04941629618406296, -0.03600641340017319, -0.0010877844179049134, -0.005877709481865168, 0.05690493434667587, 0.009028814733028412, 0.0011374456807971, -0.017883475869894028, 0.016435816884040833, -0.01719774305820465, 0.02174752578139305, -0.055...
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_osdatabase_create_fails(self): fake_dbinstance = FakeDBInstance() fake_dbinstance.status = 'ERROR' t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_create', t) self._stubout_create(instance, fake_dbinstance) self._stu...
12,350
[ -0.017997870221734047, -0.027991164475679398, 0.02791658788919449, -0.022112024948000908, 0.04830091446638107, -0.013548120856285095, 0.035374268889427185, 0.02209959551692009, -0.029582135379314423, -0.00797971896827221, 0.0020430940203368664, -0.03343527019023895, 0.021179815754294395, -...
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_db_instance(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) res = self._setup_test_clouddbinstance('trove_check', t) res.client = mock.Mock() res.client().instances.get.return_value = fake_dbinstance res.flavor = 'Foo Flavor' ...
12,351
[ -0.013147496618330479, 0.0664733499288559, 0.023768514394760132, -0.014766404405236244, 0.02965545281767845, 0.04199349507689476, 0.01772213727235794, 0.008922391571104527, 0.016912683844566345, -0.029876213520765305, 0.007824722677469254, -0.027227090671658516, 0.03419330343604088, 0.0067...
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_osdatabase_check_not_active(self): (res, fake_instance) = self._get_db_instance() fake_instance.status = 'FOOBAR' exc = self.assertRaises(exception.ResourceFailure, scheduler.TaskRunner(res.check)) self.assertIn('FOOBAR', six.text_type(exc)) ...
12,352
[ 0.018864860758185387, 0.010928566567599773, 0.038296159356832504, -0.04127611964941025, -0.00991882849484682, 0.044009797275066376, 0.027164414525032043, 0.039010364562273026, 0.024381477385759354, -0.006624866276979446, 0.03630131110548973, -0.04051265865564346, 0.02711515873670578, -0.04...
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_osdatabase_delete(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_del', t) self._stubout_create(instance, fake_dbinstance) self._stubout_check_create_complete(fake_dbinstance) ...
12,353
[ 0.02138359472155571, 0.05073339119553566, 0.03429558128118515, -0.030926190316677094, 0.0015869226772338152, 0.0039680590853095055, 0.04433155059814453, 0.030324513092637062, 0.03718363121151924, -0.034993525594472885, 0.031094659119844437, -0.027171727269887924, 0.03547486662864685, -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_osdatabase_delete_resource_none(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_del', t) self._stubout_create(instance, fake_dbinstance) self._stubout_check_create_complete(fake_dbin...
12,354
[ 0.050334345549345016, 0.013293430209159851, 0.03892522677779198, -0.03001992031931877, -0.04034491628408432, 0.03198166936635971, 0.016300585120916367, 0.03985447809100151, -0.005275426898151636, -0.01175113394856453, 0.03647304326295853, -0.019127052277326584, -0.014661491848528385, -0.02...
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_osdatabase_delete_overlimit(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_del', t) self._stubout_create(instance, fake_dbinstance) self._stubout_check_create_complete(fake_dbinstan...
12,355
[ 0.012304899282753468, -0.011784721165895462, 0.04912393167614937, -0.016621777787804604, -0.0032974500209093094, 0.012974553741514683, 0.021632228046655655, -0.002331832190975547, -0.011049297638237476, -0.018104584887623787, 0.008591905236244202, -0.01518680527806282, 0.015617297030985355, ...
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_osdatabase_get_hostname(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_test', t) instance.resource_id = 12345 trove.TroveClientPlugin._create().AndReturn(self.fc) self.m.Stu...
12,356
[ -0.01277442742139101, 0.02741646207869053, 0.050823792815208435, -0.02309606596827507, 0.014803892932832241, 0.0040464806370437145, 0.030529137700796127, 0.005854946095496416, -0.0043172831647098064, -0.028910545632243156, 0.005764678120613098, -0.029782095924019814, 0.038920916616916656, ...
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_osdatabase_resource_not_found(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_del', t) self._stubout_create(instance, fake_dbinstance) self._stubout_check_create_complete(fake_dbinst...
12,357
[ -0.026983661577105522, -0.012064688839018345, 0.02894519455730915, -0.014573188498616219, -0.003731314791366458, -0.0132906474173069, 0.015516233630478382, 0.00503586046397686, 0.007456342224031687, -0.00943045038729906, 0.03123364970088005, -0.05145253613591194, 0.047705501317977905, -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 test_osdatabase_get_href_links_none(self): fake_dbinstance = FakeDBInstance() fake_dbinstance.links = None t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_test', t) instance.resource_id = 12345 trove.TroveClientPlugin._cr...
12,358
[ -0.02380630560219288, -0.013645545579493046, 0.030303576961159706, -0.010907500982284546, 0.0015293796313926578, 0.008188603445887566, 0.016798444092273712, 0.01820256933569908, 0.003500739810988307, -0.021176762878894806, 0.03331606462597847, -0.04751049354672432, 0.045442599803209305, -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_osdatabase_get_href(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template) instance = self._setup_test_clouddbinstance('dbinstance_test', t) instance.resource_id = 12345 trove.TroveClientPlugin._create().AndReturn(self.fc) self.m.StubOut...
12,359
[ 0.04749637469649315, 0.029896069318056107, 0.07758799940347672, -0.009356272406876087, -0.017294742166996002, 0.0052984245121479034, 0.04659191146492958, 0.01641472615301609, 0.027744922786951065, 0.00041556271025910974, -0.000005648697424476268, -0.03243833780288696, 0.04918307065963745, ...
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_osdatabase_prop_validation_users_none(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['users'] = [] instance = self._setup_test_clouddbinstance('dbinstance_test', t) self._stubout_validate(instance) ret = instance.validate() ...
12,360
[ 0.030488984659314156, 0.015117164701223373, 0.08218366652727127, -0.020731119439005852, -0.02215486578643322, 0.018115133047103882, 0.03373003005981445, -0.0045432522892951965, 0.004925232380628586, 0.008218366652727127, 0.011633040383458138, -0.02163398265838623, 0.03095198981463909, -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_osdatabase_prop_validation_invaliddb(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['databases'] = [ {"name": "onedb"}] t['Resources']['MySqlCloudDB']['Properties']['users'] = [ {"name": "testuser", "passwo...
12,361
[ 0.033348873257637024, 0.009831937961280346, 0.06722919642925262, -0.027547141537070274, -0.02201114036142826, 0.004437104798853397, 0.040279943495988846, 0.004320849198848009, 0.00683696148917079, 0.005594129208475351, -0.0049990089610219, -0.012732802890241146, 0.034721799194812775, -0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_osdatabase_prop_validation_user_no_db(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['databases'] = [ {"name": "validdb"}] t['Resources']['MySqlCloudDB']['Properties']['users'] = [ {"name": "testuser", "password": "pass...
12,362
[ 0.023822156712412834, 0.006896804552525282, 0.08050726354122162, -0.028075281530618668, -0.021265631541609764, 0.009738032706081867, 0.0241707731038332, 0.003855122020468116, 0.02005709335207939, 0.0018186182714998722, -0.002502779010683298, -0.02477504312992096, 0.041043832898139954, -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_osdatabase_prop_validation_databases_none(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['databases'] = [] t['Resources']['MySqlCloudDB']['Properties']['users'] = [ {"name": "testuser", "password": "pass", ...
12,363
[ 0.05307696759700775, 0.024841120466589928, 0.042548734694719315, -0.040025629103183746, 0.002306634560227394, 0.012546715326607227, 0.029015714302659035, -0.004381028935313225, -0.007878970354795456, 0.00011871856986545026, 0.0024385242722928524, -0.0056626517325639725, 0.016468998044729233,...
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_osdatabase_prop_validation_no_datastore_yes_version(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties'].pop('datastore_type') instance = self._setup_test_clouddbinstance('dbinstance_test', t) ex = self.assertRaises(exception.StackValidation...
12,364
[ 0.04777025803923607, 0.013375196605920792, 0.07057347893714905, -0.03324182331562042, -0.01090227160602808, 0.030959121882915497, 0.0554981492459774, -0.02308856137096882, 0.007115604355931282, 0.01882038824260235, 0.00025041340268217027, -0.020056849345564842, 0.006830267142504454, 0.0076...
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_osdatabase_prop_validation_no_dsversion(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties'][ 'datastore_type'] = 'mysql' t['Resources']['MySqlCloudDB']['Properties'].pop('datastore_version') instance = self._setup_test_clouddbin...
12,365
[ 0.03839978948235512, 0.014728686772286892, 0.06743133068084717, -0.04223225265741348, -0.01232400257140398, 0.04160603508353233, 0.035644423216581345, -0.003181195817887783, 0.010583112016320229, 0.002570631681010127, 0.00001849304862844292, -0.016932979226112366, 0.0015185826923698187, -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_osdatabase_prop_validation_implicit_version_fail(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties'][ 'datastore_type'] = 'mysql' t['Resources']['MySqlCloudDB']['Properties'].pop('datastore_version') instance = self._setup_test_...
12,366
[ 0.03896758705377579, 0.005522551015019417, 0.0672290176153183, -0.020348699763417244, -0.0045816716738045216, 0.03412878140807152, 0.042263586074113846, -0.018326686695218086, -0.004856338258832693, 0.006475117988884449, -0.011676250025629997, -0.026788754388689995, 0.0018203963991254568, ...
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_osdatabase_prop_validation_wrong_dsversion(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties'][ 'datastore_type'] = 'mysql' t['Resources']['MySqlCloudDB']['Properties'][ 'datastore_version'] = 'SomeVersion' instance ...
12,367
[ 0.02644234523177147, 0.014283588156104088, 0.08485159277915955, -0.03116419166326523, -0.01291425246745348, 0.016904212534427643, 0.034611139446496964, -0.002898033708333969, 0.008617371320724487, 0.03281683847308159, 0.0006016666302457452, -0.01709308661520481, 0.033289022743701935, -0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_osdatabase_prop_validation_no_net_no_port_fail(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['networks'] = [ { "fixed_ip": "1.2.3.4" }] instance = self._setup_test_clouddbinstance('dbinstance_test', t) ...
12,368
[ 0.03167524188756943, 0.008494510315358639, 0.08360571414232254, -0.030923306941986084, -0.01290037576109171, 0.02819754369556904, 0.02749260514974594, 0.002634708071127534, 0.015344163402915001, 0.02549527958035469, -0.0016198900993913412, -0.019703034311532974, 0.022898755967617035, -0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_osdatabase_prop_validation_net_with_port_fail(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['networks'] = [ { "port": "someportuuid", "network": "somenetuuid" }] instance = self._setup_t...
12,369
[ 0.02924671396613121, 0.011556018143892288, 0.0817481279373169, -0.040850285440683365, -0.008256846107542515, 0.03939983993768692, 0.01572902500629425, -0.011615462601184845, 0.019497808068990707, 0.0005286848754622042, -0.0004885598318651319, 0.0038668671622872353, 0.008940458297729492, 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_osdatabase_prop_validation_nic_port_on_novanet_fails(self): t = template_format.parse(db_template) t['Resources']['MySqlCloudDB']['Properties']['networks'] = [ { "port": "someportuuid", }] instance = self._setup_test_clouddbinstance('dbinstance_te...
12,370
[ 0.026375873014330864, 0.0006646080291830003, 0.060173630714416504, -0.03262341022491455, 0.013411062769591808, -0.0014708718517795205, 0.01981126330792904, 0.007333808112889528, 0.003370380960404873, 0.007874008268117905, 0.016194269061088562, -0.0013226103037595749, 0.03161346912384033, -...
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_osdatabase_create_with_port(self): fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template_with_nics) instance = self._setup_test_clouddbinstance('dbinstance_test', t) self._stubout_common_create() self.m.StubOutWithMock(neutron.NeutronClientPlugin, ...
12,371
[ 0.01503821276128292, -0.009816443547606468, 0.04606734216213226, -0.03060704469680786, 0.019741423428058624, -0.018547531217336655, 0.038759276270866394, 0.02807454764842987, -0.005399647168815136, 0.00558355450630188, 0.014459356665611267, -0.0016657202504575253, 0.03415254130959511, -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_osdatabase_create_with_net_id(self): net_id = '034aa4d5-0f36-4127-8481-5caa5bfc9403' fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template_with_nics) t['resources']['MySqlCloudDB']['properties']['networks'] = [ {'network': net_id}] instance...
12,372
[ 0.01010296680033207, 0.005087868310511112, 0.03801044076681137, -0.025324122980237007, 0.01788940653204918, -0.007768247276544571, 0.02893838845193386, 0.013498921878635883, -0.004341971129179001, -0.012759088538587093, 0.011770622804760933, -0.011479540728032589, 0.028065143153071404, -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_osdatabase_create_with_net_name(self): class FakeNet(object): id = 'somenetid' fake_dbinstance = FakeDBInstance() t = template_format.parse(db_template_with_nics) t['resources']['MySqlCloudDB']['properties']['networks'] = [ {'network': 'somenetname'}] ...
12,373
[ -0.010185742750763893, 0.03490877151489258, 0.042719848453998566, 0.008914032019674778, -0.006846747826784849, 0.0048246667720377445, 0.007792997173964977, -0.0038091063033789396, -0.024674812331795692, -0.030304091051220894, 0.03348638489842415, -0.03985096514225006, -0.0026097199879586697,...
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 get_default_odm_query(self): inst = self.get_institution() inst_query = Q('primary_institution', 'eq', inst) base_query = self.base_node_query user = self.request.user permission_query = Q('is_public', 'eq', True) if not user.is_anonymous(): permission_que...
12,374
[ 0.03906441852450371, 0.004143537953495979, 0.06719983369112015, -0.0310708899050951, -0.004829423502087593, 0.025087034329771996, 0.041954733431339264, -0.002485276199877262, 0.008665300905704498, -0.02797734923660755, -0.014711253345012665, 0.0017725762445479631, 0.04041925445199013, -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 test_osdatabase_create_with_replication(self): db_template_with_replication = ''' heat_template_version: 2013-05-23 description: MySQL instance running on openstack DBaaS cloud resources: MySqlCloudDB: type: OS::Trove::Instance properties: ...
12,375
[ -0.002290688920766115, -0.0017817929619923234, 0.05078964680433273, -0.025836655870079994, 0.049569349735975266, 0.01985088363289833, -0.019051378592848778, 0.03101240284740925, -0.011413995176553726, 0.024658437818288803, -0.031832948327064514, 0.022049523890018463, -0.017599644139409065, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "ndarray", "value": {"_type": "Name", "_fields": {"...
def percentile(x: np.ndarray, groups: Optional[np.ndarray] = None) -> np.ndarray: if x.ndim == 1: x = x.reshape((-1, 1)) if groups is not None: res = np.zeros(x.shape, dtype=int) index_diff, order = utils.groupby(groups) start = 0 for diff_loc in index_diff: ...
12,376
[ 0.0120618287473917, 0.013997160829603672, 0.052515506744384766, -0.04736856743693352, 0.023893509060144424, 0.0007303264574147761, -0.009085601195693016, -0.004657874349504709, -0.021361885592341423, 0.02238708920776844, -0.012752271257340908, 0.038204509764909744, -0.00639182748273015, -0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "ndarray", "value": {"_type": "Name", "_fields": {"...
def rank(x: np.ndarray, groups: Optional[np.ndarray] = None) -> np.ndarray: if x.ndim == 1: x = x.reshape((-1, 1)) if groups is not None: res = np.zeros(x.shape, dtype=int) index_diff, order = utils.groupby(groups) start = 0 for diff_loc in index_diff: curr_...
12,377
[ 0.006101720035076141, 0.015175656415522099, -0.03555811196565628, 0.0057491762563586235, -0.03594862297177315, 0.019210927188396454, -0.02148890309035778, 0.011021062731742859, 0.00046305276919156313, 0.015663793310523033, -0.00645968783646822, -0.06703756749629974, 0.04319475591182709, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"...
class ObjectDetailPlugin(DatabrowsePlugin): def model_view(self, request, model_databrowse, url): # If the object ID wasn't provided, redirect to the model page, which is one level up. if url is None: return http.HttpResponseRedirect(urljoin(request.path, '../')) easy_model = Eas...
12,378
[ 0.0017223296454176307, 0.004280804190784693, 0.015599431470036507, -0.02825460024178028, 0.023308753967285156, 0.017342746257781982, -0.00016626049182377756, 0.008193575777113438, 0.037888024002313614, -0.007373572327196598, 0.014902106486260891, -0.024858366698026657, -0.02280513010919094, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class CoreXMPPClientTest(T.TestCase): @T.setup def setup_fakexmpp_attrs(self): self.fake_client_attrs = { "auth.return_value": True, "connect.return_value": True, "disconnect.return_value": True, "isConnected.return_value": True, "Process.retu...
12,379
[ -0.006087271496653557, -0.0008457795483991504, -0.0009635741589590907, 0.015382067300379276, 0.03781132400035858, 0.0017647234490141273, 0.028961366042494774, 0.015136235393583775, 0.03504863753914833, -0.020497716963291168, 0.0278609748929739, -0.025660190731287003, -0.024676863104104996, ...
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 fake_xmpp_connect(self): with nested( mock.patch("%s.core.xmppclient.logging" % __name__), mock.patch("%s.core.xmppclient.Settings" % __name__), mock.patch("%s.core.xmppclient.xmpp.Client" % __name__), mock.patch("%s.core.xmppclient.xmpp.protocol.JID" % __name...
12,380
[ 0.015707656741142273, -0.00005405350384535268, -0.0002013222110690549, -0.017843028530478477, 0.019700923934578896, 0.02748236618936062, 0.026131169870495796, 0.015695592388510704, 0.025817498564720154, -0.019049454480409622, 0.04415516182780266, -0.007310936693102121, -0.05221408233046532, ...
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_process_queue_item_successful(self): with nested( mock.patch("%s.core.xmppclient.xmpp.Message" % __name__), mock.patch("%s.core.xmppclient.XMPPQueue.message_queue" % __name__) ): jabber_client = mock.MagicMock() core.xmppclient.XMPPQueue.message_q...
12,381
[ 0.02190469577908516, 0.02690267004072666, -0.008490383625030518, 0.009804665111005306, -0.0023647816851735115, -0.010421698912978172, 0.020152321085333824, 0.037688419222831726, 0.012624509632587433, -0.012044497765600681, 0.0386509895324707, -0.02769247256219387, -0.011951942928135395, 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_process_queue_item_retry(self): def raise_ioerror(*args): raise IOError("Fake IOError") with nested( mock.patch("%s.core.xmppclient.logging" % __name__), mock.patch("%s.core.xmppclient.xmpp.Message" % __name__), mock.patch("%s.core.xmppclient.XMP...
12,382
[ -0.007842518389225006, -0.016413139179348946, -0.018523400649428368, -0.00523554440587759, 0.022743921726942062, 0.010051504708826542, 0.0290006585419178, 0.01670931652188301, 0.022669877856969833, -0.0017338691977784038, 0.01583312638103962, -0.021287718787789345, -0.021361762657761574, 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_enqueue_user_xmpp_with_string(self): fake_domain = "fakedomain.com" fake_user = "fakeuser" T.MockedSettings['xmpp'] = {'default_domain': fake_domain} with mock.patch.dict(core.xmppclient.Settings, T.MockedSettings): with mock.patch.object(core.xmppclient.XMPPQueue, "...
12,383
[ -0.015169011428952217, -0.01952994428575039, -0.009664432145655155, -0.004461473785340786, 0.029609106481075287, -0.0016494885785505176, 0.003949346952140331, 0.02191777527332306, 0.026969924569129944, 0.01178834494203329, 0.021251697093248367, -0.017996706068515778, -0.0078107211738824844, ...
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_enqueue_user_xmpp_with_list(self): fake_domain = "fakedomain.com" fake_users = ["fakeuser1", "fakeuser2"] T.MockedSettings['xmpp'] = {'default_domain': fake_domain} with mock.patch.dict(core.xmppclient.Settings, T.MockedSettings): with mock.patch.object(core.xmppclie...
12,384
[ -0.010512879118323326, -0.04005319997668266, -0.06598786264657974, 0.036881957203149796, 0.0306698027998209, -0.0045233615674078465, 0.010415134951472282, 0.026303917169570923, 0.016203735023736954, 0.030387433245778084, 0.018831953406333923, 0.008031274192035198, -0.0039667654782533646, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def get_front_url(context): front_url = context.get("front_url") if not front_url: try: front_url = reverse("shoop:index") except NoReverseMatch: front_url = None return front_url
12,385
[ -0.033822156488895416, -0.011599977500736713, -0.020611071959137917, -0.03244438394904137, 0.01603330299258232, -0.009677759371697903, -0.0487554632127285, 0.01821107603609562, -0.006288876757025719, 0.0019249963806942105, 0.019411073997616768, -0.014588860794901848, 0.024666620418429375, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def get_config(context): request = context["request"] url_name = None if getattr(request, "resolver_match", None): # This does not exist when testing views directly url_name = request.resolver_match.url_name qs = {"context": url_name} return { "searchUrl": manipulate_query_s...
12,386
[ -0.009219626896083355, 0.006544580217450857, -0.009500682353973389, 0.012938594445586205, -0.025214700028300285, -0.046574924141168594, -0.01818831078708172, -0.0251544751226902, -0.0018331347964704037, 0.01769646443426609, -0.014484399929642677, -0.01732506975531578, 0.006047714035958052, ...
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": "Dict", "_fields": {"k...
def get_browser_urls(): browser_urls = {} for name, urlname in BROWSER_URL_NAMES.items(): try: browser_urls[name] = reverse(urlname) except NoReverseMatch: # This may occur when a module is not available. browser_urls[name] = None return browser_urls
12,387
[ -0.0035493632312864065, 0.012133941985666752, -0.05748176947236061, -0.0516001433134079, 0.002849684562534094, -0.009329048916697502, 0.011497589759528637, 0.0028110709972679615, 0.017694301903247833, 0.048634618520736694, 0.04532311484217644, -0.06346224248409271, 0.007784504443407059, -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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') display_id = mobj.group('display_id') webpage = self._download_webpage(url, display_id) video_url = self._html_search_regex( r"url: escape\('([^']+)'\)", webpage, 'url') ...
12,388
[ -0.007845462299883366, 0.009320897050201893, -0.06230182573199272, -0.07497773319482803, 0.016255440190434456, -0.00998163502663374, 0.022773010656237602, 0.014330959878861904, 0.021490024402737617, 0.04654674977064133, 0.052268870174884796, -0.07056426256895065, -0.004262722562998533, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Sexy Karma and Watch Indian Porn"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_DESC", "ctx": {"_type": "Store", "_fields": {}}}...
class SexyKarmaIE(InfoExtractor): IE_DESC = 'Sexy Karma and Watch Indian Porn' _VALID_URL = r'https?://(?:www\.)?(?:sexykarma\.com|watchindianporn\.net)/(?:[^/]+/)*video/(?P<display_id>[^/]+)-(?P<id>[a-zA-Z0-9]+)\.html' _TESTS = [{ 'url': 'http://www.sexykarma.com/gonewild/video/taking-a-quick-pee-y...
12,389
[ 0.023812223225831985, 0.04577953740954399, -0.02246071957051754, -0.020808879286050797, -0.007556626573204994, -0.002590383868664503, -0.0009553045383654535, -0.017322856932878494, 0.0075941686518490314, -0.002664126455783844, 0.04577953740954399, -0.04552210494875908, 0.06697455793619156, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def checksubpackage(name): obj = getattr(py, name) if hasattr(obj, '__map__'): # isinstance(obj, Module): keys = dir(obj) assert len(keys) > 0 print (obj.__map__) for name in list(obj.__map__): assert hasattr(obj, name), (obj, name)
12,390
[ 0.008770143613219261, 0.00026191529468633235, 0.03692314028739929, -0.04223547875881195, -0.015972906723618507, -0.012371525168418884, -0.010660569183528423, 0.020256279036402702, -0.01696597971022129, 0.027183854952454567, 0.024503756314516068, 0.011910883709788322, 0.04288157448172569, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields"...
def test_importall(): base = py._pydir nodirs = [ ] if sys.version_info >= (3,0): nodirs.append(base.join('_code', '_assertionold.py')) else: nodirs.append(base.join('_code', '_assertionnew.py')) def recurse(p): return p.check(dotfile=0) and p.basename != "attic" fo...
12,391
[ -0.010221309028565884, 0.00020006735576316714, 0.06833885610103607, -0.03520262986421585, -0.0024338646326214075, 0.02841302566230297, -0.061795253306627274, -0.03598983213305473, -0.0490032434463501, 0.025608621537685394, -0.0007199349929578602, -0.05308684706687927, -0.01035045925527811, ...
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 Default(FactsBase): def commands(self): return(['show version | utility head -n 20']) def populate(self, results): self.facts['version'] = self.parse_version(results['show version | utility head -n 20']) self.facts['image'] = self.parse_image(results['show version | utility head ...
12,392
[ 0.025414444506168365, 0.01124735176563263, 0.019727295264601707, -0.0189910139888525, -0.02357373759150505, -0.005928344558924437, 0.010523763485252857, 0.043440673500299454, 0.025490611791610718, 0.06514831632375717, 0.050803497433662415, -0.042450498789548874, -0.0005149217904545367, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_all_resolves(): seen = py.builtin.set([py]) lastlength = None while len(seen) != lastlength: lastlength = len(seen) for item in py.builtin.frozenset(seen): for value in item.__dict__.values(): if isinstance(value, type(py.test)): seen....
12,393
[ 0.006703480612486601, 0.005195984151214361, 0.036230266094207764, -0.018178077414631844, 0.013142598792910576, 0.00006255008338484913, -0.06520944833755493, 0.006571299396455288, -0.028400098904967308, 0.035298705101013184, 0.02383040264248848, -0.01685626432299614, -0.009082743898034096, ...
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 Hardware(FactsBase): def commands(self): return(['dir /all', 'show memory summary']) def populate(self, results): self.facts['filesystems'] = self.parse_filesystems( results['dir /all']) match = re.search(r'Physical Memory: (\d+)M total \((\d+)', ...
12,394
[ 0.045290760695934296, 0.014339874498546124, 0.05529962480068207, 0.018736906349658966, -0.003598172916099429, -0.0074142166413366795, -0.02722727507352829, -0.00740761449560523, -0.002272790763527155, 0.04183123633265495, 0.0009053201065398753, -0.01569991745054722, -0.005512796808034182, ...
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": "results", "annotation": null, "type_comment": null}}], "kwarg": n...
def populate(self, results): self.facts['filesystems'] = self.parse_filesystems( results['dir /all']) match = re.search(r'Physical Memory: (\d+)M total \((\d+)', results['show memory summary']) if match: self.facts['memtotal_mb'] = match.group(1...
12,395
[ 0.025068193674087524, -0.035032957792282104, 0.0544123612344265, -0.003291372675448656, 0.00607012864202261, -0.025630822405219078, -0.02908160537481308, 0.00028951888089068234, -0.02205500937998295, 0.044935207813978195, -0.015190950594842434, -0.022405089810490608, -0.008839507587254047, ...
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": "results", "annotation": null, "type_comment": null}}], "kwarg": n...
def populate(self, results): self.facts['all_ipv4_addresses'] = list() self.facts['all_ipv6_addresses'] = list() interfaces = self.parse_interfaces(results['show interfaces']) self.facts['interfaces'] = self.populate_interfaces(interfaces) data = results['show ipv6 interface'] ...
12,396
[ -0.02717435546219349, -0.02406037412583828, 0.0397275947034359, -0.021141016855835915, 0.009238551370799541, 0.016993096098303795, -0.05318097025156021, -0.016932275146245956, -0.016555191949009895, 0.03323202207684517, 0.004829104524105787, -0.03364560008049011, -0.010181260295212269, -0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class Interfaces(FactsBase): def commands(self): return(['show interfaces', 'show ipv6 interface', 'show lldp', 'show lldp neighbors detail']) def populate(self, results): self.facts['all_ipv4_addresses'] = list() self.facts['all_ipv6_addresses'] = list() inter...
12,397
[ 0.022711049765348434, -0.014770801179111004, 0.04731827601790428, 0.0065127271227538586, -0.019726721569895744, -0.019985292106866837, -0.013973544351756573, 0.015654247254133224, -0.0032967652659863234, 0.03137313947081566, -0.022775691002607346, 0.00991723034530878, -0.0033183125779032707,...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def populate_ipv6_interfaces(self, data): for key, value in iteritems(data): if key in ['No', 'RPF'] or key.startswith('IP'): continue self.facts['interfaces'][key]['ipv6'] = list() addresses = re.findall(r'\s+(.+), subnet', value, re.M) subnets = ...
12,398
[ -0.0013824508059769869, -0.030153866857290268, -0.0009744410053826869, 0.006803152617067099, -0.00986397359520197, 0.002343440894037485, -0.017934497445821762, -0.008022698573768139, 0.029866915196180344, 0.04600796476006508, -0.006803152617067099, -0.024307221174240112, -0.00918844062834978...
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": "interfaces", "annotation": null, "type_comment": null}}], "kwarg"...
def populate_interfaces(self, interfaces): facts = dict() for key, value in iteritems(interfaces): intf = dict() intf['description'] = self.parse_description(value) intf['macaddress'] = self.parse_macaddress(value) ipv4 = self.parse_ipv4(value) ...
12,399
[ -0.013369180262088776, -0.022116616368293762, 0.015546964481472969, -0.011608803644776344, 0.004047050140798092, -0.0007051334832794964, -0.025431688874959946, -0.007555704098194838, -0.026617372408509254, 0.06547873467206955, 0.015353383496403694, -0.015607458539307117, 0.00640026805922389,...
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": "neighbors", "annotation": null, "type_comment": null}}], "kwarg":...
def parse_neighbors(self, neighbors): facts = dict() nbors = neighbors.split('------------------------------------------------') for entry in nbors[1:]: if entry == '': continue intf = self.parse_lldp_intf(entry) if intf not in facts: ...
12,400
[ 0.0185297429561615, 0.010795952752232552, -0.03179214522242546, 0.005826469976454973, 0.027423599734902382, 0.02011830359697342, -0.0076188282109797, -0.03260732814669609, 0.03459303081035614, 0.04305839538574219, 0.011527527123689651, -0.005664478521794081, 0.024183768779039383, -0.017641...
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null...
def parse_interfaces(self, data): parsed = dict() key = '' for line in data.split('\n'): if len(line) == 0: continue elif line[0] == ' ': parsed[key] += '\n%s' % line else: match = re.match(r'^(\S+)', line) ...