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
21,101
[ 0.0005980670102871954, -0.04064611345529556, 0.00040918405284173787, -0.013620518147945404, 0.01639728434383869, -0.005861729849129915, 0.010496655479073524, -0.0039018355309963226, 0.006229770835489035, 0.009958058595657349, 0.023997485637664795, -0.01997596211731434, 0.027432536706328392, ...
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 __nonzero__(self): log.debug("tests in %s?", id(self)) if self._precache: return True if self.test_generator is None: return False try: test = self.test_generator.next() if test is not None: self._precache.append(test) ...
21,102
[ 0.020232409238815308, -0.013343279249966145, 0.05280882120132446, -0.0618375763297081, -0.07053715735673904, -0.005804620683193207, -0.01897449605166912, -0.013131667859852314, 0.020302945747971535, 0.03277626633644104, -0.019562305882573128, -0.0018530699890106916, 0.050974853336811066, -...
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": "List", "_fields": {"c...
def main(): argv = [] argv.extend(sys.argv[1:]) pytest.main(argv) try: os.remove(os.path.join(basedir, '.coverage')) except OSError: pass try: shutil.rmtree(os.path.join(basedir, '.cache')) except OSError: pass try: shutil.rmtree(os.path.joi...
21,103
[ -0.007859035395085812, -0.02487332373857498, 0.039423633366823196, -0.06077031418681145, -0.006054844241589308, -0.0029442189261317253, -0.00014040508540347219, 0.005012616980820894, -0.0008947973838075995, -0.022059017792344093, 0.0020435829646885395, -0.03057199902832508, 0.014188303612172...
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 _get_tests(self): log.debug("precache is %s", self._precache) for test in self._precache: yield test if self.test_generator is None: return for test in self.test_generator: yield test
21,104
[ -0.03221743181347847, -0.03475186973810196, 0.058979377150535583, -0.05129014700651169, -0.020855415612459183, -0.013660190626978874, 0.007748291827738285, -0.021091677248477936, 0.010653230361640453, -0.016731584444642067, -0.014379712752997875, -0.012564797885715961, 0.01840689219534397, ...
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": "tests", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _set_tests(self, tests): self._precache = [] is_suite = isinstance(tests, unittest.TestSuite) if callable(tests) and not is_suite: self.test_generator = tests() elif is_suite: # Suites need special treatment: they must be called like # tests for th...
21,105
[ -0.001568310079164803, -0.010166209191083908, 0.020821819081902504, -0.03599327430129051, -0.012346271425485611, 0.0020465890411287546, 0.012546480633318424, 0.004688246175646782, 0.02460356056690216, 0.044424328953027725, -0.029675541445612907, 0.00832539051771164, 0.04015318676829338, -0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tests", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__(self, tests=(), context=None, factory=None, config=None, resultProxy=None, can_split=True): log.debug("Context suite for %s (%s) (%s)", tests, context, id(self)) self.context = context self.factory = factory if config is None: config = Config() ...
21,106
[ -0.03139796853065491, 0.003149525262415409, 0.03604321554303169, 0.012914269231259823, -0.026995930820703506, 0.010482203215360641, 0.008189981803297997, -0.003991628065705299, -0.006372012197971344, 0.01466535683721304, 0.02340863272547722, -0.030546747148036957, 0.031957343220710754, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ctx_callback", "annotation": null, "type_comment": null}}], "kwar...
def hasFixtures(self, ctx_callback=None): context = self.context if context is None: return False if self.implementsAnyFixture(context, ctx_callback=ctx_callback): return True # My context doesn't have any, but its ancestors might factory = self.factory ...
21,107
[ -0.018607286736369133, 0.0011459365487098694, 0.02907145395874977, -0.005138074513524771, -0.0476917065680027, 0.012940816581249237, -0.00674919318407774, -0.016584472730755806, 0.015586033463478088, 0.010820752941071987, 0.022743679583072662, -0.04491681978106499, 0.057364899665117264, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def implementsAnyFixture(self, context, ctx_callback): if isclass(context): names = self.classSetup + self.classTeardown else: names = self.moduleSetup + self.moduleTeardown if hasattr(context, '__path__'): names += self.packageSetup + self.packageTear...
21,108
[ -0.027483489364385605, -0.020723342895507812, 0.01779783144593239, -0.062193337827920914, -0.03631829842925072, -0.014755765907466412, 0.018170805647969246, 0.017669621855020523, -0.005979232024401426, 0.022471657022833824, 0.01489563100039959, 0.016923675313591957, 0.0038899974897503853, ...
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 setUp(self): log.debug("suite %s setUp called, tests: %s", id(self), self._tests) if not self: # I have no tests log.debug("suite %s has no tests", id(self)) return if self.was_setup: log.debug("suite %s already set up", id(self)) r...
21,109
[ -0.00024909854982979596, -0.006679012905806303, 0.013936243951320648, -0.024450378492474556, -0.040239281952381134, 0.015647297725081444, 0.031247396022081375, 0.03986167162656784, -0.021582888439297676, 0.03053937293589115, 0.01168237254023552, 0.014844872988760471, 0.018172578886151314, ...
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 tearDown(self): log.debug('context teardown') if not self.was_setup or self.was_torndown: log.debug( "No reason to teardown (was_setup? %s was_torndown? %s)" % (self.was_setup, self.was_torndown)) return self.was_torndown = True ...
21,110
[ -0.005515976343303919, 0.012228059582412243, 0.014075618237257004, -0.00843682698905468, -0.03263663873076439, 0.004629575647413731, 0.036374472081661224, 0.06087331101298332, 0.016361037269234657, 0.00704314885661006, -0.01813383959233761, 0.013242615386843681, 0.014438722282648087, -0.03...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": n...
def setupContext(self, context): self.config.plugins.startContext(context) log.debug("%s setup context %s", self, context) if self.factory: if context in self.factory.was_setup: return # note that I ran the setup for this context, so that I'll run ...
21,111
[ 0.005585654638707638, 0.03396277502179146, 0.011794707737863064, -0.015422889962792397, -0.03573322668671608, 0.014462855644524097, 0.01257395651191473, 0.028052952140569687, 0.0018655213061720133, 0.02822750434279442, 0.02630743570625782, -0.005457857623696327, 0.022267811000347137, -0.04...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": n...
def teardownContext(self, context): log.debug("%s teardown context %s", self, context) if self.factory: if context in self.factory.was_torndown: return self.factory.was_torndown[context] = self if isclass(context): names = self.classTeardown ...
21,112
[ 0.022800704464316368, -0.01214686781167984, 0.04602798819541931, -0.03474494814872742, 0.006329381838440895, -0.010109947994351387, -0.012200189754366875, -0.002659460064023733, 0.014354418963193893, 0.029967250302433968, -0.04250870272517204, 0.01330929808318615, 0.03419039398431778, -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 _get_wrapped_tests(self): for test in self._get_tests(): if isinstance(test, Test) or isinstance(test, unittest.TestSuite): yield test else: yield Test(test, config=self.config, resultProxy=self.res...
21,113
[ 0.0459548719227314, -0.040344350039958954, 0.041222333908081055, 0.0035253125242888927, -0.0006353994249366224, 0.015236202627420425, 0.008533557876944542, -0.018426917493343353, 0.0068043614737689495, -0.001622125506401062, -0.007264766842126846, -0.011660031042993069, 0.05100862309336662, ...
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": "config", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, config=None, suiteClass=None, resultProxy=_def): if config is None: config = Config() self.config = config if suiteClass is not None: self.suiteClass = suiteClass # Using a singleton to represent default instead of None allows # passing ...
21,114
[ -0.035504505038261414, -0.0143247339874506, 0.0332958921790123, -0.03275415673851967, -0.017429294064641, -0.02539905533194542, 0.004578705877065659, -0.009719982743263245, -0.010516959242522717, 0.03073306567966938, -0.03654630482196808, -0.004693303722888231, 0.041984494775533676, 0.0176...
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": "tests", "annotation": null, "type_comment": null}}], "kwarg": nul...
def findContext(self, tests): if callable(tests) or isinstance(tests, unittest.TestSuite): return None context = None for test in tests: # Don't look at suites for contexts, only tests ctx = getattr(test, 'context', None) if ctx is None: ...
21,115
[ -0.028077615424990654, -0.018170669674873352, 0.03186416253447533, -0.04389062151312828, -0.009805731475353241, -0.01265755109488964, -0.037913113832473755, -0.014717528596520424, -0.006668135989457369, 0.023374198004603386, -0.013002865016460419, 0.008882910013198853, 0.04929657652974129, ...
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": "tests", "annotation": null, "type_comment": null}}, {"_type": "ar...
def makeSuite(self, tests, context, **kw): suite = self.suiteClass( tests, context=context, config=self.config, factory=self, resultProxy=self.resultProxy, **kw) if context is not None: self.suites.setdefault(context, []).append(suite) self.context.setdefa...
21,116
[ 0.0034512528218328953, -0.02088134177029133, 0.03756847232580185, -0.04548588767647743, -0.008259456604719162, -0.0022106522228568792, -0.026152141392230988, -0.01531896460801363, 0.03283596411347389, 0.043108418583869934, -0.032701391726732254, 0.006818397436290979, 0.03178180754184723, 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": "tests", "annotation": null, "type_comment": null}}], "kwarg": nul...
def wrapTests(self, tests): log.debug("wrap %s", tests) if callable(tests) or isinstance(tests, unittest.TestSuite): log.debug("I won't wrap") return tests wrapped = [] for test in tests: log.debug("wrapping %s", test) if isinstance(test, T...
21,117
[ 0.04819751903414726, 0.023556584492325783, -0.020097879692912102, -0.033147480338811874, 0.030137471854686737, 0.04322446137666702, 0.019611790776252747, -0.016349392011761665, 0.029557904228568077, -0.03226878121495247, -0.026080504059791565, -0.04243924096226692, 0.0015575856668874621, -...
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 BaseSequenceSerializer(BaseSerializer): def _format(self): raise NotImplementedError('Subclasses of BaseSequenceSerializer must implement the _format() method.') def serialize(self): imports = set() strings = [] for item in self.value: item_string, item_imports...
21,118
[ -0.0040445476770401, -0.04381188005208969, 0.059482138603925705, -0.05913631245493889, 0.024294303730130196, -0.008688888512551785, 0.001119207707233727, -0.008386289700865746, 0.007727058604359627, 0.016048505902290344, -0.0029665420297533274, -0.013595299795269966, -0.004252584185451269, ...
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 MyTest(unittest.TestCase): def test(self): self.assertEqual(fun(3), 4) def test1(self): self.assertEqual(fun(3), 4) def test2(self): self.assertEqual(fun(3), 4) def test3(self): self.assertEqual(fun(3), 4)
21,119
[ 0.05302172899246216, -0.032641857862472534, -0.0052983881905674934, -0.027021780610084534, 0.015232866629958153, 0.01261205691844225, -0.021609855815768242, -0.02494027093052864, 0.01060623861849308, -0.022139694541692734, -0.03992713987827301, -0.020550178363919258, 0.03423137217760086, -...
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 DatetimeSerializer(BaseSerializer): def serialize(self): if self.value.tzinfo is not None and self.value.tzinfo != utc: self.value = self.value.astimezone(utc) value_repr = repr(self.value).replace("<UTC>", "utc") if isinstance(self.value, datetime_safe.datetime): ...
21,120
[ 0.06261324137449265, 0.02031717635691166, -0.040124762803316116, -0.041875097900629044, 0.020217474550008774, -0.004220744129270315, -0.02851494774222374, -0.035760004073381424, 0.044046398252248764, 0.001832035486586392, 0.015154797583818436, -0.01087312400341034, 0.007693718187510967, -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 serialize(self): imports = set() strings = [] for item in self.value: item_string, item_imports = serializer_factory(item).serialize() imports.update(item_imports) strings.append(item_string) value = self._format() return value % (", ".join...
21,121
[ 0.057115208357572556, 0.022882437333464622, -0.061558399349451065, -0.021933209151029587, 0.011673476547002792, 0.016611477360129356, -0.02312479354441166, -0.013400262221693993, 0.0313446968793869, -0.010532383807003498, -0.011875439435243607, -0.05521675571799278, 0.05041002854704857, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "args", "annotation": n...
class DeconstructableSerializer(BaseSerializer): @staticmethod def serialize_deconstructed(path, args, kwargs): name, imports = DeconstructableSerializer._serialize_path(path) strings = [] for arg in args: arg_string, arg_imports = serializer_factory(arg).serialize() ...
21,122
[ 0.033360064029693604, -0.01533020194619894, -0.02348274178802967, -0.020900925621390343, 0.00704910745844245, 0.009850538335740566, 0.0025603901594877243, -0.008388224057853222, 0.013101913034915924, 0.0010612496407702565, -0.014505306258797646, 0.015812283381819725, 0.00667951162904501, -...
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 serialize(self): if self.value.tzinfo is not None and self.value.tzinfo != utc: self.value = self.value.astimezone(utc) value_repr = repr(self.value).replace("<UTC>", "utc") if isinstance(self.value, datetime_safe.datetime): value_repr = "datetime.%s" % value_repr ...
21,123
[ 0.03373134508728981, 0.022400880232453346, -0.006491797510534525, -0.03904365748167038, 0.005312315188348293, 0.006236397661268711, 0.004652919247746468, -0.0354030504822731, 0.004629701375961304, 0.007713072933256626, -0.028326155617833138, -0.01658705435693264, 0.05412617698311806, -0.07...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _serialize_path(path): module, name = path.rsplit(".", 1) if module == "django.db.models": imports = {"from django.db import models"} name = "models.%s" % name else: imports = {"import %s" % module} name = path return name, imports
21,124
[ 0.06715121865272522, 0.03145766630768776, -0.07242530584335327, -0.027450188994407654, 0.017088884487748146, 0.01596762053668499, -0.02931896038353443, -0.021636230871081352, 0.049709342420101166, 0.009764335118234158, 0.021262476220726967, -0.024065634235739708, 0.057599715888500214, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type": "arg...
def serialize_deconstructed(path, args, kwargs): name, imports = DeconstructableSerializer._serialize_path(path) strings = [] for arg in args: arg_string, arg_imports = serializer_factory(arg).serialize() strings.append(arg_string) imports.update(arg_imports) ...
21,125
[ 0.06393551826477051, 0.009867080487310886, -0.03650876134634018, -0.058197133243083954, 0.02955040894448757, 0.006354015786200762, -0.03212590143084526, -0.05544090270996094, 0.037954654544591904, 0.0010978326899930835, 0.019372686743736267, -0.01242563035339117, 0.021575413644313812, -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 serialize(self): imports = set() strings = [] for k, v in sorted(self.value.items()): k_string, k_imports = serializer_factory(k).serialize() v_string, v_imports = serializer_factory(v).serialize() imports.update(k_imports) imports.update(v_imp...
21,126
[ 0.042655717581510544, 0.007085834164172411, -0.036162883043289185, -0.03650461137294769, 0.05057577043771744, 0.016895443201065063, -0.025649715214967728, -0.040987279266119, 0.011990638449788094, 0.0022853072732686996, -0.014282227493822575, -0.05258593708276749, 0.03437383472919464, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class DictionarySerializer(BaseSerializer): def serialize(self): imports = set() strings = [] for k, v in sorted(self.value.items()): k_string, k_imports = serializer_factory(k).serialize() v_string, v_imports = serializer_factory(v).serialize() imports.up...
21,127
[ 0.02301795780658722, 0.00973388273268938, -0.02037915773689747, -0.08172858506441116, 0.0098716514185071, 0.0037171035073697567, -0.06439093500375748, -0.051885783672332764, 0.01908625289797783, 0.01729525998234749, -0.026557551696896553, -0.06244098022580147, 0.04281424731016159, -0.00992...
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 FunctionTypeSerializer(BaseSerializer): def serialize(self): if getattr(self.value, "__self__", None) and isinstance(self.value.__self__, type): klass = self.value.__self__ module = klass.__module__ return "%s.%s.%s" % (module, klass.__name__, self.value.__name__), ...
21,128
[ 0.061201054602861404, 0.005117875058203936, -0.05875611677765846, -0.06449978053569794, 0.04160274565219879, 0.024662822484970093, -0.021441714838147163, -0.013049368746578693, 0.026622653007507324, -0.00017221286543644965, -0.01098281517624855, -0.03997278958559036, 0.028446653857827187, ...
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 EnumSerializer(BaseSerializer): def serialize(self): enum_class = self.value.__class__ module = enum_class.__module__ imports = {"import %s" % module} v_string, v_imports = serializer_factory(self.value.value).serialize() imports.update(v_imports) return "%s.%s(...
21,129
[ 0.06782520562410355, 0.005674135871231556, -0.03245826065540314, -0.056366756558418274, 0.015292622148990631, -0.0024845001753419638, -0.06685564666986465, -0.051034171134233475, 0.04036899656057358, 0.028910549357533455, -0.005872455425560474, -0.02222278155386448, 0.005944070406258106, -...
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 serialize(self): if getattr(self.value, "__self__", None) and isinstance(self.value.__self__, type): klass = self.value.__self__ module = klass.__module__ return "%s.%s.%s" % (module, klass.__name__, self.value.__name__), {"import %s" % module} # Further error che...
21,130
[ 0.04036182165145874, -0.022979725152254105, -0.0024081887677311897, -0.033059656620025635, 0.0007450786069966853, -0.02020195499062538, -0.06675063073635101, -0.011268903501331806, 0.020770136266946793, 0.019686384126544, -0.00592906353995204, -0.049578964710235596, 0.016856007277965546, -...
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 FunctoolsPartialSerializer(BaseSerializer): def serialize(self): imports = {'import functools'} # Serialize functools.partial() arguments func_string, func_imports = serializer_factory(self.value.func).serialize() args_string, args_imports = serializer_factory(self.value.args)....
21,131
[ 0.051820285618305206, -0.017723115161061287, -0.04881322756409645, -0.06442522257566452, 0.018485177308321, 0.004814384505152702, -0.012790300883352757, -0.01870143972337246, 0.027166517451405525, 0.01525155920535326, 0.011101405136287212, -0.046135708689689636, 0.008202475495636463, -0.06...
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 IterableSerializer(BaseSerializer): def serialize(self): imports = set() strings = [] for item in self.value: item_string, item_imports = serializer_factory(item).serialize() imports.update(item_imports) strings.append(item_string) # When len...
21,132
[ 0.05493410304188728, 0.01101706549525261, -0.03784000873565674, -0.05999736115336418, 0.013173431158065796, -0.015570636838674545, -0.05824986472725868, -0.014954532496631145, 0.04048365727066994, 0.03147733211517334, 0.024106482043862343, -0.01097225770354271, 0.01489852275699377, -0.0364...
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 serialize(self): imports = {'import functools'} # Serialize functools.partial() arguments func_string, func_imports = serializer_factory(self.value.func).serialize() args_string, args_imports = serializer_factory(self.value.args).serialize() keywords_string, keywords_imports ...
21,133
[ 0.06522951275110245, 0.0033504453022032976, -0.03565549477934837, -0.04110630601644516, 0.018841328099370003, -0.007269621826708317, -0.019404428079724312, -0.03281747177243233, 0.05221064016222954, 0.011526658199727535, 0.014178860001266003, -0.02108246646821499, 0.0061265286058187485, -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 serialize(self): imports = set() strings = [] for item in self.value: item_string, item_imports = serializer_factory(item).serialize() imports.update(item_imports) strings.append(item_string) # When len(strings)==0, the empty iterable should be ser...
21,134
[ 0.03716461732983589, 0.04171665757894516, -0.06165003031492233, -0.05674463137984276, 0.002741098403930664, 0.03597983717918396, -0.051174096763134, -0.061733171343803406, 0.016628462821245193, -0.006022621877491474, -0.007966073229908943, -0.04764054715633392, 0.023446133360266685, -0.065...
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 ModelManagerSerializer(DeconstructableSerializer): def serialize(self): as_manager, manager_path, qs_path, args, kwargs = self.value.deconstruct() if as_manager: name, imports = self._serialize_path(qs_path) return "%s.as_manager()" % name, imports else: ...
21,135
[ 0.07482810318470001, 0.018389400094747543, -0.004197580739855766, -0.03787406161427498, 0.005881541408598423, 0.037260714918375015, -0.0435694083571434, -0.04089697450399399, 0.032397765666246414, 0.015267912298440933, -0.006708462256938219, -0.0012807686580345035, 0.06076497584581375, -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 serialize(self): imports = {"import re"} regex_pattern, pattern_imports = serializer_factory(self.value.pattern).serialize() regex_flags, flag_imports = serializer_factory(self.value.flags).serialize() imports.update(pattern_imports) imports.update(flag_imports) args ...
21,136
[ 0.05637270584702492, 0.0065626599825918674, -0.0030122066382318735, -0.022715000435709953, -0.0007363857585005462, 0.03241331875324249, -0.041835106909275055, -0.02976652793586254, 0.007446569856256247, 0.01935713179409504, -0.044560905545949936, -0.02798883244395256, 0.07371512055397034, ...
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 RegexSerializer(BaseSerializer): def serialize(self): imports = {"import re"} regex_pattern, pattern_imports = serializer_factory(self.value.pattern).serialize() regex_flags, flag_imports = serializer_factory(self.value.flags).serialize() imports.update(pattern_imports) ...
21,137
[ 0.04965643584728241, 0.01076472271233797, -0.0336637981235981, -0.04140367731451988, 0.012390796095132828, 0.016971776261925697, -0.05292023718357086, -0.024222083389759064, 0.024315334856510162, -0.00026154136867262423, -0.011971164494752884, -0.03839631378650665, 0.023219628259539604, -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 serialize(self): special_cases = [ (models.Model, "models.Model", []), ] for case, string, imports in special_cases: if case is self.value: return string, set(imports) if hasattr(self.value, "__module__"): module = self.value.__modu...
21,138
[ 0.023017078638076782, 0.005112886894494295, -0.03086947649717331, -0.06539509445428848, 0.021749893203377724, 0.021749893203377724, -0.04150552675127983, -0.04640807956457138, 0.010506216436624527, -0.0192986149340868, -0.04246110841631889, -0.06381630152463913, 0.040529169142246246, -0.02...
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 TypeSerializer(BaseSerializer): def serialize(self): special_cases = [ (models.Model, "models.Model", []), ] for case, string, imports in special_cases: if case is self.value: return string, set(imports) if hasattr(self.value, "__module__...
21,139
[ -0.021466953679919243, -0.018246909603476524, 0.008330370299518108, -0.06277891248464584, -0.03930837661027908, -0.006368529517203569, -0.04923088103532791, -0.017078153789043427, -0.005119272042065859, 0.05423983559012413, -0.006899240426719189, -0.029719803482294083, 0.05109134688973427, ...
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": "List", "_fields": {"c...
def get_argv(): args = [sys.argv[0], ] attr_conditions = [] # Use nose's attribselect plugin to filter tests if "force-all" in sys.argv: # Don't exclude any tests return args if PY26: # Exclude tests that don't work on python2.6 attr_conditions.append("not py27_only") ...
21,140
[ -0.007273904979228973, -0.006978677585721016, 0.03874390944838524, -0.01860561966896057, -0.03341725096106529, -0.021344326436519623, 0.002781106624752283, -0.002178088529035449, 0.0024921605363488197, 0.019233763217926025, 0.038316771388053894, -0.01635686494410038, -0.06673399358987808, ...
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 Issue50(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/50 def setUp(self): Framework.TestCase.setUp(self) self.repo = self.g.get_user().get_repo("PyGithub") self.issue = self.repo.get_issue(50) self.labelName = "Label with spaces and strange characters (&*#...
21,141
[ 0.02953328937292099, 0.009761001914739609, 0.0156492181122303, -0.0022657117806375027, -0.03846440836787224, -0.004528130404651165, 0.052638277411460876, 0.011532736010849476, 0.027083158493041992, 0.03582986071705818, 0.0625968724489212, -0.04744821786880493, -0.04278506711125374, -0.0627...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "step", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "max_attempts_set", "annotation": null, "type_comment": null}}], "...
def set_the_max_attempts(step, max_attempts_set): # on firefox with selenium, the behaviour is different. eg 2.34 displays as 2.34 and is persisted as 2 index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS) world.css_fill('.wrapper-comp-setting .setting-input', max_attempts_set, index=index) if world...
21,142
[ 0.05564618110656738, 0.04259273037314415, -0.024026669561862946, -0.009270030073821545, 0.00039999757427722216, 0.020399266853928566, 0.02400066703557968, -0.024468718096613884, 0.018072007223963737, 0.015250694006681442, 0.052161794155836105, 0.004127958789467812, -0.07878874987363815, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "step", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def i_can_modify_the_display_name(step): # Verifying that the display name can be a string containing a floating point value # (to confirm that we don't throw an error because it is of the wrong type). index = world.get_setting_entry_index(DISPLAY_NAME) world.css_fill('.wrapper-comp-setting .setting-inp...
21,143
[ 0.004629807081073523, 0.00943819247186184, 0.021072236821055412, 0.012811337597668171, -0.038731642067432404, -0.03857290744781494, 0.008082320913672447, -0.021230973303318024, 0.019352594390511513, 0.018109159544110298, 0.016323376446962357, -0.020516660064458847, -0.03500134125351906, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "step", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def create_latex_problem(step): world.click_new_component_button(step, '.large-problem-icon') def animation_done(_driver): return world.browser.evaluate_script("$('div.new-component').css('display')") == 'none' world.wait_for(animation_done) # Go to advanced tab. world.css_click('#ui-id-2')...
21,144
[ -0.000297101418254897, 0.03944579139351845, -0.01440423633903265, -0.019104447215795517, 0.012087863869965076, 0.02703183703124523, -0.0008946424932219088, 0.025412626564502716, 0.0006402351427823305, 0.01571984589099884, 0.022230425849556923, -0.061619993299245834, 0.009316088631749153, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user", "annotation": n...
class JobManager(models.Manager): def filter_by_owner(self, user): if not user or user.is_anonymous: return self.get_queryset().filter(owner=None) else: return self.get_queryset().filter(owner=user) def get_active(self, user): # get the number of PENDING, QUEUED...
21,145
[ -0.04828285425901413, 0.015013094991445541, 0.0067419917322695255, -0.04269928112626076, -0.003266738262027502, -0.02502182498574257, 0.019577261060476303, -0.013287052512168884, 0.000005876934210391482, -0.011120811104774475, 0.021477065980434418, -0.07770666480064392, -0.003136416198685765...
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": "video", "annotation": null, "type_comment": null}}], "kwarg": nul...
def get_matches(self, video): matches = set() # hash if 'napiprojekt' in video.hashes and video.hashes['napiprojekt'] == self.hash: matches.add('hash') return matches
21,146
[ 0.006438286509364843, 0.017782479524612427, 0.016055691987276077, -0.029183849692344666, 0.013208207674324512, 0.001092107268050313, -0.01692480407655239, -0.06060909107327461, -0.024014923721551895, 0.013974398374557495, -0.0012865137541666627, -0.006095216143876314, -0.003762338077649474, ...
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 CanvasSource(Source): def __init__(self): Source.__init__(self) self.sequence = 0 self.clear() def clear(self): self.sequence += 1 self._drawlist = (self.sequence, [ ]) def get_drawlist(self): return self._drawlist drawlist = property(get_drawlist) def fill(self, x, y, width, height, color): ...
21,147
[ 0.008253411389887333, 0.01734708994626999, 0.0037590889260172844, -0.01704857498407364, 0.024323517456650734, -0.01837531104683876, 0.025539692491292953, -0.02799415774643421, -0.015279591083526611, 0.02905554696917534, 0.033234771341085434, 0.033942364156246185, -0.035070087760686874, -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 _create_node(self): self.node = document.createElement('canvas') self._context = ctx = self.node.getContext('2d') ctx.beginPath() ctx.lineWidth= '3' ctx.strokeStyle = "blue" ctx.moveTo(10, 60) for i in range(40): ...
21,148
[ -0.01022875402122736, 0.019102027639746666, 0.003895583562552929, -0.006429990753531456, 0.03515137732028961, -0.011869000270962715, 0.013281433843076229, -0.01669861190021038, -0.006674888543784618, 0.025492152199149132, 0.04522066190838814, 0.009083999320864677, -0.02351018786430359, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class JS: def _create_node(self): self.node = document.createElement('canvas') self._context = ctx = self.node.getContext('2d') ctx.beginPath() ctx.lineWidth= '3' ctx.strokeStyle = "blue" ctx.moveTo(10, 60) for i i...
21,149
[ -0.03196846693754196, -0.017609337344765663, 0.06155991181731224, -0.027820810675621033, 0.008064881898462772, -0.00397483492270112, 0.005039035342633724, 0.01501402072608471, 0.005978927481919527, 0.03507314249873161, 0.018349122256040573, -0.02614719606935978, 0.004723716527223587, 0.029...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "assert_lines", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def test_plugin_python_basics(assert_lines): def get_plugin_group(): section = Section() return section.python assert_lines([ 'enable-threads = true', ], get_plugin_group().set_basic_params(enable_threads=True)) assert_lines([ 'pyargv = a b', ], get_plugin_group()....
21,150
[ -0.04170222580432892, -0.034795843064785004, 0.03708330914378166, -0.08199678361415863, 0.0587262362241745, 0.03952473774552345, 0.005795641802251339, 0.04350580275058746, -0.01950942724943161, 0.027955448254942894, 0.030550839379429817, -0.015319409780204296, -0.0211920328438282, 0.013900...
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 TestNN(unittest.TestCase): def test_training(self): dataset = musicset.MusicSet(dirname='features_md_6') dataset.load_files() dataset.load_train_data() dataset.load_test_data() #print(dataset.test.music.shape) #return # dataset.load_validation_data() ...
21,151
[ -0.022264139726758003, -0.011916659772396088, 0.0312698595225811, -0.07877730578184128, 0.03752383217215538, 0.011416342109441757, -0.0061061508022248745, 0.020558511838316917, -0.014077122323215008, -0.0043408251367509365, 0.012405605986714363, 0.004269757308065891, -0.05244239792227745, ...
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 TestNNSpec(unittest.TestCase): def test_nn(self): p = os.path.join(settings.BRAIN_DIR, "specfeat") dataset = musicset.MusicSet(dirname='special') dataset.load_files() dataset.one_hot_encode_genres() storage = store(p) ds = storage['features.dat'] all_dat...
21,152
[ -0.021072618663311005, -0.03388642892241478, 0.052865587174892426, -0.07209780067205429, 0.03218405321240425, 0.02415529452264309, 0.000004285363047529245, 0.05235947668552399, -0.02022143267095089, 0.041432082653045654, 0.04297342151403427, -0.027099940925836563, -0.033035241067409515, -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_training(self): dataset = musicset.MusicSet(dirname='features_md_6') dataset.load_files() dataset.load_train_data() dataset.load_test_data() #print(dataset.test.music.shape) #return # dataset.load_validation_data() # print(dataset.validation.music...
21,153
[ -0.021549127995967865, -0.02711690403521061, 0.029148224741220474, -0.08590283244848251, 0.032892707735300064, 0.001967076910659671, 0.0016320925205945969, 0.035168763250112534, -0.02944190986454487, 0.01744977757334709, 0.030567701905965805, -0.0005384223186410964, -0.0527653843164444, 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_nn(self): p = os.path.join(settings.BRAIN_DIR, "specfeat") dataset = musicset.MusicSet(dirname='special') dataset.load_files() dataset.one_hot_encode_genres() storage = store(p) ds = storage['features.dat'] all_data = np.hstack(tuple(np.split(ds.music, 10...
21,154
[ 0.02830095775425434, -0.0016037315363064408, 0.013563534244894981, -0.010724506340920925, 0.029525887221097946, 0.0013716650428250432, -0.02947484701871872, 0.019751975312829018, 0.041111670434474945, -0.03207782283425331, 0.03940187394618988, -0.05070694535970688, 0.02165316790342331, -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 Tests(Harness): def setUp(self): self._old = Participant._generate_api_key seq = itertools.count(0) Participant._generate_api_key = lambda self: 'deadbeef{}'.format(next(seq)) Harness.setUp(self) def tearDown(self): Participant._generate_api_key = self._old ...
21,155
[ 0.0477677583694458, -0.04307134822010994, 0.014641746878623962, -0.0015374775975942612, 0.0249010156840086, -0.027374792844057083, -0.02325601689517498, 0.045381881296634674, 0.047893330454826355, -0.03247303515672684, 0.043875012546777725, -0.040434326976537704, 0.018685180693864822, -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_participant_can_recreate_their_api_key(self): self.make_participant('alice', claimed_time='now') self.hit_api_key_json('POST') self.hit_api_key_json('POST') self.hit_api_key_json() self.hit_api_key_json('POST') self.hit_api_key_json('POST') self.hit_api_k...
21,156
[ 0.040812406688928604, -0.0468294620513916, -0.001314689638093114, -0.010751788504421711, 0.023710651323199272, -0.022231047973036766, -0.03319244831800461, 0.04658286273479462, 0.05814843252301216, -0.03950542211532593, 0.05395622178912163, -0.040319204330444336, 0.009487959556281567, -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_participant_can_get_their_api_key(self): self.make_participant('alice', claimed_time='now') self.hit_api_key_json() self.hit_api_key_json() self.hit_api_key_json() self.hit_api_key_json() self.hit_api_key_json() self.hit_api_key_json() assert self...
21,157
[ 0.0651400163769722, 0.019880130887031555, 0.00734811183065176, -0.03144971281290054, -0.040412068367004395, 0.019309798255562782, -0.03739745914936066, -0.05715537443757057, -0.0172117929905653, -0.02609267085790634, 0.01896352507174015, 0.014248105697333813, -0.006431507412344217, -0.0307...
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": "plotly_name", "annotat...
class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="tickformatstopdefaults", parent_name="streamtube.colorbar", **kwargs ): super(TickformatstopdefaultsValidator, self).__init__( plotly_name=p...
21,158
[ 0.056400369852781296, 0.006493179127573967, -0.02033916674554348, -0.03793184459209442, -0.030925048515200615, 0.016165366396307945, -0.03685054928064346, -0.05462704598903656, -0.005017210729420185, -0.019192993640899658, 0.03499072045087814, 0.021604282781481743, -0.017981942743062973, -...
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": "plotly_name", "annotation": null, "type_comment": null}}, {"_type...
def __init__( self, plotly_name="tickformatstopdefaults", parent_name="streamtube.colorbar", **kwargs ): super(TickformatstopdefaultsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, data_class_str=kwargs.pop("dat...
21,159
[ 0.022092819213867188, -0.002064137253910303, 0.04628188908100128, -0.011796537786722183, 0.06120224669575691, -0.012485011480748653, -0.003460352076217532, -0.05495460331439972, -0.04245931655168533, 0.0071364943869411945, -0.02381914108991623, -0.03549237176775932, 0.05035107582807541, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "test"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nu...
class Test(SqlBase): __tablename__ = 'test' id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) module_id = Column(Integer, ForeignKey('module.id')) module = relationship(Module, backref=backref('tests', uselist=True)) name ...
21,160
[ -0.009252117946743965, 0.05297059565782547, 0.07794244587421417, -0.015323636122047901, -0.01319535356014967, 0.012935229577124119, 0.0024563930928707123, 0.0008010619785636663, -0.03218436613678932, 0.029488541185855865, -0.0009207779075950384, -0.014590561389923096, -0.008253008127212524, ...
16
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, ...
class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Country', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_crea...
21,161
[ 0.007927525788545609, -0.031184520572423935, 0.023432189598679543, -0.02658568136394024, 0.04511243849992752, 0.0051079983823001385, 0.024549050256609917, -0.038564566522836685, -0.031556807458400726, -0.03383433073759079, 0.0010545854456722736, -0.04993027448654175, 0.03600235655903816, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "series"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ...
class Series(SqlBase): __tablename__ = "series" id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) test_id = Column(Integer, ForeignKey('test.id')) test = relationship(Test, backref=backref('serieses', uselist=True)) quantity_...
21,162
[ 0.055394526571035385, 0.015575663186609745, 0.036418769508600235, 0.008629758842289448, 0.04043411836028099, -0.015899481251835823, 0.03205801919102669, -0.035922251641750336, -0.021220896393060684, -0.04421199858188629, 0.03920361027121544, -0.004630602430552244, 0.034756503999233246, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "commit"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ...
class Commit(SqlBase): __tablename__ = "commit" id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) hash = Column(String, nullable=False, unique=True) date = Column(DateTime, nullable=False) author = Column(String) message ...
21,163
[ 0.015926284715533257, 0.0059418994933366776, 0.05697135254740715, -0.04268421232700348, 0.04219689965248108, -0.03114374913275242, 0.010239116847515106, -0.03085579164326191, -0.01090917270630598, -0.017642956227064133, -0.024232760071754456, -0.008622122928500175, 0.09170349687337875, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "testrun"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":...
class TestRun(SqlBase): __tablename__ = "testrun" id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) test_id = Column(Integer, ForeignKey('test.id')) test = relationship(Test, backref=backref('testruns', uselist=True)) commit_id ...
21,164
[ 0.025375286117196083, 0.04381803795695305, 0.015174553729593754, -0.04428020492196083, 0.00993113499134779, 0.01710025779902935, 0.012049409560859203, -0.03433256596326828, -0.012654631398618221, -0.011174589395523071, -0.033914413303136826, -0.03836004063487053, 0.04661305993795395, -0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "skiprun"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":...
class SkipRun(SqlBase): __tablename__ = "skiprun" id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) test_id = Column(Integer, ForeignKey('test.id')) test = relationship(Test, backref=backref('skipruns', uselist=True)) run_id ...
21,165
[ 0.02865290269255638, -0.018149735406041145, 0.05661066249012947, -0.0280012059956789, 0.022679021582007408, 0.0184321366250515, 0.00785293709486723, -0.06347519159317017, -0.010535752400755882, -0.04153476282954216, -0.005425369367003441, -0.04540149122476578, 0.03925382345914841, -0.02178...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "measurement"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comme...
class Measurement(SqlBase): __tablename__ = "measurement" id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) series_id = Column(Integer, ForeignKey('series.id')) series = relationship(Series, backref=backref('measurements', uselist=...
21,166
[ 0.014868087135255337, 0.028289904817938805, 0.06687900424003601, -0.005993252620100975, 0.021310560405254364, -0.024367447942495346, 0.01634722575545311, -0.04305938258767128, -0.0075162178836762905, 0.008513267152011395, -0.022482914850115776, -0.025879455730319023, 0.033855851739645004, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "failure"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":...
class Failure(SqlBase): __tablename__ = "failure" id = Column(Integer, primary_key=True) created = Column(DateTime, nullable=False, default=datetime.datetime.now) testrun_id = Column(Integer, ForeignKey('testrun.id')) testrun = relationship(TestRun, backref=backref('failures', uselist=True)) k...
21,167
[ 0.04006149619817734, 0.035726264119148254, 0.07460542768239975, -0.045204661786556244, 0.02804107777774334, -0.04307645559310913, 0.05091928690671921, -0.005842712242156267, -0.03259307146072388, 0.0029952521435916424, 0.018040481954813004, -0.022365862503647804, 0.052968669682741165, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dbfile", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self, dbfile): self.dbfile = dbfile if not os.path.exists(self.dbfile): # open self.engine = create_engine('sqlite:///' + dbfile) SqlBase.metadata.create_all(self.engine) else: # create db self.engine = create_engine('sqlite:///' + dbfile) SqlBase.metadata.bi...
21,168
[ 0.001479830825701356, 0.010710285045206547, 0.0650424137711525, -0.07724092155694962, 0.012747435830533504, 0.007752148434519768, 0.013552536256611347, 0.015601885505020618, -0.0012999029131606221, 0.010813972912728786, 0.0033637371379882097, -0.048208482563495636, 0.006428610999137163, -0...
19
{"_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": "dbfile", "annotation":...
class Database(): def __init__(self, dbfile): self.dbfile = dbfile if not os.path.exists(self.dbfile): # open self.engine = create_engine('sqlite:///' + dbfile) SqlBase.metadata.create_all(self.engine) else: # create db self.engine = create_engine('sqlite:///' + dbfile) ...
21,169
[ 0.0019637506920844316, 0.039098434150218964, 0.03481492027640343, -0.07409562915563583, 0.0052803391590714455, 0.01199610996991396, -0.0038363628555089235, 0.00510945450514555, 0.03429087623953819, 0.05199453607201576, -0.0006874551763758063, -0.02175932563841343, -0.0017672332469373941, -...
18
{"_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": "modulename", "annotation": null, "type_comment": null}}, {"_type"...
def getLastSuccessFirstFailure(self, modulename, testname): testruns = self.session.query(TestRun).\ join(Test).\ join(Module).\ filter(Test.name == testname, Module.name == modulename).\ order_by(desc(TestRun.created)).\ all() lastSuccess = None firstFailure...
21,170
[ 0.01332818903028965, 0.044675737619400024, 0.007250490598380566, -0.08921995013952255, 0.031895581632852554, 0.0031648967415094376, -0.02770860306918621, 0.0038225376047194004, 0.008510969579219818, 0.035885270684957504, 0.012243080884218216, -0.008554811589419842, 0.019027743488550186, -0...
18
{"_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": "modulename", "annotation": null, "type_comment": null}}, {"_type"...
def getLastTestRun(self, modulename, testname): return self.session.query(TestRun).\ join(Test).\ join(Module).\ filter(Test.name == testname, Module.name == modulename).\ order_by(desc(TestRun.created)).\ first()
21,171
[ 0.025967171415686607, -0.015318762511014938, -0.0066267140209674835, -0.024514172226190567, 0.02393297106027603, 0.014467719942331314, 0.0031265427824109793, 0.013554406352341175, -0.0328792966902256, 0.00045633254921995103, -0.0006908232462592423, 0.004831222351640463, -0.02879014052450657,...
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 TestDataQueue(unittest.TestCase, DataQueueMixin): def setUp(self): self.loop = asyncio.new_event_loop() asyncio.set_event_loop(None) self.buffer = streams.DataQueue(loop=self.loop) def tearDown(self): self.loop.close()
21,172
[ -0.004968397784978151, -0.005330649204552174, 0.01880534552037716, 0.022612951695919037, 0.002695732517167926, -0.0543641597032547, 0.023628313094377518, -0.016965001821517944, -0.0005086724413558841, 0.03137044608592987, -0.015642916783690453, 0.0051085385493934155, 0.027034005150198936, ...
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 _getIPv4Map(self): if self._ipversion != 6: return None if (self.ip >> 32) != 0xffff: return None ipv4 = self.ip & 0xffffffff if self._prefixlen != 128: ipv4 = '%s/%s' % (ipv4, 32-(128-self._prefixlen)) return IP(ipv4, ipversion=4)
21,173
[ 0.05033876374363899, 0.030521491542458534, -0.015586212277412415, -0.06364671140909195, 0.004493240732699633, 0.033631499856710434, 0.034547626972198486, 0.010951332747936249, 0.016188926994800568, 0.026471246033906937, 0.07097572833299637, -0.03587360307574272, -0.036428097635507584, 0.00...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_feed_eof_waiters(loop): reader = streams.StreamReader(loop=loop) waiter = reader._waiter = helpers.create_future(loop) eof_waiter = reader._eof_waiter = helpers.create_future(loop) reader.feed_eof() assert reader._eof assert waiter.done() assert eof_waiter.done() assert reader...
21,174
[ 0.041173338890075684, 0.030873946845531464, -0.016285158693790436, -0.06552837789058685, 0.0035381445195525885, 0.03516333922743797, 0.017581669613718987, 0.009360331110656261, 0.0233614481985569, 0.020283745601773262, 0.0662069246172905, -0.052199747413396835, -0.03271571919322014, 0.0258...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_feed_eof_cancelled(loop): reader = streams.StreamReader(loop=loop) waiter = reader._waiter = helpers.create_future(loop) eof_waiter = reader._eof_waiter = helpers.create_future(loop) waiter.set_result(1) eof_waiter.set_result(1) reader.feed_eof() assert waiter.done() assert e...
21,175
[ 0.05194242671132088, 0.06237627565860748, -0.02637949399650097, -0.03499876335263252, 0.022614235058426857, 0.023272022604942322, 0.012395867146551609, -0.019790291786193848, 0.02259155362844467, -0.003955223131924868, 0.05307654291391373, -0.047995708882808685, -0.005628041457384825, 0.01...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_on_eof(loop): reader = streams.StreamReader(loop=loop) on_eof = mock.Mock() reader.on_eof(on_eof) assert not on_eof.called reader.feed_eof() assert on_eof.called
21,176
[ 0.05532567948102951, 0.049419354647397995, -0.013762205839157104, -0.025124965235590935, 0.00848457869142294, 0.019772356376051903, 0.012550946325063705, 0.0016063597286120057, 0.024755818769335747, -0.005222831852734089, 0.07373680919408798, -0.06261630356311798, 0.004905597306787968, 0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_on_eof_exc_in_callback(loop): reader = streams.StreamReader(loop=loop) on_eof = mock.Mock() on_eof.side_effect = ValueError reader.on_eof(on_eof) assert not on_eof.called reader.feed_eof() assert on_eof.called assert not reader._eof_callbacks
21,177
[ 0.05272963270545006, 0.054085150361061096, -0.0314028225839138, -0.030453961342573166, 0.024105621501803398, 0.03537900745868683, 0.029166219756007195, -0.01902242936193943, 0.029663242399692535, -0.020411835983395576, 0.06068200245499611, -0.051057830452919006, -0.0030160266906023026, 0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_on_eof_eof_is_set(loop): reader = streams.StreamReader(loop=loop) reader.feed_eof() on_eof = mock.Mock() reader.on_eof(on_eof) assert on_eof.called assert not reader._eof_callbacks
21,178
[ 0.04970288276672363, 0.04862336069345474, -0.033824946731328964, -0.025008870288729668, 0.01973496749997139, 0.027325339615345, 0.022287581115961075, -0.015000824816524982, 0.023457061499357224, -0.029979158192873, 0.0626121386885643, -0.054110921919345856, -0.007579127326607704, 0.0176321...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_on_eof_eof_is_set_exception(loop): reader = streams.StreamReader(loop=loop) reader.feed_eof() on_eof = mock.Mock() on_eof.side_effect = ValueError reader.on_eof(on_eof) assert on_eof.called assert not reader._eof_callbacks
21,179
[ 0.03044550120830536, 0.008164816536009312, -0.016839545220136642, -0.0694475769996643, -0.0014232463436201215, 0.013195537962019444, 0.01391687709838152, -0.01585703156888485, 0.02663981355726719, 0.0015359555836766958, 0.05442382022738457, -0.03736041113734245, -0.01522275060415268, 0.027...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_set_exception(loop): reader = streams.StreamReader(loop=loop) waiter = reader._waiter = helpers.create_future(loop) eof_waiter = reader._eof_waiter = helpers.create_future(loop) exc = ValueError() reader.set_exception(exc) assert waiter.exception() is exc assert eof_waiter.excepti...
21,180
[ 0.03803986683487892, 0.011546505615115166, -0.014861233532428741, -0.07578617334365845, -0.00950996670871973, 0.018286043778061867, 0.0019585636910051107, -0.016720416024327278, 0.027863284572958946, 0.001735339523293078, 0.04762933775782585, -0.03826003149151802, -0.022371355444192886, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_set_exception_cancelled(loop): reader = streams.StreamReader(loop=loop) waiter = reader._waiter = helpers.create_future(loop) eof_waiter = reader._eof_waiter = helpers.create_future(loop) waiter.set_result(1) eof_waiter.set_result(1) exc = ValueError() reader.set_exception(exc) ...
21,181
[ 0.04909823089838028, 0.041502922773361206, -0.012545818462967873, -0.029657863080501556, -0.012647541239857674, 0.03232526034116745, 0.014614182524383068, -0.02241293527185917, 0.03169231861829758, -0.017835406586527824, 0.04624998942017555, -0.07003053277730942, 0.007900474593043327, 0.02...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_set_exception_eof_callbacks(loop): reader = streams.StreamReader(loop=loop) on_eof = mock.Mock() reader.on_eof(on_eof) reader.set_exception(ValueError()) assert not on_eof.called assert not reader._eof_callbacks
21,182
[ 0.049390148371458054, 0.042347151786088943, 0.03057909943163395, -0.06441224366426468, 0.011623178608715534, -0.0017788589466363192, 0.02262229286134243, -0.02433846704661846, 0.03860276937484741, -0.015857893973588943, 0.036418549716472626, -0.0015587651869282126, -0.030222492292523384, 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 TestOutputValidation(): def test_no_filename(self): assert _.validate_output_file(None), 'All new files should be valid' @mock.patch('os.access') def test_not_writable(self, mock_access): mock_access.return_value = False with tempfile.NamedTemporaryFile('r') as f: ...
21,183
[ 0.009415633045136929, 0.0626535564661026, 0.013166487216949463, -0.029500851407647133, 0.01926025003194809, 0.00616525998339057, 0.012880498543381691, -0.023803072050213814, 0.03592459857463837, -0.019766230136156082, 0.016235368326306343, -0.004765564110130072, 0.001519315759651363, 0.020...
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 TestInputValidation(): def test_does_not_exist(self): assert not _.validate_input_file(''), 'validation should not pass on missing file' @mock.patch('os.access') def test_unreadable_file(self, mock_access): mock_access.return_value = False with tempfile.NamedTemporaryFile('r')...
21,184
[ 0.04486580565571785, 0.01967458240687847, 0.06262249499559402, -0.016560697928071022, 0.0014626641059294343, -0.011410395614802837, -0.006195446476340294, -0.023531921207904816, 0.047408632934093475, 0.07240591198205948, -0.007224428933113813, -0.03376787528395653, -0.028854617848992348, 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 TestRangeValidation(): def test_number_none_and_not_allowed(self): assert not _.validate_range(None, allow_none=False), 'number=None should not be allowed with allow_none=False' def test_number_not_float_compatible(self): value = 'a' assert not _.validate_range(value), 'number=%s ...
21,185
[ -0.025008460506796837, 0.006164468824863434, -0.05553280562162399, -0.06100194528698921, 0.02066119574010372, -0.03216041252017021, -0.026878252625465393, 0.016500910744071007, 0.008028416894376278, 0.036157093942165375, 0.06759296357631683, -0.045015230774879456, 0.01842913217842579, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,...
def _real_extract(self, url): id_type, url_id = re.match(self._VALID_URL, url).groups() webpage = self._download_webpage(url, url_id) video_data = self._html_search_regex(r'<div([^>]+data-%s-id="%s"[^>]+)>' % (id_type, url_id), webpage, 'video data') def extract_data_val(attr, fatal=Fal...
21,186
[ -0.01556752622127533, -0.02029966562986374, -0.08347979933023453, -0.05984336882829666, 0.03232415392994881, -0.011235798709094524, -0.010926389135420322, 0.020518071949481964, -0.0066674635745584965, 0.033561792224645615, 0.07542302459478378, -0.03373166173696518, 0.011199397034943104, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https?://(?:www\\.)?mychannels\\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)"}}, "targets": [{"_type": "Name", "_fields": {"id"...
class MyChannelsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?mychannels\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)' _TEST = { 'url': 'https://mychannels.com/missholland/miss-holland?production_id=3416', 'md5': 'b8993daad4262dd68d89d651c0c52c45', 'info_dict': { ...
21,187
[ -0.01919414848089218, 0.009257090277969837, -0.045283395797014236, -0.056926336139440536, 0.05019824579358101, -0.000669901433866471, -0.004938705824315548, 0.01822787895798683, 0.007586997002363205, -0.007199296727776527, 0.01306251809000969, -0.08336153626441956, -0.04972107335925102, 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": "response", "annotation": null, "type_comment": null}}], "kwarg": ...
def parse(self, response): self.logger.info('parse: {}'.format(response)) is_no_update = False for article in response.css('li > div.breaking-title'): # http://metro.sindonews.com/read/1146316/171/penyidik-bareskrim-mulai-dalami-video-dugaan-penistaan-agama-1476179831 ur...
21,188
[ 0.02855861186981201, 0.002656480995938182, -0.019027549773454666, -0.020433584228157997, 0.024594059213995934, -0.0036072824150323868, -0.025147251784801483, 0.012423803098499775, 0.009963245131075382, 0.022980578243732452, -0.0096981730312109, -0.08394710719585419, -0.026368888095021248, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sindonews"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}...
class SindonewsSpider(BaseSpider): name="sindonews" allowed_domains=["sindonews.com"] start_urls=( 'http://metro.sindonews.com/topic/7282/pilgub-dki/', ) def parse(self, response): self.logger.info('parse: {}'.format(response)) is_no_update = False for article in re...
21,189
[ -0.04299617558717728, 0.014932290650904179, 0.03469093143939972, -0.0005022345576435328, 0.039541784673929214, -0.0052305893041193485, -0.034421440213918686, 0.0012218998745083809, 0.07511468976736069, 0.016047006472945213, 0.033098481595516205, -0.028933610767126083, 0.0032614620868116617, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fos", "annotation": null, "type_comment": null}}], "kwarg": null,...
def fortios_ips(data, fos): login(data) methodlist = ['ips_settings'] for method in methodlist: if data[method]: resp = eval(method)(data, fos) break fos.logout() return not resp['status'] == "success", resp['status'] == "success", resp
21,190
[ 0.002921144012361765, 0.020002776756882668, -0.01217324286699295, -0.045956436544656754, 0.03544466197490692, -0.013150577433407307, -0.03459763899445534, 0.01250988058745861, 0.019818169996142387, 0.05308011919260025, -0.01891685090959072, -0.037486203014850616, -0.03229547291994095, -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}}, {"_type": "arg", "_fields": {"arg": "response", "annotation": null, "type_comment": null}}], "kwarg": ...
def parse_news(self, response): self.logger.info('parse_news: %s' % response) # Initialize item loader # extract news title, published_at, author, content, url loader = ItemLoader(item=News(), response=response) loader.add_value('url', response.url) title_selectors = re...
21,191
[ 0.0006966664805077016, -0.019037647172808647, -0.004208140075206757, 0.011879769153892994, 0.021589085459709167, 0.014465841464698315, -0.005151940975338221, -0.01960335113108158, -0.03622810170054436, -0.05911022052168846, 0.025860723108053207, -0.05412279814481735, -0.03481961414217949, ...
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": "name", "annotation": n...
class SQSQueueMock(object): def __init__(self, name): self.name = name self.messages = [] self._get_message_calls = 0 def clear(self, page_size=10, vtimeout=10): empty, self.messages[:] = not self.messages, [] return not empty def count(self, page_size=10, vtimeout...
21,192
[ -0.020329760387539864, -0.03318341448903084, -0.020603010430932045, 0.009700356051325798, 0.020756030455231667, -0.0029456294141709805, 0.00861282367259264, -0.006618102081120014, -0.036506131291389465, -0.028767704963684082, 0.024811051785945892, -0.036834027618169785, 0.017334947362542152,...
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 SQSConnectionMock(object): def __init__(self): self.queues = {} def get_queue(self, queue): return self.queues.get(queue) def get_all_queues(self, prefix=""): return self.queues.values() def delete_queue(self, queue, force_deletion=False): q = self.get_queue(que...
21,193
[ 0.019445698708295822, -0.061893220990896225, 0.05375814065337181, -0.010531600564718246, 0.007665292359888554, 0.000947754830121994, -0.020230663940310478, 0.03235002979636192, 0.05775431916117668, -0.012476170435547829, 0.014450473710894585, -0.005580975208431482, -0.023632174357771873, -...
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_messages_to_python(self): message_count = 3 # Create several test messages and publish them for i in range(message_count): message = 'message: %s' % i self.producer.publish(message) # Get the messages now messages = self.channel._get_from_sqs( ...
21,194
[ 0.029937829822301865, -0.09712527692317963, 0.06297185271978378, -0.024960100650787354, 0.02684163488447666, -0.012372873723506927, -0.015183267183601856, 0.03779740259051323, 0.002679399913176894, -0.027508506551384926, 0.034844107925891876, -0.0128730284050107, -0.025174451991915703, 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_get_from_sqs(self): # Test getting a single message message = 'my test message' self.producer.publish(message) results = self.channel._get_from_sqs(self.queue_name) self.assertEquals(len(results), 1) # Now test getting many messages for i in xrange(3): ...
21,195
[ 0.032108671963214874, -0.047179073095321655, 0.037937555462121964, -0.015120220370590687, -0.013264443725347519, 0.030763546004891396, -0.015170039609074593, 0.03499820455908775, -0.000035832097637467086, -0.013912097550928593, 0.029692426323890686, -0.013700364157557487, -0.0221821349114179...
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_puts_and_get_bulk(self): # Generate 8 messages message_count = 8 # Set the prefetch_count to 5 self.channel.qos.prefetch_count = 5 # Now, generate all the messages for i in xrange(message_count): message = 'message: %s' % i self.producer...
21,196
[ 0.03364909440279007, -0.049666646867990494, 0.04951992258429527, -0.05005791783332825, 0.02023591846227646, 0.00025753414956852794, 0.013058586977422237, 0.02089618518948555, 0.030934667214751244, -0.04526487737894058, 0.011175607331097126, 0.004270329140126705, -0.02326825074851513, -0.00...
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_puts_and_gets(self): for i in xrange(3): message = 'message: %s' % i self.producer.publish(message) for i in xrange(3): self.assertEquals('message: %s' % i, self.queue(self.channel).get().payload)
21,197
[ 0.035876985639333725, -0.052952930331230164, 0.032051775604486465, -0.006775374989956617, 0.016638420522212982, 0.0060159582644701, -0.004043973982334137, 0.029226617887616158, -0.010775596834719181, -0.03137673810124397, 0.011363129131495953, -0.02880159392952919, -0.014988330192863941, 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_drain_events_with_prefetch_none(self): # Generate 20 messages message_count = 20 expected_get_message_count = 2 # Set the prefetch_count to None self.channel.qos.prefetch_count = None # Now, generate all the messages for i in xrange(message_count): ...
21,198
[ 0.028989123180508614, -0.04741863161325455, 0.027245789766311646, -0.004906234797090292, 0.021119223907589912, 0.017632558941841125, -0.009687945246696472, 0.02241426892578602, -0.014345132745802402, -0.03663487732410431, 0.02306179329752922, -0.031853169202804565, -0.03035888262093067, 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_drain_events_with_prefetch_5(self): # Generate 20 messages message_count = 20 expected_get_message_count = 4 # Set the prefetch_count to 5 self.channel.qos.prefetch_count = 5 # Now, generate all the messages for i in xrange(message_count): s...
21,199
[ -0.0012013288214802742, 0.0036166163627058268, 0.022264329716563225, -0.03656437620520592, 0.019042955711483955, -0.004894467536360025, 0.018817102536559105, 0.017711613327264786, 0.00009240276267519221, -0.006050477270036936, -0.017093490809202194, 0.02919444441795349, 0.02786310203373432, ...
16
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "instance", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class KubeLatentWorker(CompatibleLatentWorkerMixin, DockerBaseWorker): instance = None @defer.inlineCallbacks def getPodSpec(self, build): image = yield build.render(self.image) env = yield self.createEnvironment(build) defer.returnValue({ "apiVer...
21,200
[ 0.03152301907539368, 0.01265802700072527, -0.006131413392722607, 0.012588285841047764, -0.03194146603345871, -0.04679634049534798, 0.006532425060868263, 0.006881131324917078, 0.00386482453905046, -0.030081702396273613, -0.012111720629036427, 0.020573651418089867, 0.0032051890157163143, -0....
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "build", "annotation": null, "type_comment": null}}], "kwarg": nul...
def getPodSpec(self, build): image = yield build.render(self.image) env = yield self.createEnvironment(build) defer.returnValue({ "apiVersion": "v1", "kind": "Pod", "metadata": { "name": self.getContainerName() }, "spec"...