text
stringlengths
25
2.19k
embedding
listlengths
768
768
def git _ repo ( git _ repo _ kwargs ) - > gitproject : repo = create _ project _ from _ pip _ url ( * * git _ repo _ kwargs ) repo. obtain ( quiet = true ) return repo
[ 0.4188803434371948, 0.8769479990005493, 0.34114471077919006, -0.25933611392974854, 0.25506582856178284, -0.17976151406764984, -1.1646318435668945, 0.005610509309917688, 0.08085833489894867, -0.1563398241996765, 0.41684627532958984, 0.20123392343521118, -0.5835187435150146, -0.7361252307891...
def createboard ( width, height ) : a = [ ] for row in range ( height ) : a + = [ createonerow ( width ) ] return a
[ -0.5358483195304871, 0.6138967871665955, 0.6207166314125061, 1.252726435661316, 0.47502046823501587, -0.4042928218841553, -0.20774510502815247, 0.038482192903757095, 0.33855506777763367, -0.8429121971130371, -0.3798106014728546, -0.794869601726532, -0.9727354645729065, 1.3383299112319946, ...
def write _ meshfile ( self ) : mesh _ positions _ vert = self. meshlocations _ z mesh _ positions _ hor = self. meshlocations _ x mesh _ widths = self. meshblockwidths _ x mesh _ depths = self. meshblockthicknesses _ z n _ nodes _ x = self. parameters _ mesh ['no _ nodes _ x'] n _ nodes _ z = self. parameters _ mesh [...
[ 0.44538363814353943, -0.4268287420272827, 0.9925619959831238, -0.12226755917072296, 0.7059730291366577, 0.1779259890317917, 0.7240346670150757, 0.3165076673030853, -0.8226751685142517, -0.002076019998639822, 0.48864203691482544, 0.48089736700057983, -0.4826994240283966, 0.35052916407585144...
def put ( self, request : request ) - > response. response : try : encounter : models. encounter = models. encounter. objects. get ( id = request. data. pop ('id') ) except models. encounter. doesnotexist : return response. response ( status = status. http _ 400 _ bad _ request ) encounter. update _ from _ json ( reque...
[ -1.3466311693191528, -1.6766046285629272, 0.8038974404335022, -0.4009860157966614, 0.1771029680967331, 0.22560015320777893, -0.2559974491596222, -0.10163896530866623, 0.40521109104156494, 0.8805198669433594, -0.28555986285209656, 0.03569634258747101, 0.04876147583127022, -0.440019309520721...
def deletetask ( self, label ) : rowid = self. lookuprowid ( label ) node = self. nodetable [ rowid ] parentlabel = self. nodetable [ node. parentid ]. label trace = nodetrace ( node, parentlabel ) self. database. deletetask ( rowid ) return trace
[ 0.21780161559581757, 0.92447429895401, 0.5593432188034058, 0.2611759603023529, -0.2239496409893036, -0.25740793347358704, 0.35529980063438416, -0.18220119178295135, 0.6122302412986755, 0.7415465116500854, -0.18538418412208557, -0.4610803723335266, -0.28508487343788147, 0.209212064743042, ...
def iso _ timestamp _ format _ regex ( self ) : return [ r'( \ d { 4 } ) - ( \ d { 2 } ) - ( \ d { 2 } ) t ( \ d { 2 } ) \ : ( \ d { 2 } ) \ : ( \ d { 2 } ) [ + - ] ( \ d { 2 } ) \ : ( \ d { 2 } ) ', r'( \ d { 4 } ) - ( \ d { 2 } ) - ( \ d { 2 } ) t ( \ d { 2 } ) \ : ( \ d { 2 } ) \ : ( \ d { 2 } ) (. \ d + ) [ + - ] (...
[ -0.05432005971670151, -1.4060999155044556, 1.2076205015182495, -0.35652977228164673, 0.023109901696443558, -0.11537677049636841, 0.01371921319514513, 0.12369079887866974, 0.32966580986976624, 0.9864050149917603, -0.5806090235710144, -0.4359561800956726, 0.9384679794311523, -0.8887185454368...
def send _ rejecteds ( ) : if not os. path. exists ( rejectfile ) or os. path. getsize ( rejectfile ) < = 0 : logging. debug ( " no rejected messages found. " ) return logging. info ( " trying to re - send rejected messages. " ) with open ( rejectfile,'r') as f1 : lines = [ i. rstrip ( ) for i in f1. readlines ( ) ] tr...
[ 0.2527027130126953, 0.23183786869049072, 0.4469940662384033, 0.23694926500320435, 0.6128894090652466, -0.09473733603954315, 0.15099462866783142, -0.20256735384464264, -0.9126347899436951, 0.25424253940582275, 0.23630577325820923, 0.18330277502536774, -0.6885268688201904, -0.037308149039745...
def save ( self ) : self. history. replace ( "'none'", " none " ) datafile = h5py. file ( self. file,'w') for key in self. _ _ dict _ _. keys ( ) : if key in ['file ','chr2int ','fends ','silent'] : continue elif self [ key ] is none : continue elif isinstance ( self [ key ], numpy. ndarray ) : datafile. create _ datas...
[ -0.2917410135269165, -0.6173815727233887, 0.6355889439582825, -0.34259936213493347, -0.07047856599092484, 0.12074244022369385, 0.3996829390525818, -0.9393396973609924, -0.9621689915657043, -0.8632717132568359, -0.12253299355506897, -0.06163398548960686, -0.8219685554504395, 0.4351477324962...
def leggtilhylleplassering ( dic ) : plassering = 1 for key in sorted ( dic ) : dic [ key ] [ 3 ] = plassering plassering + = 1 return dic
[ 0.13362322747707367, -0.13318413496017456, 0.26345372200012207, -2.003765106201172, -0.3749367892742157, 1.0653045177459717, -0.2036803960800171, 0.08541616797447205, 0.030337177217006683, 0.7542348504066467, -0.4132656157016754, -0.42013198137283325, 0.29072216153144836, -0.78168368339538...
def show _ mesh ( substrate, seed = 123 ) : np. random. seed ( seed ) fig = plt. figure ( ) ax = fig. add _ subplot ( 111, projection = " 3d " ) for idx in substrate. faces : tri = poly3dcollection ( [ substrate. vertices [ idx ] ], alpha = 0. 5 ) tri. set _ facecolor ( np. random. random ( 3 ) ) ax. add _ collection3d...
[ 0.9337169528007507, 0.576117753982544, 0.6575586199760437, -0.5518062114715576, -1.0151840448379517, 0.6557311415672302, 1.3418779373168945, -0.2980675995349884, -0.03338097035884857, -0.3031023442745209, 0.14943300187587738, 1.3380767107009888, 0.09378986805677414, 0.2682379484176636, -...
def write _ to _ cache ( self, data, filename ) : json _ data = self. json _ format _ dict ( data, true ) cache = open ( filename,'w') cache. write ( json _ data ) cache. close ( )
[ -1.5001251697540283, -0.8621771931648254, 0.3334568440914154, -0.5962541103363037, 0.5265671610832214, 0.3004843592643738, -0.5085338950157166, 1.0754324197769165, -0.6917776465415955, 0.9635078310966492, -0.7684768438339233, 0.5575504899024963, 0.14617976546287537, -0.12825921177864075, ...
def sign ( number ) : return 1 if number > = 0 else - 1
[ -1.3521617650985718, 0.38780462741851807, 0.8087314963340759, 0.7568143606185913, -0.06726041436195374, 0.5829454064369202, -0.07721954584121704, 0.5839149951934814, -0.23747673630714417, -0.7139103412628174, 0.15922914445400238, -0.8276503086090088, 0.13960257172584534, 0.2620684504508972...
def get _ position _ indices _ matching _ timestamps ( self, timestamps ) : return closest _ argmin ( timestamps, self. position ['timestamps'] )
[ -0.9905142784118652, -0.9278638958930969, 0.39379656314849854, 0.49522677063941956, -0.3594573438167572, 0.2647765278816223, -0.2380552738904953, -0.4186815917491913, 1.0052855014801025, 0.34678369760513306, -0.05601148307323456, -0.7708978056907654, -0.28143858909606934, -0.66308069229125...
def get _ form _ kwargs ( self ) : kwargs = super ( embeddedformmixin, self ). get _ form _ kwargs ( ) object = self. get _ embedded _ object ( ) kwargs. update ( {'instance': object } ) if not'initial'in kwargs : kwargs ['initial'] = { } return kwargs
[ -0.5916113257408142, -0.4015267789363861, 0.587277889251709, -0.8468812108039856, 0.25900790095329285, 0.39904072880744934, -0.6199846267700195, 0.4210335314273834, 0.09993622452020645, -0.07869530469179153, -0.7168606519699097, -0.28287947177886963, -0.0921972244977951, 1.2124375104904175...
def _ exit _ with _ message ( return _ code, message ='' ) : code _ error _ hash = { - 1 :'error _ enc _ cleared ', 0 :'success ', 1 :'error _ state _ not _ cleared ', 2 :'error _ invalid _ args ', } output = {'response': {'code': return _ code,'description': code _ error _ hash [ return _ code ], },'message': message ...
[ -0.3508204221725464, -0.03472956642508507, 0.5276879072189331, -0.1099514588713646, -0.25726044178009033, -0.6888992190361023, -0.15595541894435883, -0.4370867609977722, -0.7218565344810486, 0.7502846121788025, 0.1140446811914444, 0.5469813942909241, -0.3135647475719452, 0.2702242136001587...
def _ _ init _ _ ( self, dist ) : assert np. isclose ( np. sum ( dist ), 1. 0 ), " distribution must sum to 1. 0 " self. dist = dist if len ( dist ) > 1 : self. table = self. _ create _ table ( ) else : self. table = [ [ 0, 1 ] ]
[ -0.3531610667705536, 0.3803555965423584, 0.3750051259994507, 1.2485036849975586, -0.37814822793006897, 0.18343980610370636, 0.6364851593971252, 0.3953753411769867, 0.06923864036798477, -0.45390093326568604, -0.28375980257987976, -0.11991814523935318, 0.06706944853067398, 1.3761556148529053...
def data _ import ( self, file _ names, data _ folder ) : data _ files = [ ] for file in file _ names : file _ path = data _ folder +'/'+ file data _ files. append ( pd. read _ csv ( file _ path, header = none ) ) dataset = pd. concat ( data _ files, ignore _ index = true ) return dataset
[ -0.05408043786883354, 0.025420842692255974, 0.5403658747673035, 0.30887895822525024, 0.38328370451927185, 0.818444550037384, -0.09695630520582199, 0.9243634939193726, -0.6750243306159973, 0.21501418948173523, 0.5279514193534851, 0.36708784103393555, -0.11192233115434647, -0.403566628694534...
def batch _ eval ( tf _ inputs, tf _ outputs, numpy _ inputs ) : n = len ( numpy _ inputs ) assert n > 0 assert n = = len ( tf _ inputs ) m = numpy _ inputs [ 0 ]. shape [ 0 ] for i in range ( 1, n ) : assert numpy _ inputs [ i ]. shape [ 0 ] = = m out = [ ] for _ in tf _ outputs : out. append ( [ ] ) for start in rang...
[ 0.47377389669418335, -0.8497986197471619, 0.8695744276046753, 0.5645638704299927, 0.3817271590232849, 0.23683324456214905, 0.4032261073589325, 0.18262450397014618, -0.39214345812797546, 0.6992591619491577, 0.7936772704124451, 0.37943798303604126, 0.13646233081817627, 0.276119202375412, 0...
def _ domain _ iterator ( d ) : if isinstance ( d, ( tuple, list ) ) : for x in d : if isinstance ( x, ( list, tuple ) ) : min, max = x if min = = max : yield min else : for v in range ( min, max + 1 ) : yield v else : yield x else : yield d
[ -1.4132217168807983, 0.5807218551635742, 0.5703974366188049, 0.38455912470817566, -0.8246660232543945, 0.4021928310394287, -0.5053991675376892, -0.6353658437728882, 0.3652733564376831, -0.7805823683738708, 0.20618298649787903, 0.5736259818077087, 0.5583420395851135, 0.1311725229024887, -...
def rouletteselect ( valuelist ) : totalvalues = sum ( valuelist ) pick = random. random ( ) * totalvalues s = 0 for i in range ( len ( valuelist ) ) : s + = valuelist [ i ] if s > = pick : return i return len ( valuelist ) - 1
[ -0.738375186920166, 0.014705775305628777, 0.4780345857143402, -0.049021292477846146, 0.1129981279373169, 0.24753107130527496, 1.0556572675704956, 0.061785779893398285, 1.1122593879699707, 0.13986489176750183, -0.4150383472442627, -0.20667271316051483, -0.7309374213218689, -0.61988061666488...
def test _ point _ to _ pdf ( self ) : point = self. beta. random _ point ( n _ samples = 2 ) pdf = self. beta. point _ to _ pdf ( point ) x = gs. linspace ( 0., 1., 10 ) result = pdf ( x ) pdf1 = beta. pdf ( x, a = point [ 0, 0 ], b = point [ 0, 1 ] ) pdf2 = beta. pdf ( x, a = point [ 1, 0 ], b = point [ 1, 1 ] ) expe...
[ 0.34083184599876404, -0.8250687718391418, 0.46405312418937683, -0.07609005272388458, 1.0160423517227173, -0.09229699522256851, 0.29862335324287415, -0.5211942791938782, 0.0758122056722641, -0.2272205352783203, -0.2739138603210449, 0.22639094293117523, 0.1931964010000229, -0.435988545417785...
def gene _ symbol _ to _ ensembl _ id _ map ( ) : with open ('% s / onto / data / ensembl _ genes. tsv'% util. app _ home ) as f : eid _ map = defaultdict ( set ) for line in f : eid _ canonical, gene _ name, mapping _ type = line. rstrip ('\ n'). split ('\ t') eid = eid _ canonical. split (':') [ 0 ] canonical _ name ...
[ -0.6441373229026794, -0.6113460063934326, 0.4609661400318146, -0.6334735155105591, 0.07220578193664551, -0.17281942069530487, 0.31933993101119995, 0.6966262459754944, -0.7982672452926636, 0.8873811960220337, -0.5967106223106384, 0.3705860376358032, 0.523201584815979, 0.1300504058599472, ...
def date _ time _ string ( timestamp = none ) : weekdayname = ['mon ','tue ','wed ','thu ','fri ','sat ','sun'] monthname = [ none,'jan ','feb ','mar ','apr ','may ','jun ','jul ','aug ','sep ','oct ','nov ','dec'] if timestamp is none : timestamp = time. time ( ) year, month, day, hh, mm, ss, wd, y, z = time. gmtime (...
[ -0.42073777318000793, 0.09912434965372086, 1.0249220132827759, -0.8254340291023254, -0.49968940019607544, -0.02130512148141861, -0.9390766620635986, -0.5627614259719849, 0.6861273050308228, 0.7480372786521912, 0.10937397927045822, -0.313091516494751, 0.33294349908828735, -0.168224304914474...
def exit ( self ) : return self. store. get ( )
[ -0.5177938342094421, -0.04375343769788742, 0.38670995831489563, -0.5070457458496094, -0.9115104675292969, 0.15848758816719055, -0.2875806391239166, -0.3888324797153473, 0.3660109341144562, -0.024087335914373398, -0.3468343913555145, -0.3336527645587921, -1.0968304872512817, -0.939533889293...
def reset ( self ) : obs = self. gym. reset ( ) self. rewardshaping. reset ( ) agent _ obs = self. featurize ( obs [ self. gym. training _ agent ] ) return agent _ obs
[ 0.22452160716056824, -0.5780838131904602, 0.347597599029541, 0.23186305165290833, 0.3614959120750427, -0.7659801244735718, 0.0007705711177550256, -0.17386846244335175, -0.598637580871582, 0.24729137122631073, -0.15606153011322021, 1.0288991928100586, 0.4508858025074005, -0.7258820533752441...
def _ _ repr _ _ ( self ) : return " polacam image ( { } ) ". format ( self. method )
[ -0.1537942886352539, -1.2471938133239746, 0.2723257839679718, -0.7801095247268677, -0.32855522632598877, 0.22058667242527008, -0.2870933711528778, 0.11527086049318314, 0.5190628170967102, 0.3242954909801483, 0.7621199488639832, 0.63519686460495, 0.30659106373786926, 0.38504621386528015, ...
def get _ airports _ codes ( ) : airports _ codes = airport. find ( {'code': { " $ ne " : none } }, {'code': 1,'iata _ code': 1,'name': 1,'_ id': 0 } ) return dict ( ( i. code, i ) for i in airports _ codes if i. code )
[ -0.17951957881450653, 0.0246767345815897, 0.33701425790786743, -0.2512652575969696, -0.26930299401283264, 0.10528505593538284, -0.6865010261535645, 0.6523808240890503, -0.1275850236415863, 1.0035089254379272, -0.8777400851249695, -1.507944107055664, -0.09706548601388931, 0.3711677491664886...
def gateway _ map ( cls ) : return { gw. version : gw for gw in cls. _ _ subclasses _ _ ( ) }
[ 0.29057568311691284, -1.1067280769348145, 0.5378875732421875, -0.22330142557621002, -1.0157899856567383, 1.7620784044265747, -0.0809248685836792, -0.6937533617019653, -0.02564343437552452, 0.6866533756256104, -1.012901782989502, 0.6788954734802246, 0.03119834139943123, 1.8077448606491089, ...
def get _ user _ note ( ) - > str : return get _ arguments ( ) [ 2 ]
[ -0.023298144340515137, 0.18451933562755585, 0.46843937039375305, 0.5701350569725037, 0.4604862332344055, 0.6298363208770752, 0.4536822438240051, -0.72307950258255, -0.9244048595428467, 0.06119829788804054, 0.627531111240387, 0.6805890798568726, -0.19099213182926178, -0.49220770597457886, ...
def _ create _ user ( self, email, password, * * extra _ fields ) : email = self. normalize _ email ( email ) user = self. model ( email = email, * * extra _ fields ) user. set _ password ( password ) user. save ( using = self. _ db ) return user
[ -0.061091337352991104, 0.41656947135925293, 0.358655720949173, -0.17063340544700623, 0.13947491347789764, 0.8704169392585754, -0.5416668653488159, 0.2795444428920746, -0.2072978913784027, 0.4430491328239441, -1.0372482538223267, -0.8698242902755737, -0.01369633898139, -0.6780995726585388, ...
def top _ coefs ( clf, label, n, vocab ) : top _ coefs = [ ] coef = clf. coef _ [ 0 ] sorted _ vocab _ keys = sorted ( vocab. keys ( ) ) sorted _ index _ coef = np. argsort ( coef ) if label = = 0 : top _ n _ coef _ index = sorted _ index _ coef [ : n ] elif label = = 1 : top _ n _ coef _ index = sorted _ index _ coef ...
[ -1.1379567384719849, -0.7732353210449219, 0.8123618960380554, -0.265577107667923, -0.12519359588623047, -0.5267482399940491, -0.3806597590446472, -0.31320515275001526, -0.20127005875110626, 1.3412493467330933, -0.28278887271881104, 0.0542781688272953, 0.1565558910369873, -0.257131844758987...
def plot _ phase ( states, i _ h = 0, i _ v = 1, ax = none, label _ h = none, label _ v = none ) : if label _ h is none : label _ h ='q [ % s ]'% i _ h if label _ v is none : label _ v ='q [ % s ]'% i _ v q0 = states [ i _ h, : ] q1 = states [ i _ v, : ] if ax is none : fig, ax = plt. subplots ( ) ax. plot ( q0, q1,'o ...
[ -0.13544602692127228, -0.9009408354759216, 0.7461181879043579, -0.7625131011009216, -0.7305393218994141, 0.36105507612228394, -0.36054712533950806, 0.14022518694400787, 0.32850587368011475, 0.09270025789737701, -0.07143855094909668, 0.010334223508834839, -0.2630115747451782, -0.07141477614...
def test _ login _ user _ with _ invalid _ credentials ( self ) : user = user = { " username " : " bush ", " password " : " 1234 " } userdata = json. dumps ( user ) response = self. client. post ( " / v1 / auth / login ", data = userdata, content _ type ='application / json') self. assertequal ( response. status _ code...
[ -0.8291560411453247, -0.38890570402145386, 0.5674663782119751, -0.12448504567146301, -1.1393134593963623, 1.2158987522125244, -0.9332258105278015, -0.4042036831378937, 0.3111113905906677, -0.933500349521637, -1.136374592781067, 0.40844905376434326, -0.1404476761817932, -0.12432684004306793...
def compute _ observations ( self, data, weights = none, all = false ) : if weights = = none : weights = np. ones ( np. shape ( data [ 0 ] ) [ 0 ] ) all _ obs = np. array ( [ ] ) all _ std = np. array ( [ ] ) seen _ this _ time = [ ] for idx, observable in enumerate ( self. observables ) : obs, std, seen = observable. ...
[ -0.2666298449039459, 0.0009599482291378081, 0.9184211492538452, -0.12579859793186188, -0.21395380795001984, 0.05803534388542175, -0.3626006841659546, 0.16480278968811035, -0.16683165729045868, 0.6293867230415344, -0.08837664872407913, 0.4402053654193878, -0.1977846920490265, 1.216848731040...
def fibonacci ( number ) : if number = = 0 : return 0 return fibonacci ( number - 1 ) + number
[ 0.12054614722728729, 0.8821943998336792, 0.3170807361602783, 1.6296170949935913, 0.6002203822135925, -0.38306954503059387, 0.8602773547172546, 0.4186267852783203, 0.834033727645874, -0.3989165127277374, 0.217102512717247, -0.0035387605894356966, -0.12503613531589508, 0.8717418313026428, ...
def have _ unactivated _ changes ( cmgr ) : _ method _ name ='have _ unactivated _ changes'_ logger. entering ( cmgr, class _ name = _ class _ name, method _ name = _ method _ name ) try : result = cmgr. haveunactivatedchanges ( ) except ( wlstexception, exception ), e : pwe = exception _ helper. create _ pywlst _ exce...
[ -0.4140700101852417, -0.24811193346977234, 0.6557571291923523, -0.9380943179130554, -0.865726113319397, -0.4209131598472595, 0.7526073455810547, -0.5700169801712036, 0.11202903091907501, 0.029005898162722588, -0.4008871614933014, 0.33229151368141174, -0.7015419602394104, 1.3291151523590088...
def timestamp _ to _ logtime ( secs ) : format = " % d / % b / % y : % h : % m : % s " time _ in = time. gmtime ( secs ) time _ out = time. strftime ( format, time _ in ) return time _ out
[ -0.17999054491519928, -0.6303763389587402, 0.6626248955726624, -0.6537482142448425, -0.047779325395822525, 0.05107006058096886, -0.9369211792945862, -1.1778885126113892, -0.009512602351605892, 1.032841682434082, -0.050826385617256165, 0.05116855725646019, 0.8867361545562744, -0.69855248928...
def test _ adjacent _ invalid _ node ( gr ) : gr. add _ node ('c') with pytest. raises ( valueerror ) : gr. adjacent ('c ','f')
[ 1.0156354904174805, 1.0869178771972656, 0.427715539932251, -0.5135884881019592, 0.594211757183075, 1.5350624322891235, -0.028863077983260155, 0.1313914954662323, -1.112762451171875, -0.19479545950889587, 0.4657188057899475, 0.17704379558563232, -0.2522128224372864, 0.09098885208368301, 0...
def process _ true _ boxes ( true _ boxes, anchors, image _ width, image _ height ) : scale = image _ w / grid _ w # 32 times anchors _ count = len ( anchors ) / / 2 anchors = np. array ( anchors ) anchors = anchors. reshape ( len ( anchors ) / / 2, 2 ) # grid _ w * grid _ h feature point, every single point have ancho...
[ 0.0976724848151207, -0.7437219023704529, 0.999548077583313, 0.2890225648880005, 0.08427926898002625, -0.5796387791633606, 0.7360678911209106, -0.16840490698814392, -0.38098472356796265, 0.3190121054649353, -0.11449047923088074, 0.16478171944618225, 0.3494200110435486, -0.03821994736790657,...
def blackbody _ intensity _ frequency ( temperature, frequency ) : h = 6. 62e - 27 # erg * s c = 2. 998e10 # c in cm / s k = 1. 38e - 16 # erg / k intensity = 2 * h * f * * 3 / c * * 2 / ( np. exp ( h * frequency / k / temperature ) - 1 ) return intensity
[ 0.30641868710517883, -0.27833664417266846, 0.31047603487968445, -0.04028301686048508, 0.05074230208992958, -0.4978744387626648, 0.04657502472400665, 0.3886384665966034, -0.8622188568115234, 0.3830501437187195, -0.2158469259738922, -0.4348820745944977, -1.0634381771087646, 0.089056447148323...
def calculate _ distance ( dist _ matrix, tour ) : total _ dist = 0. 0 n _ stops = len ( tour ) for i in range ( 1, n _ stops ) : total _ dist + = dist _ matrix [ tour [ i - 1 ], tour [ i ] ] return total _ dist
[ -0.7010265588760376, -0.11077158153057098, 0.5966458320617676, 0.32012251019477844, -0.4727296829223633, 0.8687799572944641, 0.9750693440437317, 0.673769474029541, 0.40691590309143066, 1.209157943725586, -0.43732428550720215, -0.8565471172332764, -0.4414690136909485, -0.5058354139328003, ...
def is _ bucket ( self, bucket _ name : str ) - > bool : return self. objectdata. is _ bucket ( bucket _ name )
[ -0.36650851368904114, 0.22031664848327637, 0.43391290307044983, 0.9512321352958679, -0.22148068249225616, 0.555279016494751, -0.12813125550746918, -0.25010305643081665, 0.4565470516681671, -0.44225746393203735, -0.5764371156692505, 0.7809097170829773, 0.434987336397171, -0.0268264114856719...
def get _ center ( block :'block') - > tuple [ float, float ] : size = block. size / 2 return ( block. position [ 0 ] + size, block. position [ 1 ] + size )
[ -0.20938946306705475, -0.3749203681945801, 0.5031505227088928, 0.5841619372367859, 0.17061591148376465, -0.5621433854103088, -0.3087567389011383, -0.32411614060401917, -0.085523821413517, 1.0570911169052124, -0.9645563960075378, -0.3058760464191437, -0.4380553662776947, 0.7055580019950867,...
def login ( email, password ) : if not email or not password : response = jsonify ( {'error':'missing login credentials'} ) response. status _ code = 400 return response if not validate _ email ( email ) : response = jsonify ( {'error':'enter valid email'} ) response. status _ code = 400 return response user = usermoda...
[ -0.6856217384338379, -0.41438791155815125, 0.8752241134643555, 0.31235238909721375, -0.18610219657421112, 0.1220921203494072, -1.0058636665344238, 0.19866099953651428, 0.23645354807376862, 0.3238157033920288, -0.5450035333633423, 0.2979288399219513, 0.13863201439380646, -0.0068911900743842...
def executescript ( presto _ conn, sqlscript, params = none, preprocessor = none ) : results = [ ] stmt _ count = 0 # sqlparse. split ( ) should be a safer means to split a sql script into discrete statements for p _ stmt in sqlparse. split ( sqlscript ) : stmt _ count = stmt _ count + 1 p _ stmt = str ( p _ stmt ). st...
[ -0.26060473918914795, 0.09562405198812485, 0.7270152568817139, 0.4364238679409027, -0.003451310796663165, -0.7375437021255493, -1.0363247394561768, 0.17183205485343933, 0.05786465108394623, 0.45686858892440796, 0.032227348536252975, -0.1289387345314026, -0.07522137463092804, 0.919285535812...
def get _ gpx ( self, routes, gpx _ file = none ) : output ='' output + = " <? xml version ='1. 0 '? > \ n " output + = ( " < gpx version ='1. 1'creator ='psycopgr'" " xmlns ='http : / / www. topografix. com / gpx / 1 / 1'" " xmlns : xsi ='http : / / www. w3. org / 2001 / xmlschema - instance'" " xsi : schemalocation =...
[ -0.5393927693367004, 0.1453147679567337, 0.8945921659469604, -0.38732415437698364, -0.12498805671930313, -0.25010767579078674, -0.7999884486198425, 0.532155454158783, -0.7660691142082214, 0.452448308467865, 0.4653607904911041, -0.927363395690918, 0.002498343586921692, -0.24901843070983887,...
def _ read _ tsv ( cls, input _ file, quotechar = none ) : with open ( input _ file, " r " ) as f : reader = csv. reader ( f, delimiter = " \ t ", quotechar = quotechar ) lines = [ ] for line in reader : lines. append ( line ) return lines
[ 0.2643948197364807, -0.4443996846675873, 0.30413684248924255, -0.45327892899513245, 0.1670246571302414, 0.6460409164428711, -0.8575408458709717, 0.5705460906028748, -0.8301199674606323, 0.07546219974756241, 0.47455519437789917, 0.002156592672690749, 0.8714126348495483, -0.3949776887893677,...
def abspath ( path ) : if not isabs ( path ) : cwd = posix. getcwd ( ) path = join ( cwd, path ) return normpath ( path )
[ 0.4723901152610779, -0.8714631199836731, 0.5278375744819641, 0.8275930285453796, -1.3963463306427002, 1.1028608083724976, 0.5141753554344177, -0.15613141655921936, 0.7542227506637573, -0.49827149510383606, 1.318310022354126, -0.7843766212463379, -0.5420575141906738, 0.29984182119369507, ...
def extract _ membre _ and _ position _ from _ columns ( col _ name, line ) : col _ name = col _ name. lower ( ) col _ name = col _ name. split ('indlesion') [ - 1 ] if col _ name. find ('gauche')! = - 1 : return col _ name. split ('gauche') [ 0 ],'gauche'elif col _ name. find ('droit')! = - 1 : return col _ name. spli...
[ 0.21993164718151093, -1.3569048643112183, 0.8286930322647095, -0.7839524149894714, 0.11023371666669846, -0.3502543270587921, -0.5039440393447876, -0.12418366968631744, -1.1168212890625, 0.598176896572113, -0.24032308161258698, -0.2510342597961426, -0.23264198005199432, -1.121325135231018, ...
async def test _ unavailable _ endpoint ( v3 _ server ) : v3 _ server. get ( ( f " https : / / api. simplisafe. com / v1 / ss3 / subscriptions / { test _ subscription _ id } " " / settings / normal? forceupdate = false " ), status = 403, body = load _ fixture ( " unavailable _ endpoint _ response. json " ), ) async wit...
[ -0.3010237216949463, 0.27127861976623535, 0.41111716628074646, 0.08620190620422363, 0.3549158573150635, 1.031540036201477, -0.24601764976978302, 0.1441406011581421, 0.7832192182540894, 0.16501948237419128, -0.26932695508003235, 0.6111745238304138, -0.5254536867141724, -0.6704150438308716, ...
def _ _ init _ _ ( self, id = none, name = none, enabled = none, recipients = none, admin _ accounts = none, site _ id = none, site _ name = none, local _ vars _ configuration = none ) : # noqa : e501 # noqa : e501 if local _ vars _ configuration is none : local _ vars _ configuration = configuration ( ) self. local _ ...
[ 0.723504364490509, 0.08319421857595444, 0.37270087003707886, -0.5461270809173584, -0.6907578110694885, -0.40631210803985596, -0.003919679205864668, 0.350195050239563, 1.0671273469924927, 0.3283626437187195, -0.9289765357971191, 0.8337945342063904, -0.31617042422294617, 0.2147936224937439, ...
def open ( self, path : text ) - > vfsfile : f = self. _ get _ file ( path ) try : self. _ client. verifyaccess ( ) except api _ errors. accessforbiddenerror as e : raise errors. approvalmissingerror ( self. _ client. client _ id, e ) return vfsfile ( f. getblobwithoffset )
[ 0.4155215620994568, -0.19127346575260162, 0.6344130039215088, -0.023513756692409515, -0.8201249241828918, 0.6314444541931152, -0.27207475900650024, -0.20826168358325958, -0.4905443489551544, -0.046665340662002563, 0.83852618932724, 0.7728809714317322, -0.6629226207733154, -1.20090007781982...
def get _ expected _ electron _ counts ( self, fit _ function, time, * * kwargs ) : return self. _ get _ expected _ counts ( fit _ function, self. electron _ migration _ matrix, self. electron _ effective _ area, * * kwargs ) * time
[ -0.6252932548522949, 0.007290831301361322, 0.6143351197242737, 0.16665221750736237, 0.4779413938522339, 0.011714035645127296, -0.29520124197006226, 0.3273409903049469, -0.5800864696502686, 0.03087395615875721, -0.09855432063341141, 1.0567806959152222, 0.5992591381072998, 0.6539329290390015...
def dfs _ edge _ cmp ( e1, e2 ) : if e1 [ 0 ] < e1 [ 1 ] and e2 [ 0 ] < e2 [ 1 ] : # they are both forward edges if e1 [ 1 ] < e2 [ 1 ] or ( e1 [ 1 ] = = e2 [ 1 ] and e1 [ 0 ] > e2 [ 0 ] ) : return - 1 # e1 < e e2 elif e1 [ 1 ] = = e2 [ 1 ] and e1 [ 0 ] = = e2 [ 0 ] : return 0 # e1 = e e2 else : return 1 # e1 > e e2 if...
[ -0.8899909853935242, -0.6868798136711121, 1.4050548076629639, -0.9983667135238647, -0.39404767751693726, -0.15095749497413635, 0.25825342535972595, 0.4619114100933075, 0.04277438297867775, 0.6666573286056519, 0.3809681832790375, 0.09909079968929291, 0.08571819216012955, 0.1800638735294342,...
def _ _ plot _ clusters _ onto _ 2d ( self, clusterer, x, dim _ reduction _ method, perplexity, plot = false ) : if hasattr ( clusterer,'predict') : cluster _ labels = clusterer. predict ( x ) else : cluster _ labels = clusterer. labels _ if len ( set ( cluster _ labels ) ) = = 1 : print ( " clustering failed. unable t...
[ 0.3768020570278168, 0.46241429448127747, 0.7528018951416016, 0.14963215589523315, -0.6131682395935059, 0.26328206062316895, 0.7835993766784668, 0.4215071201324463, -0.14336876571178436, -0.18655480444431305, 0.6188318729400635, 1.1517077684402466, 0.13131360709667206, 0.33975061774253845, ...
def connectionauserveurftp ( host, user, password ) : ftp = ftp ( host, user, password ) # on se connecte return ftp
[ 0.770531952381134, -1.334594488143921, 0.6107981204986572, 0.34335941076278687, -0.35680702328681946, 0.21477216482162476, -0.7382139563560486, -0.7729312777519226, -0.944691002368927, 0.382802277803421, 0.17965364456176758, -0.4685894548892975, -0.8296070098876953, -0.6607239246368408, ...
def read _ input ( f, uuid = none ) : # read input file in as dictionary input _ dict = iprpy. tools. parseinput ( f, allsingular = true ) # set calculation uuid if uuid is not none : input _ dict ['calc _ key'] = uuid else : input _ dict ['calc _ key'] = input _ dict. get ('calc _ key ', str ( uuid. uuid4 ( ) ) ) # ve...
[ 0.23172596096992493, -0.14504210650920868, 0.9806727766990662, -0.9270368218421936, -0.4363037049770355, 0.5630779266357422, 0.6487177014350891, 0.603298544883728, -1.0578422546386719, -0.06478538364171982, 0.31427863240242004, 0.11155996471643448, 0.2035396844148636, -0.5461545586585999, ...
def test _ load _ restore ( ) : file = '. / files / simple. coll2'# load using coll2merge c = coll2merge. collection ( ) with open ( file,'r') as f : c. add _ file ( f ) # export using coll2merge coll _ str = c. get _ coll2 ( ) # load file directly with open ( file,'r') as f : coll _ str _ expected = f. read ( ) # comp...
[ 0.45836925506591797, -0.9475415349006653, 0.7091692090034485, -0.5692865252494812, 0.746855616569519, 0.5035818219184875, -0.15903960168361664, -0.6424373984336853, -0.08089976757764816, -0.949937105178833, -0.9972609281539917, -0.23710544407367706, -0.19963781535625458, -0.950651824474334...
def extract _ views _ from _ urlpatterns ( urlpatterns, base ='' ) : views = [ ] for p in urlpatterns : if hasattr ( p,'_ get _ callback') : try : views. append ( ( p. _ get _ callback ( ), base + p. regex. pattern ) ) except viewdoesnotexist : continue elif hasattr ( p,'_ get _ url _ patterns') : try : patterns = p. u...
[ -0.15626122057437897, 0.02865462377667427, 0.5404233336448669, 1.0774506330490112, -0.09103625267744064, -0.008752158842980862, 0.5669994354248047, -0.38843125104904175, 1.1225298643112183, -0.8421329855918884, -0.5147719383239746, -0.16734667122364044, -0.5005251169204712, 1.1417808532714...
def _ _ get _ args ( ) - > argparse. namespace : # make parser object parser = argparse. argumentparser ( description = _ _ doc _ _, formatter _ class = argparse. rawdescriptionhelpformatter, ) parser. add _ argument ( " - i ", " - - input - file ", metavar = " input _ xml _ file ", dest = " input _ file ", type = str,...
[ 0.5953763723373413, -0.7259762287139893, 0.7691333889961243, -0.10717608779668808, -0.061033695936203, -0.08824591338634491, -0.23722389340400696, -0.29932737350463867, -0.6401004195213318, -0.1614266037940979, -0.19117441773414612, 0.14608308672904968, -0.0251009538769722, 0.3178381323814...
def day ( request, date ) : d = day. objects. get ( date = date ) stats = d. the _ stats ( ) site _ paths = sorted ( stats. get ( " paths ", { } ). iteritems ( ), key = lambda ( k, v ) : ( v, k ), reverse = true ) feed _ paths = sorted ( stats. get ( " feed _ paths ", { } ). iteritems ( ), key = lambda ( k, v ) : ( v, ...
[ -0.5646151900291443, 0.5565834045410156, 0.831921398639679, -0.19537965953350067, -0.03202386945486069, 0.5988486409187317, 0.5635964870452881, -0.8256963491439819, -0.2810613811016083, -0.20535622537136078, 0.8665047883987427, -0.16209256649017334, 0.5013936758041382, 1.0419296026229858, ...
def locked ( m ) : return partial ( locked _, m )
[ -0.5968616604804993, -0.6201348304748535, 0.037264734506607056, 0.23874621093273163, -0.48084113001823425, -0.6542457938194275, 0.84339439868927, -1.368518590927124, -0.10244804620742798, 0.1363862305879593, 0.3768683969974518, -0.0864793062210083, -0.40765246748924255, -1.231630563735962,...
def get _ obsid _ fraction ( obsid ) : fans, blotches = get _ fans _ blotches _ per _ obsid ( obsid ) gs = get _ geoseries ( fans, blotches ) unionized = gs. unary _ union total _ pixels = get _ total _ npixels ( obsid ) fraction = unionized. area / total _ pixels return fraction
[ 0.0741041973233223, 0.31060361862182617, 0.35405850410461426, -0.233732208609581, -0.6854692697525024, -0.27241024374961853, 0.788262128829956, -1.0427117347717285, 1.5980182886123657, -0.09025236964225769, 0.6736528277397156, -0.008866735734045506, 0.7711917161941528, 0.43834295868873596,...
def _ construct _ form ( self, i, * * kwargs ) : form = super ( requiredinlineformset, self ). _ construct _ form ( i, * * kwargs ) form. empty _ permitted = false return form
[ -0.6120431423187256, 0.5189508199691772, 0.3156444728374481, -0.9034824371337891, -0.4963800609111786, 0.3021453022956848, -0.00026635939138941467, 0.3487927317619324, -0.5206241011619568, -1.0411810874938965, -0.20822466909885406, -0.23390766978263855, -0.5702626705169678, -0.582597434520...
def add _ numbers ( l1, l2 ) : ans = none carry = 0 while l1 or l2 or carry : next _ digit = carry if l1 : next _ digit + = l1. val l1 = l1. next if l2 : next _ digit + = l2. val l2 = l2. next next _ item = listnode ( next _ digit % 10 ) carry = next _ digit / / 10 if ans : ans. next = next _ item ans = ans. next else ...
[ 0.0981626957654953, 0.190482959151268, 0.8525006771087646, -0.21613016724586487, -0.17137551307678223, 0.039837516844272614, -0.6610888838768005, 0.2463640570640564, 0.28680408000946045, -0.49312645196914673, -0.33621537685394287, 0.5662710666656494, -0.3835059404373169, 0.5758399963378906...
def _ dispatch _ geis _ events ( self, fd, condition ) : _ geis _ event _ action = { geis. geis _ event _ gesture _ begin : self. _ do _ gesture _ begin, geis. geis _ event _ gesture _ update : self. _ do _ gesture _ update, geis. geis _ event _ gesture _ end : self. _ do _ gesture _ end, geis. geis _ event _ class _ a...
[ -0.45115286111831665, 0.6061016917228699, 0.9151919484138489, -0.006527298130095005, 0.12909235060214996, 0.26229238510131836, 0.159308522939682, -0.11260656267404556, 0.2820391058921814, 0.1537914276123047, -0.4724103808403015, -0.9041081666946411, 0.15682952105998993, 0.8555126190185547,...
def _ websocket _ async _ main ( args, loop ) : log. info ( " starting websocket server on % s : % i ", args. bind _ host, args. bind _ port ) cache _ context = \ yield from serverstf. cache. asynccache. connect ( args. redis, loop ) with cache _ context as cache : yield from websockets. serve ( service ( args. path, c...
[ -0.11835890263319016, -0.2079317420721054, 0.6781219840049744, 0.09460383653640747, -0.01942659355700016, -0.16061155498027802, 0.11445794999599457, -0.17940276861190796, 0.06687305122613907, 0.6532307267189026, 0.5447118282318115, 1.0661717653274536, 0.09958679974079132, 0.424703717231750...
def unsubscribe ( self, subscription ) : request = request ( method ='post ', endpoint ='/ streams / unsubscribe / { } '. format ( subscription ) ) def response _ handler ( resp ) : code = resp. status _ code if resp. is _ success : return'ok'elif code = = 403 : raise ex. streampermissionerror ( resp, request ) raise e...
[ -0.25538337230682373, 0.46105968952178955, 0.5829626321792603, 0.4091835021972656, -0.8439832925796509, -0.7316046953201294, -0.1696011871099472, -0.41005513072013855, -0.17576852440834045, 0.04872845485806465, -0.2981792688369751, 0.49137070775032043, -1.2217307090759277, -0.8094376921653...
def _ save _ data ( self, data ) : if self. _ dump _ dir is not none : # check if path is existent or generate directory if not os. path. exists ( self. _ dump _ dir ) : os. makedirs ( self. _ dump _ dir ) path = self. _ dump _ dir +'/ dataset _'+ str ( int ( time. time ( ) * 10000 ) ) + '. pickle'with open ( path,'wb'...
[ -1.2652474641799927, 0.7018622159957886, 0.5837579965591431, -0.6241945028305054, 0.4883362352848053, 0.39191117882728577, 0.13362915813922882, 0.3607432544231415, 0.22099506855010986, -0.238048255443573, -0.46012264490127563, -0.5128040313720703, 0.041327446699142456, 0.512297511100769, ...
def test _ get _ module _ non _ exosims _ ok _ 2 ( self ) : module = " tests. testmodules. planetpopulation. planetpopulationmodified " modtype = " planetpopulation " m = get _ module ( module, modtype ) self. validate _ module ( m, modtype )
[ -0.5646528601646423, -0.24393977224826813, 0.29167455434799194, 0.49142444133758545, 0.8741547465324402, 1.3481649160385132, -0.20325714349746704, -0.8277917504310608, 0.5702893137931824, 0.38851532340049744, 0.29978111386299133, 0.9862658381462097, -0.18462038040161133, 0.3896933794021606...
def p2p _ fetch _ gallery ( self, gallery _ slug ) : item = self. p2p _ get _ content _ item ( gallery _ slug, related _ items = true ) items = self. fetch _ multiple _ items ( live _ related _ item _ ids ( item ['related _ items'] ) ) return {'gallery': item,'related': items }
[ 0.046767812222242355, -0.6107644438743591, 0.3096048831939697, -0.2581384778022766, 0.07665354758501053, -0.5071987509727478, 0.11072421818971634, 0.08751615136861801, -0.12931138277053833, -0.3417244851589203, -0.8003309369087219, -0.2356729656457901, 0.29705166816711426, 0.35503929853439...
def getcommand ( self ) : cmd = self. command. split ( " < " ) # cmd = [ " any > anything ", " / any > " ] cmd = cmd [ 1 ]. split ( " > " ) # cmd [ 0 ] = = " any > anything " # cmd = [ " any ", " anything " ] if len ( cmd ) > 1 : return ( cmd [ 0 ], cmd [ 1 ] ) # ( command type, value ) else : return ( cmd [ 0 ], )
[ -1.363267183303833, -1.1607789993286133, 0.7075732350349426, 0.6897755265235901, 0.6635143160820007, -0.48425519466400146, -0.2999383509159088, -0.11853859573602676, -0.013984652236104012, -1.084580659866333, -0.19639863073825836, 0.17043697834014893, -0.337869256734848, 1.2487736940383911...
def area _ kernel ( lon, lat ) : lat1 = ( lat - 0. 5 ) * ( np. pi / 180. 0 ) lat2 = ( lat + 0. 5 ) * ( np. pi / 180. 0 ) return ( np. pi / 180. 0 ) * ( earth _ radius * * 2 ) * np. abs ( np. sin ( lat1 ) - np. sin ( lat2 ) ) * 1
[ -0.12456943839788437, -1.3524209260940552, 0.6629892587661743, -0.7433682084083557, -0.5452257394790649, -0.17466190457344055, -1.1437398195266724, 0.219807967543602, 0.09694241732358932, 0.7096843123435974, 0.5837721824645996, 0.7791472673416138, 0.3947860598564148, 0.465271919965744, 0...
def file _ size ( filename ) : filename = os. path. expanduser ( filename ) if os. path. exists ( filename ) : return os. path. getsize ( filename ) return - 1
[ -0.5806261301040649, 0.19185499846935272, 0.7551195621490479, 0.40446215867996216, -0.03715735673904419, 0.3990483283996582, 0.7838202118873596, 0.41363054513931274, -0.9849612712860107, -0.027350222691893578, 0.8520824313163757, -1.2789626121520996, -0.3116135895252228, 0.4936410486698150...
def set ( key, value ) : yield setasync ( key, value )
[ -0.4245135486125946, 0.7566134929656982, 0.542098879814148, -0.1908983588218689, -1.0553022623062134, -0.6301466822624207, -1.009461522102356, -0.7897980809211731, -0.39410412311553955, 1.0111312866210938, 0.12582874298095703, -0.012491517700254917, 0.29159730672836304, -0.1822502017021179...
def _ print _ tree _ helper ( root, depth, # depth of root parent _ edge, branch _ positions, # list of'first ','middle ','last'for each level prior to root child _ index, # index of the root as a child of parent max _ depth = none, print _ type = " summary " ) : if max _ depth is not none and depth > max _ depth : ret...
[ 0.6575664281845093, -0.20980027318000793, 1.114695429801941, -0.5436869263648987, -0.37741753458976746, -0.319789320230484, -0.05702720209956169, -0.6631048321723938, -0.3293219804763794, 0.47027072310447693, 0.6663272380828857, 0.42680320143699646, -0.24139580130577087, -0.114474758505821...
def full _ state ( self, z _ dyn, std _ dyn, z _ sup, std _ sup ) : # get mean of q ( z ). # for scales mean _ s = z _ sup [..., : 2 ] std _ s = std _ sup [..., : 2 ] # for latents mean _ l = z _ dyn [..., 4 : ] std _ l = std _ dyn [..., 4 : ] # for x and v m _ sup _ xv = z _ sup [..., 2 : 6 ] s _ sup _ xv = std _ sup ...
[ 0.07991798222064972, -0.476500928401947, 0.8297319412231445, -0.39576256275177, -1.2034045457839966, -0.09312130510807037, 0.4297231435775757, 0.2791610658168793, 0.65659099817276, 0.27881354093551636, -0.23039594292640686, 0.5436796545982361, 0.8242259621620178, -0.5724543333053589, -0....
def _ _ init _ _ ( self, pos = none, radius = none, direction = none, length = false, transform = false ) : self. init ( ) self. pos = pos self. radius = radius self. direction = direction self. length = length self. transform = transform self. point _ type ='arc'self. control = true self. dirpoint = false self. obtype...
[ 0.4970996677875519, -0.8493902683258057, 0.45990338921546936, -0.317968487739563, 0.2663407027721405, 0.13693423569202423, -0.3252631425857544, 0.7765319347381592, 0.9743759632110596, -0.21526095271110535, -0.6096802353858948, 0.7968292236328125, 0.25102394819259644, 0.013805965892970562, ...
def is _ valid _ int ( self ) : if self. datatype = = " int " : if self. value. isdigit ( ) or \ self. value [ 0 ] = = " + " and self. value [ 1 : ]. isdigit ( ) or \ self. value [ 0 ] = = " - " and self. value [ 1 : ]. isdigit ( ) : self. value = int ( self. value ) return true return false
[ -0.612937331199646, 0.38909652829170227, 0.7813596129417419, -0.7348712682723999, -1.0172786712646484, 0.6433671712875366, -0.35118645429611206, -0.2074281871318817, -0.06352784484624863, -0.26862627267837524, -0.014881035313010216, 0.25214260816574097, -0.7291538715362549, -0.112746812403...
def update _ frame _ dependent ( self ) : self. current _ frame + = 1 if self. current _ frame > = self. animation _ frames : self. current _ frame = 0 self. index = ( self. index + 1 ) % len ( self. images ) self. image = self. images [ self. index ]
[ -0.8803253173828125, -0.2687436640262604, 0.46565860509872437, 0.2588152289390564, -0.19047239422798157, 0.013040815480053425, 1.2183125019073486, -0.252482533454895, -0.04578714072704315, -0.4286339581012726, 0.3277761936187744, 0.5903887748718262, -0.3670383393764496, 1.0306894779205322,...
def _ _ gettransferfunctionoutput ( self, tf, u, t, x0, atol = 1e - 12 ) : t = np. linspace ( t [ 0 ], t [ - 1 ], 240 ) u = np. array ( u ) sample = 240 p = upsampling. ups ( sample ) input _ init = np. copy ( u ) pv = np. zeros ( ( self. q, sample ) ) for j in range ( self. q ) : if j > 0 : x0 = self. _ _ find _ x _ i...
[ -0.03311381861567497, -0.36884161829948425, 0.6307544112205505, -0.39646920561790466, -0.7632067203521729, -0.7420405149459839, -0.352507621049881, -0.17536646127700806, -0.7772948145866394, 0.5868814587593079, -0.2949814200401306, 0.4553697407245636, -0.34568899869918823, -0.1073397099971...
def set _ local _ mask ( self, mask ) : self. _ local _ mask = mask print self. local _ mask ( ). summary ( )
[ 0.061481326818466187, -0.9325438737869263, 0.2775500416755676, 0.5803014039993286, 0.40703487396240234, 0.17785042524337769, 0.6763266324996948, -0.5002810955047607, 0.10795988142490387, -0.9232980608940125, -0.4528561234474182, 1.325498342514038, -0.13353753089904785, 0.22450712323188782,...
def load _ model _ ck ( self, ck _ path = none, model _ only = false ) : if ck _ path is none : ck _ path = self. log _ path /'training. ck'if ck _ path. exists ( ) : ck = torch. load ( ck _ path, map _ location ='cpu') if model _ only : restore _ kv = { key. replace ( " module. ", " " ) : ck [ key ] for key in ck. key...
[ 0.12481866776943207, 0.05654560774564743, 0.6401288509368896, 0.7197863459587097, -0.43582332134246826, 0.1759534329175949, 0.12009118497371674, 1.350745677947998, -0.5190556645393372, 0.5482515692710876, -0.4728354215621948, -0.04078848287463188, 0.15813693404197693, 0.08100296556949615, ...
def get _ login _ view ( request ) : return { }
[ -1.370610237121582, -0.3826778829097748, 0.2556174695491791, 0.3224305510520935, -1.0429883003234863, -0.16926923394203186, 0.09734847396612167, -0.06735751777887344, 0.32049718499183655, -1.4798352718353271, -0.04717908054590225, 0.025134971365332603, 0.5442051291465759, -0.70447689294815...
def load _ tasks ( self, file _ name ) : file _ in = open ( file _ name,'r') for line in file _ in : try : parts = line. strip ( ). split ( ", " ) parts [ 2 ] = int ( parts [ 2 ] ) parts [ 4 ] = parts [ 4 ] = = " true " self. tasks. append ( task ( parts [ 0 ], parts [ 1 ], parts [ 2 ], parts [ 3 ], parts [ 4 ] ) ) exc...
[ -0.0672219917178154, 0.13566751778125763, 0.6504933834075928, -0.07076060026884079, 0.2554927170276642, 0.7425562143325806, -0.005117683205753565, 0.6783052086830139, -0.8107373714447021, 0.495021253824234, -0.6939059495925903, -0.5511921048164368, -0.5944831967353821, -0.07246044278144836...
def vote _ thread ( ) : thread _ id = int ( request. form ['thread _ id'] ) user _ id = g. user. id if not thread _ id : abort ( 404 ) thread = thread. query. get _ or _ 404 ( int ( thread _ id ) ) vote _ status = thread. vote ( user _ id = user _ id ) return jsonify ( new _ votes = thread. votes, vote _ status = vote ...
[ 0.3158952593803406, -0.9885328412055969, 0.44852110743522644, 0.6408663988113403, 0.9247372150421143, 0.14235331118106842, -0.8395459055900574, -0.17475052177906036, -0.10807085037231445, 0.6402636766433716, -0.4506721496582031, 0.8422192335128784, -0.14352373778820038, 0.1100332960486412,...
def cpu1b _ output ( self, tb1, cpu4 ) : inputs = 0. 5 * np. dot ( self. syn. cpu4 _ cpu1b, cpu4 ) pontin = 0. 5 * self. pontin _ output ( cpu4 ) inputs - = np. dot ( self. syn. pontin _ cpu1b, pontin ) inputs - = np. dot ( self. syn. tb1 _ cpu1b, tb1 ) return sigmoid ( inputs, self. cpu1 _ slope, self. cpu1 _ bias )
[ 0.33434686064720154, -0.26536768674850464, 0.38182729482650757, 0.9310124516487122, -0.35528260469436646, 0.026216041296720505, 0.9280563592910767, -0.057085078209638596, -0.8874685764312744, 0.4358728229999542, 0.28981319069862366, -0.0804683268070221, -1.329425573348999, -0.3987391889095...
def key _ type ( element, keys ) : if element. tag = = " tag " : value = element. get ('k') if lower. search ( value ) : keys ['lower'] + = 1 elif lower _ colon. search ( value ) : keys ['lower _ colon'] + = 1 elif problemchars. search ( value ) : keys ['problemchars'] + = 1 else : keys ['other'] + = 1 return keys
[ -0.454544335603714, -0.13995803892612457, 0.6810486316680908, -0.24673829972743988, 0.2441866546869278, -0.3163582384586334, -0.5110254883766174, -0.22104014456272125, -0.6252734661102295, 0.5285033583641052, -0.5370372533798218, -0.5809723734855652, -0.317685067653656, 0.4044906795024872,...
def feed ( self, data ) : data = self. _ mungeentities ( data ) self. _ parser. parse ( data )
[ -0.4367084503173828, -0.3246348202228546, 0.4024159908294678, -0.49561524391174316, 0.5985226631164551, -0.16190537810325623, -1.1202796697616577, -0.17269806563854218, -0.36193686723709106, -1.1154696941375732, -0.2555146813392639, 0.04937351122498512, 0.1324116736650467, 1.06038987636566...
def endswith _ xffxd9 ( data ) : index = len ( data ) - 1 while index > 1 : actual = data [ index ] if actual = = b'\ xd9'[ 0 ] and data [ index - 1 ] = = b'\ xff'[ 0 ] : return true if actual : return false index - = 1 continue
[ 0.3281721770763397, 0.527594804763794, 0.5275601148605347, -0.16746656596660614, -0.15211543440818787, -0.5778020620346069, -1.0052415132522583, -0.46853262186050415, 0.2378559410572052, 0.8047717213630676, -0.3733668327331543, 0.052974898368120193, -0.9897996187210083, 0.8149172067642212,...
def corr _ to _ cov ( corr, sigma _ m ) : # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # import numpy as np outer _ v = np. outer ( sigma _ m, sigma _ m ) return corr * outer _ v
[ 0.5399326682090759, -1.0218337774276733, 0.5229856967926025, 0.3640720248222351, -0.8489980697631836, -0.43721386790275574, 0.9217174649238586, 0.7086519598960876, -0.43541717529296875, 0.8381420969963074, 0.41660234332084656, 1.2891898155212402, -0.2161192148923874, -0.40881121158599854, ...
def last _ modified ( self ) : return self. _ _ card. datelastactivity. astimezone ( tz = pytz. utc )
[ 0.17910927534103394, -1.0601259469985962, 0.5912925601005554, -0.840866208076477, 0.1740393042564392, -0.22739054262638092, -0.5886473655700684, -0.11747033894062042, 1.7532320022583008, 0.14619846642017365, 0.40950632095336914, -0.4890768826007843, -0.15702438354492188, -1.083045005798339...
def get _ list ( self, key ) : raise notimplementederror
[ -1.4059232473373413, -0.08391104638576508, 0.3452775180339813, 0.18270094692707062, 0.4801280200481415, 0.23774586617946625, -1.0217418670654297, 0.4898703992366791, 0.5722296237945557, 0.9770171046257019, -0.9228971004486084, -0.5346858501434326, 0.5467877984046936, 0.7946529388427734, ...
def parse ( filename ) : # initialization value = list ( ) weight = list ( ) with open ( filename,'r') as stream : lines = stream. readlines ( ) # copy the number of items and overall capacity of the knapsack which # are specified in the first line of the inputfile line = lines [ 0 ]. split ('' ) ( nbitems, capacity ) ...
[ 0.10416533052921295, -0.8392477035522461, 0.7637346982955933, 0.22256231307983398, -0.38947418332099915, 0.18156257271766663, 0.36705994606018066, 0.35035136342048645, -0.9771454334259033, 0.3132413625717163, -0.24086426198482513, -0.5604674816131592, 0.06800417602062225, 0.294862061738967...
def scaleddotproductattention ( query, key, value, mask ) : matmul _ qk = tf. matmul ( query, key, transpose _ b = true ) # scale matmul _ qk depth = tf. cast ( tf. shape ( key ) [ - 1 ], tf. float32 ) logits = matmul _ qk / tf. math. sqrt ( depth ) # add the mask to zero out padding tokens if mask is not none : logits...
[ 0.06957181543111801, -0.28899335861206055, 0.6239964365959167, -0.47162172198295593, -0.9396724700927734, 0.0026370128616690636, 0.2031264752149582, -0.36838164925575256, 0.6729581356048584, 0.6901480555534363, 0.706473171710968, 0.6679754257202148, -0.031343091279268265, -0.49506673216819...
def make _ new _ form ( ) : newform = bp. make _ new _ form _ shell ( template _ name = " new template " ) newsection = bp. make _ new _ section ( section _ name = " new section " ) newform ['iformsectiontiesarray']. append ( newsection ) return newform
[ 0.16047599911689758, -0.8393152952194214, 0.5393847227096558, -0.09037088602781296, -0.17144107818603516, -0.3104463517665863, -0.5844071507453918, -0.6193193793296814, -0.6907174587249756, -1.1533726453781128, -0.5330963134765625, -0.18014474213123322, 0.35712018609046936, 0.7729815840721...
def get _ rid _ of _ empty _ columns ( table, title _ list ) : temp _ storage = [ ] # find empty column index table _ index _ to _ del = [ i for row in table for i in range ( len ( row ) ) if len ( row [ i ] ) = = 0 ] title _ index _ to _ del = set ( [ i for i in range ( len ( title _ list ) ) if len ( title _ list [ i...
[ -0.3437287509441376, -0.07060123234987259, 0.8130922317504883, 0.02141532674431801, -0.12844952940940857, 0.3700077533721924, 0.48052796721458435, -0.0426623560488224, -0.8053104877471924, 0.2526113986968994, -1.0925079584121704, 0.2923719882965088, -0.47165530920028687, -0.444514006376266...
def unit _ list ( ) : cnx = sql _ connect ( ) cur = cnx. cursor ( ) sql = " select distinct ( unit _ name ) from unit ; " cur. execute ( sql ) result = [ x [ 0 ] for x in cur. fetchall ( ) ] return result
[ -0.12083608657121658, -0.35004907846450806, 0.7317587733268738, 0.07272732257843018, 1.601403832435608, 0.3283267021179199, -0.7424679398536682, 0.587453305721283, 0.28045979142189026, 0.41448238492012024, -0.84490966796875, -0.24668550491333008, -0.046391237527132034, -0.12639571726322174...
def download _ data ( ) : url ='https : / / www. dropbox. com / s / xk4glpk61q3qrg2 / imdb. tgz? dl = 1'urllib. request. urlretrieve ( url,'imdb. tgz') tar = tarfile. open ( " imdb. tgz " ) tar. extractall ( ) tar. close ( )
[ -0.3082010746002197, -0.0006212721928022802, 0.40195873379707336, -0.3398377299308777, 0.1494634598493576, 0.3444876968860626, -0.6230285167694092, 0.5995847582817078, -0.11376214772462845, -0.2338891327381134, -0.7926223278045654, 0.1461600512266159, -0.636202871799469, 0.0583040043711662...
def compute _ tspreprocess ( s3 _ args : s3args, args : tspreprocessargs ) : sagemaker _ response = run _ sagemaker ( url = s3 _ args. s3 _ url, dest _ url = s3 _ args. s3 _ dest _ url, output _ name = f'{ args. kind } - preprocessed. csv ', script ='preprocess / make _ preprocess. py ', arguments = parse _ args ( args...
[ -0.15585005283355713, -0.2898653745651245, 0.7390493750572205, -1.0473871231079102, 0.3902510404586792, -0.1197410300374031, -0.4242214560508728, 0.7211238145828247, 0.3321758210659027, 0.674140453338623, 0.15385708212852478, 0.4465351104736328, 0.7556470036506653, -0.5795269012451172, 0...