Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
12,601 | [
0.0062564765103161335,
-0.02771737053990364,
0.04910743609070778,
-0.02214556559920311,
0.0036181320901960135,
0.007690744008868933,
0.005858068820089102,
-0.0044149477034807205,
0.013658005744218826,
0.04261486604809761,
-0.020363060757517815,
0.008393121883273125,
0.043936990201473236,
-... | 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_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
def _find_tests(start_dir, pattern):
self.wasRun = True
self.assertEqual(... | |
12,602 | [
0.014018237590789795,
0.022799156606197357,
0.005369453690946102,
-0.04843319207429886,
0.0282767191529274,
-0.003994056489318609,
-0.0036216783337295055,
0.03257708624005318,
0.0686136856675148,
0.016660921275615692,
-0.002615656703710556,
-0.05117197334766388,
0.01128546241670847,
-0.033... | 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 testNoExit(self):
result = object()
test = object()
class FakeRunner(object):
def run(self, test):
self.test = test
return result
runner = FakeRunner()
oldParseArgs = unittest.TestProgram.parseArgs
def restoreParseArgs():... | |
12,603 | [
-0.00870949774980545,
0.004627096001058817,
0.011781125329434872,
-0.07946925610303879,
0.033602599054574966,
-0.0292450450360775,
-0.0017871035961434245,
0.012050664983689785,
0.04977497458457947,
0.027493037283420563,
-0.043485719710588455,
-0.013948673382401466,
0.015790527686476707,
-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_defaultTest_with_string(self):
class FakeRunner(object):
def run(self, test):
self.test = test
return True
old_argv = sys.argv
sys.argv = ['faketest']
runner = FakeRunner()
program = unittest.TestProgram(testRunner=runner, exi... | |
12,604 | [
-0.014648639596998692,
0.0034785119350999594,
0.013265877962112427,
-0.08996598422527313,
0.032754186540842056,
-0.03614627569913864,
-0.006060388870537281,
0.022361861541867256,
0.038328446447849274,
0.04012171924114227,
-0.036470361053943634,
-0.025084175169467926,
0.028843561187386513,
... | 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_defaultTest_with_iterable(self):
class FakeRunner(object):
def run(self, test):
self.test = test
return True
old_argv = sys.argv
sys.argv = ['faketest']
runner = FakeRunner()
program = unittest.TestProgram(
testRun... | |
12,605 | [
0.03343737870454788,
0.01026105135679245,
0.022400476038455963,
-0.04125421121716499,
-0.004503429401665926,
0.00903602596372366,
-0.008971857838332653,
0.02009042724967003,
0.04484762251377106,
0.03437073156237602,
0.019892090931534767,
-0.01316027995198965,
0.0034213229082524776,
0.02713... | 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_Exit(self):
stream = BufferedWriter()
self.assertRaises(
SystemExit,
unittest.main,
argv=["foobar"],
testRunner=unittest.TextTestRunner(stream=stream),
exit=True,
testLoader=self.FooBarLoader())
self.assertIn('\nFAI... | |
12,606 | [
0.03327687457203865,
0.015915026888251305,
0.030187053605914116,
-0.039897918701171875,
0.010501710698008537,
0.020083831623196602,
0.003085222328081727,
0.009999001398682594,
0.045194752514362335,
0.026410607621073723,
0.017043055966496468,
-0.026042770594358444,
-0.0005042414995841682,
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_NonExit(self):
stream = BufferedWriter()
program = unittest.main(exit=False,
argv=["foobar"],
testRunner=unittest.TextTestRunner(stream=stream),
testLoader=self.FooBarLoader())
self.assertTru... | |
12,607 | [
-0.0015582711203023791,
0.0005648833466693759,
0.016294464468955994,
-0.023395854979753494,
0.0031504351645708084,
0.05939345061779022,
-0.019819336012005806,
0.020955558866262436,
0.050665196031332016,
0.019083373248577118,
0.023253826424479485,
-0.01087803952395916,
-0.02574576996266842,
... | 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 testVerbosity(self):
program = self.program
for opt in '-q', '--quiet':
program.verbosity = 1
program.parseArgs([None, opt])
self.assertEqual(program.verbosity, 0)
for opt in '-v', '--verbose':
program.verbosity = 1
program.parseA... | |
12,608 | [
0.0023714101407676935,
0.013813244178891182,
0.028702540323138237,
-0.02341584675014019,
-0.0017997568938881159,
0.0007960744551382959,
-0.004953352268785238,
0.012070505879819393,
0.03983734920620918,
0.010690351948142052,
-0.008748778142035007,
-0.008105485700070858,
0.02183685638010502,
... | 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_ExitAsDefault(self):
stream = BufferedWriter()
self.assertRaises(
SystemExit,
unittest.main,
argv=["foobar"],
testRunner=unittest.TextTestRunner(stream=stream),
testLoader=self.FooBarLoader())
self.assertIn('\nFAIL: testFail ',... | |
12,609 | [
0.0048547848127782345,
-0.0015685121761634946,
0.043231237679719925,
-0.0645652562379837,
0.02271949127316475,
-0.019880961626768112,
-0.010638848878443241,
0.018810883164405823,
0.047579143196344376,
0.02795725129544735,
-0.030885891988873482,
-0.018304001539945602,
0.001776896184310317,
... | 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 testRunTestsRunnerClass(self):
program = self.program
program.testRunner = FakeRunner
program.verbosity = 'verbosity'
program.failfast = 'failfast'
program.buffer = 'buffer'
program.warnings = 'warnings'
program.runTests()
self.assertEqual(FakeRunne... | |
12,610 | [
-0.012890495359897614,
-0.02238946594297886,
0.006485783960670233,
-0.0067154886201024055,
0.004222515504807234,
0.05380498245358467,
-0.0073640672490000725,
0.004225893411785364,
0.04756241664290428,
0.03426655754446983,
0.03848231956362724,
-0.03215868026018143,
0.027497021481394768,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testBufferCatchFailfast(self):
program = self.program
for arg, attr in (('buffer', 'buffer'), ('failfast', 'failfast'),
('catch', 'catchbreak')):
setattr(program, attr, None)
program.parseArgs([None])
self.assertIs(getattr(program, attr), Fa... | |
12,611 | [
-0.001659046858549118,
-0.013461028225719929,
0.030029302462935448,
-0.05508701130747795,
0.02361506037414074,
-0.026256218552589417,
0.0037397912237793207,
0.0266113318502903,
0.05220171436667442,
0.000552437617443502,
-0.02317116968333721,
-0.019631128758192062,
0.0020141606219112873,
-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 testRunTestsRunnerInstance(self):
program = self.program
program.testRunner = FakeRunner()
FakeRunner.initArgs = None
program.runTests()
# A new FakeRunner should not have been instantiated
self.assertIsNone(FakeRunner.initArgs)
self.assertEqual(FakeRunner... | |
12,612 | [
-0.011178738437592983,
0.03208333998918533,
0.04980602115392685,
-0.027448546141386032,
0.02025621011853218,
-0.0038963486440479755,
0.01107067335397005,
-0.01720637083053589,
0.025623444467782974,
0.006411864887923002,
-0.005919568240642548,
0.026127750054001808,
0.027088329195976257,
-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_locals(self):
program = self.program
program.testRunner = FakeRunner
program.parseArgs([None, '--locals'])
self.assertEqual(True, program.tb_locals)
program.runTests()
self.assertEqual(FakeRunner.initArgs, {'buffer': False,
... | |
12,613 | [
-0.0031310906633734703,
-0.015133123844861984,
0.0141057800501585,
-0.04192487150430679,
-0.022035952657461166,
-0.01607966609299183,
-0.003783280961215496,
0.008599677123129368,
0.025672057643532753,
0.03310587257146835,
0.02648008055984974,
-0.013043805956840515,
-0.008276468142867088,
-... | 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 testCatchBreakInstallsHandler(self):
module = sys.modules['unittest.main']
original = module.installHandler
def restore():
module.installHandler = original
self.addCleanup(restore)
self.installed = False
def fakeInstallHandler():
self.installe... | |
12,614 | [
0.002675006864592433,
0.022390451282262802,
0.06744715571403503,
-0.06644422560930252,
0.023430991917848587,
0.00037355287349782884,
-0.0007682613795623183,
0.022327767685055733,
0.026276810094714165,
0.03211888670921326,
-0.009922755882143974,
-0.0281573086977005,
0.03347284719347954,
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 testRunTestsOldRunnerClass(self):
program = self.program
# Two TypeErrors are needed to fall all the way back to old-style
# runners - one to fail tb_locals, one to fail buffer etc.
FakeRunner.raiseError = 2
program.testRunner = FakeRunner
program.verbosity = 'verbos... | |
12,615 | [
0.016308192163705826,
0.01008613035082817,
0.050871822983026505,
-0.08365047723054886,
0.00778898736461997,
-0.007033415138721466,
-0.022941002622246742,
-0.02000998891890049,
0.011683480814099312,
0.03906663879752159,
-0.00026147114112973213,
-0.005958372727036476,
0.04409702867269516,
-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 testParseArgsFileNames(self):
# running tests with filenames instead of module names
program = self.program
argv = ['progname', 'foo.py', 'bar.Py', 'baz.PY', 'wing.txt']
self._patch_isfile(argv)
program.createTests = lambda: None
program.parseArgs(argv)
# no... | |
12,616 | [
0.011441236361861229,
-0.015293363481760025,
0.024389827623963356,
-0.04450881853699684,
0.011922752484679222,
-0.0017834407044574618,
-0.025499407202005386,
-0.010101365856826305,
0.013482444919645786,
0.028723470866680145,
0.007327415980398655,
-0.02110295742750168,
0.043545786291360855,
... | 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 testParseArgsFilePaths(self):
program = self.program
argv = ['progname', 'foo/bar/baz.py', 'green\\red.py']
self._patch_isfile(argv)
program.createTests = lambda: None
program.parseArgs(argv)
expected = ['foo.bar.baz', 'green.red']
self.assertEqual(program.t... | |
12,617 | [
-0.0023697474971413612,
-0.00516734691336751,
0.03407357633113861,
-0.028773730620741844,
0.034956883639097214,
0.002050928771495819,
-0.03398524224758148,
-0.009340973570942879,
0.030164940282702446,
0.04880272224545479,
-0.017036788165569305,
-0.012366300448775291,
0.012818995863199234,
... | 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 testParseArgsAbsolutePathsThatCanBeConverted(self):
cur_dir = os.getcwd()
program = self.program
def _join(name):
return os.path.join(cur_dir, name)
argv = ['progname', _join('foo/bar/baz.py'), _join('green\\red.py')]
self._patch_isfile(argv)
program.crea... | |
12,618 | [
-0.0016211215406656265,
0.004520913120359182,
0.010765130631625652,
-0.06292271614074707,
0.002496582455933094,
-0.02622516267001629,
-0.04962233826518059,
-0.01305734645575285,
0.02271227166056633,
0.033295128494501114,
0.006224885582923889,
-0.022977394983172417,
0.06190640479326248,
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 testParseArgsNonExistentFiles(self):
program = self.program
argv = ['progname', 'foo/bar/baz.py', 'green\\red.py']
self._patch_isfile([])
program.createTests = lambda: None
program.parseArgs(argv)
self.assertEqual(program.testNames, argv[1:]) | |
12,619 | [
0.009037897922098637,
0.006791317835450172,
0.04947059601545334,
-0.0012450750218704343,
0.03296511620283127,
-0.01098646130412817,
-0.039383914321660995,
-0.01631062477827072,
0.04483989253640175,
0.03674761950969696,
0.0034386420156806707,
-0.010040834546089172,
0.020138980820775032,
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 testParseArgsAbsolutePathsThatCannotBeConverted(self):
program = self.program
# even on Windows '/...' is considered absolute by os.path.abspath
argv = ['progname', '/foo/bar/baz.py', '/green/red.py']
self._patch_isfile(argv)
program.createTests = lambda: None
progra... | |
12,620 | [
0.010513815097510815,
-0.014011042192578316,
0.041125617921352386,
-0.060028351843357086,
-0.04099281132221222,
-0.02977069839835167,
-0.03085528127849102,
0.0012990095419809222,
0.028398368507623672,
0.016999179497361183,
0.00981658324599266,
-0.01892486773431301,
0.02797781489789486,
-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 testSelectedTestNamesFunctionalTest(self):
def run_unittest(args):
p = subprocess.Popen([sys.executable, '-m', 'unittest'] + args,
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, cwd=os.path.dirname(__file__))
with p:
_, stderr = p.communicate()
... | |
12,621 | [
-0.031326137483119965,
-0.010573168285191059,
-0.06155562400817871,
-0.0625569149851799,
0.02581903338432312,
-0.023780688643455505,
0.029848041012883186,
-0.009422874078154564,
0.0107579305768013,
0.04098145663738251,
0.04803818091750145,
-0.048395786434412,
0.013732005842030048,
-0.05120... | 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):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
info = self._parse_json(self._search_regex(
r'(?s)ntv.pageInfo.article =\s(\{.*?\});', webpage, 'info'),
video_id, transform_source=js_to_json)
timestamp ... | |
12,622 | [
-0.040494706481695175,
-0.00015299298684112728,
-0.08413845300674438,
-0.07577381283044815,
0.018229998648166656,
-0.0163725558668375,
0.017504243180155754,
0.01675388403236866,
-0.013075903058052063,
0.04283188655972481,
0.04994183033704758,
-0.04167559742927551,
-0.01028973888605833,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "n-tv.de"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}... | class NTVDeIE(InfoExtractor):
IE_NAME = 'n-tv.de'
_VALID_URL = r'https?://(?:www\.)?n-tv\.de/mediathek/videos/[^/?#]+/[^/?#]+-article(?P<id>.+)\.html'
_TESTS = [{
'url': 'http://www.n-tv.de/mediathek/videos/panorama/Schnee-und-Glaette-fuehren-zu-zahlreichen-Unfaellen-und-Staus-article14438086.html'... | |
12,623 | [
-0.02641502022743225,
-0.01809954084455967,
0.07465452700853348,
-0.015386068262159824,
-0.0033626630902290344,
-0.0025529980193823576,
0.03238660469651222,
0.0105134891346097,
-0.0011050835018977523,
0.006175823975354433,
0.020754659548401833,
0.007556874305009842,
0.01658233068883419,
-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": "data_dir", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batchnum=None, dp_params={}, test=False):
if batch_range == None:
batch_range = DataProvider.get_batch_nums(data_dir)
if init_batchnum is None or init_batchnum not in batch_range:
init_batchnum = batch_range[0]
... | |
12,624 | [
-0.04239017888903618,
-0.017052991315722466,
0.05404344201087952,
-0.028337039053440094,
0.010834071785211563,
0.017029915004968643,
0.01533384621143341,
0.0033229102846235037,
-0.02376803755760193,
-0.030067721381783485,
0.010072571225464344,
-0.02676788717508316,
0.0374981164932251,
-0.0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "^data_batch_(\\d+)(\\.\\d+)?$"}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Lo... | class DataProvider:
BATCH_REGEX = re.compile('^data_batch_(\d+)(\.\d+)?$')
def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batchnum=None, dp_params={}, test=False):
if batch_range == None:
batch_range = DataProvider.get_batch_nums(data_dir)
if init_batchnum is None ... | |
12,625 | [
0.0014745501102879643,
-0.04588333144783974,
0.04212845116853714,
-0.04021845757961273,
-0.002900265157222748,
-0.04492833465337753,
0.010325920768082142,
0.0072710104286670685,
-0.05361013859510422,
-0.04484151676297188,
0.030039040371775627,
0.02237734943628311,
0.007081096060574055,
-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": "batch_num", "annotation": null, "type_comment": null}}], "kwarg":... | def get_batch(self, batch_num):
fname = self.get_data_file_name(batch_num)
if os.path.isdir(fname): # batch in sub-batches
sub_batches = sorted(os.listdir(fname), key=alphanum_key)
#print sub_batches
num_sub_batches = len(sub_batches)
tgts = [[] for i in x... | |
12,626 | [
-0.052483707666397095,
-0.03046468086540699,
0.04320276901125908,
0.0005651946412399411,
0.03264570236206055,
0.013051319867372513,
0.0032976334914565086,
0.000060906157159479335,
-0.032436881214380264,
-0.03120715543627739,
-0.0028727403841912746,
-0.023619988933205605,
0.038028646260499954... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data_dir", "annotation": null, "type_comment": null}}, {"_type": "... | def get_instance(cls, data_dir, batch_range=None, init_epoch=1, init_batchnum=None, type="default", dp_params={}, test=False):
# why the fuck can't i reference DataProvider in the original definition?
#cls.dp_classes['default'] = DataProvider
type = type or DataProvider.get_batch_meta(data_dir)[... | |
12,627 | [
-0.0021221167407929897,
-0.04548577219247818,
0.05374424159526825,
-0.013329085893929005,
0.026936305686831474,
-0.017811337485909462,
0.02389821596443653,
0.013703498058021069,
-0.012120268307626247,
-0.056696753948926926,
0.010504945181310177,
-0.04206257313489914,
0.008905668742954731,
... | 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": "data_dim", "annotation... | class DummyDataProvider(DataProvider):
def __init__(self, data_dim):
#self.data_dim = data_dim
self.batch_range = [1]
self.batch_meta = {'num_vis': data_dim, 'data_in_rows':True}
self.curr_epoch = 1
self.curr_batchnum = 1
self.batch_idx = 0
def get_next_b... | |
12,628 | [
-0.004204018507152796,
-0.05217863619327545,
0.04689865559339523,
-0.03318845480680466,
0.008302659727633,
-0.0013449531979858875,
-0.014597594738006592,
0.016605319455266,
0.0017650777008384466,
-0.01936732605099678,
0.010304837487637997,
-0.05537324771285057,
0.0013005835935473442,
-0.02... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data_dim", "annotation... | class LabeledDummyDataProvider(DummyDataProvider):
def __init__(self, data_dim, num_classes=10, num_cases=7):
#self.data_dim = data_dim
self.batch_range = [1]
self.batch_meta = {'num_vis': data_dim,
'label_names': [str(x) for x in range(num_classes)],
... | |
12,629 | [
0.020811989903450012,
0.0005776642356067896,
-0.01545699406415224,
-0.004159474745392799,
0.011996123939752579,
-0.028622331097722054,
0.019163398072123528,
-0.021455056965351105,
-0.007675882428884506,
-0.003949016332626343,
0.016848357394337654,
0.012218274176120758,
-0.006962662562727928,... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "content", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "br", "annotation": null, "type_comment": null}}], "kwarg": nul... | def decode_wp_content(content, br=True):
pre_tags = {}
if content.strip() == "":
return ""
content += "\n"
if "<pre" in content:
pre_parts = content.split("</pre>")
last_pre = pre_parts.pop()
content = ""
pre_index = 0
for pre_part in pre_parts:
... | |
12,630 | [
-0.01516354363411665,
-0.02973644621670246,
0.04641066491603851,
-0.024852309376001358,
0.028327997773885727,
-0.004929571412503719,
0.006604943890124559,
0.028555165976285934,
-0.030463388189673424,
-0.027919093146920204,
-0.01824168488383293,
-0.00799067597836256,
-0.04052698239684105,
-... | 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_next_batch(self):
epoch, batchnum = self.curr_epoch, self.curr_batchnum
self.advance_batch()
if self.data is None:
data = rand(self.num_cases, self.get_data_dims()).astype(n.single) # <--changed to rand
labels = n.require(n.c_[random_integers(0,self.num_classes-1... | |
12,631 | [
0.038039907813072205,
0.012416680343449116,
0.00239855726249516,
-0.02790856920182705,
-0.034122176468372345,
-0.025149306282401085,
0.01936749368906021,
-0.04882419854402542,
0.020504899322986603,
0.029024912044405937,
0.0207892507314682,
0.011690004728734493,
-0.00956263393163681,
0.0047... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "output_path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_... | def get_out_filename(output_path, filename, ext, kind,
dirpage, dircat, categories, wp_custpost):
filename = os.path.basename(filename)
# Enforce filename restrictions for various filesystems at once; see
# http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
# we do not need to ... | |
12,632 | [
0.017460385337471962,
0.03731008991599083,
0.03489779680967331,
-0.04335230216383934,
0.01950508914887905,
-0.04339824989438057,
0.02234240248799324,
-0.001204709173180163,
-0.000931890681385994,
0.028281230479478836,
0.05394340306520462,
-0.0042215078137815,
-0.0012305551208555698,
-0.006... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fields", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "out_markup", "annotation": null, "type_comment": null}}, {"_typ... | def fields2pelican(fields, out_markup, output_path,
dircat=False, strip_raw=False, disable_slugs=False,
dirpage=False, filename_template=None, filter_author=None,
wp_custpost=False, wp_attach=False, attachments=None):
for (title, content, filename, date, author, categories, tags, status,
... | |
12,633 | [
0.00789467804133892,
-0.010944775305688381,
-0.030364951118826866,
-0.0043684933334589005,
0.023166093975305557,
-0.009673465974628925,
0.024358928203582764,
-0.030364951118826866,
-0.011290069669485092,
0.0177355594933033,
-0.010316967964172363,
-0.03722897917032242,
0.02469375729560852,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "arr", "annotation": nul... | class SubArray(np.ndarray):
# Defines a generic np.ndarray subclass, that stores some metadata
# in the dictionary `info`.
def __new__(cls,arr,info={}):
x = np.asanyarray(arr).view(cls)
x.info = info
return x
def __array_finalize__(self, obj):
self.info = getattr(obj, '... | |
12,634 | [
0.027655934914946556,
0.00235302047803998,
0.03424384072422981,
-0.0793643519282341,
0.002209324622526765,
-0.019255250692367554,
-0.0003321240656077862,
-0.013275290839374065,
-0.0022770273499190807,
0.04198130965232849,
0.006742653902620077,
0.011561993509531021,
-0.026572689414024353,
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 = argparse.ArgumentParser(
description="Transform feed, WordPress, Tumblr, Dotclear, or Posterous "
"files into reST (rst) or Markdown (md) files. Be sure to "
"have pandoc installed.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)... | |
12,635 | [
0.0041584353893995285,
0.030498914420604706,
-0.015238293446600437,
0.01905624009668827,
-0.01848689652979374,
0.001981536392122507,
0.010030481033027172,
0.0024978520814329386,
-0.009466719813644886,
0.014769422821700573,
-0.00035706028575077653,
-0.04947700724005699,
0.0672047808766365,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": nu... | class MMatrix(MaskedArray, np.matrix,):
def __new__(cls, data, mask=nomask):
mat = np.matrix(data)
_data = MaskedArray.__new__(cls, data=mat, mask=mask)
return _data
def __array_finalize__(self, obj):
np.matrix.__array_finalize__(self, obj)
MaskedArray.__array_finalize_... | |
12,636 | [
0.01256432943046093,
0.021102208644151688,
-0.03940733149647713,
0.018902886658906937,
-0.007020911201834679,
0.008633746765553951,
0.019026951864361763,
0.0008035982609726489,
0.012327480129897594,
0.004562182351946831,
-0.005543418228626251,
-0.04678351804614067,
0.0975370928645134,
0.02... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": nu... | class MSubArray(SubArray, MaskedArray):
def __new__(cls, data, info={}, mask=nomask):
subarr = SubArray(data, info)
_data = MaskedArray.__new__(cls, data=subarr, mask=mask)
_data.info = subarr.info
return _data
def __array_finalize__(self, obj):
MaskedArray.__array_fina... | |
12,637 | [
0.029070965945720673,
-0.02584085986018181,
-0.01508175116032362,
0.02397642284631729,
-0.02683839201927185,
0.013407320715487003,
0.013858585618436337,
-0.049449145793914795,
0.03308485075831413,
-0.022183237597346306,
0.007944638840854168,
-0.06070701777935028,
0.05590935796499252,
-0.02... | 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 ComplicatedSubArray(SubArray):
def __str__(self):
return 'myprefix {0} mypostfix'.format(
super(ComplicatedSubArray, self).__str__())
def __repr__(self):
# Return a repr that does not start with 'name('
return '<{0} {1}>'.format(self.__class__.__name__, self)
def ... | |
12,638 | [
0.00455289613455534,
0.002403850667178631,
0.0009513201075606048,
-0.021638857200741768,
0.03875282034277916,
0.05232750624418259,
0.021213248372077942,
-0.0026278553996235132,
0.03301829844713211,
0.012533064931631088,
0.01305947545915842,
-0.03463113307952881,
0.014773111790418625,
0.039... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_data_subclassing(self):
# Tests whether the subclass is kept.
x = np.arange(5)
m = [0, 0, 1, 0, 0]
xsub = SubArray(x)
xmsub = masked_array(xsub, mask=m)
self.assertTrue(isinstance(xmsub, MaskedArray))
assert_equal(xmsub._data, xsub)
self.assertTru... | |
12,639 | [
0.015272809192538261,
0.028682218864560127,
-0.0002185515477322042,
0.00852093007415533,
0.013881155289709568,
0.026111196726560593,
0.028776567429304123,
0.03630093112587929,
0.029012441635131836,
0.012701787985861301,
-0.004230980761349201,
-0.02004924789071083,
0.025969672948122025,
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_masked_binary_operations(self):
# Tests masked_binary_operation
(x, mx) = self.data
# Result should be a mmatrix
self.assertTrue(isinstance(add(mx, mx), mmatrix))
self.assertTrue(isinstance(add(mx, x), mmatrix))
# Result should work
assert_equal(add(mx, x... | |
12,640 | [
0.0368804857134819,
0.002016149228438735,
-0.0071498071774840355,
0.01809117943048477,
-0.0016881489427760243,
0.035965695977211,
0.016634736210107803,
-0.012445960193872452,
-0.007745624519884586,
0.010568233206868172,
0.002980590797960758,
-0.04232108220458031,
0.0705832839012146,
0.0185... | 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_attributepropagation(self):
x = array(arange(5), mask=[0]+[1]*4)
my = masked_array(subarray(x))
ym = msubarray(x)
#
z = (my+1)
self.assertTrue(isinstance(z, MaskedArray))
self.assertTrue(not isinstance(z, MSubArray))
self.assertTrue(isinstance(z._... | |
12,641 | [
-0.022188639268279076,
-0.052298277616500854,
-0.0002844303089659661,
-0.013431260362267494,
0.019777899608016014,
0.02314801514148712,
0.006248242221772671,
-0.002410739194601774,
0.004578559193760157,
0.016543082892894745,
0.029568452388048172,
-0.009052570909261703,
0.010860625654459,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "actual", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "desired", "annotation": null, "type_comment": null}}, {"_type":... | def assert_equal(actual, desired, err_msg='', verbose=True, **kwds):
if not is_pandas_min_version('0.14.1'):
npt.assert_equal(actual, desired, err_msg='', verbose=True)
else:
if isinstance(desired, pandas.Index):
pdt.assert_index_equal(actual, desired)
elif isinstance(desire... | |
12,642 | [
0.02784556709229946,
0.03380070626735687,
-0.032717954367399216,
0.00035307143116369843,
0.0058197942562401295,
0.04966538026928902,
0.020984211936593056,
0.000617139448877424,
0.02373817004263401,
0.01554691232740879,
0.010980521328747272,
-0.050795212388038635,
0.04834724962711334,
0.063... | 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_subclasspreservation(self):
# Checks that masked_array(...,subok=True) preserves the class.
x = np.arange(5)
m = [0, 0, 1, 0, 0]
xinfo = [(i, j) for (i, j) in zip(x, m)]
xsub = MSubArray(x, mask=m, info={'xsub':xinfo})
#
mxsub = masked_array(xsub, subok=F... | |
12,643 | [
0.02203119546175003,
-0.022319473326206207,
0.03610144555568695,
-0.0030324768740683794,
0.016354309394955635,
0.02167638950049877,
-0.005158537067472935,
0.007977576926350594,
0.00021724897669628263,
-0.01786223240196705,
0.030845889821648598,
-0.024858549237251282,
0.022674279287457466,
... | 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 ClientConn:
def __init__(self):
server_h2_config = H2Configuration(
client_side=False,
header_encoding='ascii',
)
self.server_h2c = H2Connection(server_h2_config)
self.to_server_transport = TransportStub(self.server_h2c)
client_h2_config = H2C... | |
12,644 | [
-0.0013938168995082378,
0.015222760848701,
-0.009947002865374088,
0.015948178246617317,
-0.017410002648830414,
0.029830018058419228,
0.0377216711640358,
0.01635485142469406,
-0.004171146545559168,
0.020201757550239563,
0.06172637268900871,
-0.03569929674267769,
-0.004514620173722506,
0.033... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "job_id", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def delete_job(job_id):
result = True
job = get_job_by_id(job_id)
shifts_in_job = job.shift_set.all()
if job and (not shifts_in_job):
job.delete()
else:
result = False
return result | |
12,645 | [
0.038847774267196655,
0.018207993358373642,
0.0005753326113335788,
-0.010558001697063446,
0.007001515943557024,
0.04144167900085449,
0.008668302558362484,
-0.0248852726072073,
0.0025103120133280754,
-0.013263363391160965,
0.010274293832480907,
-0.02000143565237522,
0.028391096740961075,
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 ClientStream:
def __init__(self, *, client_conn=None,
send_type=None, recv_type=None,
path='/foo/bar', codec=ProtoCodec(),
cardinality=Cardinality.UNARY_UNARY,
connect_time=None,
timeout=None, deadline=None, metadata=None):
... | |
12,646 | [
0.012273349799215794,
-0.026940399780869484,
0.05487440899014473,
-0.009405428543686867,
0.015660658478736877,
-0.004428906831890345,
-0.0029893002938479185,
0.013007267378270626,
0.003652648301795125,
-0.013481490314006805,
0.029921231791377068,
-0.02120455540716648,
0.017105910927057266,
... | 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):
server_h2_config = H2Configuration(
client_side=False,
header_encoding='ascii',
)
self.server_h2c = H2Connection(server_h2_config)
self.to_server_transport = TransportStub(self.server_h2c)
client_h2_config = H2Configuration(
... | |
12,647 | [
0.02746952883899212,
-0.0032552839256823063,
0.023560086265206337,
0.0009954601991921663,
0.021202009171247482,
0.034316226840019226,
0.028545143082737923,
0.007058717310428619,
0.0016315204557031393,
0.001157707185484469,
0.0119558647274971,
-0.013424491509795189,
0.03721211105585098,
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": [{"_type": "arg", "_fields": {"arg": "cl... | def __init__(self, *, client_conn=None,
send_type=None, recv_type=None,
path='/foo/bar', codec=ProtoCodec(),
cardinality=Cardinality.UNARY_UNARY,
connect_time=None,
timeout=None, deadline=None, metadata=None):
self.client_conn ... | |
12,648 | [
0.02023615501821041,
-0.03103552758693695,
0.03659849986433983,
-0.004932351876050234,
0.013783558271825314,
0.034886814653873444,
0.0000038215080166992266,
0.005132236052304506,
0.005489774979650974,
-0.021272175014019012,
0.036350756883621216,
-0.034323763102293015,
0.016159646213054657,
... | 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 ServerConn:
def __init__(self):
client_h2_config = H2Configuration(
client_side=True,
header_encoding='ascii',
)
self.client_h2c = H2Connection(client_h2_config)
self.to_client_transport = TransportStub(self.client_h2c)
self.client_h2c.initiate... | |
12,649 | [
0.009250127710402012,
-0.04063449054956436,
0.05403773486614227,
0.003147285198792815,
-0.0004409738758113235,
0.0009615885210223496,
0.0047401003539562225,
0.01276612002402544,
0.026074977591633797,
-0.008241345174610615,
0.04082326963543892,
-0.023774243891239166,
0.0022210925817489624,
... | 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):
client_h2_config = H2Configuration(
client_side=True,
header_encoding='ascii',
)
self.client_h2c = H2Connection(client_h2_config)
self.to_client_transport = TransportStub(self.client_h2c)
self.client_h2c.initiate_connection()
... | |
12,650 | [
0.03740685060620308,
0.025189725682139397,
0.007581740152090788,
-0.03410433977842331,
0.035809557884931564,
0.03604699298739433,
0.004813460633158684,
-0.023570848628878593,
0.007954081520438194,
-0.017969533801078796,
0.017246434465050697,
-0.013469056226313114,
0.02307439222931862,
0.00... | 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 ServerStream:
def __init__(self, *, server_conn=None,
recv_type=None, send_type=None, path='/foo/bar',
content_type='application/grpc+proto',
codec=ProtoCodec(), deadline=None, metadata=None):
self.server_conn = server_conn or ServerConn()
s... | |
12,651 | [
0.03318574279546738,
0.009847976267337799,
0.03691374883055687,
-0.022648191079497337,
0.039672043174505234,
0.01759490743279457,
0.015461538918316364,
-0.008619672618806362,
0.00014183738676365465,
-0.017767300829291344,
0.008657383732497692,
0.0002853583137039095,
0.024587616324424744,
-... | 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": [{"_type": "arg", "_fields": {"arg": "se... | def __init__(self, *, server_conn=None,
recv_type=None, send_type=None, path='/foo/bar',
content_type='application/grpc+proto',
codec=ProtoCodec(), deadline=None, metadata=None):
self.server_conn = server_conn or ServerConn()
self.stream_id = (self.ser... | |
12,652 | [
0.03616621345281601,
0.011451328173279762,
0.008326457813382149,
-0.022765515372157097,
0.012411319650709629,
0.021296139806509018,
0.019483910873532295,
0.01280315313488245,
0.03418745473027229,
0.009609712287783623,
0.041651882231235504,
-0.06163537874817848,
0.0008099928963929415,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "server", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_... | class ClientServer:
server = None
channel = None
def __init__(self, handler_cls, stub_cls, *, codec=None,
config=None):
self.handler_cls = handler_cls
self.stub_cls = stub_cls
self.codec = codec
self.config = config
async def __aenter__(self):
h... | |
12,653 | [
0.02726224809885025,
0.014214974828064442,
0.033910997211933136,
-0.02210291661322117,
-0.0032111783511936665,
0.005093798507004976,
-0.00784027948975563,
0.013464310206472874,
-0.03750942274928093,
-0.03596043214201927,
0.041465308517217636,
-0.04885280504822731,
-0.0033809717278927565,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.picking"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment"... | class StockPicking(models.Model):
_inherit = "stock.picking"
@api.multi
def _process_picking(self):
for pick in self:
pick.not_sync = True
pick.action_assign()
for move in pick.move_lines.filtered(lambda m: m.state not in
... | |
12,654 | [
0.0341668538749218,
0.0033634291030466557,
0.022253956645727158,
-0.0019764346070587635,
0.04616248235106468,
0.007435220759361982,
0.019182661548256874,
0.04146764054894447,
-0.004733619280159473,
0.008102218620479107,
0.01982380822300911,
0.003645222866907716,
0.022708963602781296,
-0.02... | 9 | {"_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 __aenter__(self):
host = '127.0.0.1'
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(('127.0.0.1', 0))
_, port = s.getsockname()
handler = self.handler_cls()
self.server = server.Server([handler], codec=self.codec)
await self... | |
12,655 | [
0.006890897173434496,
0.02266612835228443,
-0.015455298125743866,
-0.007807632442563772,
0.01156686246395111,
0.015196888707578182,
0.00864438433200121,
0.019454479217529297,
-0.0032085739076137543,
-0.00013228062016423792,
0.07570142298936844,
-0.010896231047809124,
-0.028941767290234566,
... | 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 _process_picking(self):
for pick in self:
pick.not_sync = True
pick.action_assign()
for move in pick.move_lines.filtered(lambda m: m.state not in
['done', 'cancel']):
for move_line in move.move_line_ids:
... | |
12,656 | [
0.025954337790608406,
0.041464224457740784,
-0.025423672050237656,
-0.006392099894583225,
-0.04254967346787453,
-0.005312679335474968,
-0.009413271211087704,
-0.009853482246398926,
0.008092639036476612,
-0.04117476940155029,
0.037966661155223846,
-0.043803974986076355,
-0.005258406512439251,... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.move"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class StockMove(models.Model):
_inherit = "stock.move"
@api.multi
def _action_done(self):
res = super()._action_done()
vendor_deposit_loc = self.env.ref("automatize_edi_it.stock_location_vendor_deposit")
for move in self:
if move.location_dest_id == vendor_deposit_loc:
... | |
12,657 | [
-0.019925564527511597,
0.015619114972651005,
-0.024495407938957214,
0.013709526509046555,
-0.012734977528452873,
0.0008469682070426643,
0.008086117915809155,
0.029078418388962746,
0.002568066818639636,
-0.01837155595421791,
0.05694523826241493,
-0.03806006908416748,
-0.023323316127061844,
... | 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 _action_done(self):
res = super()._action_done()
vendor_deposit_loc = self.env.ref("automatize_edi_it.stock_location_vendor_deposit")
for move in self:
if move.location_dest_id == vendor_deposit_loc:
domain = [('state', 'in', ['confirmed',
... | |
12,658 | [
-0.000012420667189871892,
0.028358472511172295,
0.043952181935310364,
0.012005776166915894,
0.03677631542086601,
0.02449454367160797,
-0.010683300904929638,
-0.002938195364549756,
-0.013696244917809963,
0.04547015205025673,
0.021941591054201126,
-0.03606332838535309,
0.03808728978037834,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "terms"}}, "targets": [{"_type": "Name", "_fields": {"id": "type", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"... | class TermsFacet(Facet):
type = "terms"
result_class = TermsResult
def __init__(self, term, name, size=None):
if name is not None:
assert(name.isalnum(), "name must be a valid python variable name")
self.params = {
"field": term,
}
if size is not None... | |
12,659 | [
0.007577220909297466,
0.0034971788991242647,
0.006921499967575073,
-0.036258943378925323,
0.0003437981940805912,
0.01200333796441555,
0.014705151319503784,
0.009350095875561237,
-0.02690884843468666,
0.007255431730300188,
0.00608059810474515,
-0.02950744703412056,
-0.0006363681750372052,
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 ShowSupergraph(gcc.IpaPass):
def execute(self):
# (the callgraph should be set up by this point)
if gcc.is_lto():
sg = Supergraph(split_phi_nodes=False,
add_fake_entry_node=False)
dot = sg.to_dot('supergraph')
invoke_dot(dot) | |
12,660 | [
0.0321100577712059,
0.03249005973339081,
0.032975614070892334,
0.014513915404677391,
-0.02518559992313385,
-0.022293373942375183,
0.06054677441716194,
-0.017110586166381836,
-0.008666126988828182,
0.05358009785413742,
-0.0040322295390069485,
-0.012202244251966476,
-0.01319446787238121,
-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": "term", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, term, name, size=None):
if name is not None:
assert(name.isalnum(), "name must be a valid python variable name")
self.params = {
"field": term,
}
if size is not None:
self.params["size"] = size
self.name = name if name is not... | |
12,661 | [
-0.04819944500923157,
-0.025272883474826813,
0.0346456915140152,
-0.04732581228017807,
0.03771587833762169,
0.008230847306549549,
-0.002530408324673772,
-0.0023494421038776636,
0.022090371698141098,
-0.004062382038682699,
-0.020617680624127388,
-0.04477980360388756,
-0.017809582874178886,
... | 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 DateIntervalTest(LuigiTestCase):
def test_date(self):
di = DI().parse('2012-01-01')
self.assertEqual(di.dates(), [datetime.date(2012, 1, 1)])
self.assertEqual(di.next().dates(), [datetime.date(2012, 1, 2)])
self.assertEqual(di.prev().dates(), [datetime.date(2011, 12, 31)])
... | |
12,662 | [
-0.0012598256580531597,
-0.027894573286175728,
0.04830218479037285,
-0.02811993472278118,
0.01683940924704075,
0.015487248077988625,
0.0029093364719301462,
-0.01219448633491993,
0.008995624259114265,
0.004810812417417765,
-0.0035775918513536453,
-0.0449468232691288,
-0.048076823353767395,
... | 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_week(self):
# >>> datetime.date(2012, 1, 1).isocalendar()
# (2011, 52, 7)
# >>> datetime.date(2012, 12, 31).isocalendar()
# (2013, 1, 1)
di = DI().parse('2011-W52')
self.assertEqual(di.dates(), [datetime.date(2011, 12, 26) + datetime.timedelta(i) for i in range(... | |
12,663 | [
-0.0022622377146035433,
-0.04959007725119591,
0.016260750591754913,
-0.0328863263130188,
0.0634794682264328,
0.02411750704050064,
-0.0023094695061445236,
0.010944735258817673,
0.020638644695281982,
-0.020755909383296967,
0.01425421517342329,
-0.0640527606010437,
-0.06285405158996582,
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_comparison(self):
a = DI().parse('2011')
b = DI().parse('2013')
c = DI().parse('2012')
self.assertTrue(a < b)
self.assertTrue(a < c)
self.assertTrue(b > c)
d = DI().parse('2012')
self.assertTrue(d == c)
self.assertEqual(d, min(c, b))
... | |
12,664 | [
-0.04197949171066284,
-0.007712185848504305,
0.005626628641039133,
-0.026461781933903694,
0.02695181407034397,
0.010284858755767345,
-0.0033077227417379618,
-0.0030860411934554577,
0.022774865850806236,
-0.027605190873146057,
-0.04277287796139717,
-0.02186480537056923,
-0.007035473827272654,... | 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_parameter_parse_and_default(self):
month = luigi.date_interval.Month(2012, 11)
other = luigi.date_interval.Month(2012, 10)
class MyTask(luigi.Task):
di = DI(default=month)
class MyTaskNoDefault(luigi.Task):
di = DI()
self.assertEqual(MyTask().d... | |
12,665 | [
0.004131643567234278,
0.07013563066720963,
0.02889789454638958,
-0.021888528019189835,
-0.010765882208943367,
-0.01567663438618183,
0.039768707007169724,
-0.02988424152135849,
-0.010881305672228336,
0.007067077327519655,
0.01701974682509899,
-0.011552861891686916,
-0.0289398655295372,
-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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
super(TextAnnotationModule, self).__init__(*args, **kwargs)
xmltree = etree.fromstring(self.data)
self.instructions = self._extract_instructions(xmltree)
self.content = etree.tostring(xmltree, encoding='unicode')
self.user_email = ""
... | |
12,666 | [
-0.004190373234450817,
-0.008614682592451572,
0.031207023188471794,
-0.042763445526361465,
0.03232991322875023,
0.04271665960550308,
-0.006608683615922928,
-0.019299695268273354,
0.0109364939853549,
0.03600270301103592,
-0.01039259321987629,
-0.0810353234410286,
0.011807904578745365,
-0.02... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_cmp(self):
operators = [lambda x, y: x == y,
lambda x, y: x != y,
lambda x, y: x < y,
lambda x, y: x > y,
lambda x, y: x <= y,
lambda x, y: x >= y]
dates = [(1, 30, DI().parse('2015-01-01-2... | |
12,667 | [
0.031444672495126724,
-0.02072259783744812,
0.06030693277716637,
-0.004253385588526726,
-0.02462153322994709,
0.01216518972069025,
-0.006519326474517584,
-0.011146149598062038,
-0.000771796447224915,
0.049192432314157486,
-0.01833006739616394,
-0.03795134276151657,
0.04769868403673172,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "l", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def organisation_list_represent(l):
organisation_represent = s3db.org_organisation_represent
if l:
max = 4
if len(l) > max:
count = 1
for x in l:
if count == 1:
output = organisation_represent(x)
elif count > max:
... | |
12,668 | [
0.012684416957199574,
0.0073447758331894875,
0.0467938669025898,
-0.01607431285083294,
0.007062284275889397,
0.01283951010555029,
-0.011764935217797756,
0.009383144788444042,
-0.02818266861140728,
-0.03693436458706856,
0.0017392606241628528,
-0.06132832542061806,
0.030797099694609642,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields"... | def site_org_json():
table = s3db.org_site
otable = s3db.org_organisation
response.headers["Content-Type"] = "application/json"
#db.req_commit.date.represent = lambda dt: dt[:10]
query = (table.site_id == request.args[0]) & \
(table.organisation_id == otable.id)
records = db(query).... | |
12,669 | [
0.009302530437707901,
-0.001567952916957438,
-0.01542313490062952,
0.011182758957147598,
-0.024850575253367424,
-0.03310780227184296,
0.030004767701029778,
0.02892659604549408,
0.0025935322046279907,
0.03576378896832466,
0.0345541313290596,
0.013233917765319347,
-0.005689992569386959,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "image", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mask", "annotation": null, "type_comment": null}}, {"_type": "ar... | def imimposemin(image, mask, connectivity):
fm = image.copy()
fm[mask] = -922337203685477580
fm[np.logical_not(mask)] = 922337203685477580
if 'float' in image.dtype.name:
range = image.max() - image.min()
if range is 0:
h = 0.1
else:
h = range * 0.001
... | |
12,670 | [
0.011607563123106956,
0.05353134870529175,
0.02552422508597374,
0.014673946425318718,
-0.047423411160707474,
0.004016092512756586,
0.02815609984099865,
0.03021690808236599,
0.016238173469901085,
0.015493303537368774,
-0.023674463853240013,
-0.018783148378133774,
-0.003941605798900127,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "g", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f... | def fast_conditional_dilate(f, g, Bc=None, n=1):
if Bc is None: Bc = pymorph.secross()
f = pymorph.intersec(f,g)
for i in xrange(n):
prev = f
f = pymorph.intersec(mahotas.dilate(f, Bc), g)
if pymorph.isequal(f, prev): break
return f | |
12,671 | [
-0.015175198204815388,
0.028858976438641548,
0.025117997080087662,
-0.051851700991392136,
0.020084455609321594,
0.04456859827041626,
-0.008215238340198994,
-0.01511305570602417,
0.011682789772748947,
0.03566979244351387,
0.002005649032071233,
-0.04026833921670914,
-0.0025385210756212473,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Ansible-output-primary"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_com... | class AnsibleOutputPrimaryLexer(RegexLexer):
name = 'Ansible-output-primary'
# The following definitions are borrowed from Pygment's JSON lexer.
# It has been originally authored by Norman Richards.
# integer part of a number
int_part = r'-?(0|[1-9]\d*)'
# fractional part of a number
frac... | |
12,672 | [
0.0018872468499466777,
-0.019185271114110947,
0.0012750460300594568,
-0.023892218247056007,
-0.028122510761022568,
-0.031173087656497955,
0.010170577093958855,
0.0578179769217968,
0.0022000502794981003,
0.0006617280305363238,
0.059724584221839905,
-0.022629087790846825,
-0.028003348037600517... | 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 create_test_products():
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_products(product=ilharga)
mv_regina = Product.objects.create(ref_code=2, name='REGINA', color='Branc... | |
12,673 | [
-0.007472872268408537,
-0.017842603847384453,
0.03394196555018425,
-0.03281398490071297,
-0.01282437238842249,
-0.010280006565153599,
-0.00164230156224221,
0.037223365157842636,
0.023367146030068398,
-0.005777697078883648,
0.025200115516781807,
-0.07229331135749817,
-0.06101350486278534,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "pm/production_stages.json"}}]}}, "targets": [{"_type": "N... | class ProductUtilsTests(TestCase):
fixtures = ['pm/production_stages.json']
def test_get_product_tree(self):
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_interme... | |
12,674 | [
-0.001398200634866953,
-0.03089592419564724,
0.006541361566632986,
-0.03855830803513527,
-0.020350903272628784,
-0.021398013457655907,
0.0020326266530901194,
0.037572793662548065,
-0.019476257264614105,
-0.004884463269263506,
0.0495714507997036,
-0.036340899765491486,
-0.029590114951133728,
... | 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 create_test_orders():
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_products(product=ilharga)
fundo = Product.objects.create(
ref_code=2, name='fundo', size='200... | |
12,675 | [
0.0075898622162640095,
-0.005856719799339771,
0.017684875056147575,
-0.009456323459744453,
-0.02296801470220089,
-0.011341387405991554,
0.000533274607732892,
0.06468745321035385,
0.025770805776119232,
-0.028300760313868523,
0.0465313121676445,
-0.06225671246647835,
-0.04918528348207474,
-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_create_intermediate_products(self):
component = Product.objects.create(ref_code=1, name='ilharga', size='200x300', stages=['PT', 'CP'])
component.save()
ProductUtils.create_intermediate_products(component)
ilharga = Product.objects.get(ref_code=1)
ilharga_components = il... | |
12,676 | [
0.00009547986701363698,
-0.0188460573554039,
0.011644503101706505,
-0.023819508031010628,
0.0068766227923333645,
-0.006594793871045113,
0.0014887192519381642,
0.04806341603398323,
-0.01550390012562275,
0.0007659112452529371,
0.0427318774163723,
-0.03649848699569702,
-0.04169740155339241,
-... | 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_product_tree(self):
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_products(ilharga)
regina = Product.objects.create(ref_code=2, name='RE... | |
12,677 | [
-0.007413298357278109,
0.003904667217284441,
-0.006355139426887035,
0.009869959205389023,
-0.023687900975346565,
-0.011924395337700844,
0.021138420328497887,
0.03856400400400162,
0.04007389023900032,
-0.027029454708099365,
0.030172990635037422,
-0.043662965297698975,
-0.05673215165734291,
... | 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_create_intermediate_products_should_replace_affected_characteristic_with_default_value(self):
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_products(... | |
12,678 | [
0.04955184459686279,
-0.023370906710624695,
0.023345816880464554,
-0.04383142665028572,
-0.02259313128888607,
-0.02125084027647972,
0.010468610562384129,
0.07210733741521835,
0.02279384806752205,
-0.003336908994242549,
0.05640128627419472,
-0.0623725987970829,
-0.07070232927799225,
-0.0554... | 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_create_intermediate_products_with_just_one_stage(self):
fundo = Product.objects.create(
ref_code=2, name='fundo', color='Branco', size='200x300', stages=['CP']
)
fundo.save()
self.assertEqual(len(ProductUtils.get_product_tree(fundo)), 1)
ProductUtils.create_i... | |
12,679 | [
0.016138600185513496,
-0.013864642009139061,
0.011759607121348381,
-0.06424254179000854,
-0.01781482994556427,
0.008835948072373867,
-0.0025858143344521523,
0.00879046879708767,
0.01720411144196987,
-0.02023172192275524,
0.055718448013067245,
-0.0418408140540123,
-0.02913263998925686,
0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "pm/production_stages.json"}}]}}, "targets": [{"_type": "N... | class OrderUtilsTests(TestCase):
fixtures = ['pm/production_stages.json']
def test_delete_execution_order_should_return_deleted_order_object_with_id(self):
order = OrderUtils.get_exec_order()
order_id = order.id
deleted_order = OrderUtils.delete_execution_order()
self.assertEqua... | |
12,680 | [
0.033451128751039505,
-0.014058813452720642,
0.020486049354076385,
-0.019072795286774635,
-0.01166242454200983,
0.005686814431101084,
0.03261546418070793,
0.040234748274087906,
0.02508220076560974,
-0.024418585002422333,
0.02191159501671791,
-0.06090513616800308,
-0.05181115120649338,
-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_create_intermediate_products_should_not_create_duplicate_objects(self):
component = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
component.save()
ProductUtils.create_intermediate_products(component)
... | |
12,681 | [
0.016006147488951683,
-0.028789419680833817,
0.029967933893203735,
-0.03561999276280403,
-0.030088191851973534,
0.0028109971899539232,
0.02626403234899044,
0.035307325422763824,
0.031170500442385674,
-0.001158221042715013,
0.03761625289916992,
-0.045673441141843796,
-0.03694281354546547,
-... | 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_create_sub_orders_with_a_main_product_and_intermediate_product(self):
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_products(product=ilharga)
... | |
12,682 | [
0.05029710382223129,
0.0016812694957479835,
-0.001047606347128749,
-0.07842124998569489,
0.015309900976717472,
0.02788417786359787,
-0.016473742201924324,
-0.028268124908208847,
0.035203173756599426,
-0.04165828973054886,
0.046673599630594254,
-0.030235854908823967,
0.005705217830836773,
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_get_exec_order_should_not_create_an_order_if_there_is_one_opened(self):
order = OrderUtils.get_exec_order()
self.assertEqual(order.exec_order, True)
order_2 = OrderUtils.get_exec_order()
self.assertEqual(str(order), str(order_2))
## set order to execution status
... | |
12,683 | [
0.01734292320907116,
-0.02828606404364109,
-0.007395169232040644,
-0.021532095968723297,
-0.021153481677174568,
-0.03417288884520531,
0.0009579827892594039,
0.027553265914320946,
-0.0006858546403236687,
-0.021825214847922325,
0.04079250991344452,
-0.04680146649479866,
-0.0018167323432862759,... | 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_create_sub_orders_when_stock_for_components_exist(self):
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_products(product=ilharga)
mv_regina ... | |
12,684 | [
0.014696023426949978,
-0.0309145487844944,
0.006954483222216368,
-0.030630692839622498,
-0.015470176935195923,
-0.017082998529076576,
0.006473862566053867,
0.026553481817245483,
-0.0005245699430815876,
-0.017934566363692284,
0.045623473823070526,
-0.04797174036502838,
-0.0034707903396338224,... | 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_create_sub_orders_when_some_stock_for_components_exist(self):
ilharga = Product.objects.create(ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP'])
ilharga.save()
ProductUtils.create_intermediate_products(product=ilharga)
mv_regina = Product.objects.c... | |
12,685 | [
0.03913356736302376,
-0.015861446037888527,
0.0011530426563695073,
-0.03780744597315788,
-0.009393356740474701,
-0.013189702294766903,
0.010342443361878395,
0.027848539873957634,
0.012104103341698647,
-0.017278576269745827,
0.06807420402765274,
-0.04732431471347809,
-0.0223490372300148,
-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_create_sub_orders_with_some_stock_in_first_stage(self):
# --- Set up ---#
ilharga = Product.objects.create(ref_code=1, name='ilharga', color='Branco', size='200x300',
stages=['PT', 'CP'])
ilharga.save()
ProductUtils.create_intermediate_pr... | |
12,686 | [
0.03613453358411789,
-0.008862590417265892,
0.0015481025911867619,
-0.04644782841205597,
-0.020031100139021873,
-0.014367658644914627,
0.008387468755245209,
0.034563466906547546,
-0.0029061567038297653,
-0.022451050579547882,
0.05483529716730118,
-0.02784842438995838,
-0.029748909175395966,
... | 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_create_sub_orders_should_create_orders_for_all_stages_if_no_stock(self):
#--- Set up ---#
ilharga = Product.objects.create(
ref_code=1, name='ilharga', color='Branco', size='200x300', stages=['PT', 'CP']
)
ilharga.save()
ProductUtils.create_intermediate_produ... | |
12,687 | [
-0.03957527503371239,
0.0010694226948544383,
0.02410365454852581,
0.019823014736175537,
-0.009127313271164894,
-0.009021181613206863,
-0.004174507688730955,
-0.007918592542409897,
0.032240405678749084,
0.025636665523052216,
0.0036703827790915966,
0.008319534361362457,
-0.02311309240758419,
... | 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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _hemisphere(self, value, value_source_crs):
# Perform basic hemisphere detection.
if value < 0:
hemisphere = 'W'
elif value > 0:
hemisphere = 'E'
else:
hemisphere = ''
# Correct for user preferences:
if value == 0 and self._zero_dir... | |
12,688 | [
0.0341092050075531,
0.01468984317034483,
0.001657783635891974,
-0.027701469138264656,
-0.012030850164592266,
0.014123172499239445,
-0.03347714990377426,
-0.015779593959450722,
0.009644296020269394,
0.012586623430252075,
0.02532581239938736,
-0.025696327909827232,
-0.008870572783052921,
-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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __call__(self, value, pos=None):
if not isinstance(self.axis.axes, GeoAxes):
raise TypeError("This formatter can only be "
"used with cartopy axes.")
# We want to produce labels for values in the familiar Plate Carree
# projection, so convert the tick ... | |
12,689 | [
-0.0067606838420033455,
0.005516367964446545,
0.038442645221948624,
0.0018825007136911154,
-0.04231255501508713,
-0.037906453013420105,
-0.003630953375250101,
-0.03813958168029785,
0.01971088908612728,
-0.004149660933762789,
0.014220748096704483,
-0.020934807136654854,
-0.03758007660508156,
... | 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 __init__(self):
super(KG_StabilityCalculator, self).__init__()
self.g0 = -1.2 # kcal/mol
self.lnz = numpy.log(7.54)
self.cp = -0.0148 # cal/(mol*K)
self.Th = 373.15 # K
self.Ts = 385.15 # K
self.residues_per_ss = 1./0.0723 | |
12,690 | [
0.012218233197927475,
0.056369293481111526,
0.06168794259428978,
-0.03637201339006424,
0.006459854077547789,
-0.006857705768197775,
-0.01580936834216118,
0.015421985648572445,
0.046402063220739365,
0.022384388372302055,
0.005193010903894901,
-0.0076743485406041145,
0.03180719166994095,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "_cfg", "annotation": null, "type_comment": null}}, {"_type": "arg... | def handle(name, _cfg, cloud, log, _args):
# Comes from the following:
# https://forums.aws.amazon.com/thread.jspa?threadID=96918
runparts_path = os.path.join(cloud.get_cpath(), 'scripts', SCRIPT_SUBDIR)
try:
util.runparts(runparts_path)
except:
log.warn("Failed to run module %s (%s ... | |
12,691 | [
0.04708228260278702,
0.025003451853990555,
-0.028690122067928314,
-0.044281236827373505,
0.00989634171128273,
0.03503366559743881,
-0.0028988763224333525,
0.014602510258555412,
-0.015086513943970203,
0.044693153351545334,
0.020688604563474655,
-0.035424988716840744,
0.0018639310728758574,
... | 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": "seq", "annotation": nu... | class looper_iter(object):
def __init__(self, seq):
self.seq = list(seq)
self.pos = 0
def __iter__(self):
return self
def __next__(self):
if self.pos >= len(self.seq):
raise StopIteration
result = loop_pos(self.seq, self.pos), self.seq[self.pos]
... | |
12,692 | [
-0.005376789253205061,
0.008869740180671215,
-0.03056752309203148,
-0.0017114336369559169,
0.01313080359250307,
0.03458189219236374,
0.04301431402564049,
-0.029221924021840096,
0.01932055875658989,
-0.025274833664298058,
-0.005158129148185253,
-0.06382624059915543,
0.031105762347579002,
-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": "item", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _compare_group(self, item, other, getter):
if getter is None:
return item != other
elif (isinstance(getter, basestring_)
and getter.startswith('.')):
getter = getter[1:]
if getter.endswith('()'):
getter = getter[:-2]
r... | |
12,693 | [
0.01977195218205452,
-0.02745583839714527,
0.04085578769445419,
-0.030313869938254356,
-0.0010505313985049725,
-0.017827553674578667,
-0.015695743262767792,
-0.020545026287436485,
0.001881439471617341,
-0.03256281092762947,
0.026823323220014572,
-0.061658505350351334,
-0.03724810853600502,
... | 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": "cr", "annotation": nul... | class payment_order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
super(payment_order, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
'get_invoice_name': self._get_invoice_name,
'get_amount_total... | |
12,694 | [
0.008861513808369637,
-0.031968411058187485,
0.003661246970295906,
0.008208105340600014,
-0.019613051787018776,
-0.01609220542013645,
0.0363316647708416,
-0.03281082212924957,
-0.00372334779240191,
-0.004552258178591728,
0.05028544366359711,
-0.011102542281150818,
-0.015670999884605408,
-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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def __init__(self, cr, uid, name, context=None):
super(payment_order, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
'get_invoice_name': self._get_invoice_name,
'get_amount_total_in_currency': self._get_amount_total_in_currenc... | |
12,695 | [
0.02768060937523842,
0.05708080902695656,
0.03678010404109955,
-0.014007487334311008,
-0.00840090960264206,
0.004251206759363413,
0.01881994865834713,
-0.027847792953252792,
-0.04033869877457619,
0.04841121286153793,
-0.0036989080253988504,
-0.009039784781634808,
0.008789011277258396,
0.02... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value": ... | def main(argv=None):
if argv is None:
argv = sys.argv
usage = "usage: %prog [options] [workflow_file]"
parser = optparse.OptionParser(usage=usage)
parser.add_option("--no-discovery",
action="store_true",
help="Don't run widget discovery "
... | |
12,696 | [
-0.028168590739369392,
-0.03537006303668022,
0.012459184043109417,
0.001792401890270412,
-0.01645292155444622,
-0.02549193799495697,
0.01563505455851555,
0.03093021735548973,
0.02044665813446045,
0.026107992976903915,
0.0456305667757988,
-0.05174863338470459,
-0.01733451709151268,
-0.02912... | 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": "payment", "annotation": null, "type_comment": null}}], "kwarg": n... | def _get_amount_total_in_currency(self, payment):
total = 0.0
if payment.line_ids:
currency_cmp = payment.line_ids[0].currency.id
else:
return False
for line in payment.line_ids:
if currency_cmp == line.currency.id:
total += line.amount... | |
12,697 | [
-0.0253436416387558,
-0.004046438727527857,
-0.08934055268764496,
-0.061421629041433334,
-0.009254159405827522,
-0.012009949423372746,
0.007984571158885956,
-0.0006607428076677024,
0.004004319664090872,
-0.003107785014435649,
0.029579615220427513,
-0.0540568083524704,
0.013080977834761143,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "anitube.se"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nu... | class AnitubeIE(InfoExtractor):
IE_NAME = 'anitube.se'
_VALID_URL = r'https?://(?:www\.)?anitube\.se/video/(?P<id>\d+)'
_TEST = {
'url': 'http://www.anitube.se/video/36621',
'md5': '59d0eeae28ea0bc8c05e7af429998d43',
'info_dict': {
'id': '36621',
'ext': 'mp4'... | |
12,698 | [
0.011858968995511532,
0.0027133459225296974,
-0.07184731960296631,
-0.06412627547979355,
0.0017250985838472843,
-0.0017019816441461444,
0.015407412312924862,
-0.00972643494606018,
0.007472537457942963,
0.023463651537895203,
0.036524698138237,
-0.04970133304595947,
0.016089361160993576,
-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):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
key = self._html_search_regex(
r'http://www\.anitube\.se/embed/([A-Za-z0-9_-]*)', webpage, 'key')
config_xml = self._downl... | |
12,699 | [
0.049272991716861725,
0.0301060788333416,
-0.003561656456440687,
-0.04277494177222252,
-0.03667425364255905,
0.017600836232304573,
-0.0021022246219217777,
0.018161818385124207,
0.04298530891537666,
0.043593041598796844,
-0.015462089329957962,
-0.011219656094908714,
0.03314473479986191,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flags", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_startup_config(module, flags=None):
reply = run_commands(module, {'command': 'show switch', 'output': 'text'})
match = re.search(r'Config Selected: +(\S+)\.cfg', to_text(reply, errors='surrogate_or_strict').strip(), re.MULTILINE)
if match:
cfgname = match.group(1).strip()
command = '... | |
12,700 | [
0.04865720123052597,
0.07391595095396042,
0.051509659737348557,
-0.07565223425626755,
-0.017548836767673492,
0.011637214571237564,
0.03596581518650055,
0.021765518933534622,
0.02594086155295372,
0.025382770225405693,
-0.024431949481368065,
-0.023584479466080666,
0.03952105715870857,
0.0045... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "current_config", "annotation": null, "type_comment": null}}, {"... | def get_running_config(module, current_config=None, flags=None):
contents = module.params['running_config']
if not contents:
if current_config:
contents = current_config.config_text
else:
contents = get_config(module, flags=flags)
return contents |