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
1,301
[ -0.009189961478114128, -0.026032954454421997, 0.043894242495298386, 0.012801432982087135, -0.012978527694940567, 0.01913890242576599, 0.035874370485544205, 0.012371345423161983, 0.002616893732920289, 0.0024492861703038216, 0.025893807411193848, 0.023009691387414932, 0.035545483231544495, 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 testInvertMutuallyConsistent(self): dims = 4 with self.test_session() as sess: nvp = Invert(RealNVP( num_masked=3, validate_args=True, **self._real_nvp_kwargs)) dist = transformed_distribution_lib.TransformedDistribution( distribution=normal_lib.Normal(loc...
1,302
[ 0.03222278878092766, -0.034593772143125534, -0.014677513390779495, 0.03434538096189499, 0.01831302046775818, 0.0010542406234890223, 0.043738991022109985, -0.02863244153559208, -0.014045251533389091, 0.026103394106030464, 0.0027054608799517155, -0.0009759135427884758, -0.0067685917019844055, ...
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": "question", "annotation": null, "type_comment": null}}, {"_type": ...
def __init__(self, question=None, timestamp=None): if question is None: self.question = self.generate_question() else: self.question = question if timestamp is None: self.timestamp = time.time() else: self.timestamp = timestamp
1,303
[ 0.01982024870812893, -0.03363703563809395, 0.012646995484828949, -0.013000139966607094, 0.062065187841653824, 0.0517798475921154, 0.0017229600343853235, 0.04749796539545059, 0.0004397065786179155, 0.018937386572360992, 0.04478316754102707, -0.07204152643680573, -0.02004096284508705, 0.0010...
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": "seq", "annotation": nu...
class Set: def __init__(self, seq=None): self.values = {} if seq: for e in seq: self.values[e] = None def add(self, e): self.values[e] = None def discard(self, e): if e in list(self.values.keys()): ...
1,304
[ 0.0010330688674002886, -0.030810682103037834, -0.006295241881161928, -0.021886058151721954, 0.014848915860056877, 0.018591148778796196, -0.02932688221335411, 0.00641525536775589, -0.0014401593944057822, 0.017740145325660706, 0.008853706531226635, 0.005804278422147036, -0.013015985488891602, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def numBits(n): if n==0: return 0 s = "%x" % n return ((len(s)-1)*4) + \ {'0':0, '1':1, '2':2, '3':2, '4':3, '5':3, '6':3, '7':3, '8':4, '9':4, 'a':4, 'b':4, 'c':4, 'd':4, 'e':4, 'f':4, }[s[0]] return int(math.floor(math.log(n, 2))+...
1,305
[ 0.08882812410593033, 0.016720587387681007, -0.007048973813652992, -0.020287780091166496, 0.08408526331186295, 0.00694848969578743, -0.01073172315955162, 0.003042162163183093, 0.03187362104654312, 0.00624007498845458, 0.010591045953333378, -0.0009244555840268731, 0.01935327611863613, 0.0053...
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 write_only_fields_are_present_on_input(self): data = { 'email': 'foo@example.com', 'password': '123' } serializer = self.Serializer(data=data) self.assertTrue(serializer.is_valid()) self.assertEquals(serializer.validated_data, data)
1,306
[ 0.07191811501979828, -0.0322282500565052, 0.03450467437505722, -0.04312557354569435, 0.03541102632880211, -0.018896421417593956, -0.004729374777525663, -0.0153131615370512, -0.009400784969329834, 0.025124967098236084, 0.006365553941577673, 0.0015610888367518783, 0.003267088904976845, -0.00...
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 WriteOnlyFieldTests(TestCase): def setUp(self): class ExampleSerializer(serializers.Serializer): email = serializers.EmailField() password = serializers.CharField(write_only=True) def create(self, attrs): return attrs self.Serializer = Exam...
1,307
[ 0.03435744717717171, 0.03734781593084335, 0.05111200362443924, -0.017942221835255623, -0.012311417609453201, 0.011961481533944607, 0.0032210105564445257, 0.02697695791721344, -0.05412358045578003, -0.03560873493552208, -0.028737246990203857, 0.020359966903924942, 0.0004904419183731079, 0.0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('quotes', '0005_auto_20170107_1205'), ] operations = [ migrations.AddField( model_name='quote', name='igv', field=models.DecimalField(decimal_places=1, default=18, max_digits=3, verbose_name='IGV')...
1,308
[ 0.005295082461088896, 0.008643565699458122, 0.030216533690690994, 0.020428234711289406, 0.016557155176997185, -0.0060831233859062195, 0.021113969385623932, 0.060388825833797455, -0.033512480556964874, -0.020549897104501724, 0.05061158537864685, 0.060034897178411484, -0.02344767563045025, -...
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": "quota_list", "annotation": null, "type_comment": null}}, {"_type"...
def push_quota_to_tsdb(self, quota_list, cluster_name): self.check_quota_new_keys(quota_list) timestamp = int(time.time()) # reset the quota_total_dict quota_total_dict = dict.fromkeys(QUOTA_TOTAL_DICT, 0) # push every user's quota to tsdb for cluster_name for quota_dict in quota_list: f...
1,309
[ 0.062221892178058624, 0.051490869373083115, 0.0334104485809803, 0.03771638497710228, -0.01792261004447937, 0.013357416726648808, 0.006802701391279697, -0.02567780204117298, 0.004883629269897938, -0.03343299403786659, -0.018057875335216522, -0.06488209962844849, 0.04290154203772545, -0.0287...
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "body"}}, "targets": [{"_type": "Name", "_fields": {"id": "default_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class AnimalBody(Model): default_name = 'body' eyes = Model.children_property(SimpleEye) mouths = Model.children_property(SimpleMouth) exoskeleton = Model.children_property(Exoskeleton) flesh = Model.children_property(Flesh) jelly = Model.children_property(Jelly)
1,310
[ 0.011286565102636814, 0.02895745076239109, 0.030680203810334206, 0.012363285757601261, -0.020217012614011765, -0.03192159906029701, -0.00003688856668304652, -0.010190843604505062, 0.026423990726470947, 0.07539577782154083, 0.028248080983757973, -0.03420171141624451, -0.016150809824466705, ...
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": "s", "annotation": null, "type_comment": null}}], "kwarg": {"_type...
def __init__(self, s=None, **kws): _mstates = kws.get('mstates', None) _machine = kws.get('machine', None) _latfile = kws.get('latfile', None) self._states = None if s is None: if _mstates is not None: self._states = _mstates.clone() else:...
1,311
[ -0.013735453598201275, 0.03281877934932709, 0.034988198429346085, -0.03241516649723053, 0.005887073464691639, 0.014706647023558617, -0.005070387851446867, 0.024052809923887253, 0.039831556379795074, 0.016207583248615265, 0.03276832774281502, -0.00005010673703509383, 0.004969484638422728, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "If", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "not a POSIX platform"}}, "targets": [{"_type": "Name", "_fields": {"id": "skip", "ctx": {"_type": "S...
class TestPOSIXKilling(BasedirMixin, unittest.TestCase): if runtime.platformType != "posix": skip = "not a POSIX platform" def setUp(self): self.pidfiles = [] self.setUpBasedir() def tearDown(self): # make sure all of the subprocesses are dead for pidfile in self.p...
1,312
[ 0.03796235844492912, 0.016687670722603798, 0.03779512643814087, -0.017977770417928696, -0.050266083329916, 0.01074485294520855, 0.05623876303434372, 0.0607302188873291, 0.009944513440132141, 0.03918078541755676, 0.04314664751291275, -0.01153324730694294, -0.01764329895377159, -0.0279043652...
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): # make sure all of the subprocesses are dead for pidfile in self.pidfiles: if not os.path.exists(pidfile): continue with open(pidfile) as f: pid = f.read() if not pid: return pid = int(pid...
1,313
[ 0.007952271960675716, 0.04605371877551079, 0.01848270371556282, -0.029525237157940865, 0.010024217888712883, 0.059992268681526184, 0.014256403781473637, 0.00048377300845459104, 0.06738534569740295, 0.027359111234545708, 0.05857957527041435, -0.008964699693024158, -0.01994248479604721, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pid", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def assertDead(self, pid, timeout=5): log.msg("checking pid %r" % (pid,)) def check(): try: os.kill(pid, 0) except OSError: return True # dead return False # alive # check immediately if check(): return ...
1,314
[ 0.037358444184064865, 0.019270190969109535, -0.00637318380177021, -0.0021263258531689644, 0.03232942521572113, 0.026373393833637238, 0.00886451918631792, 0.027740731835365295, 0.025585437193512917, 0.021888989955186844, 0.016106773167848587, 0.0003220992803107947, 0.03791465237736702, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pidfile", "annotation": null, "type_comment": null}}], "kwarg": n...
def waitForPidfile(self, pidfile): # wait for a pidfile, and return the pid via a Deferred until = time.time() + 10 d = defer.Deferred() def poll(): if reactor.seconds() > until: d.errback(RuntimeError("pidfile %s never appeared" % pidfile)) r...
1,315
[ -0.010508917272090912, 0.04318355768918991, 0.008207401260733604, -0.03427594527602196, -0.00856898631900549, -0.006789759267121553, 0.03489580377936363, 0.04623693972826004, 0.07672484964132309, 0.03122256137430668, 0.02998284250497818, 0.009665219113230705, -0.00956190936267376, -0.03381...
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": "interruptSignal", "annotation": null, "type_comment": null}}], "k...
def test_simple(self, interruptSignal=None): # test a simple process that just sleeps waiting to die pidfile = self.newPidfile() self.pid = None b = FakeWorkerForBuilder(self.basedir) s = runprocess.RunProcess(b, scriptCommand( ...
1,316
[ 0.02098534256219864, 0.0448831208050251, 0.02143688313663006, -0.02039833925664425, -0.031224021688103676, 0.032872144132852554, 0.009138049557805061, 0.04709566757082939, 0.07563302665948868, 0.007151271682232618, 0.034633152186870575, 0.017768116667866707, -0.022543156519532204, -0.01588...
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": "interruptSignal", "annotation": null, "type_comment": null}}], "k...
def test_sigterm(self, interruptSignal=None): # Tests that the process will receive SIGTERM if sigtermTimeout # is not None pidfile = self.newPidfile() self.pid = None b = FakeWorkerForBuilder(self.basedir) s = runprocess.RunProcess(b, s...
1,317
[ 0.03949586674571037, 0.01497267372906208, 0.030604004859924316, -0.04083670303225517, 0.00640425831079483, 0.01918337121605873, 0.014361063949763775, 0.04156592860817909, 0.050904739648103714, 0.015160861425101757, 0.039166539907455444, -0.012926134280860424, 0.0005149429198354483, -0.0214...
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": "usePTY", "annotation": null, "type_comment": null}}, {"_type": "a...
def do_test_double_fork(self, usePTY, useProcGroup=True, expectChildSurvival=False): # when a spawned process spawns another process, and then dies itself # (either intentionally or accidentally), we should be able to clean up # the child. parent_pidfile = sel...
1,318
[ 0.007946878671646118, 0.0377211831510067, 0.0521315261721611, -0.012302945367991924, 0.01681206375360489, 0.024087872356176376, 0.005136038176715374, 0.05260245129466057, 0.060419823974370956, 0.004650395829230547, 0.03906332328915596, -0.008676813915371895, 0.01570538803935051, 0.00409705...
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": "usePTY", "annotation": null, "type_comment": null}}, {"_type": "a...
def do_test_pgroup(self, usePTY, useProcGroup=True, expectChildSurvival=False): # test that a process group gets killed parent_pidfile = self.newPidfile() self.parent_pid = None child_pidfile = self.newPidfile() self.child_pid = None b = FakeWorker...
1,319
[ 0.04917610436677933, 0.02358723245561123, 0.019435681402683258, -0.016186105087399483, -0.003105940530076623, 0.0425039678812027, 0.0121334008872509, 0.0010239873081445694, 0.03971155732870102, 0.03328653797507286, 0.03279230743646622, -0.015234707854688168, 0.00901973806321621, 0.00535624...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value...
def poll(): if reactor.seconds() > until: d.errback(RuntimeError("pidfile %s never appeared" % pidfile)) return if os.path.exists(pidfile): try: with open(pidfile) as f: pid = int(f.read()) ...
1,320
[ 0.027973953634500504, 0.0826503187417984, -0.017654016613960266, -0.021252937614917755, 0.005886564496904612, 0.046229682862758636, 0.02527192421257496, 0.01600782200694084, 0.0554029606282711, -0.000002342124162169057, 0.0372607596218586, 0.002832589903846383, 0.009082452394068241, 0.0202...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pid", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def check_alive(pid): # Create a mock process that will check if we receive SIGTERM mock_process = Mock(wraps=s.process) mock_process.pgid = None # Skips over group SIGTERM mock_process.pid = pid process = s.process def _mock_signalProcess(sig): ...
1,321
[ -0.021696414798498154, -0.023611977696418762, 0.06938596069812775, -0.03200586885213852, -0.004014036152511835, 0.033070072531700134, 0.008686547167599201, 0.003287385916337371, 0.01842399314045906, 0.012171808630228043, -0.005071586929261684, 0.016614850610494614, -0.029664626345038414, -...
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 TestLogging(BasedirMixin, unittest.TestCase): def setUp(self): self.setUpBasedir() def tearDown(self): self.tearDownBasedir() def testSendStatus(self): b = FakeWorkerForBuilder(self.basedir) s = runprocess.RunProcess(b, stdoutCommand('hello'), self.basedir) s...
1,322
[ -0.0016234958311542869, -0.021325834095478058, 0.04057246819138527, 0.011948367580771446, -0.00452366191893816, 0.00848537776619196, 0.012306607328355312, 0.052991464734077454, 0.015228724107146263, 0.0015550086973235011, 0.008372988551855087, 0.02711387351155281, -0.017083145678043365, -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 testSendBufferedInterleaved(self): b = FakeWorkerForBuilder(self.basedir) s = runprocess.RunProcess(b, stdoutCommand('hello'), self.basedir) s._addToBuffers('stdout', 'hello ') s._addToBuffers('stderr', 'DIEEEEEEE') s._addToBuffers('stdout', 'world') s._sendBuffers() ...
1,323
[ -0.0008768776897341013, 0.021196551620960236, 0.024051502346992493, -0.07891316711902618, 0.006531428080052137, -0.0049553788267076015, -0.03411957249045372, -0.03400304540991783, 0.045795738697052, 0.0032016232144087553, 0.05420910567045212, 0.021080022677779198, 0.04481690004467964, 0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_statFile_exists(self): rp = self.makeRP() with open('statfile.log', 'w') as f: f.write('hi') lf = runprocess.LogFileWatcher(rp, 'test', 'statfile.log', False) st = lf.statFile() self.assertEqual( st and st[2], 2, "statfile.log exists and size is c...
1,324
[ -0.011302013881504536, 0.02307518944144249, 0.043700333684682846, -0.049377843737602234, -0.0003599977062549442, -0.007656392641365528, -0.006004378665238619, -0.018893621861934662, -0.009293682873249054, 0.009535154327750206, -0.0010939807398244739, 0.006396032869815826, 0.00642548035830259...
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 TestLogFileWatcher(BasedirMixin, unittest.TestCase): def setUp(self): self.setUpBasedir() def tearDown(self): self.tearDownBasedir() def makeRP(self): b = FakeWorkerForBuilder(self.basedir) rp = runprocess.RunProcess(b, stdoutCommand('hello'), self.basedir) r...
1,325
[ 0.013922015205025673, 0.006730935536324978, -0.01479949802160263, -0.023991666734218597, -0.020053694024682045, -0.007126872893422842, -0.009668363258242607, -0.0048395320773124695, 0.023841852322220802, 0.07109751552343369, 0.02257913164794445, -0.04451620578765869, 0.03238125890493393, -...
10
{"_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 _PathComponents( path ): path_components = [] while True: path, folder = os.path.split( path ) if folder: path_components.append( folder ) else: if path: path_components.append( path ) break path_components.reverse() return path_components
1,326
[ -0.01814817264676094, -0.01760643534362316, -0.001180632272735238, -0.04246743023395538, 0.00033876931411214173, 0.0038569283206015825, 0.021799005568027496, -0.02708682417869568, 0.005920826457440853, -0.0021860834676772356, 0.0013918799813836813, -0.018572140485048294, -0.03629634529352188...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "github"}}, "targets": [{"_type": "Name", "_fields": {"id": "short_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class TestNodeSettings(models.OAuthAddonNodeSettingsTestSuiteMixin, OsfTestCase): short_name = 'github' full_name = 'GitHub' ExternalAccountFactory = GitHubAccountFactory NodeSettingsFactory = GitHubNodeSettingsFactory NodeSettingsClass = GitHubNodeSettings UserSettingsFactory = GitHubUserSett...
1,327
[ 0.023975372314453125, -0.0013925374951213598, 0.005457165185362101, -0.00849645584821701, 0.024223938584327698, -0.014654126949608326, 0.01767081953585148, -0.01275598257780075, 0.03197469562292099, -0.011038613505661488, 0.056040454655885696, -0.02361381985247135, 0.0016199193196371198, -...
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": "mock_org", "annotation": null, "type_comment": null}}, {"_type": ...
def test_to_json_user_is_owner(self, mock_org, mock_repos): mock_repos.return_value = {} mock_org.return_value = {} result = self.node_settings.to_json(self.user) assert_true(result['user_has_auth']) assert_equal(result['github_user'], 'abc') assert_true(result['is_owner'...
1,328
[ 0.022044597193598747, 0.001002483768388629, -0.003387060482054949, -0.012733050622045994, 0.022836824879050255, -0.021378666162490845, 0.014719361439347267, -0.024800172075629234, 0.04496179148554802, -0.025718696415424347, 0.03497283533215523, -0.03648839890956879, -0.003995583392679691, ...
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": "mock_org", "annotation": null, "type_comment": null}}, {"_type": ...
def test_to_json_user_is_not_owner(self, mock_org, mock_repos): mock_repos.return_value = {} mock_org.return_value = {} not_owner = UserFactory() result = self.node_settings.to_json(not_owner) assert_false(result['user_has_auth']) assert_equal(result['github_user'], 'abc'...
1,329
[ 0.017432555556297302, -0.031674329191446304, 0.0699896290898323, -0.004646735731512308, -0.015279427170753479, 0.007905611768364906, 0.03460569679737091, 0.000529770040884614, -0.008229877799749374, -0.017380671575665474, 0.026071008294820786, 0.0010692680953070521, -0.01261395774781704, -...
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): super(TestCallbacks, self).setUp() self.project = ProjectFactory.build() self.consolidated_auth = Auth(self.project.creator) self.non_authenticator = UserFactory() self.project.save() self.project.add_contributor( contributor=self.non_authen...
1,330
[ 0.023402679711580276, -0.01818888448178768, 0.014123444445431232, -0.032972302287817, -0.006626139394938946, 0.03936085104942322, -0.01656534895300865, -0.029170852154493332, 0.03072839230298996, 0.0013884203508496284, 0.0602424293756485, -0.02906525693833828, -0.014400633983314037, -0.027...
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 TestCallbacks(OsfTestCase): def setUp(self): super(TestCallbacks, self).setUp() self.project = ProjectFactory.build() self.consolidated_auth = Auth(self.project.creator) self.non_authenticator = UserFactory() self.project.save() self.project.add_contributor( ...
1,331
[ 0.014825987629592419, -0.0019960447680205107, -0.023927703499794006, -0.004979246761649847, -0.01290134061127901, 0.003982776775956154, 0.0011633246904239058, -0.04959379509091377, 0.01928371749818325, -0.029329130426049232, 0.061191342771053314, -0.029602305963635445, -0.03613368794322014, ...
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": "mock_repo", "annotation": null, "type_comment": null}}], "kwarg":...
def test_before_page_load_osf_public_gh_public(self, mock_repo): self.project.is_public = True self.project.save() mock_repo.return_value = Repository.from_json({'private': False}) message = self.node_settings.before_page_load(self.project, self.project.creator) mock_repo.assert_...
1,332
[ 0.01659940555691719, -0.00653041061013937, -0.02140352688729763, -0.009061481803655624, -0.007709939032793045, 0.004653608426451683, 0.002024242887273431, -0.044551774859428406, 0.02388545125722885, -0.030618593096733093, 0.06172865629196167, -0.019793963059782982, -0.033764004707336426, -...
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": "mock_repo", "annotation": null, "type_comment": null}}], "kwarg":...
def test_before_page_load_osf_public_gh_private(self, mock_repo): self.project.is_public = True self.project.save() mock_repo.return_value = Repository.from_json({'private': True}) message = self.node_settings.before_page_load(self.project, self.project.creator) mock_repo.assert_...
1,333
[ 0.012122313492000103, -0.008282667025923729, -0.03432522341609001, -0.014992906711995602, -0.006655387580394745, -0.0009606734965927899, 0.009489412419497967, -0.045320022851228714, 0.02991267666220665, -0.02251373790204525, 0.06094677373766899, -0.02228214032948017, -0.03186297416687012, ...
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": "mock_repo", "annotation": null, "type_comment": null}}], "kwarg":...
def test_before_page_load_osf_private_gh_public(self, mock_repo): mock_repo.return_value = Repository.from_json({'private': False}) message = self.node_settings.before_page_load(self.project, self.project.creator) mock_repo.assert_called_with( self.node_settings.user, sel...
1,334
[ 0.009688274003565311, -0.009415620937943459, -0.0366688147187233, -0.01486868318170309, -0.007270749658346176, 0.0006854196544736624, 0.012123974971473217, -0.04704175144433975, 0.03220942243933678, -0.02402982860803604, 0.05947473272681236, -0.024708431214094162, -0.029567716643214226, -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": "mock_repo", "annotation": null, "type_comment": null}}], "kwarg":...
def test_before_page_load_osf_private_gh_private(self, mock_repo): mock_repo.return_value = Repository.from_json({'private': True}) message = self.node_settings.before_page_load(self.project, self.project.creator) mock_repo.assert_called_with( self.node_settings.user, sel...
1,335
[ 0.04602838307619095, -0.023309851065278053, 0.0008433707407675683, -0.009537998586893082, -0.021181097254157066, 0.016911763697862625, 0.007882301695644855, 0.037655286490917206, 0.035786714404821396, 0.0399969145655632, 0.040895722806453705, 0.0019720536656677723, -0.03987865149974823, -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_after_remove_contributor_authenticator_self(self): message = self.node_settings.after_remove_contributor( self.project, self.project.creator, self.consolidated_auth ) assert_equal( self.node_settings.user_settings, None ) assert_true(m...
1,336
[ 0.04020826891064644, -0.02827143855392933, -0.012371774762868881, -0.021566033363342285, -0.010184966959059238, 0.00744239566847682, -0.003117107320576906, 0.04716739058494568, 0.03192014619708061, 0.04958375170826912, 0.0328383632004261, -0.0031714753713458776, -0.02706325799226761, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_after_remove_contributor_authenticator_not_self(self): auth = Auth(user=self.non_authenticator) message = self.node_settings.after_remove_contributor( self.project, self.project.creator, auth ) assert_equal( self.node_settings.user_settings, N...
1,337
[ 0.020976996049284935, -0.011492650955915451, 0.016727715730667114, -0.052999671548604965, 0.011394684202969074, -0.020487165078520775, 0.036467887461185455, 0.009741506539285183, 0.015992969274520874, 0.010219091549515724, 0.043252043426036835, -0.013249917887151241, -0.05432221293449402, ...
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_after_fork_authenticator(self): fork = ProjectFactory() clone, message = self.node_settings.after_fork( self.project, fork, self.project.creator, ) assert_equal( self.node_settings.user_settings, clone.user_settings, )
1,338
[ 0.019379569217562675, 0.0026726152282208204, 0.010864491574466228, -0.055640120059251785, 0.017751138657331467, -0.014295384287834167, 0.042140305042266846, 0.0038224614690989256, 0.02061021514236927, 0.009198768995702267, 0.037491198629140854, -0.009671138599514961, -0.05514289066195488, ...
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_after_fork_not_authenticator(self): fork = ProjectFactory() clone, message = self.node_settings.after_fork( self.project, fork, self.non_authenticator, ) assert_equal( clone.user_settings, None, )
1,339
[ -0.0030897697433829308, -0.02870100550353527, 0.04294121265411377, 0.0063174073584377766, -0.01909315399825573, -0.03446081280708313, 0.036299049854278564, 0.006666672416031361, 0.009785547852516174, -0.024105412885546684, 0.0254657082259655, -0.00981005746871233, -0.04100493714213371, -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 setUp(self): OsfTestCase.setUp(self) self.user = UserFactory() self.user.add_addon('github') self.user_settings = self.user.get_addon('github') self.external_account = GitHubAccountFactory() self.user_settings.owner.external_accounts.append(self.external_account) ...
1,340
[ -0.02263726480305195, -0.01797630824148655, 0.020060855895280838, -0.037498459219932556, 0.013467592187225819, -0.004300846252590418, 0.020377052947878838, -0.005937451496720314, 0.019885191693902016, -0.009925030171871185, 0.012999153696000576, -0.015704384073615074, -0.03970012068748474, ...
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 TestGithubNodeSettings(OsfTestCase): def setUp(self): OsfTestCase.setUp(self) self.user = UserFactory() self.user.add_addon('github') self.user_settings = self.user.get_addon('github') self.external_account = GitHubAccountFactory() self.user_settings.owner.exte...
1,341
[ 0.0053323255851864815, 0.010411500930786133, -0.019939666613936424, -0.04485616832971573, -0.01265754085034132, 0.019067103043198586, 0.02960248664021492, 0.01582461968064308, 0.03466550260782242, -0.014391893520951271, 0.031563058495521545, 0.012560589239001274, -0.03309273719787598, 0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_delete_hook", "annotation": null, "type_comment": null}}], "...
def test_delete_hook_not_found(self, mock_delete_hook): self.node_settings.hook_id = 'hook' self.node_settings.save() mock_delete_hook.side_effect = NotFoundError args = ( self.node_settings.user, self.node_settings.repo, self.node_settings.hook_id, ...
1,342
[ -0.0003747750888578594, 0.016866203397512436, -0.02498147450387478, -0.05199706554412842, -0.002441997407004237, 0.019387658685445786, 0.030871931463479996, 0.036423370242118835, 0.044877659529447556, -0.003988772165030241, 0.04962392896413803, 0.011272386647760868, -0.040470413863658905, ...
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": "mock_delete_hook", "annotation": null, "type_comment": null}}], "...
def test_delete_hook(self, mock_delete_hook): self.node_settings.hook_id = 'hook' self.node_settings.save() args = ( self.node_settings.user, self.node_settings.repo, self.node_settings.hook_id, ) res = self.node_settings.delete_hook() ...
1,343
[ -0.01923273876309395, -0.0057295700535178185, 0.007578629534691572, -0.019660411402583122, -0.04470448195934296, -0.005817620549350977, 0.019911983981728554, -0.022440291941165924, -0.032528359442949295, -0.00036301164072938263, 0.0011729580583050847, -0.05288059636950493, 0.0043427748605608...
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": "delay", "annotation": ...
class conj_fs_iqcorr(gr.hier_block2): def __init__(self, delay=0, taps=[]): gr.hier_block2.__init__( self, "Conj FS IQBal", gr.io_signature(1, 1, gr.sizeof_gr_complex*1), gr.io_signature(1, 1, gr.sizeof_gr_complex*1), ) ##################################...
1,344
[ 0.011076437309384346, 0.008123784326016903, -0.02519596926867962, -0.015630438923835754, -0.006591597571969032, 0.010980675928294659, 0.01768399402499199, 0.027132483199238777, 0.02826034277677536, -0.0043837581761181355, 0.049753524363040924, 0.000346471177181229, -0.026111025363206863, -...
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": "mock_delete_hook", "annotation": null, "type_comment": null}}], "...
def test_delete_hook_error(self, mock_delete_hook): self.node_settings.hook_id = 'hook' self.node_settings.save() mock_delete_hook.side_effect = GitHubError(mock.Mock()) args = ( self.node_settings.user, self.node_settings.repo, self.node_settings.hook...
1,345
[ 0.03617662563920021, -0.0012957711005583405, 0.03672131523489952, 0.016204586252570152, -0.0176230538636446, -0.04275831952691078, 0.00904983002692461, -0.02600904181599617, 0.01760035939514637, -0.015455634333193302, 0.03522341325879097, -0.02021034061908722, 0.022479891777038574, 0.01602...
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": "play_head_callback", "...
class PlayHeadBox(RectBox): def __init__(self, play_head_callback): RectBox.__init__(self, parent_box=None, width=50, height=1, border_color="000000", border_width=1, fill_color="65737255") self.play_head_callback = play_head_callback def get_center_x(self): return...
1,346
[ 0.0019288267940282822, 0.027325758710503578, 0.056567512452602386, 0.02552380971610546, -0.010760372504591942, 0.001252383110113442, -0.009386101737618446, 0.02486233413219452, -0.026755521073937416, 0.04762619733810425, 0.021075960248708725, -0.008496532216668129, 0.0034556363243609667, 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": "ctx", "annotation": null, "type_comment": null}}], "kwarg": null,...
def draw(self, ctx): RectBox.draw(self, ctx) ctx.save() self.pre_draw(ctx) cx = self.width*.5 draw_straight_line(ctx, cx, 0, cx, self.height) ctx.restore() draw_stroke(ctx, self.border_width, self.border_color)
1,347
[ -0.004621787462383509, 0.013781329616904259, -0.0034313269425183535, -0.02287924662232399, -0.006341652479022741, 0.016268691048026085, 0.01905857026576996, -0.0360555425286293, -0.029288126155734062, 0.031260088086128235, -0.01537234429270029, -0.04094063118100166, 0.004350082017481327, -...
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 TimeRange(object): def __init__(self): self._start_pixel = 0 self._visible_duration_pixel = 0 self._non_scaled_full_length_pixel = 0 self.scaled_full_length_pixel = 0 self._scale = 1. self.pixel_per_second = PIXEL_PER_SECOND self.visible_span = Span(0, 0...
1,348
[ -0.002542737405747175, 0.013152454048395157, 0.00337798148393631, 0.016979776322841644, -0.022900495678186417, -0.015013251453638077, 0.02979390323162079, -0.02366173081099987, 0.022075822576880455, -0.013057299889624119, 0.010429980233311653, 0.034128714352846146, 0.018470527604222298, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "time_marker", "annotat...
class TimeMarkerBox(RectBox): def __init__(self, time_marker): RectBox.__init__(self, parent_box=None, width=10, height=TIME_STAMP_LABEL_HEIGHT, border_color="000000", border_width=1, fill_color="65737255") self.time_marker = time_marker def set_x(self, x): self....
1,349
[ 0.0007030547712929547, 0.025952963158488274, 0.012365431524813175, -0.00652157049626112, -0.04530658572912216, 0.024775302037596703, 0.017942652106285095, 0.037151843309402466, -0.010937795974314213, 0.033552203327417374, 0.03781844303011894, -0.007677010726183653, 0.02915264293551445, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 1000}}, "targets": [{"_type": "Name", "_fields": {"id": "MARKER_SAVED", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}...
class TimeMarkerEditDialog(Gtk.Dialog): MARKER_SAVED = 1000 DELETE_MARKER = 2000 def __init__(self, parent, title, time_marker, width=400, height=50): Gtk.Dialog.__init__(self, title, parent, 0) self.set_default_size(width, height) self.props.resizable = False self.time_mark...
1,350
[ 0.055954642593860626, 0.030318519100546837, 0.035000916570425034, 0.017687754705548286, -0.048041392117738724, -0.004038567189127207, 0.025870243087410927, -0.013497008942067623, -0.029007447883486748, 0.04338240623474121, 0.008849729783833027, -0.001931488630361855, -0.03083358332514763, ...
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": "scale_incre", "annotation": null, "type_comment": null}}, {"_type...
def increse_scale(self, scale_incre, abs_mouse_point): self._scale *= (1+scale_incre) mouse_offset_x = abs_mouse_point.x - TIME_SLICE_START_X current_mouse_time_pixel = mouse_offset_x+self._start_pixel current_mouse_time = current_mouse_time_pixel/self.pixel_per_second self.pixel...
1,351
[ 0.004130884073674679, 0.01922798715531826, -0.0075361840426921844, -0.0007159649394452572, -0.027594195678830147, -0.014555663801729679, 0.01679837889969349, -0.01076833251863718, -0.0076845986768603325, 0.020701143890619278, 0.04351307824254036, 0.014236846007406712, 0.02601110376417637, ...
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": "parent", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, parent, title, time_marker, width=400, height=50): Gtk.Dialog.__init__(self, title, parent, 0) self.set_default_size(width, height) self.props.resizable = False self.time_marker= time_marker box = self.get_content_area() label_box = Gtk.Box(orientation...
1,352
[ 0.0190935879945755, 0.02817915380001068, 0.018272222951054573, -0.020862681791186333, -0.04953465610742569, 0.040613360702991486, 0.01978858932852745, -0.005992808844894171, -0.027395697310566902, 0.010911524295806885, 0.05747031047940254, 0.00742388004437089, -0.03586208075284958, 0.00382...
16
{"_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": "master_editor", "annot...
class TimeLineEditor(Gtk.VBox): def __init__(self, master_editor, time_slice_box_select_callback, keyboard_object, parent_window): Gtk.VBox.__init__(self) self.keyboard_object = keyboard_object self.master_editor = master_editor self.tim...
1,353
[ 0.011583604849874973, 0.01686735451221466, -0.008021887391805649, 0.015209497883915901, -0.04487978294491768, -0.018942348659038544, 0.04873029142618179, -0.003096448490396142, -0.007214350625872612, 0.014182696118950844, 0.022760767489671707, 0.03692207112908363, 0.029156886041164398, -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": "image_name", "annotation": null, "type_comment": null}}, {"_type"...
def create_info_check_widget(self, image_name, tooltip, default, callback): self.info_hbox.pack_start( buttons.create_new_image_widget(image_name, border_scale=2), expand=False, fill=False, padding=5) button = Gtk.CheckButton() button.set_tooltip_text(tooltip) bu...
1,354
[ 0.0005344735691323876, 0.017103154212236404, 0.00974121131002903, -0.017597397789359093, -0.02836732752621174, -0.012356108985841274, 0.04351649060845375, -0.019493917003273964, -0.018505427986383438, 0.0012320190435275435, 0.026620231568813324, 0.001872094115242362, 0.006758504081517458, ...
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": "master_editor", "annotation": null, "type_comment": null}}, {"_ty...
def __init__(self, master_editor, time_slice_box_select_callback, keyboard_object, parent_window): Gtk.VBox.__init__(self) self.keyboard_object = keyboard_object self.master_editor = master_editor self.time_slice_box_select_callback = time_s...
1,355
[ 0.013352778740227222, 0.0426534004509449, -0.006024674978107214, -0.030291464179754257, -0.009265555068850517, 0.026776332408189774, 0.035481590777635574, -0.00024291854060720652, 0.048055849969387054, 0.0017501930706202984, 0.03460870310664177, 0.001334393280558288, -0.05194844305515289, ...
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": "widget", "annotation": null, "type_comment": null}}], "kwarg": nu...
def play_head_time_entry_activated(self, widget): if not self.time_line: return text = self.play_head_time_entry.get_text() value = Text.parse_number(text, None) if value is None: marker = self.time_line.get_time_marker_by_text(text) if marker: ...
1,356
[ -0.012065830640494823, -0.00013801375462207943, 0.007199086248874664, -0.012608503922820091, -0.013208908960223198, 0.01237757969647646, 0.06350436806678772, -0.012262117117643356, -0.01873956248164177, 0.0206677857786417, 0.011471198871731758, -0.005885700695216656, 0.017481021583080292, ...
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": "multi_shape_time_line", "annotation": null, "type_comment": null}...
def set_multi_shape_time_line(self, multi_shape_time_line): self.time_line = multi_shape_time_line self.time_marker_boxes = dict() self.selected_time_slice_box = None self.is_playing = False self.last_play_updated_at = 0 self.selected_shape = None self.time_range....
1,357
[ 0.009400215931236744, -0.0007195957587100565, -0.04030313715338707, -0.024251170456409454, -0.018684949725866318, 0.010999638587236404, 0.024759290739893913, -0.05376831069588661, 0.016791049391031265, -0.01168098021298647, 0.044090937823057175, 0.013095632195472717, -0.027669431641697884, ...
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 move_play_head_to_time(self, value, force_visible=False): if value is not None: self.play_head_time = value self.queue_move_play_head_to_time(self.play_head_time, force_visible) extra_x = self.time_range.get_extra_pixel_for_time(self.play_head_time) if self.play_head_...
1,358
[ 0.01856083795428276, 0.0074794781394302845, 0.02761833928525448, 0.006945648696273565, -0.013914762996137142, 0.032428670674562454, 0.03130234777927399, 0.00008877297659637406, -0.05260859802365303, 0.046507690101861954, 0.006916317623108625, 0.007438414264470339, 0.04545176401734352, 0.00...
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": "shape", "annotation": null, "type_comment": null}}], "kwarg": nul...
def set_selected_shape(self, shape): if not self.time_line: return load_single_shape = None if self.time_line.shape_time_lines.key_exists(shape): if self.multi_shape_time_line_box.shape_exists(shape): if self.multi_shape_time_line_box.get_shape_count()>1: ...
1,359
[ 0.026360658928751945, 0.01721058040857315, -0.03022688813507557, -0.021322844550013542, -0.009653858840465546, 0.041895873844623566, 0.013449793681502342, -0.007820328697562218, -0.030976703390479088, -0.00506710447371006, 0.03990417718887329, -0.04065399244427681, 0.012946012429893017, 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 delete_time_slice(self): if not self.selected_time_slice_box: return time_slice = self.selected_time_slice_box.time_slice prop_time_line_box = self.selected_time_slice_box.prop_time_line_box prop_time_line = prop_time_line_box.prop_time_line shape_time_line_box = prop_time_...
1,360
[ -0.010958107188344002, 0.017542771995067596, 0.006407031789422035, -0.0044959476217627525, -0.03427700698375702, -0.01103160995990038, 0.012863066047430038, 0.017236508429050446, -0.026436662301421165, -0.013291834853589535, 0.021695705130696297, -0.0026262092869728804, 0.02050740271806717, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "point", "annotation": null, "type_comment": null}}], "kwarg": nul...
def select_item_at(self, point): if not self.multi_shape_time_line_box: return if self.play_head_box.is_within(point): self.selected_item = self.play_head_box if not self.selected_item: tm_point = point.copy() tm_point.translate(0, TIME_STAMP_LABEL_HEIGHT) ...
1,361
[ 0.014311487786471844, 0.03612000122666359, 0.002761031733825803, 0.006685780826956034, -0.03947687894105911, 0.01513951737433672, 0.026407435536384583, -0.004853485617786646, -0.026675986126065254, 0.01023847609758377, 0.0087614506483078, 0.022200150415301323, 0.009729349985718727, -0.0492...
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": "start_point", "annotation": null, "type_comment": null}}, {"_type...
def move_active_item(self, start_point, end_point): if not self.selected_item: return if self.selected_item.parent_box: start_point = self.selected_item.parent_box.abs_transform_point(start_point) end_point = self.selected_item.parent_box.abs_transform_point(end_point) ...
1,362
[ -0.026236815378069878, -0.00460570165887475, -0.009992804378271103, -0.0017267817165702581, -0.02954493649303913, -0.017590073868632317, 0.010101174004375935, 0.008692370727658272, -0.010568873956799507, -0.010620206594467163, 0.008692370727658272, 0.000014002919670019764, 0.0243432018905878...
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": "point", "annotation": null, "type_comment": null}}], "kwarg": nul...
def select_time_slice_box_at(self, point): if not self.multi_shape_time_line_box: return self.selected_time_slice_box = None for shape_line_box in self.multi_shape_time_line_box.shape_time_line_boxes: for prop_line_box in shape_line_box.prop_time_line_boxes: for time_...
1,363
[ 0.005861365702003241, 0.025173276662826538, -0.021873632445931435, -0.04763484373688698, -0.01974986307322979, 0.02200561948120594, 0.024429356679320335, -0.05317824333906174, -0.0034346282482147217, 0.010144902393221855, 0.02058977261185646, -0.03335639089345932, -0.003182655666023493, 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 split_prop_line(self): if not self.selected_time_slice_box: return time_slice = self.selected_time_slice_box.time_slice prop_time_line_box = self.selected_time_slice_box.prop_time_line_box prop_time_line = prop_time_line_box.prop_time_line if prop_time_line.spli...
1,364
[ 0.009965019300580025, 0.014538737945258617, -0.0275845006108284, -0.016221297904849052, -0.03767985850572586, 0.04512104019522667, 0.014052928425371647, -0.05976641923189163, -0.02149410918354988, 0.0012759905075654387, 0.013543421402573586, -0.002855611965060234, 0.027892574667930603, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "direction", "annotation": null, "type_comment": null}}], "kwarg":...
def move_prop_line(self, direction): if not self.selected_time_slice_box: return prop_time_line_box = self.selected_time_slice_box.prop_time_line_box prop_name = prop_time_line_box.prop_time_line.prop_name shape_time_line_box = prop_time_line_box.parent_box shape_tim...
1,365
[ 0.006058345083147287, 0.026176733896136284, 0.04066993296146393, 0.00826510414481163, -0.02915029786527157, 0.041606489568948746, 0.05165104940533638, -0.011332324706017971, -0.04687461629509926, 0.04582098871469498, 0.0041676731780171394, -0.004621317144483328, -0.037626128643751144, 0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "update_scale", "annotation": null, "type_comment": null}}], "kwar...
def update(self, update_scale=False): if self.multi_shape_time_line_box: self.multi_shape_time_line_box.update() if update_scale: self.update_prop_lines_time_scale() self.update_slices_left() self.multi_shape_time_line_box.update() ...
1,366
[ 0.013457989320158958, -0.011563815176486969, -0.0015989401144906878, -0.016006939113140106, -0.03386128321290016, 0.007214230485260487, 0.0641212984919548, -0.01829865574836731, 0.0055305203422904015, -0.0017757881432771683, 0.018380502238869667, 0.007529926020652056, -0.031359102576971054, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def update_time_marker_boxes(self): marker_boxes = self.time_marker_boxes.values() self.time_marker_boxes.clear() for marker_box in marker_boxes: marker_at = marker_box.time_marker.at self.time_marker_boxes[marker_at] = marker_box extra_x = self.time_range.ge...
1,367
[ -0.016314001753926277, 0.03968459740281105, 0.0036214522551745176, 0.0036563859321177006, -0.032837606966495514, 0.01934158243238926, 0.005848471075296402, 0.009117675945162773, -0.010567421093583107, 0.006555876694619656, -0.0048441290855407715, 0.007202148903161287, -0.009024519473314285, ...
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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar...
def zoom_vertical(self, value, point): if not self.multi_shape_time_line_box: return scale_y = 1+ value if point.x>TIME_SLICE_START_X: for shape_line_box in self.multi_shape_time_line_box.shape_time_line_boxes: for prop_line_box in shape_line_box.prop_time_line_boxes:...
1,368
[ 0.014595575630664825, 0.0007587719592265785, -0.020117003470659256, -0.02762976475059986, -0.015636499971151352, 0.012785271741449833, 0.056390970945358276, 0.019336309283971786, 0.03557247295975685, 0.007495790254324675, 0.04765625298023224, -0.01952865533530712, -0.009639868512749672, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def on_play_pause_button_click(self, widget, play): if self.time_line.duration == 0: self.is_playing = False else: was_playing = self.is_playing if not self.is_playing: self.last_play_updated_at = 0 self.is_playing = play if not...
1,369
[ 0.06840002536773682, 0.009620273485779762, -0.0004233953950461, -0.00015972345136106014, -0.022378385066986084, 0.023922981694340706, 0.0467756912112236, -0.023424331098794937, 0.013171626254916191, -0.010915543884038925, 0.05978921055793762, -0.012259463779628277, -0.05151893571019173, -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 on_play_head_move(self): self.play_head_mover_thread.clear() extra_x = self.play_head_box.get_center_x()-TIME_SLICE_START_X play_head_time = self.time_range.get_time_for_extra_x(extra_x) if play_head_time<0: play_head_time = 0 self.move_play_head_to_time(play_head...
1,370
[ 0.0336279571056366, 0.01618330553174019, 0.0058783479034900665, -0.024144064635038376, 0.008573582395911217, 0.04628901556134224, 0.061068180948495865, -0.034460920840501785, 0.010929681360721588, 0.029177548363804817, 0.04474208131432533, 0.003144440008327365, -0.04795494303107262, -0.003...
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 on_playing_timer_movement(self): current_time = time.time() if self.last_play_updated_at>0: #diff = current_time - self.last_play_updated_at diff = MOVE_TO_INCREMENT*self.speed_scale value = self.play_head_time + diff if self.time_line.duration == 0: ...
1,371
[ 0.015070839785039425, 0.012562921270728111, 0.009897529147565365, -0.0024175166618078947, -0.03723384067416191, -0.0008500676485709846, 0.015887370333075523, 0.04157312214374542, -0.012306297197937965, -0.007278795354068279, 0.03765377029776573, 0.01853526569902897, 0.013974354602396488, 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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def on_drawing_area_mouse_press(self, widget, event): if event.button == 1:#Left mouse if event.type == Gdk.EventType._2BUTTON_PRESS:#double button click if self.selected_time_slice_box: self.selected_time_slice_box.highlighted = False if self.mou...
1,372
[ 0.005388312041759491, 0.013716815039515495, 0.05799694359302521, -0.038460873067379, -0.0554540753364563, 0.015134952962398529, 0.021247616037726402, -0.0020018969662487507, -0.04242187738418579, 0.021651051938533783, 0.030465511605143547, 0.028998471796512604, -0.014425884000957012, -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}}, {"_type": "arg", "_fields": {"arg": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def on_drawing_area_draw(self, widget, ctx): widget_width = widget.get_allocated_width() widget_height = widget.get_allocated_height() ctx.rectangle(0, 0, widget_width, widget.get_allocated_height()) draw_fill(ctx, TIME_LINE_BACKGROUND_COLOR) active = (self.multi_shape_time_lin...
1,373
[ 0.04453989118337631, 0.010470781475305557, 0.005743301939219236, 0.02035551145672798, -0.07388152182102203, 0.01134009100496769, 0.009132631123065948, -0.0025957184843719006, -0.00823401939123869, -0.020492257550358772, 0.012717311270534992, 0.019212711602449417, -0.009464726783335209, -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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def on_drawing_area_mouse_move(self, widget, event): self.mouse_point.x = event.x self.mouse_point.y = event.y self.mouse_point.translate(-DRAW_AREA_PADDING, -TIME_STAMP_LABEL_HEIGHT) self.mouse_position_box.left = self.mouse_point.x - TIME_SLICE_START_X self.mouse_time_position...
1,374
[ 0.02948680892586708, 0.0193319134414196, 0.02980918623507023, -0.02437175065279007, -0.05312783643603325, 0.03567646071314812, 0.024715619161725044, -0.005190280266106129, -0.010745921172201633, 0.0026649886276572943, 0.01741913892328739, -0.015226970426738262, -0.04098494350910187, 0.0161...
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": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def on_drawing_area_scrollbar_value_changed(self, widget, scroll_dir): if not self.time_line: return if scroll_dir == "horiz": self.time_scroll_to(widget.get_value()) self.move_play_head_to_time(None) elif scroll_dir == "vert": value = widget.get_value() ...
1,375
[ 0.04233729839324951, 0.04031594842672348, 0.047623906284570694, 0.0121947405859828, -0.06739316135644913, 0.022012729197740555, -0.006014073267579079, 0.017547987401485443, -0.050689250230789185, 0.0007121928501874208, 0.011939295567572117, -0.004922877065837383, -0.023034511134028435, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "widget", "annotation": null, "type_comment": null}}, {"_type": "a...
def on_drawing_area_mouse_scroll(self, widget, event): if self.keyboard_object.control_key_pressed: if event.direction == Gdk.ScrollDirection.UP: zoom = 1. elif event.direction == Gdk.ScrollDirection.DOWN: zoom = -1. if self.keyboard_object.shi...
1,376
[ 0.005931036546826363, -0.0007762277964502573, -0.031070977449417114, -0.03083045780658722, -0.01864040084183216, -0.004487908910959959, 0.0079864002764225, -0.040363848209381104, -0.029124941676855087, 0.015360564924776554, 0.017558054998517036, -0.03428521752357483, -0.016945818439126015, ...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "editor", "annotation":...
class TimeLineEditorAudioBlock(object): def __init__(self, editor): self.editor = editor self.paused = True self.last_at = 0 self.lock = threading.RLock() def update_time(self): self.lock.acquire() self.last_at = self.editor.play_head_time self.lock.relea...
1,377
[ 0.014095231890678406, -0.004760952200740576, -0.01950114034116268, -0.04247331991791725, -0.026619115844368935, -0.012594242580235004, -0.03578922525048256, -0.03951824828982353, -0.011380551382899284, -0.023241888731718063, 0.002399531425908208, -0.03039504401385784, -0.028917506337165833, ...
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": "frame_count", "annotation": null, "type_comment": null}}, {"_type...
def get_samples(self, frame_count, loop): audio_message = AudioMessage() if not self.editor.time_line or self.paused: return audio_message self.lock.acquire() start_at = self.last_at end_at = start_at+frame_count*1./AudioBlock.SampleRate self.last_at = end_at...
1,378
[ 0.02130410447716713, 0.03687896952033043, -0.015887808054685593, -0.05406669154763222, -0.03805851936340332, 0.020100483670830727, 0.02777959033846855, 0.01432309951633215, -0.005286908708512783, 0.010333092883229256, 0.044846948236227036, -0.008323044516146183, -0.034062497317790985, -0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "editor", "annotation":...
class PlayHeadMoverThread(threading.Thread): def __init__(self, editor): super(PlayHeadMoverThread, self).__init__() self.time_line_editor = editor self.should_exit = False self.time_queue = queue.Queue() self.start() def move_to(self, move_to_time, force_visible): ...
1,379
[ 0.007200447376817465, 0.061643458902835846, 0.005678430199623108, -0.04531443864107132, -0.02755875140428543, 0.03678266704082489, 0.014845846220850945, 0.046105463057756424, 0.012140823528170586, 0.008185697719454765, 0.029861198738217354, 0.010240950621664524, -0.036810919642448425, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def run(self): while not self.should_exit: move_to = None try: st = time.time() c = 0 c_limit = 100 while time.time()-st<.1 and c<c_limit: ret = self.time_queue.get(block=False) move_t...
1,380
[ 0.03448667377233505, 0.005514332093298435, 0.01737932674586773, -0.03987181931734085, -0.017909681424498558, 0.03367074579000473, 0.019038384780287743, 0.05385143309831619, -0.02266927808523178, 0.043053947389125824, 0.04759596288204193, -0.05115886032581329, -0.045855309814214706, -0.0033...
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": "keep_last", "annotation": null, "type_comment": null}}], "kwarg":...
def clear(self, keep_last=False): c = 0 ret = None while c<100: try: ret = self.time_queue.get(block=False) c += 1 except queue.Empty: if ret and keep_last: self.time_queue.put(ret) break ...
1,381
[ 0.003271543886512518, 0.03913073241710663, -0.013213970698416233, -0.0460316464304924, 0.0012611737474799156, 0.013750707730650902, 0.025265010073781013, -0.005067059304565191, 0.01265806332230568, -0.03675375133752823, 0.06609541177749634, -0.03680486977100372, 0.00041812824201770127, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_tar_open", "annotation": null, "type_comment": null}}, {"_ty...
def test_fetch_image_ova(self, mock_tar_open, mock_write_class, mock_read_class): session = mock.MagicMock() ovf_descriptor = None ovf_path = os.path.join(os.path.dirname(__file__), 'ovf.xml') with open(ovf_path) as f: ovf_descriptor = f.read() ...
1,382
[ 0.021974630653858185, 0.032352156937122345, 0.024236399680376053, -0.03079996258020401, 0.02236267924308777, 0.011170253157615662, 0.01565498486161232, 0.023149864748120308, -0.024524664506316185, -0.004986423067748547, 0.025455981492996216, 0.008370759896934032, -0.03024560771882534, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_from_image_with_image_ref(self): raw_disk_size_in_gb = 83 raw_disk_size_in_bytes = raw_disk_size_in_gb * units.Gi image_id = nova.tests.unit.image.fake.get_valid_image_id() mdata = {'size': raw_disk_size_in_bytes, 'disk_format': 'vmdk', 'propert...
1,383
[ 0.018269132822752, 0.007402462884783745, -0.00013104730169288814, -0.05591351538896561, -0.0035675251856446266, -0.018852578476071358, 0.0020709270611405373, -0.00904948078095913, -0.006709621753543615, -0.020615069195628166, 0.010872747749090195, -0.003528021275997162, 0.0006005385075695813...
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_image_no_defaults(self): image = self._image_build(False, False, disk_format='iso', os_type='otherGuest', adapter_type='lsiLogic', disk_type='preallocated', ...
1,384
[ 0.012873929925262928, 0.03545350953936577, -0.01619839482009411, -0.028916141018271446, -0.0008171710651367903, 0.001167885260656476, 0.028626088052988052, -0.0009454641258344054, -0.0154286352917552, -0.01757057197391987, 0.010179775767028332, 0.013498662039637566, -0.031348131597042084, ...
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": "image_lc_setting", "annotation": null, "type_comment": null}}, {"...
def _image_build(self, image_lc_setting, global_lc_setting, disk_format=constants.DEFAULT_DISK_FORMAT, os_type=constants.DEFAULT_OS_TYPE, adapter_type=constants.DEFAULT_ADAPTER_TYPE, disk_type=constants.DEFAULT_DISK_TYPE, ...
1,385
[ 0.019690843299031258, 0.003076694207265973, 0.00330977700650692, -0.03097826987504959, -0.018124526366591454, -0.03470759838819504, 0.00034030101960524917, 0.022127335891127586, 0.019591394811868668, -0.003086017444729805, 0.008546372875571251, -0.004767321981489658, -0.020212948322296143, ...
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_image_defaults(self): image = images.VMwareImage(image_id='fake-image-id') # N.B. We intentially don't use the defined constants here. Amongst # other potential failures, we're interested in changes to their # values, which would not otherwise be picked up. self.assertE...
1,386
[ 0.01859467476606369, 0.00886727124452591, 0.021356146782636642, -0.026709331199526787, -0.022023880854249, -0.00799582339823246, 0.02417420782148838, -0.023121679201722145, 0.030602555721998215, -0.04085622355341911, -0.002122033853083849, -0.060390252619981766, 0.028904929757118225, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "targets", "annotation": null, "type_comment": null}}, {"_type": "...
def __call__(self, targets, sources, property_set): # Bjam actions defined from Python have only the command # to execute, and no associated jam procedural code. So # passing 'property_set' to it is not necessary. bjam_interface.call("set-update-action", self.action_name, ...
1,387
[ 0.060929685831069946, -0.021590735763311386, -0.054771631956100464, -0.06553570926189423, -0.017798276618123055, 0.04318147152662277, -0.007753890473395586, -0.02199126034975052, 0.0043556964956223965, -0.029688827693462372, 0.056974511593580246, -0.026810063049197197, -0.02928830310702324, ...
19
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 3}}, "targets": [{"_type": "Name", "_fields": {"id": "api_version", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class Decoder(srd.Decoder): api_version = 3 id = 'ds28ea00' name = 'DS28EA00' longname = 'Maxim DS28EA00 1-Wire digital thermometer' desc = '1-Wire digital thermometer with Sequence Detect and PIO.' license = 'gplv2+' inputs = ['onewire_network'] outputs = [] tags = ['IC', 'Sensor'] ...
1,388
[ 0.0203535333275795, 0.02105494774878025, 0.028682824224233627, -0.02765575423836708, -0.014980200678110123, -0.033667873591184616, -0.015656564384698868, -0.006456766743212938, 0.02069171518087387, -0.03369292616844177, -0.01220585685223341, -0.06437978893518448, 0.047044843435287476, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "targets", "annotation": null, "type_comment": null}}, {"_type": "...
def __call__(self, targets, sources, property_set): if self.function: self.function(targets, sources, property_set) p = [] if property_set: p = property_set.raw() b2.util.set_jam_action(self.action_name, targets, sources, p)
1,389
[ 0.046079158782958984, 0.01395934633910656, -0.02375389076769352, -0.031938210129737854, 0.03271305561065674, 0.03159921243786812, -0.04675715044140816, -0.03050958551466465, 0.00919525045901537, -0.020775575190782547, 0.07075317949056625, -0.0281850453466177, 0.02042447216808796, -0.002686...
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": "ss", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def decode(self, ss, es, data): code, val = data self.ss, self.es = ss, es # State machine. if code == 'RESET/PRESENCE': self.putx([0, ['Reset/presence: %s' % ('true' if val else 'false')]]) self.state = 'ROM' elif code == 'ROM...
1,390
[ 0.03702535852789879, 0.03702535852789879, 0.050919059664011, -0.0324186310172081, -0.027493350207805634, 0.0018240073695778847, -0.0076390840113162994, -0.026488691568374634, -0.0066773067228496075, 0.028154956176877022, -0.025042962282896042, -0.05684899538755417, -0.005559317301958799, 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}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Notice' db.create_table('modelnotice_notice', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_n...
1,391
[ 0.03702681139111519, 0.03798019513487816, 0.012948297895491123, -0.0016919811023399234, -0.023679422214627266, -0.03030877187848091, 0.009700137190520763, 0.0032675606198608875, -0.013580192811787128, -0.011573649942874908, -0.010215630754828453, -0.0023765338119119406, 0.07041745632886887, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "_formfield", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},...
class UnboundField(object): _formfield = True creation_counter = 0 def __init__(self, field_class, *args, **kwargs): UnboundField.creation_counter += 1 self.field_class = field_class self.args = args self.kwargs = kwargs self.creation_counter = UnboundField.creation_...
1,392
[ 0.024416202679276466, 0.021754616871476173, 0.03059724159538746, -0.0030850202310830355, -0.029497412964701653, 0.00222715362906456, 0.006373508833348751, -0.00014778951299376786, 0.020918747410178185, 0.02929944358766079, -0.03022330068051815, -0.02320639230310917, 0.019192015752196312, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding model 'Notice' db.create_table('modelnotice_notice', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='notices', to=orm['contenttypes.Con...
1,393
[ 0.009582391008734703, 0.05825227499008179, -0.013599416241049767, -0.004799316171556711, 0.008732427842915058, -0.02007429674267769, -0.009241322986781597, -0.00639908853918314, 0.0027596745640039444, 0.0002598614664748311, 0.02267291210591793, 0.026159387081861496, -0.010112941265106201, ...
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 _value(self): if self.raw_data: return self.raw_data[0] elif self.data is not None: if self.places is not None: if hasattr(self.data, 'quantize'): exp = decimal.Decimal('.1') ** self.places quantized = self.data.quantize...
1,394
[ 0.025523019954562187, 0.05039455369114876, -0.018327904865145683, 0.01031842827796936, 0.005058616865426302, 0.005441845394670963, 0.01074956078082323, -0.0029796019662171602, -0.02356855571269989, 0.05464839190244675, -0.010826206766068935, -0.015089623630046844, 0.015539917163550854, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "form_class", "annotation": null, "type_comment": null}}, {"_type"...
def __init__(self, form_class, label=None, validators=None, separator='-', **kwargs): super(FormField, self).__init__(label, validators, **kwargs) self.form_class = form_class self.separator = separator self._obj = None if self.filters: raise TypeError('FormField cann...
1,395
[ 0.03823025897145271, 0.06435529887676239, 0.02666030451655388, 0.0007154019549489021, 0.01511093694716692, -0.03040715679526329, 0.0022787353955209255, -0.015069762244820595, 0.02003125473856926, 0.0010814664419740438, -0.021987030282616615, -0.013844829984009266, 0.04813265800476074, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def populate_obj(self, obj, name): candidate = getattr(obj, name, None) if candidate is None: if self._obj is None: raise TypeError('populate_obj: cannot find a value to populate from the provided obj or input data/defaults') candidate = self._obj seta...
1,396
[ 0.034323837608098984, 0.055152833461761475, 0.016924969851970673, 0.028524214401841164, 0.03389507159590721, -0.010307306423783302, 0.027125084772706032, 0.0009816482197493315, -0.011858762241899967, -0.009026650339365005, -0.014352373778820038, -0.023988323286175728, 0.048292577266693115, ...
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": "formdata", "annotation": null, "type_comment": null}}, {"_type": ...
def process(self, formdata, data=_unset_value): if data is _unset_value: try: data = self.default() except TypeError: data = self.default self._obj = data self.object_data = data prefix = self.name + self.separator if ...
1,397
[ -0.012552686966955662, 0.020768990740180016, 0.01616288162767887, -0.027034960687160492, -0.011587893590331078, -0.03649615868926048, -0.013216630555689335, -0.002743955235928297, -0.03226351737976074, 0.09170723706483841, -0.01201323326677084, 0.010768338106572628, 0.022076129913330078, 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": "unbound_field", "annotation": null, "type_comment": null}}, {"_ty...
def __init__(self, unbound_field, label=None, validators=None, min_entries=0, max_entries=None, default=tuple(), **kwargs): super(FieldList, self).__init__(label, validators, default=default, **kwargs) if self.filters: raise TypeError('FieldList does not accept any filters. ...
1,398
[ 0.04861189424991608, 0.04851572960615158, 0.05241044983267784, -0.02966720052063465, 0.016384275630116463, 0.004543841816484928, 0.02745538204908371, 0.02839300036430359, -0.03437933325767517, 0.008690998889505863, 0.02164936251938343, -0.030268236994743347, 0.03298492729663849, -0.0141003...
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": "formdata", "annotation": null, "type_comment": null}}, {"_type": ...
def process(self, formdata, data=_unset_value): self.entries = [] if data is _unset_value or not data: try: data = self.default() except TypeError: data = self.default self.object_data = data if formdata: indices = sor...
1,399
[ 0.062346749007701874, 0.03537289798259735, 0.0626697912812233, -0.008214449509978294, 0.007204948924481869, 0.018644031137228012, 0.01713266596198082, 0.014963681809604168, -0.022705107927322388, 0.06936133652925491, 0.005543599836528301, -0.014421435073018074, -0.00007882215868448839, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "form", "annotation": null, "type_comment": null}}, {"_type": "arg...
def validate(self, form, extra_validators=tuple()): self.errors = [] success = True for subfield in self.entries: if not subfield.validate(form): success = False self.errors.append(subfield.errors) return success
1,400
[ 0.07743296027183533, 0.06609904021024704, 0.007205631583929062, -0.021227871999144554, 0.009533962234854698, -0.03527914360165596, -0.009423642419278622, -0.03130762651562691, 0.004572469741106033, 0.0005084150470793247, 0.008366893045604229, -0.011090053245425224, 0.04744917154312134, -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": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def populate_obj(self, obj, name): values = getattr(obj, name, None) try: ivalues = iter(values) except TypeError: ivalues = iter([]) candidates = itertools.chain(ivalues, itertools.repeat(None)) _fake = type(str('_fake'), (object, ), {}) output =...