text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def test _ extraarg ( self ) : self. _ test ('test _ foo') | [
0.4963033199310303,
1.5140293836593628,
0.30031561851501465,
-0.03395574167370796,
0.2747963070869446,
0.9831737279891968,
0.5104758143424988,
0.43627476692199707,
-0.10239889472723007,
0.059045031666755676,
-0.2743925452232361,
0.33743149042129517,
-0.25424695014953613,
0.6169344782829285... |
def compare _ zips ( file1, file2 ) : try : z1 = zipfile. zipfile ( file1 ) z2 = zipfile. zipfile ( file2 ) except ioerror : return false crc1 = z1. getinfo ( z1. namelist ( ) [ 0 ] ). crc crc2 = z2. getinfo ( z2. namelist ( ) [ 0 ] ). crc return crc1 = = crc2 | [
0.6974053382873535,
-0.4782045781612396,
0.8102871179580688,
0.21051575243473053,
0.7226877212524414,
0.25181692838668823,
-0.2323703169822693,
-0.341753751039505,
-0.5014745593070984,
-0.33072802424430847,
-0.06357654184103012,
-0.0006635681493207812,
-0.4457925856113434,
0.23287945985794... |
def artists ( self ) - > chartregistry : return self. _ artists | [
-0.020672177895903587,
-0.22658948600292206,
0.03409174457192421,
-0.527669370174408,
0.4562271237373352,
0.5952017307281494,
0.6337441802024841,
-0.2827839255332947,
0.8844872117042542,
-1.1830662488937378,
-0.47414836287498474,
1.435160756111145,
-0.05784333497285843,
-0.8078163266181946... |
def test _ get _ arrangement _ after _ creation ( self ) : # creating an order for testing created _ arrangement = self. create _ test _ arrangement _ lastrites ( ) url = reverse ( " lastrites : arrangements - lastrites ", kwargs = { " order _ pk " : created _ arrangement. order _ id }, ) r = self. client. get ( url, a... | [
-0.21797433495521545,
0.25307896733283997,
0.510664165019989,
0.1785610020160675,
0.4417628347873688,
-0.030749138444662094,
0.9619419574737549,
-0.5014070868492126,
0.2075750231742859,
-0.2878960967063904,
0.08371509611606598,
0.15869711339473724,
0.6108299493789673,
0.3770411014556885,
... |
def add _ field ( self, layer _ name, field _ name, storage ) : if'field _ type'not in storage : raise keyerror ('the storage dictionary must contain the'' key field _ type.') layer _ path = os. path. join ( self. path, layer _ name ) arcpy. addfield _ management ( layer _ path, field _ name, * * storage ) | [
-0.07902984321117401,
0.4746801555156708,
0.5154401659965515,
-0.02238127775490284,
0.9617873430252075,
0.7813968658447266,
-0.1436326503753662,
-0.5422694087028503,
-0.38477614521980286,
-0.5755004286766052,
-0.43857520818710327,
0.26680469512939453,
0.061679549515247345,
-0.1706399917602... |
def crit ( evals, atol = 1e - 2 ) : return [ idx for idx, v in enumerate ( evals ) if v > atol ] | [
-0.11965501308441162,
0.06583364307880402,
0.28503090143203735,
-0.5050981044769287,
-0.09164348989725113,
0.3030596673488617,
-0.6770557761192322,
-0.4388130009174347,
-0.7420434355735779,
0.31297600269317627,
0.4449272155761719,
0.34792444109916687,
0.2895503342151642,
-0.761516153812408... |
def test _ ls ( subtests, etcd _ client, prefix ) : with subtests. test ( " ls on a non - existent directory should return an empty dict " ) : assert not etcd _ client. ls ( " { } / ls ". format ( prefix ) ) with subtests. test ( " ls should list the top level keys and values at the given path " ) : etcd _ client. set ... | [
-0.1367943435907364,
-0.2501240670681,
0.46079307794570923,
-1.45919930934906,
-0.266603022813797,
-0.04610488936305046,
-0.9794187545776367,
0.24691137671470642,
0.7439677715301514,
-0.8292672634124756,
0.32420840859413147,
0.586176335811615,
0.5290555953979492,
0.370895117521286,
-0.16... |
def post ( org _ id ) : request _ json = request. get _ json ( ) valid _ format, errors = schema _ utils. validate ( request _ json,'contact') if not valid _ format : return {'message': schema _ utils. serialize ( errors ) }, http _ status. http _ 400 _ bad _ request try : response, status = orgservice. add _ contact (... | [
-0.9477375149726868,
-0.46776914596557617,
0.9190225601196289,
0.706321120262146,
-0.11348309367895126,
0.30720826983451843,
-0.034866828471422195,
-0.4673137068748474,
0.12471047788858414,
0.5019088387489319,
-0.46209201216697693,
-0.022640621289610863,
-0.6999426484107971,
0.318074613809... |
def set _ score ( self, new _ score ) : self. _ _ score = new _ score | [
-0.5504339933395386,
-0.5406813025474548,
0.4551990032196045,
-0.23170016705989838,
0.6385639905929565,
0.082676000893116,
-0.8678486943244934,
-0.19965898990631104,
-0.25435328483581543,
1.076564908027649,
-0.48518481850624084,
0.5753523707389832,
-0.06097637489438057,
0.0462188646197319,... |
def injectors ( self, value ) : if isinstance ( value, dict ) : self. _ update _ values ('injectors ', value ) else : raise invalidvalue ( f'value is not valid dictionary received : { value }') | [
-1.7586811780929565,
0.8982464075088501,
0.5848692059516907,
-0.4989609718322754,
-0.5350297093391418,
-0.06833804398775101,
-0.2609129846096039,
-0.5975288152694702,
0.7632687091827393,
0.4041900932788849,
-0.36125293374061584,
0.08594620227813721,
-0.6189075708389282,
0.27468714118003845... |
def get _ voltage _ scan ( self ) : scan _ folder = self. app. getfromstudycase ('intscn') fault = scan _ folder. getcontents ('*. scnfrt') [ 0 ] num _ of _ violations = fault. getnumberofviolations ( ) time _ stamp = [ ] for i in range ( 1, num _ of _ violations + 1 ) : time _ stamp. append ( fault. getviolationtime (... | [
0.22603309154510498,
0.16840992867946625,
0.40238428115844727,
0.68827223777771,
0.14417466521263123,
-0.9244551658630371,
-0.10169841349124908,
0.11192548274993896,
0.8960383534431458,
-0.09722919762134552,
-0.5138692855834961,
-0.11675425618886948,
-0.29486051201820374,
0.715389370918273... |
def fetchone ( self ) : columns = self. _ columns ( ) if columns is none : self. record = none return self. record try : record = next ( self. cursor ) except stopiteration : record = none if record is none : self. record = none return self. record record = record. decode ('ascii ','ignore') record = record. replace ( ... | [
-0.06717284768819809,
0.13168726861476898,
0.6131300926208496,
-0.759548008441925,
-0.9114965200424194,
-0.6602669954299927,
-0.8948385119438171,
-0.3034406304359436,
-0.8012259602546692,
-0.03396587446331978,
-0.04656803980469704,
-0.7176988124847412,
-0.31806907057762146,
0.1461461484432... |
def _ get _ snr ( self, freqs ) : snr = [ ] for freq in freqs. flat : stimband = ( ( self. freqs < = freq + self. frequency _ resolution ) & ( self. freqs > = freq - self. frequency _ resolution ) ) noiseband = ( ( self. freqs < = freq + self. noisebandwidth ) & ( self. freqs > = freq - self. noisebandwidth ) & ~ stimb... | [
-1.0438512563705444,
-0.005393235012888908,
0.5641120672225952,
-0.05189650505781174,
0.36284133791923523,
-0.8433550000190735,
0.16000781953334808,
-0.23512592911720276,
0.5659794211387634,
-0.3033972382545471,
0.18792539834976196,
-0.45895570516586304,
-0.4666549861431122,
0.656728506088... |
def get _ token _ type ( self ) : if self. has _ more _ tokens ( ) : self. _ _ next _ token = self. _ _ token _ list [ self. _ _ token _ index ] return self. _ _ next _ token [ 1 ] return none | [
-0.36605390906333923,
0.40292713046073914,
0.7049229741096497,
0.0012472706148400903,
0.4001041352748871,
-0.5239033699035645,
0.19987095892429352,
-0.3490028381347656,
0.2397495061159134,
-0.8295838832855225,
-0.5491197109222412,
1.1689971685409546,
-0.7668853998184204,
-0.238782867789268... |
def max _ age ( self ) - > int : return pulumi. get ( self, " max _ age " ) | [
0.36954644322395325,
0.6084770560264587,
0.4796948730945587,
0.7580613493919373,
0.7247615456581116,
1.1218833923339844,
-0.6999952793121338,
0.5233876705169678,
0.2961740791797638,
0.24494589865207672,
0.5085729360580444,
0.3808470070362091,
0.1628766655921936,
-0.8120677471160889,
0.15... |
def value ( self, * args ) : return _ topods. topods _ iterator _ value ( self, * args ) | [
-1.347914457321167,
-0.25369638204574585,
0.38233184814453125,
-0.014360119588673115,
0.027798032388091087,
0.29411131143569946,
0.44470521807670593,
-0.9533270597457886,
-0.5941080451011658,
0.023065805435180664,
0.49921146035194397,
-0.32359495759010315,
-0.08945680409669876,
0.151624739... |
def predict ( self, data, test _ labels, plot _ conf = false ) : # the predicted labels pred _ labels = self. rdmf. predict ( data ) # if plot _ conf is true then plot the confusion matrix if plot _ conf : confusion _ matrix _ pretty _ print. plot _ confusion _ matrix _ from _ data ( test _ labels, pred _ labels ) # ca... | [
0.646537184715271,
0.43989238142967224,
0.47171759605407715,
-0.7611669898033142,
-0.15055625140666962,
-0.14998558163642883,
0.22242826223373413,
0.23545697331428528,
-0.35919585824012756,
-0.03932871297001839,
0.04347142577171326,
0.1946224868297577,
-0.5784574151039124,
-0.0294326543807... |
def response _ from _ handler _ output ( logger, handler _ output ) : response = {'body':'','content _ type':'text / plain ','headers': { },'status _ code': 200,'body _ encoding':'text ', } # if the type of the output is a string, just return that and 200 if isinstance ( handler _ output, str ) : response ['body'] = ha... | [
-0.27777397632598877,
-1.2667642831802368,
0.6144758462905884,
0.10608292371034622,
-1.0116157531738281,
-0.8060806393623352,
0.27225902676582336,
-0.1144624724984169,
-0.3125530481338501,
-0.22137369215488434,
-0.4906773865222931,
-0.05573486164212227,
-0.10743493586778641,
0.628804624080... |
def test _ info _ complete _ flight ( c, users : list [ user ], flights : list [ flight ] ) : # this mock _ data should not be returned mock _ data = { " fake " : " exists ", " anotherfake " : " alsoexists ", " dummycount " : 100 } httpretty. register _ uri ( httpretty. get, f " http : / / container - nodeodm : 3000 / ... | [
-0.3661687672138214,
0.6612871885299683,
0.790634274482727,
-0.5976876020431519,
0.9857960343360901,
0.22448976337909698,
-0.37299707531929016,
0.1521243155002594,
-0.5860605835914612,
-0.14684844017028809,
-0.5882282853126526,
-0.5893676280975342,
0.012111266143620014,
0.3622101843357086,... |
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, security ) : return false return self. to _ dict ( ) = = other. to _ dict ( ) | [
-0.8621178269386292,
-0.2226925492286682,
0.577278196811676,
0.2178027331829071,
0.06401706486940384,
0.13968870043754578,
-0.08198803663253784,
-1.0190236568450928,
0.9350594282150269,
0.3154648542404175,
-1.4811285734176636,
-0.17803704738616943,
-0.36749616265296936,
-0.4574878811836242... |
def build _ single _ input _ model ( learning _ rate = 0. 005, activations = " sigmoid " ) : input _ shape = ( field _ count * max _ field _ size, channel _ count, 1 ) model = sequential ( ) model. add ( convolution2d ( activation ='relu ', filters = 8, kernel _ size = ( 1, 2 ), input _ shape = input _ shape ) ) model.... | [
-0.1656302660703659,
-0.1997731328010559,
0.5998870730400085,
0.6374816298484802,
-0.04199777916073799,
0.32344141602516174,
0.21560414135456085,
0.47171515226364136,
0.21017025411128998,
0.0233224555850029,
0.06703981757164001,
0.41645774245262146,
0.5999141931533813,
-0.23309969902038574... |
def avg _ price ( self ) : if self. net _ quantity = = 0 : return 0. 0 elif self. net _ quantity > 0 : return ( self. avg _ bought * self. buy _ quantity + self. buy _ commission ) / self. buy _ quantity else : return ( self. avg _ sold * self. sell _ quantity - self. sell _ commission ) / self. sell _ quantity | [
-0.3351500928401947,
-0.4869398772716522,
0.385696679353714,
-0.2703728973865509,
0.7235735058784485,
0.2884473502635956,
0.03057522140443325,
-0.13313595950603485,
-0.015284305438399315,
1.184973955154419,
1.0689581632614136,
0.4068927466869354,
-0.20172101259231567,
0.21201980113983154,
... |
def _ _ init _ _ ( self, name, bind, upstream = none, allowed _ acls = none, denied _ acls = none ) : self. name = name self. bind = bind self. upstream = upstream self. allowed _ acls = allowed _ acls or [ ] self. denied _ acls = denied _ acls or [ ] | [
0.5065342783927917,
-0.04711313173174858,
0.5454601645469666,
0.6031094789505005,
-1.881260871887207,
0.1161758303642273,
-0.33577296137809753,
0.009673785418272018,
0.18957512080669403,
0.44262924790382385,
-0.24857307970523834,
0.920261561870575,
-0.35563620924949646,
0.20882850885391235... |
def get _ nodes ( self, selection = false ) : items = self. get _ selected _ items ( ) # collect all nodes by hash ( optimization ) if not selection : nodes = cmds. ls ( dag = true, long = true ) else : nodes = commands. get _ selected _ nodes ( ) id _ nodes = commands. create _ asset _ id _ hash ( nodes ) # collect th... | [
-0.5606105327606201,
-0.06376709043979645,
0.5473052263259888,
-0.707495927810669,
-0.29237058758735657,
-0.7489003539085388,
0.06806056946516037,
-0.47398436069488525,
0.37252867221832275,
0.41604331135749817,
-0.05885559692978859,
0.8424243330955505,
0.8589738607406616,
0.190171852707862... |
def check _ reload ( self ) : pass | [
-0.5607994198799133,
-0.3547727167606354,
0.37769028544425964,
1.1931880712509155,
0.7350229024887085,
-0.09718315303325653,
0.08949579298496246,
-0.6987848281860352,
-0.055001191794872284,
-0.29311031103134155,
0.12156029790639877,
0.6109716296195984,
0.07903441786766052,
0.13305145502090... |
def load _ from _ dict ( self, *, data : dict, _ type : str = none ) - > union [ basenode, automljob ] : if _ type is none : _ type = data [ commonyamlfields. type ] if commonyamlfields. type in data else nodetype. command else : data [ commonyamlfields. type ] = _ type new _ instance = self. get _ create _ instance _ ... | [
-0.06875382363796234,
0.2843518555164337,
0.7873094081878662,
-0.3107322156429291,
-0.2560141682624817,
-0.06841585785150528,
-0.16411493718624115,
0.30733808875083923,
-0.17002008855342865,
-0.2838551104068756,
-0.02559490315616131,
0.5528940558433533,
-0.22428548336029053,
0.020611319690... |
def last _ action _ date _ time ( self, last _ action _ date _ time ) : self. _ last _ action _ date _ time = last _ action _ date _ time | [
-0.5239988565444946,
-0.41387248039245605,
0.1868412345647812,
0.4544072449207306,
0.5577290654182434,
0.8549680113792419,
0.46504804491996765,
0.31875360012054443,
0.4241200387477875,
-0.36085569858551025,
-0.6336782574653625,
0.04589997977018356,
-0.023009689524769783,
0.439793199300766,... |
def modified ( self, * args ) : return _ topods. topods _ tshape _ modified ( self, * args ) | [
-0.8635350465774536,
-0.3682711720466614,
0.35973507165908813,
-1.006950855255127,
0.08860000222921371,
0.13130685687065125,
0.15491928160190582,
-0.4691811800003052,
-0.15568798780441284,
0.43970146775245667,
-0.1564072221517563,
-0.25895267724990845,
0.13012148439884186,
0.11718875914812... |
def _ make _ dataset ( self, split _ file, batch _ size, is _ training, balanced = true ) : files, classes, bboxes = self. _ get _ files ( split _ file ) count = len ( files ) # create balanced dataset if required if is _ training and balanced : files = np. asarray ( files ) classes = np. asarray ( classes, dtype = np.... | [
-0.39540114998817444,
-0.09746190160512924,
0.7713183164596558,
-0.5364418625831604,
-0.06918486207723618,
0.08003241568803787,
0.8886357545852661,
0.4440314471721649,
-0.3284401595592499,
-0.10117614269256592,
0.4011131227016449,
-0.17085839807987213,
0.15698586404323578,
-0.5027844309806... |
def test _ convergence ( self, epsilon, make _ plots ) : # get list of all pareto individuals par _ list = [ ] for isle in self. isles : par _ list = par _ list + isle. solution _ island. dump _ pareto ( ) par _ list = par _ list + self. pareto _ isle. dump _ pareto ( ) # load into pareto island self. pareto _ isle. lo... | [
0.35330522060394287,
-0.6683864593505859,
1.0888476371765137,
-0.1536651998758316,
0.19475294649600983,
0.8915677070617676,
0.2911601960659027,
0.03404707461595535,
-0.81120365858078,
-0.6567142605781555,
-0.03236206993460655,
0.160617858171463,
0.23746322095394135,
0.5896363258361816,
-... |
def suggest _ libraries ( mode : str, names : list [ str ], single _ version : bool, config : dict [ str, union [ float, int ] ] ) - > dict [ str, list [ tuple [ str, float ] ] ] : # upload the dependencies and their idfs. reqs = read _ dependencies ( ) idfs = read _ idfs ( ) suggestions = { } # find the closest repos ... | [
-1.0150091648101807,
-0.06305383145809174,
0.5872892141342163,
-0.36703577637672424,
-0.2721812129020691,
0.33682799339294434,
0.006611770950257778,
-0.9587912559509277,
-0.9569452404975891,
1.0100764036178589,
-0.1313733160495758,
-0.3967483341693878,
-0.26199057698249817,
0.0645597800612... |
def dns _ ptr ( self, i ) : return self. dns ( reverse _ dots ( i ) + ". in - addr. arpa ",'ptr') | [
-1.1414531469345093,
-0.01728704199194908,
0.4169677197933197,
-1.1320621967315674,
-0.05654902011156082,
-0.1433366984128952,
0.29155707359313965,
-1.7634987831115723,
0.9592874050140381,
0.1500139981508255,
0.3836980164051056,
0.613906741142273,
-0.22025439143180847,
-1.4882785081863403,... |
def make _ mnist _ lmdb _ dataset ( caffe _ dir, data _ dir, target _ dir ) : if not path ( os. path. join ( target _ dir,'mnist _ test _ lmdb') ). exists ( ) : executor = os. path. join ( caffe _ dir,'build / examples / mnist / convert _ mnist _ data. bin') if not path ( executor ). exists ( ) : raise runtimeerror ('c... | [
0.31635820865631104,
-0.25513750314712524,
0.4889751076698303,
-0.8226089477539062,
0.03892223909497261,
0.8610758185386658,
-0.4494874179363251,
0.715155839920044,
0.4021977186203003,
-0.1489671766757965,
0.09077771753072739,
1.5942063331604004,
-0.4658437669277191,
0.006683101411908865,
... |
def pick _ wm _ 1 ( probability _ maps ) : import sys import os if ( isinstance ( probability _ maps, list ) ) : if ( len ( probability _ maps ) = = 1 ) : probability _ maps = probability _ maps [ 0 ] for file in probability _ maps : print file if file. endswith ( " seg _ 1. nii. gz " ) : return file return none | [
-0.17998965084552765,
-1.2227818965911865,
0.742973268032074,
1.091123104095459,
0.36721381545066833,
0.17048776149749756,
0.8948068022727966,
-0.35142508149147034,
-0.4664788246154785,
0.09037137776613235,
1.2458348274230957,
-0.6277502179145813,
-1.5246914625167847,
0.18976831436157227,
... |
def _ get _ lun _ id ( self, volume _ name ) : vip = self. vmem _ vip. basic lun _ id = - 1 prefix = " / vshare / config / export / container " bn = " % s / % s / lun / % s / target / * * " \ % ( prefix, self. container, volume _ name ) resp = vip. get _ node _ values ( bn ) # ex : / vshare / config / export / containe... | [
0.6905798316001892,
-1.435481071472168,
0.6689119935035706,
0.058838970959186554,
0.3548811078071594,
-0.36272701621055603,
-0.5749129056930542,
0.42574411630630493,
0.9050058722496033,
-0.1520017385482788,
0.11954746395349503,
0.5204883813858032,
-0.92875736951828,
-0.5767152309417725,
... |
def test _ create _ index _ is _ called ( self ) : assert len ( self. index _ calls ) = = 0 connection. _ index _ all _ fields = false class testindexcreationcalltestvertex ( vertex ) : col1 = columns. text ( index = true ) col2 = columns. text ( index = true, db _ field ='_ _ _ _ column') col3 = columns. text ( db _ f... | [
-0.25287580490112305,
0.7243857383728027,
0.5864978432655334,
0.13205091655254364,
0.7543205618858337,
0.15530866384506226,
0.1454395353794098,
-0.48751628398895264,
-0.15905813872814178,
-0.1303437501192093,
-0.9897385239601135,
-0.20440244674682617,
-0.6583927869796753,
0.130837008357048... |
def plot _ snr ( self, collapse _ epochs = true, collapse _ electrodes = false, * * kwargs ) : # construct the snr spectrum ydata = np. stack ( [ self. _ get _ snr ( freq ) for idx, freq in enumerate ( self. freqs ) ], axis = - 1 ) # average over axes if necessary ydata = ydata. mean ( axis = tuple ( [ x for x in range... | [
-0.8736586570739746,
0.9456637501716614,
0.5469395518302917,
0.16474880278110504,
0.329922080039978,
-0.5383700728416443,
0.6528781056404114,
0.4673002064228058,
-0.060530222952365875,
-0.3912733793258667,
0.5087583065032959,
-0.002707574749365449,
0.09960103780031204,
0.5640632510185242,
... |
def deathprotect ( self ) : # activate death protect for specified duration self. deathprotectcounter = int ( round ( protect _ duration * framerate ) ) | [
0.25522300601005554,
-0.36596065759658813,
0.5414600968360901,
0.4965554177761078,
0.30174657702445984,
0.11529920995235443,
-0.5712701082229614,
-0.7616865634918213,
-0.10062971711158752,
-0.3494715392589569,
-0.7513167858123779,
0.24271681904792786,
0.5464465022087097,
0.1297551989555359... |
def build _ configuration _ list _ for _ target ( self, native _ target _ name : str ) - > optional [ xcconfigurationlist ] : for native _ target in self. fetch _ type ( pbxnativetarget ). values ( ) : if native _ target _ name! = native _ target. name : continue return native _ target. build _ configuration _ list ret... | [
-1.1621390581130981,
-0.44638460874557495,
0.4764843285083771,
0.4060637056827545,
0.24912044405937195,
-0.5823847055435181,
-1.2867039442062378,
-0.7960091233253479,
-0.11200511455535889,
0.6327874660491943,
-0.8719482421875,
-0.16724315285682678,
0.38837239146232605,
0.0575990229845047,
... |
def create _ ap _ speed ( self ) : speed _ array = [ 0 for z in range ( 0, self. number _ axons, 1 ) ] for x in range ( 0, self. number _ axons, 1 ) : first _ pulse = false index = 0 ap _ number = 0 temps _ total = 0. 0 temps1 = 0. 0 for i in range ( 0, len ( self. temps ), 1 ) : if self. sol _ array [ x ] [ i ] [ 0 ] ... | [
0.19380389153957367,
-0.03130794316530228,
0.9412868022918701,
-0.29469412565231323,
0.5184150338172913,
0.4563732445240021,
0.44512107968330383,
-0.44696804881095886,
0.4806716740131378,
1.0578612089157104,
0.2231041043996811,
-0.016200639307498932,
-0.44119325280189514,
0.869423925876617... |
def types ( self, template = none ) : is _ root = template is none if is _ root : if hasattr ( self,'_ types') and self. _ types is not none : return self. _ types template = self. first ( ) if isinstance ( template, list ) : types = [ self. types ( item ) for item in template ] elif isinstance ( template, np. ndarray ... | [
-0.6046407222747803,
0.22350488603115082,
0.9601232409477234,
-0.3756483197212219,
0.13515447080135345,
-1.0946191549301147,
0.15731181204319,
-0.185285747051239,
0.010482384823262691,
-0.2903461456298828,
-0.6668417453765869,
-0.13659971952438354,
-0.6060369610786438,
1.232897400856018,
... |
def get _ header _ comment ( self, res ) : sender = self. o if res = ='pass': return \ " domain of % s designates % s as permitted sender " \ % ( sender, self. i ) elif res = ='softfail': return \ " transitioning domain of % s does not designate % s as permitted sender " \ % ( sender, self. i ) elif res = ='neutral': r... | [
0.16767999529838562,
-0.9171678423881531,
0.8433642983436584,
-0.3521280288696289,
-0.6832413077354431,
-0.3798670768737793,
0.6571561098098755,
0.1633867770433426,
-0.44303467869758606,
-0.029785234481096268,
0.19471190869808197,
0.08533214032649994,
-0.6466720700263977,
-0.61221581697463... |
def draw _ annotation _ box ( self, image, rotation _ vector, translation _ vector, color = ( 255, 255, 255 ), line _ width = 2 ) : point _ 3d = [ ] rear _ size = 200 rear _ depth = 0 point _ 3d. append ( ( - rear _ size, - rear _ size, rear _ depth ) ) point _ 3d. append ( ( - rear _ size, rear _ size, rear _ depth ) ... | [
0.07122503221035004,
0.13387084007263184,
1.0296584367752075,
-0.03199086710810661,
-0.13835865259170532,
0.7807966470718384,
-0.19661511480808258,
-0.1531253457069397,
0.22979655861854553,
-0.14665329456329346,
0.24494630098342896,
0.526923656463623,
0.48230189085006714,
-0.01800235174596... |
def updatematingpool ( self ) : self. matingpool = [ ] for ind _ i in self. population : self. matingpool. append ( ind _ i. copy ( ) ) | [
-1.761070966720581,
-0.9196715950965881,
0.2039434164762497,
0.13843338191509247,
-0.40778648853302,
1.8136887550354004,
0.2376301884651184,
0.473427414894104,
0.7172291874885559,
0.9027000069618225,
-0.2257179617881775,
0.7821292281150818,
-0.293472021818161,
0.1659538745880127,
-0.8780... |
def get _ queue _ status ( self ) : in _ size = self. _ _ q _ in. qsize ( ) out _ size = self. _ _ q _ out. qsize ( ) cancel _ size = self. _ _ q _ cancel. qsize ( ) return ( in _ size, out _ size, cancel _ size ) | [
0.010112488642334938,
-0.7185900807380676,
0.6731967926025391,
-0.07890836149454117,
-0.6043102741241455,
-0.44840413331985474,
-0.2157881110906601,
0.04469044506549835,
-0.1321517676115036,
0.2876773476600647,
-1.223608136177063,
-0.12637829780578613,
-0.08607937395572662,
0.4929130971431... |
def register _ form ( ) : return render _ template ( " register _ form. html " ) | [
0.23900064826011658,
1.4498226642608643,
0.2151230275630951,
-0.42584457993507385,
0.8878834843635559,
-0.7165423035621643,
0.15774843096733093,
1.0499403476715088,
-1.2289420366287231,
-0.9460083246231079,
-0.2536691129207611,
0.005431711673736572,
0.27923092246055603,
-0.0336420536041259... |
def xmain ( bids _ dir, freesurfer _ dir, acquisition ='clinical ', noparallel = false ) : args = [ ] for electrode _ path in find _ in _ bids ( bids _ dir, generator = true, acquisition = acquisition, modality ='electrodes ', extension = '. tsv') : elec = electrodes ( electrode _ path ) fs = freesurfer ( freesurfer _ ... | [
0.44342753291130066,
0.35242408514022827,
0.5411279201507568,
-0.2554304897785187,
-0.4655148684978485,
0.32712143659591675,
1.1282627582550049,
0.3045419156551361,
-0.03119574300944805,
-0.24825450778007507,
0.5505666136741638,
0.8215763568878174,
0.5289114117622375,
0.6183819770812988,
... |
def created _ by ( self ) : url = self. _ data. get ('related ', { } ). get ('created _ by') return self. _ tower. _ get _ object _ by _ url ('user ', url ) # pylint : disable = protected - access | [
0.8327199220657349,
0.25243133306503296,
0.27603840827941895,
0.8299928307533264,
0.6399787068367004,
0.04413078352808952,
0.866413950920105,
-0.6865567564964294,
-0.5538333654403687,
-1.0655838251113892,
-0.11142642050981522,
0.06374877691268921,
0.2781028747558594,
-0.4659298360347748,
... |
def test _ profile _ not _ logged _ in ( self ) : response = self. client. get ('/ user _ auth / profile /') self. asserttrue ( response. status _ code! = 200 ) | [
-0.36662301421165466,
0.11817405372858047,
0.2642330229282379,
0.7406627535820007,
1.105404019355774,
1.4628394842147827,
-0.03546825423836708,
-0.30868664383888245,
-0.06949896365404129,
-0.6965740323066711,
-0.7685728669166565,
0.12651140987873077,
-0.012156795710325241,
-0.6892759799957... |
def _ _ call _ _ ( self, * args, * * kwargs ) : return self. predict ( args, kwargs ) | [
-0.8649245500564575,
-0.354653537273407,
0.5109612941741943,
-0.0754295215010643,
-0.09900224208831787,
-0.08659389615058899,
-1.1678855419158936,
0.11394136399030685,
-0.969820499420166,
-0.5909373164176941,
0.17743930220603943,
0.7712160348892212,
-0.5821928977966309,
0.07369033992290497... |
def check _ allowed ( client, user, page, expect = true ) : login _ as ( client, user ) rv = client. get ( page ) if expect : assert rv. status _ code = = 200, \ " expected user { } to be able to access page { } ". format ( user. name, page ) else : assert rv. status _ code = = 403, \ " expected user { } to be blocked ... | [
0.125240758061409,
0.679383397102356,
0.6319660544395447,
0.2274172008037567,
-0.716843843460083,
0.5883774161338806,
-0.20621904730796814,
-0.11766550689935684,
-0.08766041696071625,
0.209297314286232,
0.8902512192726135,
0.6934890747070312,
-0.22859446704387665,
-0.23174093663692474,
0... |
def bgr2luma ( im : np. ndarray ) - > np. ndarray : im _ y, _, _ = cv. split ( cv. cvtcolor ( im, cv. color _ bgr2yuv ) ) return im _ y | [
-0.2050318568944931,
-0.22495906054973602,
0.8104614615440369,
-0.14038868248462677,
1.4845622777938843,
-0.7367815971374512,
0.3881951570510864,
0.07631709426641464,
0.6214876174926758,
0.6497128009796143,
-0.281460165977478,
1.0062779188156128,
0.32578766345977783,
0.34255677461624146,
... |
def forward ( self, inputs, inputs _ length, sequence, targets _ present, embedder ) : masked _ inputs = self. mask _ input ( inputs, targets _ present ) sequence _ rnn _ inputs = embedder ( sequence ) # bs * seq _ len * emb masked _ rnn _ inputs = embedder ( masked _ inputs ) sequence _ rnn _ inputs. detach ( ) masked... | [
-0.14085984230041504,
-0.5575351119041443,
0.7554887533187866,
0.8547652959823608,
-0.392147958278656,
-0.23809342086315155,
0.763131320476532,
0.09630949795246124,
0.00359001150354743,
0.08654821664094925,
-0.5027592778205872,
-0.05690518394112587,
0.40644657611846924,
0.6895595192909241,... |
def process _ set _ fly _ level _ cmd ( self, t, dt ) : assert ( type ( self. altitude _ cmd ). _ _ name _ _ = ='setflylevelcmd') # self. platform. yaw _ cmd ( 0. 0 ) self. platform. pitch _ cmd ( 0. 0 ) self. platform. roll _ cmd ( 0. 0 ) | [
0.3663097321987152,
-0.6422818899154663,
0.675603449344635,
0.09294441342353821,
0.9683111310005188,
1.3990477323532104,
0.9123985767364502,
-1.0591894388198853,
-0.5265821218490601,
-0.30608490109443665,
0.09389036148786545,
0.7158247232437134,
0.35279586911201477,
1.4431766271591187,
0... |
def rescale _ data _ to _ image ( data ) : return ( 255. 0 / data. max ( ) * ( data - data. min ( ) ) ). astype ( np. uint8 ) | [
-0.7052345275878906,
-0.3830231726169586,
0.455784410238266,
-0.4807310402393341,
-0.13874365389347076,
-0.2847050726413727,
-1.2565585374832153,
-0.9704382419586182,
0.5310030579566956,
0.6018832325935364,
0.16149137914180756,
0.37189772725105286,
-0.1624916046857834,
-0.02435977011919021... |
def check _ host _ key ( session, hostname, agent _ key ) : matched = false if agent _ key in db. get _ agent _ keys ( session, hostname ) : matched = true if not matched : raise exception ( " agent key does not match. " ) | [
-0.16924035549163818,
-0.09826825559139252,
0.3798770308494568,
0.9429932832717896,
0.09784147143363953,
-0.06808498501777649,
-1.077257513999939,
0.5389189124107361,
-0.7618749141693115,
1.077978253364563,
0.6107029318809509,
-0.23075459897518158,
-0.1513778269290924,
0.4180924594402313,
... |
def load ( self, filename ) : address = 0 # try : with open ( filename ) as file : for line in file : comment _ split = line. split ('#') instruction = comment _ split [ 0 ] if instruction = ='' : continue first _ bit = instruction [ 0 ] if first _ bit = ='1'or first _ bit = ='0': self. ram [ address ] = int ( instruct... | [
-0.2637961208820343,
-0.40354278683662415,
0.7251465320587158,
-0.23775222897529602,
-0.06925684958696365,
0.06710878759622574,
1.0569307804107666,
0.8460074663162231,
0.030994849279522896,
0.21400144696235657,
-0.5035005211830139,
0.5859997272491455,
-1.0371849536895752,
0.796321213245391... |
def write ( lines : list [ str ] ) - > none : with open ( file _ dest,'w') as f : for line in lines : f. write ( line ) | [
0.07075735181570053,
-0.2457493096590042,
0.20750394463539124,
0.21971917152404785,
1.5014419555664062,
1.1982871294021606,
-0.8839837312698364,
1.330931305885315,
-0.3852408826351166,
-0.15285661816596985,
-0.12287116795778275,
-0.9944664835929871,
0.86296546459198,
0.5831592082977295,
... |
def readline ( self, limit = - 1 ) : return b'' | [
-0.0027978941798210144,
0.25462812185287476,
0.8204308748245239,
0.7580885887145996,
0.1819658726453781,
0.7087643146514893,
-0.8499855995178223,
-0.14948338270187378,
-0.03048202022910118,
-0.724481999874115,
0.2251967489719391,
0.7516877055168152,
-1.0667188167572021,
-1.7196922302246094... |
def _ generate _ share _ section ( f, d, extra _ share _ param _ lines = none ) : try : if not f : raise exception ('no file handle passed') ret, err = cifs _ utils. generate _ share _ header ( f, d ['share _ name'] ) if err : raise exception ( err ) ret, err = _ generate _ gridcell _ specific _ share _ body ( f, d ) i... | [
-0.3545447289943695,
0.6355101466178894,
0.8705198764801025,
-0.33083561062812805,
0.29566583037376404,
0.2243914157152176,
0.938805878162384,
0.14416441321372986,
-1.345539927482605,
0.5292439460754395,
0.37655049562454224,
-0.7239658236503601,
-0.19838717579841614,
0.6832181215286255,
... |
def test _ wl _ load _ from _ file _ empty _ file ( self ) : try : os. remove ( " rectangle. json " ) except : pass open ( " rectangle. json ",'a'). close ( ) self. assertequal ( rectangle. load _ from _ file ( ), [ ] ) | [
0.03690130263566971,
-0.6576219797134399,
0.5522550344467163,
-0.8865465521812439,
0.49364155530929565,
0.8033446073532104,
-0.20382294058799744,
-0.3410455882549286,
-0.40616095066070557,
-0.2738087773323059,
-0.2879035770893097,
-0.25299468636512756,
0.24767519533634186,
0.34501132369041... |
def hex _ to _ rgb ( hex _ color ) : # hex _ color = hex _ color. lstrip ('# 0bfc03') hex _ color = hex _ color. lstrip ( " # 0bfc03 " ) h _ len = len ( hex _ color ) return tuple ( int ( hex _ color [ i : i + h _ len / / 3 ], 16 ) for i in range ( 0, h _ len, h _ len / / 3 ) ) | [
0.11158544570207596,
0.6194714903831482,
0.5917132496833801,
-0.9283658266067505,
1.2051892280578613,
0.19083650410175323,
-0.9159445762634277,
1.0245931148529053,
-0.3442407548427582,
0.3450377285480499,
-1.0738108158111572,
-0.6117948889732361,
-0.4055897295475006,
0.25445684790611267,
... |
def _ _ init _ _ ( self, id, location, movieplaying, starttime ) : # pre : # id must be a valid and unique identifier, the location must be an existing at the theater, the movie must be known to the theater and the start time must correspond to one of the theater's time slots. self. number _ of _ free _ seats _ value =... | [
-0.35654574632644653,
-0.36958134174346924,
0.489109069108963,
0.5378037095069885,
-0.4264501929283142,
-0.24901385605335236,
0.04036508500576019,
0.2449842095375061,
-0.1808866709470749,
0.2093995362520218,
-0.5272775888442993,
0.5034809112548828,
-0.588197648525238,
0.41509631276130676,
... |
def cmdloop ( self, intro = none ) : signal. signal ( signal. sigtstp, self. handler ) self. preloop ( ) if self. use _ rawinput and self. completekey : try : import readline self. old _ completer = readline. get _ completer ( ) readline. set _ completer ( self. complete ) # readline. parse _ and _ bind ( self. complet... | [
-0.03566407784819603,
-1.2828892469406128,
0.9636921882629395,
0.9033991098403931,
-0.4277377426624298,
0.3781990110874176,
0.5813682675361633,
-0.3641088306903839,
-0.29205483198165894,
-0.23904526233673096,
0.5126868486404419,
-0.4028915464878082,
-0.11069931089878082,
0.8433386087417603... |
def get _ mask ( line ) : mask _ str = line. split ( " = " ) [ - 1 ] return mask _ str. strip ( ) | [
-0.636557936668396,
-0.3366686701774597,
0.5417996048927307,
0.4614429771900177,
0.6988747715950012,
-0.18192872405052185,
-0.1471995860338211,
-0.6885851621627808,
-0.5568821430206299,
0.4930304288864136,
0.30878958106040955,
0.28138741850852966,
-0.29530903697013855,
-1.4101841449737549,... |
def _ _ del _ _ ( self ) : # super ( rkhttprequesthandler, self ). _ _ del _ _ ( ) pass | [
0.0831056758761406,
-0.7930781245231628,
0.8729196190834045,
0.20826905965805054,
-0.7729107141494751,
1.0505213737487793,
-0.2667725086212158,
0.048036206513643265,
0.9116888046264648,
-0.9989380240440369,
-0.017993787303566933,
-0.2507098913192749,
-0.48210471868515015,
0.930356264114379... |
def tiles _ str ( tiles ) : s = " " for j in range ( 12 * 11 ) : for i in range ( 12 * 11 ) : x, x _ rem = divmod ( i, 11 ) y, y _ rem = divmod ( j, 11 ) if x _ rem = = 10 or y _ rem = = 10 : c = " " else : t = tiles. get ( ( x, y ) ) if t : # t is a stringblock, with newlines c = t [ y _ rem * 11 + x _ rem ] else : c ... | [
0.15494735538959503,
-0.21559450030326843,
0.5837374925613403,
-0.7337442636489868,
-0.6528372764587402,
-0.17934036254882812,
0.04246920719742775,
-0.5504627823829651,
-0.026611901819705963,
0.6041784286499023,
0.25907978415489197,
-0.018840670585632324,
0.2487577199935913,
-0.25317367911... |
def find _ chunk _ shape ( shape, n _ max = none ) : if n _ max is none : return tuple ( shape ) block _ shape = [ ] max _ repeat _ remaining = n _ max for size in shape [ : : - 1 ] : if max _ repeat _ remaining > size : block _ shape. append ( size ) max _ repeat _ remaining = max _ repeat _ remaining / / size else : ... | [
-0.7270630598068237,
0.4519801437854767,
0.7887863516807556,
0.5689091682434082,
0.4009135961532593,
-0.5253543853759766,
0.31840619444847107,
-0.6432516574859619,
-0.9968787431716919,
0.44580376148223877,
-0.4735882878303528,
-0.22962947189807892,
-0.31700408458709717,
0.0158025324344635,... |
def test _ stop _ after _ pop _ non _ empty ( self ) : retries = self. patch _ retry ( ) pops = self. patch _ next _ req ( ) worker = yield self. mk _ worker ( {'frequency': 5 } ) self. asserttrue ( worker. started ) worker. stop ( ) self. asserttrue ( worker. stopping ) popped _ req = {'owner _ id':'1234 ','timestamp'... | [
-0.20639461278915405,
0.208676278591156,
0.41955673694610596,
0.06005312129855156,
0.5786163210868835,
0.44670772552490234,
-0.3544359505176544,
-0.38084354996681213,
0.07430531829595566,
0.037487756460905075,
-0.7558476328849792,
-0.45827585458755493,
-0.18559445440769196,
-0.010738102719... |
def _ storecursor ( self, cursor ) : # we first have to check that we don't have this pos already new _ discrete = ( int ( cursor [ 0 ] ), int ( cursor [ 1 ] ), int ( cursor [ 2 ] ) ) discretes = [ i ['discrete'] for i in self. _ pointslist ] if new _ discrete in discretes : return worldpos = self. slice3dvwr. getworld... | [
-0.2716934084892273,
-0.536126971244812,
0.35800984501838684,
0.28393223881721497,
-0.47027552127838135,
0.13176025450229645,
0.07295796275138855,
0.05946941673755646,
0.3470976948738098,
0.6746366620063782,
-1.2206732034683228,
-0.21677710115909576,
-0.5255307555198669,
0.3218749761581421... |
def _ parse _ oakland _ sheet ( sheet : xlrd. sheet. sheet, datemode : int ) : # assume the first 6 rows are just header, and verify that the columns are in order # date, full imports, full exports, total full, empty imports, empty expots, total empty # grand total keys = _ verify _ oakland _ sheet ( sheet ) nrow = len... | [
0.25111663341522217,
0.33402690291404724,
0.7270116806030273,
-0.43850597739219666,
-0.8963016867637634,
-0.2864145040512085,
0.2859298884868622,
-0.06458470225334167,
-0.12529650330543518,
0.34127897024154663,
0.15090273320674896,
0.047900065779685974,
1.0597796440124512,
-0.3724892139434... |
def checkcolexist ( df, key ) : result = false if df. get ( key ) is none else true return ( result ) | [
-1.0302093029022217,
0.03957267850637436,
0.5994871854782104,
0.08981812745332718,
0.9853466153144836,
-0.3231794536113739,
-0.7881582975387573,
-0.10437268018722534,
-1.3281060457229614,
0.7081950902938843,
-0.2688920497894287,
-0.5422054529190063,
-0.6140276789665222,
-0.524050235748291,... |
def get _ total _ storage _ used ( tenant _ uuid, datastore _ url ) : total _ storage _ used = 0 err _ msg, _ auth _ mgr = get _ auth _ mgr ( ) if err _ msg : return err _ msg, total _ storage _ used try : cur = _ auth _ mgr. conn. execute ( " select sum ( volume _ size ) from volumes where tenant _ id =? and datastore... | [
-0.3100348114967346,
0.0025970342103391886,
0.6549519300460815,
-0.5700299143791199,
0.08835749328136444,
-1.7416555881500244,
0.6390038132667542,
-0.38800710439682007,
0.12905916571617126,
0.3221397399902344,
0.08023528009653091,
-0.291572630405426,
0.2302754819393158,
0.17887181043624878... |
def rename ( inst, filename ) : r = " " if suffix = = " " : r ='kiosk _ % s / % s'% ( inst. type, inst. name ) else : r ='kiosk _ % s / % s _ _ % s'% ( inst. type, inst. name, suffix ) ts = int ( time. time ( ) * 1000 ) return " { 0 }. { 1 } ". format ( r, ts ) | [
0.05916514992713928,
-0.6093263030052185,
0.5603423714637756,
-0.0826597511768341,
-0.60948646068573,
-0.35264021158218384,
0.047754917293787,
1.0233790874481201,
-0.7764385938644409,
0.7141973972320557,
0.8227608799934387,
0.7340189814567566,
1.1381266117095947,
0.2258451133966446,
0.81... |
def _ _ init _ _ ( self, nout, hparams, dim = - 1 ) : is _ spk _ layer _ norm = hparams. is _ spk _ layer _ norm if is _ spk _ layer _ norm : super ( layernorm, self ). _ _ init _ _ ( nout, eps = 1e - 12, elementwise _ affine = false ) self. w = torch. nn. linear ( hparams. spk _ embed _ dim, nout ) self. b = torch. nn... | [
0.5105811953544617,
0.42332372069358826,
0.7014069557189941,
1.6902250051498413,
-0.7519886493682861,
0.5645336508750916,
0.7234096527099609,
0.9728972315788269,
0.2024814337491989,
-0.2619102895259857,
-0.02504247985780239,
-0.13104330003261566,
-0.30436328053474426,
0.6767792105674744,
... |
def _ get _ mimetype ( file : path ) - > list [ str ] : # todo : specify the actual mime - type of the file return [ " application / octet - stream " ] | [
0.10909292101860046,
0.14311489462852478,
0.49602627754211426,
0.17261506617069244,
0.9720117449760437,
-0.2767948806285858,
-0.6323021054267883,
0.39230915904045105,
-0.005246573127806187,
0.6229238510131836,
-0.18350571393966675,
-0.2944040894508362,
-0.41664695739746094,
0.1555501222610... |
def page _ not _ found ( request, exception, * args, * * kwargs ) : return httpresponsenotfound ( * * exception _ response ( request, 400, exception ) ) | [
-0.2271912693977356,
-1.2022231817245483,
0.4641345143318176,
-0.05318782478570938,
0.5614189505577087,
0.2869910001754761,
-0.875722348690033,
-0.5216664671897888,
0.4834780991077423,
-0.0013021989725530148,
0.683400571346283,
-0.22085708379745483,
-0.18916353583335876,
-0.151308953762054... |
def artifacts _ dir ( self ) - > path : if self. project. id _ relative : return self. repo _ artifacts _ dir / self. project. id _ relative else : return self. repo _ artifacts _ dir | [
0.49739375710487366,
-0.04796526953577995,
0.46816399693489075,
-0.19744737446308136,
0.3629662096500397,
1.1133918762207031,
1.8565915822982788,
-0.5114161968231201,
0.009630297310650349,
-0.41380763053894043,
0.8740484118461609,
0.4327230453491211,
0.03817876800894737,
-1.094904780387878... |
def onconnecting ( self, progress, message ) : raise notimplementederror | [
-0.05216518044471741,
-0.6561149954795837,
0.6528809666633606,
0.29338428378105164,
-0.44246819615364075,
0.6624341607093811,
-0.2735627293586731,
-0.8584890961647034,
-0.8684440851211548,
0.31861987709999084,
0.0670090764760971,
-0.6232379674911499,
-1.0303716659545898,
0.2150763124227523... |
def tags ( self, query : dict = none ) : return self. bynder _ request _ handler. get ( endpoint ='/ api / v4 / tags / ', params = query or { } ) | [
-0.2646324932575226,
0.9898580312728882,
0.2780541479587555,
0.05649339407682419,
0.7284337878227234,
-0.8807868361473083,
-0.8527930378913879,
-0.44318410754203796,
-0.34343644976615906,
-0.056469276547431946,
0.023950479924678802,
1.0522680282592773,
-0.23938795924186707,
0.6192580461502... |
def _ get _ airfoil _ from _ file ( af _ opts : airfoilfilelocationopt ) : # get full path to the file fullpath = af _ opts. get _ fullpath ( ) thickness = 0. 0 with open ( fullpath,'r') as f : line = f. readline ( ) # assuming thickness is on the first line thickness = float ( line ) # read file line by line with io. ... | [
0.714993953704834,
-0.9315374493598938,
0.4196910262107849,
-0.9410845637321472,
0.15440839529037476,
0.22034913301467896,
0.3168923854827881,
-0.08902190625667572,
-0.44310081005096436,
-0.38728004693984985,
0.10578347742557526,
1.1644388437271118,
0.34707894921302795,
-0.2156124413013458... |
def add _ items ( self, items ) : self. model. add _ items ( items ) self. refreshed. emit ( ) | [
-1.2046982049942017,
0.607263445854187,
0.18617771565914154,
0.8612953424453735,
1.1700536012649536,
0.43375930190086365,
-0.9052391648292542,
-0.31004586815834045,
0.11185245215892792,
0.09362498670816422,
-1.3871439695358276,
-0.505785346031189,
0.050925690680742264,
0.6872557401657104,
... |
def _ generate _ image _ and _ label _ batch ( image, label, min _ queue _ examples, batch _ size, shuffle ) : # create a queue that shuffles the examples, and then # read'batch _ size'images + labels from the example queue. num _ preprocess _ threads = 2 # # batch ( # # tensors, # # batch _ size, # # num _ threads = 1... | [
-0.21494461596012115,
-0.33653581142425537,
0.5652855038642883,
-0.10270322859287262,
-0.05199253186583519,
0.05470582842826843,
-0.35230082273483276,
0.4308437705039978,
0.21258148550987244,
0.02175157144665718,
-0.13178651034832,
0.5281149744987488,
0.8437530398368835,
0.3297493457794189... |
def plot _ ci _ manual ( t, s _ err, n, x, x2, y2, ax = none ) : if ax is none : ax = plt. gca ( ) ci = t * s _ err * np. sqrt ( 1 / n + ( x2 - np. mean ( x ) ) * * 2 / np. sum ( ( x - np. mean ( x ) ) * * 2 ) ) ax. fill _ between ( x2, y2 + ci, y2 - ci, color = " # b9cfe7 ", edgecolor = " " ) return ax | [
1.3521920442581177,
0.1134522408246994,
0.45101144909858704,
0.0075752572156488895,
-0.9187537431716919,
0.4279623031616211,
0.509297251701355,
-0.2102222889661789,
-0.6413841247558594,
0.09677568823099136,
0.300197571516037,
1.2791988849639893,
0.2808375060558319,
-0.6619782447814941,
0... |
def get _ queryset ( self ) : if self. request. user. is _ authenticated : return self. queryset. filter ( livemode = settings. stripe _ live _ mode, customer _ _ subscriber _ _ users = self. request. user, ) return self. queryset. none ( ) | [
1.40818452835083,
-0.2537173926830292,
0.7196716666221619,
0.7471879124641418,
0.38544076681137085,
0.36419710516929626,
-0.7500705718994141,
0.15009689331054688,
0.34056010842323303,
-0.352297306060791,
0.3757252097129822,
0.4293239116668701,
0.08693753927946091,
0.04583461955189705,
-1... |
def getgroupid ( self, cmd ) : cmdkeys = cmd. cmd. keywords docontinue ='continue'in cmdkeys groupname = cmdkeys ['groupname']. values [ 0 ] try : groupid = self. engine. requestgroupid ( groupname, docontinue = docontinue ) except exception as e : cmd. fail ( f'text = " { str ( e ) } "') return cmd. finish ( f'groupid... | [
-0.031246844679117203,
0.08968993276357651,
0.6857524514198303,
0.4645654559135437,
-0.6476308107376099,
0.3142213225364685,
0.39275461435317993,
-0.8614400029182434,
-0.7347186803817749,
-0.07357216626405716,
0.6862874627113342,
1.118572473526001,
-1.4251883029937744,
0.45624086260795593,... |
def setmenu ( self, menu ) : raise notimplementederror | [
-1.4810826778411865,
-0.34451568126678467,
0.3752453029155731,
1.256771206855774,
0.39336729049682617,
0.4418588876724243,
-0.40902096033096313,
0.4730844497680664,
0.5023468732833862,
-0.9104647040367126,
-0.409041166305542,
0.3032291829586029,
-0.11295551806688309,
1.2592741250991821,
... |
async def voices ( self ) - > voicesiterable : flite _ voices = [ # english voice ( id = " cmu _ us _ aew ", name = " cmu _ us _ aew ", gender = " m ", locale = " en - us ", language = " en ", ), voice ( id = " cmu _ us _ ahw ", name = " cmu _ us _ ahw ", gender = " m ", locale = " en - us ", language = " en ", ), voic... | [
-0.502885103225708,
0.03288266807794571,
0.800541877746582,
-0.01209996547549963,
0.36088916659355164,
-0.35277578234672546,
-0.3464619815349579,
-0.4146547019481659,
-0.7750447988510132,
0.4948432445526123,
-0.6201361417770386,
0.4305241107940674,
0.5706816911697388,
0.2949357032775879,
... |
def resize _ photo ( src, dst, locally = false, * * kw ) : task _ log. debug ('[ 1 @ none ] resizing photo : % s'% dst ) try : resize _ image ( src, dst, ( 200, 200 ) ) return true except exception, e : task _ log. error ( " error saving userpic : % s " % e ) | [
-1.3166282176971436,
1.0156424045562744,
0.5358726382255554,
0.7733248472213745,
-0.5014835000038147,
0.044234853237867355,
0.2413550466299057,
0.6473566293716431,
-0.5312950015068054,
0.633296549320221,
-1.105375051498413,
-0.4282231330871582,
0.4036777913570404,
-0.19053128361701965,
0... |
def gettargetposition ( actions, world _ x, world _ y, world _ heading, close _ enough = 50, heading _ enough = 0. 1 ) : robot = actions. _ world. robot our _ x, our _ y, our _ heading = robot. world _ x, robot. world _ y, robot. world _ heading dx, dy, dh = world _ x - our _ x, world _ y - our _ y, world _ heading - o... | [
0.051225870847702026,
-0.9028960466384888,
1.003133773803711,
-0.784218966960907,
-0.5571001768112183,
-0.07212051749229431,
-0.03171323239803314,
-0.5851924419403076,
-0.19099518656730652,
-0.26482346653938293,
0.4447970986366272,
-0.022054463624954224,
-0.30004650354385376,
-0.5627084970... |
def _ _ init _ _ ( self, url = none, matchers = none, input ='url ', failed = none, cache _ redirects = true, output = ('response ','url') ) : self. _ url = url self. _ matchers = matchers self. _ input = input self. _ output = output self. _ seen = set ( ) self. _ providers = providers. from _ config _ files ( ) # par... | [
-0.6967664361000061,
-0.23896995186805725,
0.5465315580368042,
0.7514256238937378,
-0.34361305832862854,
-0.026896918192505836,
0.44511374831199646,
-0.057537660002708435,
0.5040701627731323,
-0.8577262759208679,
-0.686034083366394,
0.02826126292347908,
-0.21500498056411743,
0.101994648575... |
def get _ image ( self, http _ get _ request, image _ id, absolutize _ url ) : if image _ id in get _ presets ['servers'] ['invalid _ image _ ref'] or image _ id. endswith ('z') : return dumps ( not _ found ( " the resource could not be found. ", http _ get _ request ) ) self. image _ store. create _ image _ store ( se... | [
-0.7142277956008911,
0.23243491351604462,
0.3577306866645813,
-0.0984368547797203,
0.1280442476272583,
-0.4925946593284607,
-1.1099355220794678,
-0.41757437586784363,
0.34680163860321045,
0.30632278323173523,
0.98410564661026,
0.7912595868110657,
0.00752384215593338,
0.7097865343093872,
... |
def save _ login ( self, user, status, n = 0 ) : now = int ( time. time ( ) ) sid = " " if status = = login. status _ accepted : # authentication successful, generate random session id sid = utils. random _ string ( 64 ) lo = login ( self. db, user. id ) lo. set ( user _ id = user. id, session _ id = sid, status = stat... | [
-0.4648132622241974,
0.0008435206254944205,
0.3832175135612488,
0.3580390214920044,
-1.1520276069641113,
0.8879262804985046,
-0.6974153518676758,
-0.05084099620580673,
0.9587236046791077,
-0.3314315378665924,
-1.2725337743759155,
-0.7392237186431885,
-0.12707524001598358,
0.152673482894897... |
def get _ ct _ statistics ( scan _ fids ) : total _ val = 0 n _ pix = 0 for fid in scan _ fids : in _ img = read _ nii _ bysitk ( fid ) total _ val + = in _ img. sum ( ) n _ pix + = np. prod ( in _ img. shape ) del in _ img meanval = total _ val / n _ pix total _ var = 0 for fid in scan _ fids : in _ img = read _ nii _... | [
0.14869065582752228,
0.2580014765262604,
0.5064908862113953,
0.30352696776390076,
-0.4795156419277191,
-0.07936649769544601,
1.2825173139572144,
-0.11729155480861664,
-0.21677090227603912,
0.6382913589477539,
-0.0855286493897438,
0.3526466488838196,
-0.0953550860285759,
0.8905674815177917,... |
def split _ cluster ( fm, labels, icluster, n _ samples, kmax _ iter = 100, nsamples _ small = 40000, sampling _ size _ clara = 10000, niter _ clara = 5 ) : ind _ cluster = np. where ( labels = = icluster ) [ 0 ] fm _ cluster = fm [ ind _ cluster, : ] if ind _ cluster. size > nsamples _ small and _ clara _ available : ... | [
-0.1033574715256691,
0.11013323068618774,
0.7667257785797119,
0.4485386908054352,
-0.2725828289985657,
0.020181570202112198,
-0.023170389235019684,
0.3505655825138092,
0.12441183626651764,
0.22994793951511383,
0.7014122009277344,
0.6578385829925537,
-0.789551317691803,
0.05332080274820328,... |
def remove ( self, key : int ) - > none : key _ hashcode = self. hashcode ( key ) for i, each in enumerate ( self. map [ key _ hashcode ] ) : if each [ 0 ] = = key : self. map [ key _ hashcode ]. pop ( i ) return return | [
-0.7284330129623413,
-0.013095379807054996,
0.6000686287879944,
-0.06148704141378403,
-0.703113317489624,
0.016644202172756195,
0.6644121408462524,
1.1586484909057617,
-0.06967289745807648,
0.8400323390960693,
-0.46925118565559387,
-0.7289648056030273,
-0.8187432289123535,
0.49701133370399... |
def test _ adderrbackonlycalledonfailure ( self ) : l = [ ] synchronousdeferred ( " foo " ). adderrback ( l. append ) self. assertequals ( l, [ ] ) | [
0.5198741555213928,
1.4234330654144287,
0.5597419142723083,
0.8158881664276123,
1.2954884767532349,
0.8257518410682678,
-1.0990232229232788,
0.3089621067047119,
0.3766721189022064,
-1.532810091972351,
-0.8118017911911011,
0.7953943610191345,
-0.6419909000396729,
1.9893356561660767,
0.705... |
def reset ( self, grassnum, zebranum, lionnum, grassgrownum = none ) : for lifeclass in [ grass, zebra, lion ] : self. species [ lifeclass ] = { } if grassgrownum : self. grassgrownum = grassgrownum else : self. grassgrownum = int ( grassnum * 0. 1 ) self. setlives ( grass, grassnum ) self. setlives ( zebra, zebranum )... | [
0.03997514396905899,
-0.4003450274467468,
0.4214750826358795,
0.6044220924377441,
0.34684380888938904,
0.12983191013336182,
0.680302083492279,
0.47283798456192017,
-0.8666627407073975,
-0.27572450041770935,
-0.8493876457214355,
0.14406505227088928,
-0.2910598814487457,
0.45056214928627014,... |
def test _ addbothsuccessextraargs ( self ) : sd = synchronousdeferred ( " foo " ) l = [ ] def cb ( r, extra, more = none ) : l. append ( ( r, extra, more ) ) sd. addboth ( cb, 1, more = " heyo " ) self. assertequals ( l, [ ( " foo ", 1, " heyo " ) ] ) | [
0.08999425917863846,
0.7678272724151611,
0.7727131843566895,
-0.11367059499025345,
0.3343621492385864,
1.0675891637802124,
-0.8092054724693298,
0.23712925612926483,
0.26984912157058716,
-0.5364420413970947,
-1.206234097480774,
0.14757637679576874,
-0.08082826435565948,
0.8503963947296143,
... |
def _ _ init _ _ ( self, dock _ id, url = none ) : self. base _ url = url or'https : / / secure - brook - 1414. herokuapp. com / api / % s'self. dock _ id = dock _ id | [
0.3664036989212036,
0.060390036553144455,
0.4407767653465271,
1.5869828462600708,
0.8008056282997131,
-0.306165874004364,
-0.44304078817367554,
1.1839486360549927,
0.5124760866165161,
-1.0306822061538696,
-0.32935529947280884,
0.729981541633606,
0.1172277107834816,
0.8805159330368042,
0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.