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
9,701
[ 0.024932773783802986, -0.002519708825275302, 0.03143899515271187, 0.00017127847240772098, -0.017369288951158524, 0.00278983311727643, -0.018101239576935768, 0.023643147200345993, 0.03696928545832634, 0.05121326446533203, 0.022597504779696465, -0.001616389607079327, -0.010107881389558315, -...
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_init_arguments(self): self.initialize_arguments() definition = InputDefinition() self.assertEqual([], definition.get_arguments()) definition = InputDefinition([self.foo, self.bar]) self.assertEqual( [self.foo, self.bar], definition.get_arguments...
9,702
[ 0.012611307203769684, -0.01718565635383129, 0.017590979114174843, -0.008969198912382126, 0.0009488879586569965, 0.009860907681286335, -0.019270170480012894, 0.006653072778135538, 0.05151064693927765, 0.03810027614235878, 0.03592311963438988, -0.004467228427529335, -0.005092582665383816, -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_set_arguments(self): self.initialize_arguments() definition = InputDefinition() definition.set_arguments([self.foo]) self.assertEqual([self.foo], definition.get_arguments()) definition.set_arguments([self.bar]) self.assertEqual([self.bar], definition.get_argumen...
9,703
[ 0.021009663119912148, 0.0019004467176273465, 0.05128512531518936, -0.003956520464271307, -0.022134967148303986, -0.014736692421138287, 0.01635281927883625, -0.014197982847690582, 0.01844780147075653, 0.03476470708847046, 0.02439754642546177, 0.007116948254406452, -0.04221086576581001, 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_init_options(self): self.initialize_options() definition = InputDefinition() self.assertEqual([], definition.get_options()) definition = InputDefinition([self.foo, self.bar]) self.assertEqual( [self.foo, self.bar], definition.get_options() ...
9,704
[ 0.022749610245227814, -0.005399324465543032, 0.025715958327054977, -0.008117526769638062, -0.0014945832081139088, 0.006605829577893019, -0.03212783485651016, 0.013405612669885159, 0.041620150208473206, 0.04492877051234245, 0.015470648184418678, -0.001075301319360733, -0.011831166222691536, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_add_arguments(self): self.initialize_arguments() definition = InputDefinition() definition.add_arguments([self.foo]) self.assertEqual([self.foo], definition.get_arguments()) definition.add_arguments([self.bar]) self.assertEqual([self.foo, self.bar], definition.g...
9,705
[ 0.025793971493840218, -0.006574826315045357, -0.0020762609783560038, 0.007662391290068626, -0.0012894239043816924, 0.014566782861948013, -0.02592579647898674, 0.007426202762871981, 0.05207130312919617, 0.039811477065086365, 0.02561820298433304, 0.005976115819066763, -0.007876608520746231, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_add_argument(self): self.initialize_arguments() definition = InputDefinition() definition.add_argument(self.foo) self.assertEqual([self.foo], definition.get_arguments()) definition.add_argument(self.bar) self.assertEqual([self.foo, self.bar], definition.get_argu...
9,706
[ 0.05353805050253868, 0.00953085906803608, 0.008079099468886852, -0.0036618562880903482, -0.0006923151086084545, 0.024668104946613312, -0.02995581366121769, -0.007536164950579405, 0.05065813660621643, 0.028515856713056564, 0.03545597568154335, -0.015497235581278801, 0.04565369710326195, 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_arguments_must_have_different_names(self): self.initialize_arguments() definition = InputDefinition() definition.add_argument(self.foo) self.assertRaisesRegexp( Exception, 'An argument with name "foo" already exists.', definition.add_argument...
9,707
[ 0.030090998858213425, 0.018191376700997353, -0.005707342643290758, -0.008480191230773926, -0.009226248599588871, 0.01969592645764351, -0.06008252501487732, 0.011769062839448452, 0.04113265499472618, 0.05804330110549927, 0.027231112122535706, 0.007410841062664986, 0.01839032582938671, -0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_list_argument_has_to_be_last(self): self.initialize_arguments() definition = InputDefinition() definition.add_argument(InputArgument('foolist', InputArgument.IS_LIST)) self.assertRaisesRegexp( Exception, 'Cannot add an argument after a list argument.', ...
9,708
[ 0.05560985207557678, 0.023799525573849678, -0.00363571522757411, 0.0064156255684792995, -0.000069042929681018, 0.03160073980689049, -0.0361650325357914, 0.04282517358660698, 0.0481579452753067, 0.05160445347428322, 0.03188018873333931, -0.012155922129750252, -0.01471751555800438, 0.0088374...
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_required_argument_cannot_follow_an_optional_one(self): self.initialize_arguments() definition = InputDefinition() definition.add_argument(self.foo) self.assertRaisesRegexp( Exception, 'Cannot add a required argument after an optional one.', d...
9,709
[ 0.02135767787694931, 0.011523265391588211, 0.011586453765630722, 0.0007776481215842068, 0.002460039220750332, -0.004506481345742941, -0.047609586268663406, 0.014935439452528954, 0.03747646510601044, 0.01873823255300522, 0.02913559600710869, -0.005666850134730339, 0.009759735316038132, 0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_get_invalid_argument(self): self.initialize_arguments() definition = InputDefinition() definition.add_arguments([self.foo]) self.assertRaises( Exception, 'The "bar" argument does not exist.', definition.get_argument, 'bar' ...
9,710
[ 0.012264956720173359, 0.00634452048689127, 0.0040036882273852825, 0.010451439768075943, 0.017476726323366165, 0.02235369198024273, -0.03176166117191315, 0.0003829311463050544, 0.05838967487215996, 0.027944905683398247, 0.054059553891420364, -0.014151014387607574, 0.02394958771765232, -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_has_argument(self): self.initialize_arguments() definition = InputDefinition() definition.add_arguments([self.foo]) self.assertTrue(definition.has_argument('foo')) self.assertFalse(definition.has_argument('bar'))
9,711
[ 0.022623954340815544, 0.013085014186799526, 0.01560272742062807, -0.008368735201656818, 0.004178457893431187, 0.039172302931547165, -0.03364042565226555, 0.006719810888171196, 0.037257421761751175, 0.06723356992006302, 0.06264731287956238, 0.0022015213035047054, -0.0023064259439706802, -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_get_argument_required_count(self): self.initialize_arguments() definition = InputDefinition() definition.add_argument(self.foo2) self.assertEqual(1, definition.get_argument_required_count()) definition.add_argument(self.foo) self.assertEqual(1, definition.get_ar...
9,712
[ -0.007475167512893677, -0.022495146840810776, 0.004271524492651224, -0.012373492121696472, 0.0035286506172269583, -0.0016874262364581227, -0.018676310777664185, -0.01387084648013115, 0.06240139901638031, 0.018003081902861595, 0.008072949014604092, -0.010110048577189445, 0.027416685596108437,...
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_argument_default(self): definition = InputDefinition([ InputArgument('foo1', InputArgument.OPTIONAL), InputArgument('foo2', InputArgument.OPTIONAL, '', 'default'), InputArgument('foo3', InputArgument.OPTIONAL | InputArgument.IS_LIST), ]) self.asse...
9,713
[ 0.02359015867114067, 0.00671394681558013, 0.014010225422680378, -0.0043589272536337376, 0.000762883631978184, 0.03427766636013985, -0.019902056083083153, 0.002012471202760935, 0.04750002920627594, 0.0585985966026783, 0.06101927161216736, -0.014672485180199146, 0.014558302238583565, -0.0136...
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_argument_count(self): self.initialize_arguments() definition = InputDefinition() definition.add_argument(self.foo2) self.assertEqual(1, definition.get_argument_count()) definition.add_argument(self.foo) self.assertEqual(2, definition.get_argument_count())
9,714
[ 0.002543496200814843, 0.006017687730491161, 0.020639002323150635, -0.041811563074588776, -0.03029155544936657, 0.006157140713185072, -0.006169266998767853, 0.009828384965658188, 0.05379236862063408, 0.02219117246568203, 0.04040490835905075, 0.0065118358470499516, -0.028884902596473694, 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_set_options_clears_options(self): self.initialize_options() definition = InputDefinition([self.foo]) definition.set_options([self.bar]) self.assertRaisesRegexp( Exception, 'The "-f" option does not exist.', definition.get_option_for_shortcut,...
9,715
[ 0.021060490980744362, 0.0028186733834445477, 0.01748032122850418, -0.009689189493656158, -0.008382143452763557, 0.0018952167592942715, 0.006853467784821987, -0.016366489231586456, 0.03718830272555351, 0.0205831341445446, 0.029823381453752518, 0.0032278355211019516, -0.03684733435511589, -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_add_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertEqual([self.foo], definition.get_options()) definition.add_option(self.bar) self.assertEqual([self.foo, self.bar], definition.get_options())
9,716
[ 0.04038277268409729, 0.005634088069200516, 0.02464682050049305, -0.024720871821045876, -0.02900351956486702, 0.023881621658802032, 0.010521489195525646, -0.011940810829401016, 0.017834078520536423, 0.002710595028474927, 0.020586328580975533, -0.017525531351566315, -0.002840185072273016, 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_add_duplicate_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertRaisesRegexp( Exception, 'An option named "foo" already exists.', definition.add_option, self.foo2 ...
9,717
[ 0.027120549231767654, -0.0006706160493195057, 0.033965013921260834, -0.033347468823194504, -0.03674396872520447, 0.03236968815326691, -0.0004233565414324403, 0.01466671098023653, 0.019517017528414726, -0.0034704783465713263, 0.00889651756733656, -0.01744566671550274, -0.0008282188791781664, ...
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_add_duplicate_shortcut_option(self): self.initialize_options() definition = InputDefinition() definition.add_option(self.foo) self.assertRaisesRegexp( Exception, 'An option with shortcut "f" already exists.', definition.add_option, ...
9,718
[ 0.015321898274123669, 0.03198866546154022, 0.020497241988778114, -0.012217892333865166, -0.03170047700405121, 0.0034192088060081005, -0.01374888140708208, -0.012680191546678543, 0.02569659985601902, 0.012776253744959831, 0.013664827682077885, -0.0007666202145628631, -0.007324731908738613, ...
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_get_invalid_option(self): self.initialize_options() definition = InputDefinition([self.foo]) self.assertRaisesRegexp( Exception, 'The "--bar" option does not exist.', definition.get_option, 'bar' )
9,719
[ -0.014820011332631111, -0.0028024238999933004, 0.05385540798306465, -0.03418498858809471, -0.022468261420726776, -0.013427198864519596, 0.0020082765258848667, -0.011166933923959732, 0.047599971294403076, 0.016897011548280716, -0.0017914131749421358, -0.026707787066698074, -0.0009033426176756...
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_options_defaults(self): definition = InputDefinition([ InputOption('foo1', None, InputOption.VALUE_NONE), InputOption('foo2', None, InputOption.VALUE_REQUIRED), InputOption('foo3', None, InputOption.VALUE_REQUIRED, '', 'default'), InputOption('foo4', ...
9,720
[ 0.01113052386790514, -0.014109650626778603, 0.0016670431941747665, -0.05375105142593384, -0.03818352892994881, 0.01743105985224247, -0.003524243365973234, -0.03405078500509262, 0.07139762490987778, 0.022273724898695946, 0.012404575943946838, -0.02179199457168579, 0.011491822078824043, 0.00...
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_synopsis(self): definition = InputDefinition([InputOption('foo')]) self.assertEqual('[--foo]', definition.get_synopsis()) definition = InputDefinition([InputOption('foo', 'f')]) self.assertEqual('[-f|--foo]', definition.get_synopsis()) definition = InputDefinition([I...
9,721
[ -0.004681693855673075, -0.0040364800952374935, 0.00928234588354826, -0.03291523829102516, -0.006950850132852793, -0.026905711740255356, -0.032167162746191025, -0.04658004641532898, 0.0640350952744484, 0.029997749254107475, 0.03730393573641777, -0.025334758684039116, 0.025060463696718216, 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_as_text(self): definition = InputDefinition([ InputArgument('foo', InputArgument.OPTIONAL, 'The foo argument'), InputArgument('baz', InputArgument.OPTIONAL, 'The baz argument', True), InputArgument('bar', InputArgument.OPTIONAL | InputArgument.IS_LIST, ...
9,722
[ -0.015231969766318798, -0.004084641579538584, 0.02241833508014679, -0.04902871698141098, -0.051892850548028946, 0.024605490267276764, -0.05087738484144211, -0.043508756905794144, 0.04814344272017479, 0.006939008831977844, -0.008494752459228039, -0.08670505881309509, -0.00952974520623684, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "guiSecurityBanner"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "guiSecurityBannerT...
class Parameters(AnsibleF5Parameters): api_map = { 'guiSecurityBanner': 'security_banner', 'guiSecurityBannerText': 'banner_text', 'guiSetup': 'gui_setup', 'lcdDisplay': 'lcd_display', 'mgmtDhcp': 'mgmt_dhcp', 'netReboot': 'net_reboot', 'quietBoot': 'quiet_boo...
9,723
[ 0.038615476340055466, 0.002109190681949258, 0.05261220410466194, -0.010020384564995766, 0.026886994019150734, -0.005483895540237427, -0.018201276659965515, -0.028214747086167336, 0.03383003547787666, 0.0024048229679465294, -0.01763421669602394, -0.01176305953413248, -0.02565605565905571, 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 UsableChanges(Changes): @property def security_banner(self): if self._values['security_banner'] is None: return None if self._values['security_banner'] == 'yes': return 'enabled' return 'disabled' @property def gui_setup(self): if self._valu...
9,724
[ 0.045249342918395996, 0.007110800594091415, 0.07183697819709778, -0.011630432680249214, 0.01373120117932558, 0.014924065209925175, -0.027966056019067764, -0.03395688906311989, 0.022280065342783928, 0.02579239010810852, -0.017429081723093987, -0.019006313756108284, -0.02809859625995159, 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 ReportableChanges(Changes): @property def security_banner(self): return flatten_boolean(self._values['security_banner']) @property def gui_setup(self): return flatten_boolean(self._values['gui_setup']) @property def lcd_display(self): return flatten_boolean(self._...
9,725
[ 0.021934479475021362, -0.021837899461388588, -0.03382460027933121, 0.007844474166631699, 0.07468883693218231, -0.013070546090602875, -0.009314642287790775, -0.022256415337324142, -0.0011596353724598885, -0.0072971852496266365, -0.02114037424325943, -0.06091003492474556, 0.0032327603548765182...
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": "want", "annotation": n...
class Difference(object): def __init__(self, want, have=None): self.want = want self.have = have def compare(self, param): try: result = getattr(self, param) return result except AttributeError: return self.__default(param) def __default(...
9,726
[ 0.01630350761115551, 0.007125146221369505, -0.04328862205147743, 0.005444687325507402, 0.03842445835471153, -0.025714078918099403, -0.0032631459180265665, 0.00836563017219305, 0.005783834494650364, -0.008707833476364613, -0.027669521048665047, -0.011812099255621433, -0.006709614302963018, ...
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": "param", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __default(self, param): want = getattr(self.want, param) try: have = getattr(self.have, param) if want != have: return want except AttributeError: return want
9,727
[ -0.012362390756607056, 0.06786894798278809, -0.006636584643274546, -0.029628975316882133, -0.0035284720361232758, 0.04203594848513603, 0.0008853025501593947, -0.01588449440896511, 0.02810039557516575, 0.03352685272693634, 0.010216009803116322, -0.03925902768969536, -0.058289848268032074, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class ModuleManager(object): def __init__(self, *args, **kwargs): self.module = kwargs.get('module', None) self.client = kwargs.get('client', None) self.want = ModuleParameters(params=self.module.params) self.have = ApiParameters() self.changes = UsableChanges() def _set...
9,728
[ 0.003059339476749301, 0.0030374201014637947, 0.0025755444075912237, 0.013314546085894108, 0.017986536026000977, 0.016946924850344658, 0.033317681401968, -0.021856898441910744, 0.018487554043531418, 0.030737439170479774, 0.016896823421120644, -0.05506185069680214, -0.03990606218576431, 0.05...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _update_changed_options(self): diff = Difference(self.want, self.have) updatables = Parameters.updatables changed = dict() for k in updatables: change = diff.compare(k) if change is None: continue else: if isinstance...
9,729
[ 0.04779284447431564, 0.024340549483895302, 0.02289714105427265, -0.02235431969165802, -0.00037029740633443, 0.055762432515621185, -0.0038675935938954353, 0.010646676644682884, 0.018307842314243317, -0.0010563402902334929, 0.03222377598285675, -0.05778567120432854, 0.006723567843437195, -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 exec_module(self): result = dict() changed = self.present() reportable = ReportableChanges(params=self.changes.to_return()) changes = reportable.to_return() result.update(**changes) result.update(dict(changed=changed)) self._announce_deprecations(result) ...
9,730
[ 0.04488178715109825, 0.015050110407173634, -0.01556384563446045, -0.0063224476762115955, 0.059499893337488174, 0.05819220468401909, 0.03652191162109375, 0.0071455915458500385, 0.015178544446825981, 0.00023898910149000585, -0.0009143613278865814, -0.010455681942403316, -0.05730484426021576, ...
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 update(self): self.have = self.read_current_from_device() if not self.should_update(): return False if self.module.check_mode: return True self.update_on_device() return True
9,731
[ -0.0041068969294428825, 0.025203652679920197, -0.03649544715881348, -0.0006727688596583903, 0.03086114302277565, 0.0090427091345191, -0.031069820746779442, -0.006712472531944513, 0.041828326880931854, -0.010254200547933578, -0.013251046650111675, -0.03477964922785759, -0.026780331507325172, ...
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 read_current_from_device(self): uri = "https://{0}:{1}/mgmt/tm/sys/global-settings/".format( self.client.provider['server'], self.client.provider['server_port'], ) resp = self.client.api.get(uri) try: response = resp.json() except ValueErro...
9,732
[ 0.01821821928024292, 0.02669600397348404, -0.013227749615907669, 0.014249893836677074, 0.0005877329385839403, 0.02082769200205803, -0.0001268285559490323, -0.010359732434153557, 0.014153691940009594, -0.003556460840627551, -0.013119522482156754, 0.006247105076909065, -0.028163081035017967, ...
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 update_on_device(self): params = self.changes.api_params() uri = "https://{0}:{1}/mgmt/tm/sys/global-settings/".format( self.client.provider['server'], self.client.provider['server_port'], ) resp = self.client.api.patch(uri, json=params) try: ...
9,733
[ 0.029221558943390846, 0.017916439101099968, -0.020610373467206955, 0.019445747137069702, -0.029174502938985825, -0.003085085889324546, -0.018822260200977325, -0.016504768282175064, 0.05853722617030144, 0.06390157341957092, 0.005405517760664225, -0.02943330816924572, 0.01624596305191517, 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 ArgumentSpec(object): def __init__(self): self.supports_check_mode = True self.states = ['present'] argument_spec = dict( security_banner=dict( type='bool' ), banner_text=dict(), gui_setup=dict( type='bool'...
9,734
[ 0.025937354192137718, 0.0433807373046875, 0.010315733961760998, -0.01600874401628971, -0.02769080176949501, 0.045862890779972076, -0.03868969529867172, 0.004554408136755228, 0.06526466459035873, 0.042287677526474, 0.014904300682246685, -0.07396358996629715, -0.001035416265949607, 0.0075033...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): spec = ArgumentSpec() module = AnsibleModule( argument_spec=spec.argument_spec, supports_check_mode=spec.supports_check_mode ) client = F5RestClient(**module.params) try: mm = ModuleManager(module=module, client=client) results = mm.exec_module() ...
9,735
[ 0.02255718596279621, 0.018797654658555984, -0.005382395349442959, 0.029148897156119347, -0.021065905690193176, 0.02043931744992733, 0.007788495160639286, 0.017206119373440742, 0.05188152939081192, 0.09443941712379456, 0.014774956740438938, -0.01283253263682127, 0.014712298288941383, -0.004...
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 __init__(self): self.supports_check_mode = True self.states = ['present'] argument_spec = dict( security_banner=dict( type='bool' ), banner_text=dict(), gui_setup=dict( type='bool' ), lcd_...
9,736
[ 0.010482086800038815, 0.05965200066566467, 0.02991417795419693, -0.06053377315402031, -0.03405851498246193, -0.027334989979863167, 0.0075832549482584, 0.023631539195775986, 0.006536148488521576, -0.006833747494965792, 0.03513868898153305, 0.010052221827208996, -0.018506228923797607, -0.037...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "target_list", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "target_dicts", "annotation": null, "type_comment": null}},...
def GenerateOutput(target_list, target_dicts, data, params): output_files = {} for qualified_target in target_list: [input_file, target] = \ gyp.common.ParseQualifiedTarget(qualified_target)[0:2] if input_file[-4:] != '.gyp': continue input_file_stem = input_file[:-4] output_file = in...
9,737
[ 0.0038596910890191793, 0.013946350663900375, 0.0576968677341938, -0.0005008408334106207, -0.01530643180012703, -0.013799314387142658, 0.00602111779153347, -0.052844684571027756, -0.005554279312491417, 0.016585644334554672, 0.026245899498462677, -0.05910841003060341, -0.0003691978345159441, ...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Lot.planning_district' db.add_column(u'lots_lot', 'planning_district', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['b...
9,738
[ 0.01872633956372738, 0.0450921393930912, 0.04352012276649475, -0.020960262045264244, -0.030006268993020058, 0.031137019395828247, 0.003936943598091602, 0.018933182582259178, -0.008066942915320396, 0.02705528400838375, -0.0020994734950363636, -0.07314027845859528, 0.054220885038375854, 0.02...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Address (Aux) Mass Edit"}}, "targets": [{"_type": "Name", "_fields": {"id": "_description", "ctx": {"_type": "Store", "_fields": {}}}}], ...
class AddressAuxMassEdit(models.TransientModel): _description = 'Address (Aux) Mass Edit' _name = 'clv.address_aux.mass_edit' address_aux_ids = fields.Many2many( comodel_name='clv.address_aux', relation='clv_address_aux_mass_edit_rel', string='Addresses (Aux)' ) global_tag_...
9,739
[ 0.0429522767663002, -0.0006029015639796853, 0.0446646623313427, 0.002629221649840474, -0.016553036868572235, 0.028425561264157295, -0.0025257652159780264, 0.02307436242699623, 0.014883464202284813, 0.026984304189682007, 0.023516729474067688, -0.04101157560944557, 0.04820358753204346, -0.01...
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 do_address_aux_mass_edit(self): self.ensure_one() for address_aux in self.address_aux_ids: _logger.info(u'%s %s', '>>>>>', address_aux.name) if self.global_tag_ids_selection == 'add': m2m_list = [] for global_tag_id in self.global_tag_ids: ...
9,740
[ 0.023368585854768753, 0.02100522071123123, 0.006819518748670816, 0.021038353443145752, -0.0007123221876099706, -0.014257487840950489, -0.004146929830312729, -0.0009973890846595168, 0.06599748134613037, 0.014975331723690033, -0.0032496247440576553, -0.031386349350214005, -0.01716199517250061,...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "m", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def handle_match(m): name = m.group(1) if name in HTML_ENTITIES: return unichr(HTML_ENTITIES[name]) try: if name[:2] in ('#x', '#X'): return unichr(int(name[2:], 16)) elif name.startswith('#'): re...
9,741
[ -0.016982678323984146, 0.03272321820259094, 0.015506367199122906, -0.0469161793589592, -0.012034488841891289, -0.030096402391791344, 0.019945485517382622, -0.0160052590072155, 0.003958043642342091, -0.04054258391261101, -0.020077843219041824, 0.018245181068778038, 0.051558926701545715, 0.0...
9
{"_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 make_simple_escaping_wrapper(name): orig = getattr(text_type, name) def func(self, *args, **kwargs): args = _escape_argspec(list(args), enumerate(args), self.escape) _escape_argspec(kwargs, iteritems(kwargs), self.escape) return self.__class__(orig(self, *args, **...
9,742
[ 0.009165354073047638, 0.027691282331943512, -0.006242051720619202, -0.05053709074854851, 0.0021812140475958586, -0.008709839545190334, 0.006096887402236462, 0.03343777358531952, -0.01680898852646351, -0.0022675616201013327, -0.009505738504230976, -0.007313261739909649, -0.00658243615180254, ...
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": "escape", "annotation":...
class EscapeFormatter(string.Formatter): def __init__(self, escape): self.escape = escape def format_field(self, value, format_spec): if hasattr(value, '__html_format__'): rv = value.__html_format__(format_spec) elif hasattr(value, '__html__'): ...
9,743
[ -0.0005129411001689732, 0.017296181991696358, -0.015426583588123322, -0.03627979755401611, 0.04283777251839638, -0.04962585121393204, 0.003957316745072603, -0.02749747782945633, 0.03323091194033623, 0.028705526143312454, 0.01077655702829361, 0.012502339668571949, -0.0010870036203414202, 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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar...
def format_field(self, value, format_spec): if hasattr(value, '__html_format__'): rv = value.__html_format__(format_spec) elif hasattr(value, '__html__'): if format_spec: raise ValueError('No format specification allowed ' ...
9,744
[ -0.027082253247499466, -0.02282862737774849, 0.03601738065481186, -0.018373647704720497, 0.04185668006539345, 0.00293852505274117, -0.002549972850829363, 0.06403090059757233, 0.030756982043385506, 0.021456895396113396, 0.028894448652863503, -0.006657300982624292, -0.0401703305542469, 0.011...
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_quantile_box(self): cases = [[pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02'), pd.Timestamp('2011-01-03')], [pd.Timestamp('2011-01-01', tz='US/Eastern'), pd.Timestamp('2011-01-02', tz='US/Eastern'), pd.Timestamp('2011-01-03',...
9,745
[ 0.007139560300856829, -0.022376803681254387, 0.03283579647541046, -0.0007313413079828024, 0.0409705676138401, -0.0318714901804924, 0.001593265449628234, 0.0700233206152916, 0.027890644967556, 0.02845933847129345, 0.006731585133820772, -0.030066510662436485, -0.04148980602622032, 0.03592651...
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_quantile_nan(self): # GH 13098 s = pd.Series([1, 2, 3, 4, np.nan]) result = s.quantile(0.5) expected = 2.5 self.assertEqual(result, expected) # all nan/empty cases = [Series([]), Series([np.nan, np.nan])] for s in cases: res = s.qua...
9,746
[ 0.0007167573203332722, -0.01370745338499546, 0.06568720191717148, -0.034743644297122955, 0.06682229042053223, -0.008920331485569477, -0.008796952664852142, 0.05976498872041702, 0.02196153625845909, 0.0396047942340374, 0.005752565339207649, -0.03536054119467735, -0.03612549230456352, 0.0149...
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_quantile_empty(self): # floats s = Series([], dtype='float64') res = s.quantile(0.5) self.assertTrue(np.isnan(res)) res = s.quantile([0.5]) exp = Series([np.nan], index=[0.5]) tm.assert_series_equal(res, exp) # int s = Series([], dtype...
9,747
[ -0.020548135042190552, -0.031996555626392365, -0.012216978706419468, 0.02938961237668991, 0.012665816582739353, -0.0463593453168869, -0.010360145941376686, 0.023314939811825752, -0.0059301843866705894, -0.00766712287440896, 0.0026991714257746935, -0.05376208573579788, -0.0017323270440101624,...
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": "offer", "annotation": ...
class Negotiator(BaseNegotiator): # Override the make_offer method from BaseNegotiator to accept a given offer 5% # of the time, and return a random permutation the rest of the time. def make_offer(self, offer): if random() < 0.05 and offer: # Very important - we save the offer we're ...
9,748
[ 0.03241763263940811, 0.018618950620293617, 0.052943501621484756, -0.033238667994737625, -0.020698022097349167, -0.00276933703571558, -0.000977461808361113, 0.0000037697145671700127, -0.008415606804192066, -0.0011959630064666271, 0.01804952323436737, -0.04915614798665047, -0.00328248389996588...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CreditCourse' db.create_table('credit_creditcourse', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('course_key', self.gf('xmodule_django.models.CourseKeyField')(unique=Tru...
9,749
[ 0.02395561710000038, -0.07241006195545197, -0.000178029018570669, 0.051251985132694244, 0.04060504585504532, -0.03408650681376457, 0.015345718711614609, 0.015956832095980644, -0.0008211826789192855, 0.010456817224621773, 0.022896355018019676, -0.057960644364356995, -0.009268542751669884, -...
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": "offer", "annotation": null, "type_comment": null}}], "kwarg": nul...
def make_offer(self, offer): if random() < 0.05 and offer: # Very important - we save the offer we're going to return as self.offer self.offer = offer[:] return offer else: ordering = self.preferences shuffle(ordering) self.offer = ...
9,750
[ 0.07344082742929459, 0.01574081741273403, 0.07495860010385513, -0.007680686190724373, -0.028348157182335854, 0.02248513139784336, 0.010030792094767094, 0.035520877689123154, -0.015202250331640244, -0.002541358582675457, 0.043697290122509, -0.06320806592702866, -0.001147512928582728, 0.0278...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def backwards(self, orm): # Removing unique constraint on 'CreditEligibility', fields ['username', 'course'] db.delete_unique('credit_crediteligibility', ['username', 'course_id']) # Removing unique constraint on 'CreditRequirement', fields ['namespace', 'name', 'course'] db.delete_uniq...
9,751
[ 0.020959964022040367, 0.0032153790816664696, 0.05956912785768509, -0.017624584957957268, -0.012553824111819267, 0.0038707624189555645, 0.01110151968896389, 0.014572282321751118, 0.007446140982210636, -0.013587668538093567, 0.01257228571921587, -0.02609226293861866, 0.012676901184022427, -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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding model 'CreditCourse' db.create_table('credit_creditcourse', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('course_key', self.gf('xmodule_django.models.CourseKeyField')(unique=True, max_length=255, db_index=True)), ...
9,752
[ 0.0023521052207797766, -0.01168789528310299, -0.010458767414093018, -0.04701975733041763, 0.023800399154424667, 0.0031733866780996323, -0.03381220996379852, -0.05805956572294235, 0.05157870426774025, -0.011933721601963043, 0.002233382547274232, -0.035912901163101196, 0.009492225013673306, ...
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 testJsFunctionNameToClassName(self): self.assertEquals('FooBar', JsFunctionNameToClassName('foo', 'bar')) self.assertEquals('FooBar', JsFunctionNameToClassName('experimental.foo', 'bar')) self.assertEquals('FooBarBaz', JsFunctionNameToClassName('foo.bar', 'baz...
9,753
[ 0.0268683023750782, 0.0025084514636546373, -0.009972487576305866, -0.038596704602241516, 0.030636552721261978, 0.015318276360630989, -0.03529669716954231, -0.03081493265926838, 0.04869740456342697, 0.017715241760015488, 0.021817952394485474, -0.04584334418177605, -0.001774032600224018, 0.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 SchemaUtilTest(unittest.TestCase): def testStripNamespace(self): self.assertEquals('Bar', StripNamespace('foo.Bar')) self.assertEquals('Baz', StripNamespace('Baz')) def testJsFunctionNameToClassName(self): self.assertEquals('FooBar', JsFunctionNameToClassName('foo', 'bar')) self.assertEquals(...
9,754
[ 0.020856989547610283, -0.026422599330544472, 0.0017085091676563025, -0.0252841804176569, -0.027251821011304855, 0.02612745389342308, -0.0024156300351023674, 0.037469495087862015, 0.013169136829674244, 0.013871865347027779, -0.0047328779473900795, -0.021039698272943497, 0.03218497708439827, ...
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": "dut", "annotation": nu...
class TB: def __init__(self, dut, speed=1000e6): self.dut = dut self.log = SimLog("cocotb.tb") self.log.setLevel(logging.DEBUG) cocotb.start_soon(Clock(dut.clk, 8, units="ns").start()) # Ethernet self.gmii_phy = GmiiPhy(dut.phy_txd, dut.phy_tx_er, dut.phy_tx_en, du...
9,755
[ 0.02339067868888378, -0.011333908885717392, -0.012363644316792488, -0.02304970659315586, -0.020485596731305122, 0.012084047310054302, 0.0026953835040330887, 0.03385169804096222, 0.04069841653108597, 0.007228606380522251, -0.0024805711582303047, -0.014416296035051346, 0.007521842140704393, ...
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": "dut", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def __init__(self, dut, speed=1000e6): self.dut = dut self.log = SimLog("cocotb.tb") self.log.setLevel(logging.DEBUG) cocotb.start_soon(Clock(dut.clk, 8, units="ns").start()) # Ethernet self.gmii_phy = GmiiPhy(dut.phy_txd, dut.phy_tx_er, dut.phy_tx_en, dut.phy_tx_clk, ...
9,756
[ 0.003124628681689501, 0.007454367820173502, 0.05452585220336914, -0.021114695817232132, -0.0015686284750699997, 0.04295101389288902, 0.015529331751167774, 0.040901605039834976, 0.010340861044824123, 0.041738688945770264, 0.012325325049459934, -0.009388318285346031, -0.04121911898255348, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_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...
async def init(self): self.dut.rst.setimmediatevalue(0) for k in range(10): await RisingEdge(self.dut.clk) self.dut.rst <= 1 for k in range(10): await RisingEdge(self.dut.clk) self.dut.rst <= 0
9,757
[ -0.013513489626348019, 0.0020647384226322174, 0.0362064354121685, -0.0432891920208931, -0.005912950728088617, 0.019087644293904305, 0.0007954516913741827, 0.04546260088682175, 0.02278243936598301, 0.02251395955681801, 0.004129476845264435, 0.017195500433444977, 0.02175965905189514, -0.0251...
10
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dut", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
async def run_test(dut): tb = TB(dut) await tb.init() tb.log.info("test UDP RX packet") payload = bytes([x % 256 for x in range(256)]) eth = Ether(src='5a:51:52:53:54:55', dst='02:00:00:00:00:00') ip = IP(src='192.168.1.100', dst='192.168.1.128') udp = UDP(sport=5678, dport=1234) tes...
9,758
[ -0.01696600951254368, 0.008959125727415085, 0.014887170866131783, -0.05286957323551178, 0.013572807423770428, 0.014256812632083893, -0.060514338314533234, 0.03090093843638897, 0.011359849944710732, 0.0083086509257555, 0.014954229816794395, -0.04042336344718933, 0.008570182137191296, -0.050...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def test_fpga_core(request): dut = "fpga_core" module = os.path.splitext(os.path.basename(__file__))[0] toplevel = dut verilog_sources = [ os.path.join(rtl_dir, f"{dut}.v"), os.path.join(eth_rtl_dir, "iddr.v"), os.path.join(eth_rtl_dir, "oddr.v"), os.path.join(eth_rtl_di...
9,759
[ -0.026262549683451653, 0.023972682654857635, -0.0313691571354866, -0.036597348749637604, 0.00386541779153049, -0.024864312261343002, -0.004303633701056242, -0.014134358614683151, -0.048634350299835205, 0.025654619559645653, -0.045959461480379105, -0.028451096266508102, 0.05588897690176964, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "type_", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "trans", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _transform_type(type_, trans): if isinstance(trans, str): return trans elif isinstance(trans, dict): if type_ in trans: return _transform_type(type_, trans[type_]) elif None in trans: return _transform_type(type_, trans[None]) else: return ...
9,760
[ 0.014202159829437733, -0.009196382015943527, 0.05845106765627861, -0.036423228681087494, 0.017861390486359596, 0.016617493703961372, 0.009498298168182373, 0.01932266727089882, 0.019878193736076355, 0.021049629896879196, -0.00043400522554293275, 0.0033301408402621746, -0.0245035570114851, 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 testInvalidSecondGradient(self): inputs = np.random.randn(2, 2, 3).astype(np.float32) inputs_t = constant_op.constant(inputs) labels = SimpleSparseTensorFrom([[0, 1], [1, 0]]) seq_lens = np.array([2, 2], dtype=np.int32) v = [1.0] with self.test_session(use_gpu=False): loss = ctc_ops.c...
9,761
[ 0.01923244632780552, 0.03867584839463234, 0.038839928805828094, -0.018236249685287476, 0.01903320662677288, 0.036402180790901184, 0.021810835227370262, -0.0017404132522642612, -0.014380384236574173, 0.03262835368514061, 0.002650174777954817, 0.0245415847748518, 0.01573989912867546, 0.03227...
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": "inputs", "annotation": null, "type_comment": null}}, {"_type": "a...
def _testCTCLoss(self, inputs, seq_lens, labels, loss_truth, grad_truth, expected_err_re=None): self.assertEquals(len(inputs), len(grad_truth)) inputs_t = constant_op.constant(inputs) with sel...
9,762
[ 0.0043181381188333035, -0.027310898527503014, 0.043758705258369446, -0.012123777531087399, -0.0002847953583113849, -0.014598017558455467, 0.006085452623665333, 0.02455388940870762, 0.018380070105195045, 0.030067909508943558, 0.002963197184726596, 0.003923438023775816, 0.014444850385189056, ...
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 testEmptyBatch(self): inputs = constant_op.constant([], dtype=dtypes.float32, shape=(1, 0, 2)) sequence_lengths = constant_op.constant([], dtype=dtypes.int32) labels = sparse_tensor.SparseTensor( indices=constant_op.constant([], shape=(0, 2), dtype=dtypes.int64), values=constant_op.const...
9,763
[ 0.02926008403301239, 0.05501434952020645, 0.0738019347190857, -0.02057419903576374, -0.0010435984004288912, -0.006977923214435577, 0.027507174760103226, 0.03287826478481293, -0.029979225248098373, 0.0002821437956299633, -0.02307995781302452, 0.007725156378000975, 0.00036624266067519784, 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 = [ ('users', '0001_initial'), ] operations = [ migrations.AlterModelManagers( name='user', managers=[ ('objects', django.contrib.auth.models.UserManager()), ], ), migrat...
9,764
[ -0.03618843853473663, -0.03354229778051376, 0.025481363758444786, -0.017653195187449455, -0.026338910683989525, -0.01158912107348442, -0.020434094592928886, -0.0008751562563702464, -0.010168044827878475, -0.0042816041968762875, 0.06399742513895035, -0.028176508843898773, -0.04875761270523071...
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): super(HostFiltersTestCase, self).setUp() self.stubs = stubout.StubOutForTesting() stub_out_https_backend(self.stubs) self.context = context.RequestContext('fake', 'fake') self.json_query = jsonutils.dumps( ['and', ['>=', '$free_capacity_gb', 1024]...
9,765
[ 0.004061592742800713, 0.0012754392810165882, 0.002765029901638627, -0.048529334366321564, 0.017073841765522957, -0.010873647406697273, 0.0031962464563548565, -0.04470665752887726, 0.019894229248166084, 0.01687571406364441, 0.02227174863219261, -0.01692233234643936, -0.05267833545804024, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f1name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "f2name", "annotation": null, "type_comment": null}}], "kwarg": ...
def fcompare(f1name, f2name): f1 = fopen(f1name) f2 = fopen(f2name) if not f1 or not f2: return 0 a = f1.readlines(); f1.close() b = f2.readlines(); f2.close() for line in difflib.ndiff(a, b): print(line, end=' ') return 1
9,766
[ 0.019146403297781944, 0.021222811192274094, 0.028514379635453224, -0.047781504690647125, 0.01132969744503498, 0.01388295367360115, -0.052972521632909775, 0.004167904146015644, 0.007152738980948925, 0.019170548766851425, 0.05147557705640793, -0.009259326383471489, -0.02109001763164997, 0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_capacity_filter_passes(self): self._stub_service_is_up(True) filt_cls = self.class_map['CapacityFilter']() filter_properties = {'size': 100} service = {'disabled': False} host = fakes.FakeHostState('host1', {'free_capacity_gb': 200, ...
9,767
[ 0.006751917768269777, 0.02570551633834839, 0.03853416070342064, -0.042971134185791016, -0.004132535308599472, 0.014179027639329433, -0.052568502724170685, 0.01288892887532711, 0.00408732146024704, 0.013118011876940727, 0.05208622291684151, -0.017916696146130562, -0.016903908923268318, 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_capacity_filter_fails(self): self._stub_service_is_up(True) filt_cls = self.class_map['CapacityFilter']() filter_properties = {'size': 100} service = {'disabled': False} host = fakes.FakeHostState('host1', {'free_capacity_gb': 120, ...
9,768
[ 0.007163308560848236, 0.014962789602577686, 0.012946121394634247, -0.0430561900138855, 0.005547428969293833, 0.0034321534913033247, -0.06000383943319321, 0.007220563944429159, 0.016171518713235855, 0.014224829152226448, 0.039111919701099396, -0.002506521763280034, -0.01222088374197483, 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_capacity_filter_passes_unknown(self): self._stub_service_is_up(True) filt_cls = self.class_map['CapacityFilter']() filter_properties = {'size': 100} service = {'disabled': False} host = fakes.FakeHostState('host1', {'free_capacity_gb': ...
9,769
[ 0.020106205716729164, 0.008122415281832218, 0.030399106442928314, -0.02882504276931286, 0.010913918726146221, -0.0018522918689996004, -0.051304642111063004, -0.001132126897573471, -0.0006544508505612612, 0.021483510732650757, 0.06886529177427292, -0.028210174292325974, -0.034358859062194824,...
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_capacity_filter_passes_infinite(self): self._stub_service_is_up(True) filt_cls = self.class_map['CapacityFilter']() filter_properties = {'size': 100} service = {'disabled': False} host = fakes.FakeHostState('host1', {'free_capacity_gb':...
9,770
[ 0.0247211791574955, 0.005521467421203852, 0.05685209482908249, -0.011197304353117943, 0.007635778747498989, 0.01833689585328102, 0.009427567943930626, -0.013286806643009186, 0.0011701761977747083, 0.030631326138973236, 0.03100622445344925, -0.0027938128914684057, 0.026441296562552452, 0.01...
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 CreateCommandTest(unittest.TestCase): def testHasDnsGivesDnsPort(self): expected_cmd_line = [ sys.executable, 'replay.py', '--host=127.0.0.1', '--port=2', '--ssl_port=1', '--dns_port=0', '--use_closest_match', '--log_level=warning', '--extra_arg', 'foo.wpr'] cmd_line = webpagerep...
9,771
[ -0.008475803770124912, -0.008810972794890404, 0.01523599587380886, -0.031949009746313095, 0.04458318278193474, 0.027268001809716225, -0.012895492836833, -0.0436515249311924, 0.018621772527694702, 0.038629669696092606, -0.002550694392994046, -0.028767742216587067, 0.004271986894309521, 0.01...
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 ParseLogFilePortsTest(unittest.TestCase): def testEmptyLinesGivesEmptyDict(self): log_lines = iter([]) self.assertEqual( {}, webpagereplay.ReplayServer._ParseLogFilePorts(log_lines)) def testSingleMatchGivesSingleElementDict(self): log_lines = iter([ 'extra stuff', '20...
9,772
[ 0.020429221913218498, -0.02456994354724884, 0.04435061663389206, -0.03035697527229786, 0.015353096649050713, 0.015378040261566639, 0.019082240760326385, -0.013532176613807678, 0.004115777090191841, 0.025255905464291573, -0.008562063798308372, -0.06300880759954453, 0.040160007774829865, -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 testSingleMatchGivesSingleElementDict(self): log_lines = iter([ 'extra stuff', '2014-09-27 17:04:27,11 WARNING HTTP server started on 127.0.0.1:5167', 'extra stuff', ]) self.assertEqual( {'http': 5167}, webpagereplay.ReplayServer._ParseLogFilePorts(log_lines))
9,773
[ -0.008630122989416122, -0.03294792026281357, 0.03766563534736633, -0.0325167290866375, 0.0113504184409976, 0.03621988371014595, -0.0009456039988435805, 0.001582876080647111, 0.013658547773957253, 0.004521144088357687, -0.015002843923866749, -0.028357023373246193, -0.00379192759282887, 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 testUnknownProtocolSkipped(self): log_lines = iter([ '2014-09-27 17:04:27,11 WARNING FOO server started on 127.0.0.1:1111', '2014-09-27 17:04:27,12 WARNING HTTP server started on 127.0.0.1:5167', ]) self.assertEqual( {'http': 5167}, webpagereplay.ReplayServer._ParseLo...
9,774
[ -0.002916287165135145, 0.02093343809247017, 0.020438434556126595, -0.022874372079968452, 0.028423622250556946, 0.02868415042757988, 0.0020011819433420897, -0.025401495397090912, 0.015905244275927544, 0.06877943128347397, 0.001388126634992659, -0.008851444348692894, 0.01809368096292019, -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 testTypicalLogLinesGiveFullDict(self): log_lines = iter([ 'extra', '2014-09-27 17:04:27,11 WARNING DNS server started on 127.0.0.1:2345', '2014-09-27 17:04:27,12 WARNING HTTP server started on 127.0.0.1:3456', '2014-09-27 17:04:27,13 WARNING HTTPS server started on 127.0.0.1:4567...
9,775
[ 0.010343183763325214, 0.011021705344319344, 0.056015126407146454, -0.005952747538685799, -0.04269556701183319, -0.02912512794137001, -0.012065147049725056, -0.050404489040374756, -0.035055067390203476, -0.02946723997592926, -0.026365425437688828, -0.07339441031217575, -0.008507182821631432, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo...
class City(models.Model): name = models.CharField(max_length=30) point = models.PointField() objects = models.GeoManager() class Meta: app_label = 'geoadmin' def __str__(self): return self.name
9,776
[ 0.054439276456832886, 0.003306823782622814, 0.017565928399562836, -0.023052135482430458, 0.03152807429432869, -0.005657336208969355, 0.01176766213029623, 0.007076703477650881, 0.004575194325298071, 0.053432635962963104, -0.027602164074778557, 0.021803896874189377, 0.006367019843310118, -0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): parser = ArgumentParser(description="""\ Send the contents of a directory as a MIME message. Unless the -o option is given, the email is sent by forwarding to your local SMTP server, which then does the normal delivery process. Your local machine must be running an SMTP server. """) parser.add_argu...
9,777
[ 0.0026336507871747017, -0.042552389204502106, 0.004398496355861425, -0.014924928545951843, 0.017888126894831657, -0.025448637083172798, -0.023770945146679878, -0.013704787939786911, 0.009298121556639671, -0.00013830410898663104, -0.004082567058503628, -0.037192486226558685, -0.00955413281917...
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 FakeConnection(object): def __init__(self): self.requests = [] self.headers = [] self.body = '' def __call__(self, netloc): return self def connect(self): pass endheaders = connect def putrequest(self, method, url): self.requests.append((meth...
9,778
[ -0.019599704071879387, 0.01698077842593193, 0.03719599172472954, 0.019720392301678658, 0.009552442468702793, -0.04856478422880173, -0.0006675546173937619, 0.011175693944096565, -0.005020614247769117, 0.027420276775956154, -0.03478223457932472, -0.01735491119325161, 0.02086692675948143, 0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def default_get(self, cr, uid, fields_list, context=None): if context is None: context = {} defaults = super(attach_mail_manually, self).default_get( cr, uid, fields_list, context ) for folder in self.pool.get('fetchmail.server.folder').browse( c...
9,779
[ -0.023304099217057228, 0.05184122547507286, 0.023890981450676918, -0.016958439722657204, 0.004242666531354189, -0.04264674708247185, -0.0332077294588089, -0.008057398721575737, -0.011762090027332306, 0.03927217423915863, -0.010973467491567135, -0.03130036219954491, 0.041448529809713364, 0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "fetchmail.attach.mail.manually"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], ...
class attach_mail_manually(models.TransientModel): _name = 'fetchmail.attach.mail.manually' folder_id = fields.Many2one( 'fetchmail.server.folder', 'Folder', readonly=True) mail_ids = fields.One2many( 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails') def default_get(self, c...
9,780
[ 0.007150496821850538, 0.034545257687568665, 0.024214182049036026, 0.013708988204598427, 0.00382772134616971, -0.04773188754916191, 0.0020183322485536337, 0.026489341631531715, 0.010748961009085178, 0.052700091153383255, 0.012374074198305607, -0.042856547981500626, 0.01845663972198963, 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}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def attach_mails(self, cr, uid, ids, context=None): for this in self.browse(cr, uid, ids, context): for mail in this.mail_ids: connection = this.folder_id.server_id.connect() connection.select(this.folder_id.path) result, msgdata = connection.fetch(mai...
9,781
[ 0.0019342812011018395, 0.0401013046503067, 0.00734420120716095, -0.007823798805475235, 0.013821659609675407, -0.061342284083366394, -0.0036287636030465364, -0.017508206889033318, -0.03265887126326561, 0.03924611955881119, 0.01587872952222824, -0.03684234991669655, 0.027550866827368736, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): result = super(attach_mail_manually, self).fields_view_get( cr, user, view_id, view_type, context, toolbar, submenu) tree = result['fields']['mail_ids']['...
9,782
[ 0.015374403446912766, 0.06386826932430267, 0.019767090678215027, -0.024543266743421555, -0.004392686765640974, -0.03474638611078262, -0.020464342087507248, -0.013538307510316372, -0.007704633288085461, 0.014375009573996067, -0.04060330241918564, -0.01430528424680233, 0.043113406747579575, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "fetchmail.attach.mail.manually.mail"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}...
class attach_mail_manually_mail(models.TransientModel): _name = 'fetchmail.attach.mail.manually.mail' wizard_id = fields.Many2one( 'fetchmail.attach.mail.manually', readonly=True) msgid = fields.Char('Message id', readonly=True) subject = fields.Char('Subject', readonly=True) date = fields....
9,783
[ -0.005939344875514507, -0.007990577258169651, 0.022399814799427986, -0.055683963000774384, 0.025674642994999886, 0.025341205298900604, 0.01302785612642765, -0.0196846853941679, 0.03234338015317917, 0.013277933932840824, 0.02579372748732567, -0.027079841122031212, -0.018029410392045975, -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": "line", "annotation": null, "type_comment": null}}], "kwarg": null...
def parse_line(self, line): self.logger.info('Parsing line %r; counter is %r', line, self.acc) self.acc += 1 res = line.split() res[0] = self.args + ':' + res[0] res[2] = self.acc res[3] = {'metric_type': 'counter'} return tuple(res)
9,784
[ 0.04347015172243118, -0.02226637862622738, 0.04610251262784004, 0.0009546830551698804, -0.012328618206083775, 0.005463956389576197, 0.020104944705963135, -0.008790630847215652, 0.008899305947124958, 0.016917133703827858, 0.011054701171815395, -0.017762387171387672, -0.00955135840922594, -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 setUp(self): TailTestCase.setUp(self) self.config = { 'dogstreams': self.log_file.name, 'check_freq': 5, } log.info("Test config: %s" % self.config) self.dogstream = Dogstreams.init(self.logger, self.config) self.maxDiff = None
9,785
[ 0.04555003345012665, -0.01217360608279705, 0.05048498138785362, -0.03928308188915253, 0.020438557490706444, 0.00841780286282301, -0.0001972069585463032, -0.007757262326776981, 0.015394425950944424, -0.009061967022716999, -0.005336188245564699, 0.005210631061345339, -0.012872360646724701, -...
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 TailTestCase(unittest.TestCase): def setUp(self): self.log_file = NamedTemporaryFile() self.logger = logging.getLogger('test.dogstream') def _write_log(self, log_data): for data in log_data: print >> self.log_file, data self.log_file.flush() def tearDown(s...
9,786
[ 0.06275200843811035, -0.040389034897089005, 0.005375714972615242, -0.06149212270975113, 0.0024455718230456114, 0.046203892678022385, -0.002001886023208499, -0.012829030863940716, 0.023283660411834717, 0.017602059990167618, 0.03559177741408348, 0.022217603400349617, -0.0071232011541724205, ...
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_dogstream_counter(self): log_data = [ # bucket 0 ('test.metric.a', '1000000000', '10', 'metric_type=counter'), ('test.metric.a', '1000000001', '20', 'metric_type=counter'), ('test.metric.a', '1000000002', '3', 'metric_type=counter'), ('test.me...
9,787
[ 0.050336405634880066, -0.005822117906063795, -0.009726658463478088, -0.06706473976373672, 0.008004623465240002, 0.020487800240516663, -0.02775440737605095, -0.04460890218615532, 0.03358283266425133, 0.009285110980272293, 0.031993262469768524, 0.00048727908870205283, -0.010048357769846916, ...
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_dogstream_gauge(self): log_data = [ # bucket 0 ('test.metric.a', '1000000000', '10', 'metric_type=gauge'), ('test.metric.a', '1000000001', '20', 'metric_type=gauge'), ('test.metric.a', '1000000002', '3', 'metric_type=gauge'), ('test.metric.a',...
9,788
[ 0.06868736445903778, 0.004157188814133406, 0.0010433379793539643, -0.05617053806781769, -0.004671180155128241, 0.016783922910690308, -0.016577033326029778, -0.033981624990701675, 0.03928317129611969, 0.011527632363140583, 0.03426609933376312, -0.025615524500608444, -0.028938690200448036, 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_dogstream_bad_input(self): log_data = [ ('test.metric.e1000000000 1metric_type=gauge'), ('1000000001 1 metric_type=gauge tag=staging'), ('test_metric.e 1 1000000002 metric_type=gauge'), ('test_metric.e 1000000002 10 metric_type=gauge'), ] ...
9,789
[ 0.03238539770245552, 0.0020305027719587088, 0.0035060658119618893, -0.04393327981233597, 0.016179867088794708, 0.031974807381629944, -0.013844628818333149, -0.04501108452677727, 0.01194564439356327, 0.028151173144578934, 0.03425871953368187, 0.01651347428560257, 0.000993599183857441, -0.00...
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_dogstream_events(self): log_data = [ '2012-05-14 12:46:01 [ERROR] - host0 is down (broke its collarbone)', '2012-05-14 12:48:07 [ERROR] - host1 is down (got a bloody nose)', '2012-05-14 12:52:03 [RECOVERY] - host0 is up (collarbone healed)', '2012-05-14 1...
9,790
[ 0.06958894431591034, -0.0017226794734597206, 0.005569793749600649, -0.054930951446294785, -0.0027179375756531954, 0.029681218788027763, -0.00011432534665800631, -0.03715630993247032, 0.03477012366056442, 0.03128824010491371, 0.03963989019393921, 0.005152820143848658, -0.005286738742142916, ...
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_dogstream_events_validation(self): log_data = [ {"msg_title": "title", "timestamp": 1336999561}, {"msg_text": "body", "timestamp": 1336999561}, {"none of the above": "should get filtered out", "timestamp": 1336999561}, ] expected_output = { ...
9,791
[ 0.0071828365325927734, 0.001174895209260285, -0.006045014597475529, 0.010062442161142826, 0.025064432993531227, 0.013826420530676842, -0.006497986614704132, 0.01826985739171505, 0.008412331342697144, 0.008067209273576736, 0.004219646565616131, -0.04096158221364021, 0.03408072516322136, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "GET"}}, "targets": [{"_type": "Name", "_fields": {"id": "GET", "ctx": {"_type": "Store", "_fie...
class Request: class Method: GET = "GET" PUT = "PUT" POST = "POST" DELETE = "DELETE" def __init__(self, object_id, method, path, body=None): self.object_id = object_id self.method = method self.path = path self.txid = '*' if hasattr(body,...
9,792
[ 0.056036192923784256, 0.015690132975578308, -0.026718055829405785, 0.042744409292936325, 0.014513373374938965, 0.0018688070122152567, 0.044268593192100525, 0.00881449319422245, 0.01669878512620926, 0.006270450074225664, 0.02192135900259018, -0.015140979550778866, 0.06894692778587341, -0.05...
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": "object_id", "annotation": null, "type_comment": null}}, {"_type":...
def __init__(self, object_id, method, path, body=None): self.object_id = object_id self.method = method self.path = path self.txid = '*' if hasattr(body, "packed_object"): body = body.packed_object() self.body = body
9,793
[ 0.011542197316884995, 0.024372665211558342, 0.0073350113816559315, -0.017049258574843407, 0.03549124300479889, -0.013451389968395233, -0.027227748185396194, -0.036883965134620667, 0.014739658683538437, 0.01815183274447918, 0.004178171046078205, -0.0476311519742012, -0.004851320758461952, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "DATA_NONE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_...
class RawData(models.Model): DATA_NONE = 0 DATA_URLS = 1 DATA_COOKIES = 2 DATA_FBADS = 3 DATA_FB = 4 DATA_FBLISTING = 5 DATA_CHOICES = ( (DATA_NONE, 'none'), (DATA_URLS, 'urls'), (DATA_COOKIES, 'cookies'), (DATA_FBADS, 'fbads'), (DATA_FB, 'fb'), ...
9,794
[ -0.018736669793725014, -0.007802754174917936, 0.01908876746892929, -0.0053349207155406475, 0.0010775156551972032, -0.019466016441583633, -0.0013816722203046083, -0.01466238684952259, -0.02438282035291195, 0.043106917291879654, -0.012178835459053516, -0.06886040419340134, -0.00963240861892700...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "AUTH_USER_MODEL", "value": {"_type": "Name", "_fields": {"id": "setting...
class FBSponsored(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL) date = models.DateTimeField(default=now) actor = models.CharField(max_length=128, null=True) target = models.CharField(max_length=128, null=True) type_id = models.PositiveIntegerField(default=0) text = models.Tex...
9,795
[ 0.013676056638360023, 0.02713767997920513, 0.03130720928311348, -0.046079255640506744, -0.00829140655696392, -0.045245349407196045, -0.021657725796103477, -0.025588996708393097, -0.009524396620690823, -0.006975026801228523, 0.0021056123077869415, -0.013116148300468922, 0.006564030423760414, ...
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": "anon", "annotation": null, "type_comment": null}}], "kwarg": null...
def detail_data(self, anon=True): return {'date': date_to_timestamp(self.date), 'type': 'fbsp', 'id': self.id, 'title': self.title, 'text': self.text, 'images': [i.thumbpath() for i in self.images.all() if i.thu...
9,796
[ 0.013433939777314663, 0.0074762264266610146, 0.023524701595306396, -0.01618930511176586, 0.011309246532619, -0.03438696637749672, -0.014119720086455345, -0.0434245690703392, -0.010360175743699074, 0.018724242225289345, 0.015846416354179382, -0.03830571100115776, 0.018381353467702866, -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}}, {"_type": "arg", "_fields": {"arg": "anon", "annotation": null, "type_comment": null}}], "kwarg": null...
def detail_data(self, anon=True): return {'date': date_to_timestamp(self.date), 'type': 'fbad', 'id': self.id, 'title': self.title, 'text': self.text, 'adid': self.adid, 'images': [i.thumbpath() ...
9,797
[ -0.022274862974882126, -0.01731027290225029, 0.03562542423605919, 0.0007716050604358315, 0.021234093233942986, -0.008254379965364933, 0.007638292387127876, -0.05278018116950989, -0.027036085724830627, 0.054933495819568634, 0.00006350601324811578, -0.08847738057374954, 0.003310724161565304, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "AUTH_USER_MODEL", "value": {"_type": "Name", "_fields": {"id": "setting...
class FBAd(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL) date = models.DateTimeField(default=now) adid = models.CharField(max_length=128) text = models.TextField(null=True) title = models.TextField(null=True) images = models.ManyToManyField('FBAdImage', related_name='ad_image...
9,798
[ 0.011850524693727493, -0.009951886720955372, -0.001032058265991509, -0.008308721706271172, 0.012262768112123013, 0.019648298621177673, 0.024455860257148743, -0.04993361979722977, 0.006375245749950409, 0.03404776006937027, 0.010938946157693863, -0.07445915043354034, 0.0061952522955834866, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "STATUS_NEW", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"...
class FBAdImage(models.Model): STATUS_NEW = 0 STATUS_DONE = 1 STATUS_ERROR = 2 STATUS_NO_MEDIA = 3 STATUS_HAS_MEDIA = 4 STATUS_NO_THUMB = 5 STATUS_NO_DOWNLOAD = 6 STATUS_CHOICES = ( (STATUS_NEW, 'new'), (STATUS_DONE, 'done'), (STATUS_ERROR, 'error'), (STAT...
9,799
[ 0.011016583070158958, -0.011208128184080124, 0.03150096908211708, 0.0008934213547036052, 0.010638965293765068, 0.007880715653300285, 0.018158480525016785, -0.06238899752497673, -0.03868117555975914, 0.0498674139380455, 0.002603646134957671, -0.06519103050231934, 0.028589483350515366, -0.04...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "DomainName"}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}...
class FBAdLink(models.Model): domain = models.ForeignKey('DomainName', null=True) url = models.TextField(unique=True) localfile = models.CharField(max_length=128, null=True) thumbfile = models.CharField(max_length=128, null=True) def thumbpath(self): if self.thumbfile: retur...
9,800
[ -0.047124721109867096, -0.014496585354208946, 0.018564283847808838, -0.02579093910753727, 0.005403764545917511, 0.01034774910658598, -0.013252475298941135, -0.017038896679878235, 0.012224731966853142, 0.028452252969145775, 0.01345802377909422, -0.04612943157553673, 0.04255937784910202, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "AUTH_USER_MODEL", "value": {"_type": "Name", "_fields": {"id": "setting...
class FBListing(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL) date = models.DateTimeField(default=now) data = models.TextField(null=True) @property def listing(self): return json.loads(self.data) if self.data else [] @listing.setter def listing(self,...